summaryrefslogtreecommitdiff
path: root/src/lib/ecore_x
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-09-26 11:23:01 -0400
committerChristopher Michael <cp.michael@samsung.com>2019-09-26 11:23:01 -0400
commit2bc6754d395ca645ce29359dab3be757edb28064 (patch)
tree3cc7233abc8b3dcbd929e5ce01398d0c6ac15d49 /src/lib/ecore_x
parentfddc27ed4041d792f4933110d7e6c14f1cac2bca (diff)
ecore-x: track whether ecore-x is internally "managing" the root window
Summary: when ecore_x_window_manage is called, this is probably only for the case of managing the root window, i.e., running a window manager. store this state internally so that we can avoid calling additional XSelectInput later and fucking up the expected eventing Depends on D9899 Reviewers: devilhorns Reviewed By: devilhorns Subscribers: devilhorns, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10012
Diffstat (limited to 'src/lib/ecore_x')
-rw-r--r--src/lib/ecore_x/ecore_x.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/ecore_x/ecore_x.c b/src/lib/ecore_x/ecore_x.c
index 500ef19..8503add 100644
--- a/src/lib/ecore_x/ecore_x.c
+++ b/src/lib/ecore_x/ecore_x.c
@@ -779,7 +779,7 @@ ecore_x_init_from_display(Ecore_X_Display *display)
779 eina_shutdown(); 779 eina_shutdown();
780 return --_ecore_x_init_count; 780 return --_ecore_x_init_count;
781} 781}
782 782static Eina_Bool _ecore_x_window_manage_succeeded = EINA_FALSE;
783int 783int
784_ecore_x_shutdown(void) 784_ecore_x_shutdown(void)
785{ 785{
@@ -855,6 +855,7 @@ _ecore_x_shutdown(void)
855 free(_ecore_x_event_handlers); 855 free(_ecore_x_event_handlers);
856 _ecore_x_fd_handler_handle = NULL; 856 _ecore_x_fd_handler_handle = NULL;
857 _ecore_x_event_handlers = NULL; 857 _ecore_x_event_handlers = NULL;
858 _ecore_x_window_manage_succeeded = EINA_FALSE;
858 _ecore_x_events_shutdown(); 859 _ecore_x_events_shutdown();
859 _ecore_x_input_shutdown(); 860 _ecore_x_input_shutdown();
860 _ecore_x_selection_shutdown(); 861 _ecore_x_selection_shutdown();
@@ -1347,13 +1348,12 @@ ecore_x_window_root_first_get(void)
1347 1348
1348static void _ecore_x_window_manage_error(void *data); 1349static void _ecore_x_window_manage_error(void *data);
1349 1350
1350static int _ecore_x_window_manage_failed = 0;
1351static void 1351static void
1352_ecore_x_window_manage_error(void *data EINA_UNUSED) 1352_ecore_x_window_manage_error(void *data EINA_UNUSED)
1353{ 1353{
1354 if ((ecore_x_error_request_get() == X_ChangeWindowAttributes) && 1354 if ((ecore_x_error_request_get() == X_ChangeWindowAttributes) &&
1355 (ecore_x_error_code_get() == BadAccess)) 1355 (ecore_x_error_code_get() == BadAccess))
1356 _ecore_x_window_manage_failed = 1; 1356 _ecore_x_window_manage_succeeded = EINA_FALSE;
1357} 1357}
1358 1358
1359EAPI Eina_Bool 1359EAPI Eina_Bool
@@ -1367,7 +1367,7 @@ ecore_x_window_manage(Ecore_X_Window win)
1367 return EINA_FALSE; 1367 return EINA_FALSE;
1368 1368
1369 ecore_x_sync(); 1369 ecore_x_sync();
1370 _ecore_x_window_manage_failed = 0; 1370 _ecore_x_window_manage_succeeded = EINA_TRUE;
1371 ecore_x_error_handler_set(_ecore_x_window_manage_error, NULL); 1371 ecore_x_error_handler_set(_ecore_x_window_manage_error, NULL);
1372 XSelectInput(_ecore_x_disp, win, 1372 XSelectInput(_ecore_x_disp, win,
1373 EnterWindowMask | 1373 EnterWindowMask |
@@ -1382,9 +1382,8 @@ ecore_x_window_manage(Ecore_X_Window win)
1382 att.your_event_mask); 1382 att.your_event_mask);
1383 ecore_x_sync(); 1383 ecore_x_sync();
1384 ecore_x_error_handler_set(NULL, NULL); 1384 ecore_x_error_handler_set(NULL, NULL);
1385 if (_ecore_x_window_manage_failed) 1385 if (!_ecore_x_window_manage_succeeded)
1386 { 1386 {
1387 _ecore_x_window_manage_failed = 0;
1388 return EINA_FALSE; 1387 return EINA_FALSE;
1389 } 1388 }
1390 1389