summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2018-05-08 13:26:46 -0500
committerDerek Foreman <derekf@osg.samsung.com>2018-05-08 13:26:46 -0500
commited60eddff5cf2c9397eb30afad25ce30266ab65e (patch)
tree64b8a877e31aa561737d314b9c9a75534b99d4cc /src/lib/ecore_wl2
parentf78ff5f4455bd9e945d015c00ddfc1f5d3415f55 (diff)
ecore_wl2: Fix window drag mouse eventing
Summary: When a CSD button interaction under wayland leads to a compositor action like move or resize, we essentially "give back" that button press to the compositor, and it never sends us a mouse up for it. We need to internally fire a mouse up event to fix up state so the client doesn't think the mouse is still down. Until now we've been doing this by setting a flag when we start a move/resize and checking it at next pointer enter for the window. This leads to unsolvable races and wacky bookkeeping, and runs afoul of the fact that we're not actually guaranteed a pointer enter immediately after a move completes. There is absolutely no way at all on wayland to know if a move or resize operation has completed. So, let's just fire the mouse up immediately on start of interaction, which is raceless. This fixes a years old bug where dragging a window might leave a stuck mouse up, and allow hilighting text without drag after the window drag completes. (elementary-test -to "text editor" with multiple windows open exhibits this bug) Depends on D6127 Reviewers: zmike, cedric Reviewed By: zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6128
Diffstat (limited to 'src/lib/ecore_wl2')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_input.c7
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_private.h2
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_window.c8
3 files changed, 4 insertions, 13 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index 7e67fc9a99..9d6378f1bb 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -716,13 +716,6 @@ _pointer_cb_enter(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned i
716 input->focus.pointer = window; 716 input->focus.pointer = window;
717 717
718 _ecore_wl2_input_mouse_in_send(input, window); 718 _ecore_wl2_input_mouse_in_send(input, window);
719
720 if ((window->moving || window->resizing) && (input->grab.window == window))
721 {
722 _ecore_wl2_input_mouse_up_send(input, window, 0, input->grab.button,
723 input->grab.timestamp);
724 window->resizing = window->moving = EINA_FALSE;
725 }
726} 719}
727 720
728static void 721static void
diff --git a/src/lib/ecore_wl2/ecore_wl2_private.h b/src/lib/ecore_wl2/ecore_wl2_private.h
index c79e3fa088..b636612270 100644
--- a/src/lib/ecore_wl2/ecore_wl2_private.h
+++ b/src/lib/ecore_wl2/ecore_wl2_private.h
@@ -229,8 +229,6 @@ struct _Ecore_Wl2_Window
229 Ecore_Wl2_Window_Configure_State req_config; 229 Ecore_Wl2_Window_Configure_State req_config;
230 Ecore_Wl2_Window_Configure_State def_config; 230 Ecore_Wl2_Window_Configure_State def_config;
231 231
232 Eina_Bool moving : 1;
233 Eina_Bool resizing : 1;
234 Eina_Bool alpha : 1; 232 Eina_Bool alpha : 1;
235 233
236 Eina_Bool input_set : 1; 234 Eina_Bool input_set : 1;
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c
index 7010938c40..7b1d6b711e 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -734,8 +734,6 @@ ecore_wl2_window_move(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input)
734 if (!input) 734 if (!input)
735 input = EINA_INLIST_CONTAINER_GET(window->display->inputs, Ecore_Wl2_Input); 735 input = EINA_INLIST_CONTAINER_GET(window->display->inputs, Ecore_Wl2_Input);
736 736
737 window->moving = EINA_TRUE;
738
739 if (window->xdg_toplevel) 737 if (window->xdg_toplevel)
740 xdg_toplevel_move(window->xdg_toplevel, input->wl.seat, 738 xdg_toplevel_move(window->xdg_toplevel, input->wl.seat,
741 window->display->serial); 739 window->display->serial);
@@ -743,6 +741,8 @@ ecore_wl2_window_move(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input)
743 zxdg_toplevel_v6_move(window->zxdg_toplevel, input->wl.seat, 741 zxdg_toplevel_v6_move(window->zxdg_toplevel, input->wl.seat,
744 window->display->serial); 742 window->display->serial);
745 ecore_wl2_display_flush(window->display); 743 ecore_wl2_display_flush(window->display);
744
745 _ecore_wl2_input_ungrab(input);
746} 746}
747 747
748EAPI void 748EAPI void
@@ -754,8 +754,6 @@ ecore_wl2_window_resize(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input, int lo
754 if (!input) 754 if (!input)
755 input = EINA_INLIST_CONTAINER_GET(window->display->inputs, Ecore_Wl2_Input); 755 input = EINA_INLIST_CONTAINER_GET(window->display->inputs, Ecore_Wl2_Input);
756 756
757 window->resizing = EINA_TRUE;
758
759 if (window->xdg_toplevel) 757 if (window->xdg_toplevel)
760 xdg_toplevel_resize(window->xdg_toplevel, input->wl.seat, 758 xdg_toplevel_resize(window->xdg_toplevel, input->wl.seat,
761 window->display->serial, location); 759 window->display->serial, location);
@@ -763,6 +761,8 @@ ecore_wl2_window_resize(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input, int lo
763 zxdg_toplevel_v6_resize(window->zxdg_toplevel, input->wl.seat, 761 zxdg_toplevel_v6_resize(window->zxdg_toplevel, input->wl.seat,
764 window->display->serial, location); 762 window->display->serial, location);
765 ecore_wl2_display_flush(window->display); 763 ecore_wl2_display_flush(window->display);
764
765 _ecore_wl2_input_ungrab(input);
766} 766}
767 767
768EAPI void 768EAPI void