aboutsummaryrefslogtreecommitdiffstats
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
parentecore_wl2: avoid crash during shutdown due to Ecore_Event queue. (diff)
downloadefl-4eeb4e8706305002a20b96ca83bc935bb1a4c3d9.tar.gz
ecore_x: avoid crash during shutdown due to Ecore_Event queue.
-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 ae8b5bd2cf..8ca8e61f45 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)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ ecore_event_type_flush(ECORE_X_EVENT_ANY,
+ ECORE_X_EVENT_MOUSE_IN,
+ ECORE_X_EVENT_MOUSE_OUT,
+ ECORE_X_EVENT_WINDOW_FOCUS_IN,
+ ECORE_X_EVENT_WINDOW_FOCUS_OUT,
+ ECORE_X_EVENT_WINDOW_KEYMAP,
+ ECORE_X_EVENT_WINDOW_DAMAGE,
+ ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE,
+ ECORE_X_EVENT_WINDOW_CREATE,
+ ECORE_X_EVENT_WINDOW_DESTROY,
+ ECORE_X_EVENT_WINDOW_HIDE,
+ ECORE_X_EVENT_WINDOW_SHOW,
+ ECORE_X_EVENT_WINDOW_SHOW_REQUEST,
+ ECORE_X_EVENT_WINDOW_REPARENT,
+ ECORE_X_EVENT_WINDOW_CONFIGURE,
+ ECORE_X_EVENT_WINDOW_CONFIGURE_REQUEST,
+ ECORE_X_EVENT_WINDOW_GRAVITY,
+ ECORE_X_EVENT_WINDOW_RESIZE_REQUEST,
+ ECORE_X_EVENT_WINDOW_STACK,
+ ECORE_X_EVENT_WINDOW_STACK_REQUEST,
+ ECORE_X_EVENT_WINDOW_PROPERTY,
+ ECORE_X_EVENT_WINDOW_COLORMAP,
+ ECORE_X_EVENT_WINDOW_MAPPING,
+ ECORE_X_EVENT_MAPPING_CHANGE,
+ ECORE_X_EVENT_SELECTION_CLEAR,
+ ECORE_X_EVENT_SELECTION_REQUEST,
+ ECORE_X_EVENT_SELECTION_NOTIFY,
+ ECORE_X_EVENT_CLIENT_MESSAGE,
+ ECORE_X_EVENT_WINDOW_SHAPE,
+ ECORE_X_EVENT_SCREENSAVER_NOTIFY,
+ ECORE_X_EVENT_GESTURE_NOTIFY_FLICK,
+ ECORE_X_EVENT_GESTURE_NOTIFY_PAN,
+ ECORE_X_EVENT_GESTURE_NOTIFY_PINCHROTATION,
+ ECORE_X_EVENT_GESTURE_NOTIFY_TAP,
+ ECORE_X_EVENT_GESTURE_NOTIFY_TAPNHOLD,
+ ECORE_X_EVENT_GESTURE_NOTIFY_HOLD,
+ ECORE_X_EVENT_GESTURE_NOTIFY_GROUP,
+ ECORE_X_EVENT_SYNC_COUNTER,
+ ECORE_X_EVENT_SYNC_ALARM,
+ ECORE_X_EVENT_SCREEN_CHANGE,
+ ECORE_X_EVENT_RANDR_CRTC_CHANGE,
+ ECORE_X_EVENT_RANDR_OUTPUT_CHANGE,
+ ECORE_X_EVENT_RANDR_OUTPUT_PROPERTY_NOTIFY,
+ ECORE_X_EVENT_DAMAGE_NOTIFY,
+ ECORE_X_EVENT_WINDOW_DELETE_REQUEST,
+ ECORE_X_EVENT_DESKTOP_CHANGE,
+ ECORE_X_EVENT_WINDOW_MOVE_RESIZE_REQUEST,
+ ECORE_X_EVENT_WINDOW_STATE_REQUEST,
+ ECORE_X_EVENT_FRAME_EXTENTS_REQUEST,
+ ECORE_X_EVENT_PING,
+ ECORE_X_EVENT_STARTUP_SEQUENCE_NEW,
+ ECORE_X_EVENT_STARTUP_SEQUENCE_CHANGE,
+ ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE,
+ ECORE_X_EVENT_XKB_STATE_NOTIFY,
+ ECORE_X_EVENT_XKB_NEWKBD_NOTIFY,
+ ECORE_X_EVENT_GENERIC,
+ ECORE_X_RAW_BUTTON_PRESS,
+ ECORE_X_RAW_BUTTON_RELEASE,
+ ECORE_X_RAW_MOTION,
+ ECORE_X_EVENT_PRESENT_CONFIGURE,
+ ECORE_X_EVENT_PRESENT_COMPLETE,
+ ECORE_X_EVENT_PRESENT_IDLE);
ecore_main_fd_handler_del(_ecore_x_fd_handler_handle);
if (close_display)
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 d673094807..4398754fa9 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)
_target->source = None;
_target->state = ECORE_X_DND_TARGET_IDLE;
- ECORE_X_EVENT_XDND_ENTER = ecore_event_type_new();
- ECORE_X_EVENT_XDND_POSITION = ecore_event_type_new();
- ECORE_X_EVENT_XDND_STATUS = ecore_event_type_new();
- ECORE_X_EVENT_XDND_LEAVE = ecore_event_type_new();
- ECORE_X_EVENT_XDND_DROP = ecore_event_type_new();
- ECORE_X_EVENT_XDND_FINISHED = ecore_event_type_new();
+ if (ECORE_X_EVENT_XDND_ENTER == 0)
+ {
+ ECORE_X_EVENT_XDND_ENTER = ecore_event_type_new();
+ ECORE_X_EVENT_XDND_POSITION = ecore_event_type_new();
+ ECORE_X_EVENT_XDND_STATUS = ecore_event_type_new();
+ ECORE_X_EVENT_XDND_LEAVE = ecore_event_type_new();
+ ECORE_X_EVENT_XDND_DROP = ecore_event_type_new();
+ ECORE_X_EVENT_XDND_FINISHED = ecore_event_type_new();
+ }
}
_ecore_x_dnd_init_count++;
@@ -74,6 +77,13 @@ _ecore_x_dnd_shutdown(void)
if (_ecore_x_dnd_init_count > 0)
return;
+ ecore_event_type_flush(ECORE_X_EVENT_XDND_ENTER,
+ ECORE_X_EVENT_XDND_POSITION,
+ ECORE_X_EVENT_XDND_STATUS,
+ ECORE_X_EVENT_XDND_LEAVE,
+ ECORE_X_EVENT_XDND_DROP,
+ ECORE_X_EVENT_XDND_FINISHED);
+
if (_source)
free(_source);
diff --git a/src/lib/ecore_x/ecore_x_fixes.c b/src/lib/ecore_x/ecore_x_fixes.c
index 012e458743..30432354d5 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)
{
_fixes_available = 1;
- ECORE_X_EVENT_FIXES_SELECTION_NOTIFY = ecore_event_type_new();
+ if (ECORE_X_EVENT_FIXES_SELECTION_NOTIFY == 0)
+ ECORE_X_EVENT_FIXES_SELECTION_NOTIFY = ecore_event_type_new();
}
else
_fixes_available = 0;
diff --git a/src/lib/ecore_x/ecore_x_present.c b/src/lib/ecore_x/ecore_x_present.c
index eb190b7560..a944f7b850 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;
void
_ecore_x_present_init(void)
{
- ECORE_X_EVENT_PRESENT_CONFIGURE = ecore_event_type_new();
- ECORE_X_EVENT_PRESENT_COMPLETE = ecore_event_type_new();
- ECORE_X_EVENT_PRESENT_IDLE = ecore_event_type_new();
+ if (ECORE_X_EVENT_PRESENT_CONFIGURE == 0)
+ {
+ ECORE_X_EVENT_PRESENT_CONFIGURE = ecore_event_type_new();
+ ECORE_X_EVENT_PRESENT_COMPLETE = ecore_event_type_new();
+ ECORE_X_EVENT_PRESENT_IDLE = ecore_event_type_new();
+ }
#ifdef ECORE_XPRESENT
LOGFN(__FILE__, __LINE__, __FUNCTION__);
_ecore_x_present_exists = XPresentQueryExtension(_ecore_x_disp, &_ecore_x_present_major, NULL, NULL);