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
path: root/source
diff options
context:
space:
mode:
authorJulian Eisel <eiseljulian@gmail.com>2018-03-23 01:52:38 +0300
committerJulian Eisel <eiseljulian@gmail.com>2018-03-23 01:52:38 +0300
commitaeec19d2e76fc292d21d00090d02c672c3997647 (patch)
tree9fdccc8fa7565f8ea44abf701b6419cc572b7088 /source
parenta4ea46ffc5570499078c0caeba55121f709e5ee7 (diff)
Fix own mistake from 4cb4556fa5ba78ff
Trying to close Blender from a second window wouldn't work, the first window would have to be hovered first. Ouch!
Diffstat (limited to 'source')
-rw-r--r--source/blender/windowmanager/WM_api.h2
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c2
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c5
3 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index a910e1bce2e..bf26d512589 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -186,7 +186,7 @@ enum {
struct wmEventHandler *WM_event_add_dropbox_handler(ListBase *handlers, ListBase *dropboxes);
/* mouse */
-void WM_event_add_mousemove(struct bContext *C);
+void WM_event_add_mousemove(const struct bContext *C);
bool WM_event_is_modal_tweak_exit(const struct wmEvent *event, int tweak_event);
bool WM_event_is_last_mousemove(const struct wmEvent *event);
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index d62327a83a9..b18e9f050c2 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -2919,7 +2919,7 @@ static void WM_event_remove_handler(ListBase *handlers, wmEventHandler *handler)
}
#endif
-void WM_event_add_mousemove(bContext *C)
+void WM_event_add_mousemove(const bContext *C)
{
wmWindow *window = CTX_wm_window(C);
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 4fcbff6bf98..9b4868523dc 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -450,12 +450,11 @@ void wm_exit_schedule_delayed(const bContext *C)
/* What we do here is a little bit hacky, but quite simple and doesn't require bigger
* changes: Add a handler wrapping WM_exit() to cause a delayed call of it. */
- wmWindowManager *wm = CTX_wm_manager(C);
- /* Doesn't matter which window we use. */
- wmWindow *win = wm->windows.first;
+ wmWindow *win = CTX_wm_window(C);
/* Use modal UI handler for now. Could add separate WM handlers or so, but probably not worth it. */
WM_event_add_ui_handler(C, &win->modalhandlers, wm_exit_handler, NULL, NULL, 0);
+ WM_event_add_mousemove(C); /* ensure handler actually gets called */
}
/**