diff options
author | Giulio Camuffo <giuliocamuffo@gmail.com> | 2013-03-27 18:05:26 +0100 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2013-03-27 13:11:06 -0400 |
commit | 1b4b61ace327ee6a56096b5efbb283375d8a1702 (patch) | |
tree | 1bc80dbc0e01c6f67e0c9527994807f80e79bb45 | |
parent | 5085a75dee2b60edaeba7e506e496aeb62810fb6 (diff) |
shell: set the popup grab button as pressed only if it actually is
This ensures the popup_grab.initial_up field isn't reset to 0
if the popup was not opened because of a mouse press but because
of moving the mouse with a popup already open. Not doing so will
make the first click outside the client area go ignored.
-rw-r--r-- | src/shell.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/shell.c b/src/shell.c index da9193c8..c6ff3007 100644 --- a/src/shell.c +++ b/src/shell.c @@ -2008,7 +2008,11 @@ add_popup_grab(struct shell_surface *shsurf, struct shell_seat *shseat) if (wl_list_empty(&shseat->popup_grab.surfaces_list)) { shseat->popup_grab.client = shsurf->surface->surface.resource.client; shseat->popup_grab.grab.interface = &popup_grab_interface; - shseat->popup_grab.initial_up = 0; + /* We must make sure here that this popup was opened after + * a mouse press, and not just by moving around with other + * popups already open. */ + if (shseat->seat->pointer.button_count > 0) + shseat->popup_grab.initial_up = 0; wl_pointer_start_grab(seat->pointer, &shseat->popup_grab.grab); } |