summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2016-05-12 11:23:20 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-05-12 11:23:20 -0400
commit55c83134c17cbc60e248b64a3717490e9b8fd614 (patch)
treeee387e0303d30d925be1c0f8b3f9300ce7f0c59a
parent60da58d8ad15968a8297aecd3df071d21a61c1fd (diff)
use parent windows for x11 binding grabs
ensure that internal windows do not receive mouse events before the compositor fix T3347
-rw-r--r--src/bin/e_comp_x.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/src/bin/e_comp_x.c b/src/bin/e_comp_x.c
index ff80e0294..24e305b59 100644
--- a/src/bin/e_comp_x.c
+++ b/src/bin/e_comp_x.c
@@ -310,20 +310,21 @@ _e_comp_x_focus_setup(E_Client *ec)
310static void 310static void
311_e_comp_x_focus_setdown(E_Client *ec) 311_e_comp_x_focus_setdown(E_Client *ec)
312{ 312{
313 Ecore_X_Window win; 313 Ecore_X_Window win, pwin;
314 314
315 if (!_e_comp_x_client_data_get(ec)->button_grabbed) return; 315 if (!_e_comp_x_client_data_get(ec)->button_grabbed) return;
316 if ((!e_client_focus_policy_click(ec)) || 316 if ((!e_client_focus_policy_click(ec)) ||
317 (e_config->always_click_to_raise) || 317 (e_config->always_click_to_raise) ||
318 (e_config->always_click_to_focus)) return; 318 (e_config->always_click_to_focus)) return;
319 win = e_client_util_win_get(ec); 319 win = e_client_util_win_get(ec);
320 e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, win); 320 pwin = e_client_util_pwin_get(ec);
321 e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, win); 321 e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, pwin);
322 e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, pwin);
322 ecore_x_window_button_ungrab(win, 1, 0, 1); 323 ecore_x_window_button_ungrab(win, 1, 0, 1);
323 ecore_x_window_button_ungrab(win, 2, 0, 1); 324 ecore_x_window_button_ungrab(win, 2, 0, 1);
324 ecore_x_window_button_ungrab(win, 3, 0, 1); 325 ecore_x_window_button_ungrab(win, 3, 0, 1);
325 e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, win); 326 e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, pwin);
326 e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, win); 327 e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, pwin);
327 _e_comp_x_client_data_get(ec)->button_grabbed = 0; 328 _e_comp_x_client_data_get(ec)->button_grabbed = 0;
328} 329}
329 330
@@ -2328,10 +2329,7 @@ _e_comp_x_mapping_change(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_E
2328 e_comp_canvas_keys_ungrab(); 2329 e_comp_canvas_keys_ungrab();
2329 EINA_LIST_FOREACH(e_comp->clients, l, ec) 2330 EINA_LIST_FOREACH(e_comp->clients, l, ec)
2330 { 2331 {
2331 Ecore_X_Window win;
2332
2333 if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_X) continue; 2332 if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_X) continue;
2334 win = e_client_util_win_get(ec);
2335 if ((!_e_comp_x_client_data_get(ec)->first_map) || (!_e_comp_x_client_data_get(ec)->reparented)) continue; 2333 if ((!_e_comp_x_client_data_get(ec)->first_map) || (!_e_comp_x_client_data_get(ec)->reparented)) continue;
2336 if (ec->focused) 2334 if (ec->focused)
2337 { 2335 {
@@ -2342,8 +2340,8 @@ _e_comp_x_mapping_change(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_E
2342 { 2340 {
2343 _e_comp_x_focus_setdown(ec); 2341 _e_comp_x_focus_setdown(ec);
2344 _e_comp_x_focus_setup(ec); 2342 _e_comp_x_focus_setup(ec);
2345 e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, win); 2343 e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, e_client_util_pwin_get(ec));
2346 e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, win); 2344 e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, e_client_util_pwin_get(ec));
2347 } 2345 }
2348 } 2346 }
2349 e_comp_canvas_keys_grab(); 2347 e_comp_canvas_keys_grab();
@@ -3249,8 +3247,8 @@ _e_comp_x_hook_client_pre_frame_assign(void *d EINA_UNUSED, E_Client *ec)
3249 ecore_x_window_show(pwin); 3247 ecore_x_window_show(pwin);
3250 3248
3251 _e_comp_x_focus_init(ec); 3249 _e_comp_x_focus_init(ec);
3252 e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, win); 3250 e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, pwin);
3253 e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, win); 3251 e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, pwin);
3254 _e_comp_x_client_evas_init(ec); 3252 _e_comp_x_client_evas_init(ec);
3255 if (ec->netwm.ping && (!ec->ping_poller)) 3253 if (ec->netwm.ping && (!ec->ping_poller))
3256 e_client_ping(ec); 3254 e_client_ping(ec);
@@ -3491,8 +3489,8 @@ _e_comp_x_hook_client_fetch(void *d EINA_UNUSED, E_Client *ec)
3491 ec->focus_policy_override = E_FOCUS_CLICK; 3489 ec->focus_policy_override = E_FOCUS_CLICK;
3492 _e_comp_x_focus_setdown(ec); 3490 _e_comp_x_focus_setdown(ec);
3493 _e_comp_x_focus_setup(ec); 3491 _e_comp_x_focus_setup(ec);
3494 e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, win); 3492 e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, pwin);
3495 e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, win); 3493 e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, pwin);
3496 if (!ec->netwm.state.skip_pager) 3494 if (!ec->netwm.state.skip_pager)
3497 { 3495 {
3498 ec->netwm.state.skip_pager = 1; 3496 ec->netwm.state.skip_pager = 1;
@@ -4709,8 +4707,8 @@ _e_comp_x_hook_client_del(void *d EINA_UNUSED, E_Client *ec)
4709 if ((!ec->already_unparented) && cd && cd->reparented) 4707 if ((!ec->already_unparented) && cd && cd->reparented)
4710 { 4708 {
4711 _e_comp_x_focus_setdown(ec); 4709 _e_comp_x_focus_setdown(ec);
4712 e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, win); 4710 e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, pwin);
4713 e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, win); 4711 e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, pwin);
4714 if (!cd->deleted) 4712 if (!cd->deleted)
4715 { 4713 {
4716 if (stopping) 4714 if (stopping)
@@ -5254,8 +5252,8 @@ _e_comp_x_bindings_grab_cb(void)
5254 else 5252 else
5255 { 5253 {
5256 _e_comp_x_focus_setup(ec); 5254 _e_comp_x_focus_setup(ec);
5257 e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, e_client_util_win_get(ec)); 5255 e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, e_client_util_pwin_get(ec));
5258 e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, e_client_util_win_get(ec)); 5256 e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, e_client_util_pwin_get(ec));
5259 } 5257 }
5260 } 5258 }
5261} 5259}
@@ -5275,8 +5273,8 @@ _e_comp_x_bindings_ungrab_cb(void)
5275 ecore_x_window_button_ungrab(win, 1, 0, 1); 5273 ecore_x_window_button_ungrab(win, 1, 0, 1);
5276 ecore_x_window_button_ungrab(win, 2, 0, 1); 5274 ecore_x_window_button_ungrab(win, 2, 0, 1);
5277 ecore_x_window_button_ungrab(win, 3, 0, 1); 5275 ecore_x_window_button_ungrab(win, 3, 0, 1);
5278 e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, win); 5276 e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, e_client_util_pwin_get(ec));
5279 e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, win); 5277 e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, e_client_util_pwin_get(ec));
5280 _e_comp_x_client_data_get(ec)->button_grabbed = 0; 5278 _e_comp_x_client_data_get(ec)->button_grabbed = 0;
5281 } 5279 }
5282} 5280}