Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-03-01 03:59:21 +0300
committerCampbell Barton <campbell@blender.org>2022-03-01 04:21:27 +0300
commit8a8424021c6bd7666375b5d93804c2693fab4a0d (patch)
tree7df04308ecfabcaf2524526e8fc3f632c01dcf86 /source/blender/editors/interface/interface_handlers.c
parenteb0f8317e231c4a02940d0269125a96a47e94c7e (diff)
Cleanup: move Event.is_repeat & is_direction_inverted to flags
Use a flag for events to avoid adding struct members every time a new kind of tag is needed - so events remain small. This also simplifies copying settings as flags can be copied at once with a mask.
Diffstat (limited to 'source/blender/editors/interface/interface_handlers.c')
-rw-r--r--source/blender/editors/interface/interface_handlers.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 3d92cd6c397..c277ca2e36b 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -8974,7 +8974,7 @@ void ui_but_activate_event(bContext *C, ARegion *region, uiBut *but)
wm_event_init_from_window(win, &event);
event.type = EVT_BUT_OPEN;
event.val = KM_PRESS;
- event.is_repeat = false;
+ event.flag = 0;
event.customdata = but;
event.customdata_free = false;
@@ -9538,7 +9538,7 @@ static int ui_handle_list_event(bContext *C, const wmEvent *event, ARegion *regi
ui_pan_to_scroll(event, &type, &val);
/* 'ui_pan_to_scroll' gives the absolute direction. */
- if (event->is_direction_inverted) {
+ if (event->flag & WM_EVENT_SCROLL_INVERT) {
scroll_dir = -1;
}
@@ -10459,7 +10459,7 @@ static int ui_handle_menu_event(bContext *C,
/* Only respond to explicit press to avoid the event that opened the menu
* activating an item when the key is held. */
- if (event->is_repeat) {
+ if (event->flag & WM_EVENT_IS_REPEAT) {
break;
}
@@ -10546,7 +10546,7 @@ static int ui_handle_menu_event(bContext *C,
((event->modifier & (KM_SHIFT | KM_CTRL | KM_OSKEY)) == 0) &&
/* Only respond to explicit press to avoid the event that opened the menu
* activating an item when the key is held. */
- !event->is_repeat) {
+ (event->flag & WM_EVENT_IS_REPEAT) == 0) {
if (ui_menu_pass_event_to_parent_if_nonactive(menu, but, level, retval)) {
break;
}