summaryrefslogtreecommitdiff
path: root/desktop-shell
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2015-12-10 13:08:01 -0600
committerBryce Harrington <bryce@osg.samsung.com>2016-02-16 21:55:46 -0800
commitbbde643ecde257c0e0e920c3ddf65697bc7ac5ff (patch)
tree169789dd858f93c666dab632a53404108bd51a39 /desktop-shell
parentf6c854ef803367079b59a2515b110083ae05f6ab (diff)
shell: Don't send extra configure events on click
The click_to_activate handler fires on every mouse click for a surface so let's be a little quicker to early return if you're clicking on the surface that already has activation. This prevents (among other side effects) the sending of two xdg_configure events for every mouse click. This should also make having two seats with keyboards behave in the same way as a single seat. Previously the second seat could have a keyboard focus on the surface and prevent some of the extra processing (including the extra configure events) from taking place. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Diffstat (limited to 'desktop-shell')
-rw-r--r--desktop-shell/shell.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 991effe5..e1fefae1 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -5156,6 +5156,7 @@ activate_binding(struct weston_seat *seat,
struct desktop_shell *shell,
struct weston_view *focus_view)
{
+ struct focus_state *state;
struct weston_surface *focus;
struct weston_surface *main_surface;
@@ -5168,6 +5169,13 @@ activate_binding(struct weston_seat *seat,
if (get_shell_surface_type(main_surface) == SHELL_SURFACE_NONE)
return;
+ state = ensure_focus_state(shell, seat);
+ if (state == NULL)
+ return;
+
+ if (state->keyboard_focus == focus)
+ return;
+
activate(shell, focus, seat, true);
}