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:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-05-10 19:34:23 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-05-10 19:34:23 +0400
commit591a0910037d3ca2de511c6e2790d5585a3991fc (patch)
tree53b90d98d7abe1ba90c8bd2884bf613c7aacc3d2 /source/blender/windowmanager
parentf3d721aa93d4f669107667f4cfdc03b8907923d6 (diff)
Fix #31221: Multiple Monitors/Windows Double Click For Focus
Window might be focused by mouse click in configuration of window manager when focus is not following mouse. Click could have been done on a button and depending on window manager settings click would be passed to blender or not, but in any case button under cursor should be activated. Currently the easiest way to activate button is to generate mouse move event. Not sure about OSX, but on windows it worked fine because OS is generating WM_MOUSEMOVE event "automatically" so nothing special from blender side was needed.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_window.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 8d962c828ca..5f6b15dee02 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -672,6 +672,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
case GHOST_kEventWindowActivate:
{
GHOST_TEventKeyData kdata;
+ wmEvent event;
int cx, cy, wx, wy;
wm->winactive = win; /* no context change! c->wm->windrawable is drawable, or for area queues */
@@ -711,6 +712,23 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
win->addmousemove = 1; /* enables highlighted buttons */
wm_window_make_drawable(C, win);
+
+ /* window might be focused by mouse click in configuration of window manager
+ * when focus is not following mouse
+ * click could have been done on a button and depending on window manager settings
+ * click would be passed to blender or not, but in any case button under cursor
+ * should be activated, so at max next click on button without moving mouse
+ * would trigger it's handle function
+ * currently it seems to be common practice to generate new event for, but probably
+ * we'll need utility function for this? (sergey)
+ */
+ event = *(win->eventstate);
+ event.type = MOUSEMOVE;
+ event.prevx = event.x;
+ event.prevy = event.y;
+
+ wm_event_add(win, &event);
+
break;
}
case GHOST_kEventWindowClose: {