diff options
| author | Dana Jansens <danakj@orodu.net> | 2009-12-14 16:08:30 -0500 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2009-12-14 16:08:30 -0500 |
| commit | 111465b7373cdcdd791b603aefd882ae06d5bf0b (patch) | |
| tree | bf62f6a4c64cfb9162b9765611a9f56e363b17a3 /openbox/screen.c | |
| parent | d55f4b41c6ebf00e36a5e91ddc962a753f6c9ef8 (diff) | |
Let menus place themselves on monitors where the mouse is not present
This fixes a bug which forced menus to show up on the same monitor as the
mouse pointer.
Diffstat (limited to 'openbox/screen.c')
| -rw-r--r-- | openbox/screen.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/openbox/screen.c b/openbox/screen.c index 8d0460d5..35c9f543 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -1719,17 +1719,21 @@ void screen_set_root_cursor(void) ob_cursor(OB_CURSOR_POINTER)); } -guint screen_monitor_pointer() +guint screen_find_monitor_point(guint x, guint y) { Rect mon; - gint x, y; - if (screen_pointer_pos(&x, &y)) - RECT_SET(mon, x, y, 1, 1); - else - RECT_SET(mon, 0, 0, 1, 1); + RECT_SET(mon, x, y, 1, 1); return screen_find_monitor(&mon); } +guint screen_monitor_pointer() +{ + gint x, y; + if (!screen_pointer_pos(&x, &y)) + x = y = 0; + return screen_find_monitor_point(x, y); +} + gboolean screen_pointer_pos(gint *x, gint *y) { Window w; |
