diff options
| author | Mikael Magnusson <mikachu@comhem.se> | 2005-09-14 17:05:53 +0000 |
|---|---|---|
| committer | Mikael Magnusson <mikachu@comhem.se> | 2005-09-14 17:05:53 +0000 |
| commit | fa32adf16ce190fd20fc75cbe37551fc1cc3f89f (patch) | |
| tree | df321eb5b831eb8eae71621aeb5e07aaf3fda2ef /openbox/menu.c | |
| parent | 9df57ff1b5c6f2bc631253cc8a51ec3af7d24d7e (diff) | |
fix menus to show on the screen the mouse cursor spawned them from
Diffstat (limited to 'openbox/menu.c')
| -rw-r--r-- | openbox/menu.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/openbox/menu.c b/openbox/menu.c index fce49a6f..33a70b54 100644 --- a/openbox/menu.c +++ b/openbox/menu.c @@ -284,6 +284,7 @@ void menu_show(gchar *name, gint x, gint y, ObClient *client) { ObMenu *self; ObMenuFrame *frame; + guint i; if (!(self = menu_from_name(name))) return; @@ -305,6 +306,14 @@ void menu_show(gchar *name, gint x, gint y, ObClient *client) else menu_frame_move(frame, x - ob_rr_theme->bwidth, y - ob_rr_theme->bwidth); + frame->monitor = 0; + for (i = 0; i < screen_num_monitors; ++i) { + Rect *a = screen_physical_area_monitor(i); + if (RECT_CONTAINS(*a, frame->area.x, frame->area.y)) { + frame->monitor = i; + break; + } + } if (!menu_frame_show(frame, NULL)) menu_frame_free(frame); } |
