From 2e5ab5a94779052c970f79889252ff60053a88ce Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 16 Jul 2015 12:50:54 -0400 Subject: [PATCH] only use input xwindows for internal drags in x11 compositor this fixes input region detection for dnd operations fix T1831 --- src/bin/e_dnd.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/src/bin/e_dnd.c b/src/bin/e_dnd.c index 95b36a8..1172099 100644 --- a/src/bin/e_dnd.c +++ b/src/bin/e_dnd.c @@ -275,26 +275,33 @@ e_drag_start(E_Drag *drag, int x, int y) if (_drag_win) return 0; #ifndef HAVE_WAYLAND_ONLY - if (e_comp_util_has_x()) + if (e_comp->comp_type == E_PIXMAP_TYPE_X) { _drag_win = ecore_x_window_input_new(e_comp->win, 0, 0, e_comp->w, e_comp->h); - if (e_comp->comp_type == E_PIXMAP_TYPE_X) - ecore_event_window_register(_drag_win, e_comp->ee, e_comp->evas, - NULL, NULL, NULL, NULL); + ecore_event_window_register(_drag_win, e_comp->ee, e_comp->evas, + NULL, NULL, NULL, NULL); ecore_x_window_show(_drag_win); + _drag_win_root = e_comp->root; + if (!e_grabinput_get(_drag_win, 0, _drag_win)) + { + ecore_x_window_free(_drag_win); + _drag_win = _drag_win_root = 0; + return 0; + } } + else #endif - _drag_win_root = e_comp->root; - if (!e_grabinput_get(_drag_win, 0, _drag_win)) { -#ifndef HAVE_WAYLAND_ONLY - if (e_comp_util_has_x()) - ecore_x_window_free(_drag_win); -#endif - return 0; + _drag_win = _drag_win_root = e_comp->ee_win; + if (!e_comp_grab_input(1, 1)) + { + _drag_win = _drag_win_root = 0; + return 0; + } } + if (!drag->object) { e_drag_object_set(drag, evas_object_rectangle_add(drag->evas)); @@ -1168,7 +1175,8 @@ _e_drag_free(E_Drag *drag) { if (e_comp->comp_type == E_PIXMAP_TYPE_X) ecore_event_window_unregister(_drag_win); - ecore_x_window_free(_drag_win); + if (_drag_win != e_comp->ee_win) + ecore_x_window_free(_drag_win); ecore_x_window_shadow_tree_flush(); } #endif -- 2.7.4