summaryrefslogtreecommitdiff
path: root/src/lib/ecore_x
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-12-19 11:14:37 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-12-19 11:14:37 +0900
commitff24ac2d6ddaafba49ae5100f17fe37e5d874140 (patch)
treeb98881dd9ccb98896bbc8784a91e6b61a7403b41 /src/lib/ecore_x
parent47bf356435d7b4562e64f45ef59dbf190dff16c7 (diff)
efl: Reset ecore event types on init
This fixes cycles of init/shutdown/init where ecore event types would become invalid, since they are now stored in a dynamic array rather than a statically stored array. The risk here is that if a module of EFL tends to init/shutdown in a "normal" scenario then the event type array will grow in a leaking manner. This could be fixed by resetting those event ID's only when the loop actually exits (EFL_EVENT_DEL on the main loop). I'm not using EFL_EVENT_DEL in this patch as this would add too many event callbacks to the main loop object, which may result in slightly slower event calls to it, affecting the overall performance.
Diffstat (limited to 'src/lib/ecore_x')
-rw-r--r--src/lib/ecore_x/ecore_x.c133
-rw-r--r--src/lib/ecore_x/ecore_x_dnd.c15
2 files changed, 71 insertions, 77 deletions
diff --git a/src/lib/ecore_x/ecore_x.c b/src/lib/ecore_x/ecore_x.c
index f54f3c3..ff213a7 100644
--- a/src/lib/ecore_x/ecore_x.c
+++ b/src/lib/ecore_x/ecore_x.c
@@ -589,74 +589,71 @@ _ecore_x_init2(void)
589 589
590#endif /* ifdef ECORE_XGESTURE */ 590#endif /* ifdef ECORE_XGESTURE */
591 591
592 if (!ECORE_X_EVENT_ANY) 592 ECORE_X_EVENT_ANY = ecore_event_type_new();
593 { 593 ECORE_X_EVENT_MOUSE_IN = ecore_event_type_new();
594 ECORE_X_EVENT_ANY = ecore_event_type_new(); 594 ECORE_X_EVENT_MOUSE_OUT = ecore_event_type_new();
595 ECORE_X_EVENT_MOUSE_IN = ecore_event_type_new(); 595 ECORE_X_EVENT_WINDOW_FOCUS_IN = ecore_event_type_new();
596 ECORE_X_EVENT_MOUSE_OUT = ecore_event_type_new(); 596 ECORE_X_EVENT_WINDOW_FOCUS_OUT = ecore_event_type_new();
597 ECORE_X_EVENT_WINDOW_FOCUS_IN = ecore_event_type_new(); 597 ECORE_X_EVENT_WINDOW_KEYMAP = ecore_event_type_new();
598 ECORE_X_EVENT_WINDOW_FOCUS_OUT = ecore_event_type_new(); 598 ECORE_X_EVENT_WINDOW_DAMAGE = ecore_event_type_new();
599 ECORE_X_EVENT_WINDOW_KEYMAP = ecore_event_type_new(); 599 ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE = ecore_event_type_new();
600 ECORE_X_EVENT_WINDOW_DAMAGE = ecore_event_type_new(); 600 ECORE_X_EVENT_WINDOW_CREATE = ecore_event_type_new();
601 ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE = ecore_event_type_new(); 601 ECORE_X_EVENT_WINDOW_DESTROY = ecore_event_type_new();
602 ECORE_X_EVENT_WINDOW_CREATE = ecore_event_type_new(); 602 ECORE_X_EVENT_WINDOW_HIDE = ecore_event_type_new();
603 ECORE_X_EVENT_WINDOW_DESTROY = ecore_event_type_new(); 603 ECORE_X_EVENT_WINDOW_SHOW = ecore_event_type_new();
604 ECORE_X_EVENT_WINDOW_HIDE = ecore_event_type_new(); 604 ECORE_X_EVENT_WINDOW_SHOW_REQUEST = ecore_event_type_new();
605 ECORE_X_EVENT_WINDOW_SHOW = ecore_event_type_new(); 605 ECORE_X_EVENT_WINDOW_REPARENT = ecore_event_type_new();
606 ECORE_X_EVENT_WINDOW_SHOW_REQUEST = ecore_event_type_new(); 606 ECORE_X_EVENT_WINDOW_CONFIGURE = ecore_event_type_new();
607 ECORE_X_EVENT_WINDOW_REPARENT = ecore_event_type_new(); 607 ECORE_X_EVENT_WINDOW_CONFIGURE_REQUEST = ecore_event_type_new();
608 ECORE_X_EVENT_WINDOW_CONFIGURE = ecore_event_type_new(); 608 ECORE_X_EVENT_WINDOW_GRAVITY = ecore_event_type_new();
609 ECORE_X_EVENT_WINDOW_CONFIGURE_REQUEST = ecore_event_type_new(); 609 ECORE_X_EVENT_WINDOW_RESIZE_REQUEST = ecore_event_type_new();
610 ECORE_X_EVENT_WINDOW_GRAVITY = ecore_event_type_new(); 610 ECORE_X_EVENT_WINDOW_STACK = ecore_event_type_new();
611 ECORE_X_EVENT_WINDOW_RESIZE_REQUEST = ecore_event_type_new(); 611 ECORE_X_EVENT_WINDOW_STACK_REQUEST = ecore_event_type_new();
612 ECORE_X_EVENT_WINDOW_STACK = ecore_event_type_new(); 612 ECORE_X_EVENT_WINDOW_PROPERTY = ecore_event_type_new();
613 ECORE_X_EVENT_WINDOW_STACK_REQUEST = ecore_event_type_new(); 613 ECORE_X_EVENT_WINDOW_COLORMAP = ecore_event_type_new();
614 ECORE_X_EVENT_WINDOW_PROPERTY = ecore_event_type_new(); 614 ECORE_X_EVENT_WINDOW_MAPPING = ecore_event_type_new();
615 ECORE_X_EVENT_WINDOW_COLORMAP = ecore_event_type_new(); 615 ECORE_X_EVENT_MAPPING_CHANGE = ecore_event_type_new();
616 ECORE_X_EVENT_WINDOW_MAPPING = ecore_event_type_new(); 616 ECORE_X_EVENT_SELECTION_CLEAR = ecore_event_type_new();
617 ECORE_X_EVENT_MAPPING_CHANGE = ecore_event_type_new(); 617 ECORE_X_EVENT_SELECTION_REQUEST = ecore_event_type_new();
618 ECORE_X_EVENT_SELECTION_CLEAR = ecore_event_type_new(); 618 ECORE_X_EVENT_SELECTION_NOTIFY = ecore_event_type_new();
619 ECORE_X_EVENT_SELECTION_REQUEST = ecore_event_type_new(); 619 ECORE_X_EVENT_CLIENT_MESSAGE = ecore_event_type_new();
620 ECORE_X_EVENT_SELECTION_NOTIFY = ecore_event_type_new(); 620 ECORE_X_EVENT_WINDOW_SHAPE = ecore_event_type_new();
621 ECORE_X_EVENT_CLIENT_MESSAGE = ecore_event_type_new(); 621 ECORE_X_EVENT_SCREENSAVER_NOTIFY = ecore_event_type_new();
622 ECORE_X_EVENT_WINDOW_SHAPE = ecore_event_type_new(); 622 ECORE_X_EVENT_GESTURE_NOTIFY_FLICK = ecore_event_type_new();
623 ECORE_X_EVENT_SCREENSAVER_NOTIFY = ecore_event_type_new(); 623 ECORE_X_EVENT_GESTURE_NOTIFY_PAN = ecore_event_type_new();
624 ECORE_X_EVENT_GESTURE_NOTIFY_FLICK = ecore_event_type_new(); 624 ECORE_X_EVENT_GESTURE_NOTIFY_PINCHROTATION = ecore_event_type_new();
625 ECORE_X_EVENT_GESTURE_NOTIFY_PAN = ecore_event_type_new(); 625 ECORE_X_EVENT_GESTURE_NOTIFY_TAP = ecore_event_type_new();
626 ECORE_X_EVENT_GESTURE_NOTIFY_PINCHROTATION = ecore_event_type_new(); 626 ECORE_X_EVENT_GESTURE_NOTIFY_TAPNHOLD = ecore_event_type_new();
627 ECORE_X_EVENT_GESTURE_NOTIFY_TAP = ecore_event_type_new(); 627 ECORE_X_EVENT_GESTURE_NOTIFY_HOLD = ecore_event_type_new();
628 ECORE_X_EVENT_GESTURE_NOTIFY_TAPNHOLD = ecore_event_type_new(); 628 ECORE_X_EVENT_GESTURE_NOTIFY_GROUP = ecore_event_type_new();
629 ECORE_X_EVENT_GESTURE_NOTIFY_HOLD = ecore_event_type_new(); 629 ECORE_X_EVENT_SYNC_COUNTER = ecore_event_type_new();
630 ECORE_X_EVENT_GESTURE_NOTIFY_GROUP = ecore_event_type_new(); 630 ECORE_X_EVENT_SYNC_ALARM = ecore_event_type_new();
631 ECORE_X_EVENT_SYNC_COUNTER = ecore_event_type_new(); 631 ECORE_X_EVENT_SCREEN_CHANGE = ecore_event_type_new();
632 ECORE_X_EVENT_SYNC_ALARM = ecore_event_type_new(); 632 ECORE_X_EVENT_RANDR_CRTC_CHANGE = ecore_event_type_new();
633 ECORE_X_EVENT_SCREEN_CHANGE = ecore_event_type_new(); 633 ECORE_X_EVENT_RANDR_OUTPUT_CHANGE = ecore_event_type_new();
634 ECORE_X_EVENT_RANDR_CRTC_CHANGE = ecore_event_type_new(); 634 ECORE_X_EVENT_RANDR_OUTPUT_PROPERTY_NOTIFY = ecore_event_type_new();
635 ECORE_X_EVENT_RANDR_OUTPUT_CHANGE = ecore_event_type_new(); 635 ECORE_X_EVENT_DAMAGE_NOTIFY = ecore_event_type_new();
636 ECORE_X_EVENT_RANDR_OUTPUT_PROPERTY_NOTIFY = ecore_event_type_new(); 636
637 ECORE_X_EVENT_DAMAGE_NOTIFY = ecore_event_type_new(); 637 ECORE_X_EVENT_WINDOW_DELETE_REQUEST = ecore_event_type_new();
638 638
639 ECORE_X_EVENT_WINDOW_DELETE_REQUEST = ecore_event_type_new(); 639 ECORE_X_EVENT_DESKTOP_CHANGE = ecore_event_type_new();
640 640 ECORE_X_EVENT_WINDOW_MOVE_RESIZE_REQUEST = ecore_event_type_new();
641 ECORE_X_EVENT_DESKTOP_CHANGE = ecore_event_type_new(); 641 ECORE_X_EVENT_WINDOW_STATE_REQUEST = ecore_event_type_new();
642 ECORE_X_EVENT_WINDOW_MOVE_RESIZE_REQUEST = ecore_event_type_new(); 642 ECORE_X_EVENT_FRAME_EXTENTS_REQUEST = ecore_event_type_new();
643 ECORE_X_EVENT_WINDOW_STATE_REQUEST = ecore_event_type_new(); 643 ECORE_X_EVENT_PING = ecore_event_type_new();
644 ECORE_X_EVENT_FRAME_EXTENTS_REQUEST = ecore_event_type_new(); 644
645 ECORE_X_EVENT_PING = ecore_event_type_new(); 645 ECORE_X_EVENT_STARTUP_SEQUENCE_NEW = ecore_event_type_new();
646 646 ECORE_X_EVENT_STARTUP_SEQUENCE_CHANGE = ecore_event_type_new();
647 ECORE_X_EVENT_STARTUP_SEQUENCE_NEW = ecore_event_type_new(); 647 ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE = ecore_event_type_new();
648 ECORE_X_EVENT_STARTUP_SEQUENCE_CHANGE = ecore_event_type_new(); 648
649 ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE = ecore_event_type_new(); 649 ECORE_X_EVENT_XKB_STATE_NOTIFY = ecore_event_type_new();
650 650 ECORE_X_EVENT_XKB_NEWKBD_NOTIFY = ecore_event_type_new();
651 ECORE_X_EVENT_XKB_STATE_NOTIFY = ecore_event_type_new(); 651
652 ECORE_X_EVENT_XKB_NEWKBD_NOTIFY = ecore_event_type_new(); 652 ECORE_X_EVENT_GENERIC = ecore_event_type_new();
653 653
654 ECORE_X_EVENT_GENERIC = ecore_event_type_new(); 654 ECORE_X_RAW_BUTTON_PRESS = ecore_event_type_new();
655 655 ECORE_X_RAW_BUTTON_RELEASE = ecore_event_type_new();
656 ECORE_X_RAW_BUTTON_PRESS = ecore_event_type_new(); 656 ECORE_X_RAW_MOTION = ecore_event_type_new();
657 ECORE_X_RAW_BUTTON_RELEASE = ecore_event_type_new();
658 ECORE_X_RAW_MOTION = ecore_event_type_new();
659 }
660 657
661 _ecore_x_modifiers_get(); 658 _ecore_x_modifiers_get();
662 659
diff --git a/src/lib/ecore_x/ecore_x_dnd.c b/src/lib/ecore_x/ecore_x_dnd.c
index 59607b8..c5d6fd5 100644
--- a/src/lib/ecore_x/ecore_x_dnd.c
+++ b/src/lib/ecore_x/ecore_x_dnd.c
@@ -56,15 +56,12 @@ _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 if (ECORE_X_EVENT_XDND_ENTER == 0) 59 ECORE_X_EVENT_XDND_ENTER = ecore_event_type_new();
60 { 60 ECORE_X_EVENT_XDND_POSITION = ecore_event_type_new();
61 ECORE_X_EVENT_XDND_ENTER = ecore_event_type_new(); 61 ECORE_X_EVENT_XDND_STATUS = ecore_event_type_new();
62 ECORE_X_EVENT_XDND_POSITION = ecore_event_type_new(); 62 ECORE_X_EVENT_XDND_LEAVE = ecore_event_type_new();
63 ECORE_X_EVENT_XDND_STATUS = ecore_event_type_new(); 63 ECORE_X_EVENT_XDND_DROP = ecore_event_type_new();
64 ECORE_X_EVENT_XDND_LEAVE = ecore_event_type_new(); 64 ECORE_X_EVENT_XDND_FINISHED = 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 }
68 } 65 }
69 66
70 _ecore_x_dnd_init_count++; 67 _ecore_x_dnd_init_count++;