summaryrefslogtreecommitdiff
path: root/src/lib/ecore_x
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-03-09 16:15:04 -0800
committerCedric BAIL <cedric@osg.samsung.com>2017-03-09 16:17:58 -0800
commit4eeb4e8706305002a20b96ca83bc935bb1a4c3d9 (patch)
tree45b25d61d603b267cb64d637d782b4e092c3cf64 /src/lib/ecore_x
parent81adcf8107106e36e714ce79d724c3506bfd0b95 (diff)
ecore_x: avoid crash during shutdown due to Ecore_Event queue.
Diffstat (limited to 'src/lib/ecore_x')
-rw-r--r--src/lib/ecore_x/ecore_x.c62
-rw-r--r--src/lib/ecore_x/ecore_x_dnd.c22
-rw-r--r--src/lib/ecore_x/ecore_x_fixes.c3
-rw-r--r--src/lib/ecore_x/ecore_x_present.c9
4 files changed, 86 insertions, 10 deletions
diff --git a/src/lib/ecore_x/ecore_x.c b/src/lib/ecore_x/ecore_x.c
index ae8b5bd..8ca8e61 100644
--- a/src/lib/ecore_x/ecore_x.c
+++ b/src/lib/ecore_x/ecore_x.c
@@ -794,6 +794,68 @@ _ecore_x_shutdown(int close_display)
794 794
795 LOGFN(__FILE__, __LINE__, __FUNCTION__); 795 LOGFN(__FILE__, __LINE__, __FUNCTION__);
796 796
797 ecore_event_type_flush(ECORE_X_EVENT_ANY,
798 ECORE_X_EVENT_MOUSE_IN,
799 ECORE_X_EVENT_MOUSE_OUT,
800 ECORE_X_EVENT_WINDOW_FOCUS_IN,
801 ECORE_X_EVENT_WINDOW_FOCUS_OUT,
802 ECORE_X_EVENT_WINDOW_KEYMAP,
803 ECORE_X_EVENT_WINDOW_DAMAGE,
804 ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE,
805 ECORE_X_EVENT_WINDOW_CREATE,
806 ECORE_X_EVENT_WINDOW_DESTROY,
807 ECORE_X_EVENT_WINDOW_HIDE,
808 ECORE_X_EVENT_WINDOW_SHOW,
809 ECORE_X_EVENT_WINDOW_SHOW_REQUEST,
810 ECORE_X_EVENT_WINDOW_REPARENT,
811 ECORE_X_EVENT_WINDOW_CONFIGURE,
812 ECORE_X_EVENT_WINDOW_CONFIGURE_REQUEST,
813 ECORE_X_EVENT_WINDOW_GRAVITY,
814 ECORE_X_EVENT_WINDOW_RESIZE_REQUEST,
815 ECORE_X_EVENT_WINDOW_STACK,
816 ECORE_X_EVENT_WINDOW_STACK_REQUEST,
817 ECORE_X_EVENT_WINDOW_PROPERTY,
818 ECORE_X_EVENT_WINDOW_COLORMAP,
819 ECORE_X_EVENT_WINDOW_MAPPING,
820 ECORE_X_EVENT_MAPPING_CHANGE,
821 ECORE_X_EVENT_SELECTION_CLEAR,
822 ECORE_X_EVENT_SELECTION_REQUEST,
823 ECORE_X_EVENT_SELECTION_NOTIFY,
824 ECORE_X_EVENT_CLIENT_MESSAGE,
825 ECORE_X_EVENT_WINDOW_SHAPE,
826 ECORE_X_EVENT_SCREENSAVER_NOTIFY,
827 ECORE_X_EVENT_GESTURE_NOTIFY_FLICK,
828 ECORE_X_EVENT_GESTURE_NOTIFY_PAN,
829 ECORE_X_EVENT_GESTURE_NOTIFY_PINCHROTATION,
830 ECORE_X_EVENT_GESTURE_NOTIFY_TAP,
831 ECORE_X_EVENT_GESTURE_NOTIFY_TAPNHOLD,
832 ECORE_X_EVENT_GESTURE_NOTIFY_HOLD,
833 ECORE_X_EVENT_GESTURE_NOTIFY_GROUP,
834 ECORE_X_EVENT_SYNC_COUNTER,
835 ECORE_X_EVENT_SYNC_ALARM,
836 ECORE_X_EVENT_SCREEN_CHANGE,
837 ECORE_X_EVENT_RANDR_CRTC_CHANGE,
838 ECORE_X_EVENT_RANDR_OUTPUT_CHANGE,
839 ECORE_X_EVENT_RANDR_OUTPUT_PROPERTY_NOTIFY,
840 ECORE_X_EVENT_DAMAGE_NOTIFY,
841 ECORE_X_EVENT_WINDOW_DELETE_REQUEST,
842 ECORE_X_EVENT_DESKTOP_CHANGE,
843 ECORE_X_EVENT_WINDOW_MOVE_RESIZE_REQUEST,
844 ECORE_X_EVENT_WINDOW_STATE_REQUEST,
845 ECORE_X_EVENT_FRAME_EXTENTS_REQUEST,
846 ECORE_X_EVENT_PING,
847 ECORE_X_EVENT_STARTUP_SEQUENCE_NEW,
848 ECORE_X_EVENT_STARTUP_SEQUENCE_CHANGE,
849 ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE,
850 ECORE_X_EVENT_XKB_STATE_NOTIFY,
851 ECORE_X_EVENT_XKB_NEWKBD_NOTIFY,
852 ECORE_X_EVENT_GENERIC,
853 ECORE_X_RAW_BUTTON_PRESS,
854 ECORE_X_RAW_BUTTON_RELEASE,
855 ECORE_X_RAW_MOTION,
856 ECORE_X_EVENT_PRESENT_CONFIGURE,
857 ECORE_X_EVENT_PRESENT_COMPLETE,
858 ECORE_X_EVENT_PRESENT_IDLE);
797 ecore_main_fd_handler_del(_ecore_x_fd_handler_handle); 859 ecore_main_fd_handler_del(_ecore_x_fd_handler_handle);
798 if (close_display) 860 if (close_display)
799 XCloseDisplay(_ecore_x_disp); 861 XCloseDisplay(_ecore_x_disp);
diff --git a/src/lib/ecore_x/ecore_x_dnd.c b/src/lib/ecore_x/ecore_x_dnd.c
index d673094..4398754 100644
--- a/src/lib/ecore_x/ecore_x_dnd.c
+++ b/src/lib/ecore_x/ecore_x_dnd.c
@@ -56,12 +56,15 @@ _ecore_x_dnd_init(void)
56 _target->source = None; 56 _target->source = None;
57 _target->state = ECORE_X_DND_TARGET_IDLE; 57 _target->state = ECORE_X_DND_TARGET_IDLE;
58 58
59 ECORE_X_EVENT_XDND_ENTER = ecore_event_type_new(); 59 if (ECORE_X_EVENT_XDND_ENTER == 0)
60 ECORE_X_EVENT_XDND_POSITION = ecore_event_type_new(); 60 {
61 ECORE_X_EVENT_XDND_STATUS = ecore_event_type_new(); 61 ECORE_X_EVENT_XDND_ENTER = ecore_event_type_new();
62 ECORE_X_EVENT_XDND_LEAVE = ecore_event_type_new(); 62 ECORE_X_EVENT_XDND_POSITION = ecore_event_type_new();
63 ECORE_X_EVENT_XDND_DROP = ecore_event_type_new(); 63 ECORE_X_EVENT_XDND_STATUS = ecore_event_type_new();
64 ECORE_X_EVENT_XDND_FINISHED = ecore_event_type_new(); 64 ECORE_X_EVENT_XDND_LEAVE = ecore_event_type_new();
65 ECORE_X_EVENT_XDND_DROP = ecore_event_type_new();
66 ECORE_X_EVENT_XDND_FINISHED = ecore_event_type_new();
67 }
65 } 68 }
66 69
67 _ecore_x_dnd_init_count++; 70 _ecore_x_dnd_init_count++;
@@ -74,6 +77,13 @@ _ecore_x_dnd_shutdown(void)
74 if (_ecore_x_dnd_init_count > 0) 77 if (_ecore_x_dnd_init_count > 0)
75 return; 78 return;
76 79
80 ecore_event_type_flush(ECORE_X_EVENT_XDND_ENTER,
81 ECORE_X_EVENT_XDND_POSITION,
82 ECORE_X_EVENT_XDND_STATUS,
83 ECORE_X_EVENT_XDND_LEAVE,
84 ECORE_X_EVENT_XDND_DROP,
85 ECORE_X_EVENT_XDND_FINISHED);
86
77 if (_source) 87 if (_source)
78 free(_source); 88 free(_source);
79 89
diff --git a/src/lib/ecore_x/ecore_x_fixes.c b/src/lib/ecore_x/ecore_x_fixes.c
index 012e458..3043235 100644
--- a/src/lib/ecore_x/ecore_x_fixes.c
+++ b/src/lib/ecore_x/ecore_x_fixes.c
@@ -27,7 +27,8 @@ _ecore_x_fixes_init(void)
27 { 27 {
28 _fixes_available = 1; 28 _fixes_available = 1;
29 29
30 ECORE_X_EVENT_FIXES_SELECTION_NOTIFY = ecore_event_type_new(); 30 if (ECORE_X_EVENT_FIXES_SELECTION_NOTIFY == 0)
31 ECORE_X_EVENT_FIXES_SELECTION_NOTIFY = ecore_event_type_new();
31 } 32 }
32 else 33 else
33 _fixes_available = 0; 34 _fixes_available = 0;
diff --git a/src/lib/ecore_x/ecore_x_present.c b/src/lib/ecore_x/ecore_x_present.c
index eb190b7..a944f7b 100644
--- a/src/lib/ecore_x/ecore_x_present.c
+++ b/src/lib/ecore_x/ecore_x_present.c
@@ -13,9 +13,12 @@ static Eina_Bool _ecore_x_present_exists = EINA_FALSE;
13void 13void
14_ecore_x_present_init(void) 14_ecore_x_present_init(void)
15{ 15{
16 ECORE_X_EVENT_PRESENT_CONFIGURE = ecore_event_type_new(); 16 if (ECORE_X_EVENT_PRESENT_CONFIGURE == 0)
17 ECORE_X_EVENT_PRESENT_COMPLETE = ecore_event_type_new(); 17 {
18 ECORE_X_EVENT_PRESENT_IDLE = ecore_event_type_new(); 18 ECORE_X_EVENT_PRESENT_CONFIGURE = ecore_event_type_new();
19 ECORE_X_EVENT_PRESENT_COMPLETE = ecore_event_type_new();
20 ECORE_X_EVENT_PRESENT_IDLE = ecore_event_type_new();
21 }
19#ifdef ECORE_XPRESENT 22#ifdef ECORE_XPRESENT
20 LOGFN(__FILE__, __LINE__, __FUNCTION__); 23 LOGFN(__FILE__, __LINE__, __FUNCTION__);
21 _ecore_x_present_exists = XPresentQueryExtension(_ecore_x_disp, &_ecore_x_present_major, NULL, NULL); 24 _ecore_x_present_exists = XPresentQueryExtension(_ecore_x_disp, &_ecore_x_present_major, NULL, NULL);