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 <ideasman42@gmail.com>2021-03-05 09:09:01 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-03-05 09:10:11 +0300
commitb5d154f400e46ba322f0e08a231bb2557bf51a1e (patch)
tree554d34430b54a1bdac5315b856aa93809b2ef4b2 /source/blender/makesdna/DNA_windowmanager_types.h
parent663b0bb04c324659f24e6b408ee4437cb3d5148b (diff)
Cleanup: move check_drag & check_click out of wmEvent
These variables track the wmWindow.event_queue state, however they were used in a way that wasn't correct. - check_drag & check_click from wmWindow.eventstate were used to track the click/drag status of events handled in wmWindow.event_queue. - Event's in the queue read from wmEvent.check_drag. - Once a drag action was detected, wmWindow.eventstate.check_drag was disabled. Disabling drag in the event state would not change the drag state for values already in the event queue. Simplify logic by moving these values into the window, so there is one place these variables are tracked.
Diffstat (limited to 'source/blender/makesdna/DNA_windowmanager_types.h')
-rw-r--r--source/blender/makesdna/DNA_windowmanager_types.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index 33b038694cf..68d69a671ba 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -251,13 +251,14 @@ typedef struct wmWindow {
struct bScreen *screen DNA_DEPRECATED;
+ /** Winid also in screens, is for retrieving this window after read. */
+ int winid;
/** Window coords. */
short posx, posy, sizex, sizey;
/** Borderless, full. */
char windowstate;
/** Set to 1 if an active window, for quick rejects. */
char active;
- char _pad0[4];
/** Current mouse cursor type. */
short cursor;
/** Previous cursor when setting modal one. */
@@ -271,8 +272,14 @@ typedef struct wmWindow {
char addmousemove;
char tag_cursor_refresh;
- /** Winid also in screens, is for retrieving this window after read. */
- int winid;
+ /* Track the state of the event queue,
+ * these store the state that needs to be kept between handling events in the queue. */
+ /** Enable when #KM_PRESS events are not handled (keyboard/mouse-buttons only). */
+ char event_queue_check_click;
+ /** Enable when #KM_PRESS events are not handled (keyboard/mouse-buttons only). */
+ char event_queue_check_drag;
+
+ char _pad0[2];
/** Internal, lock pie creation from this event until released. */
short pie_event_type_lock;