summaryrefslogtreecommitdiff
path: root/openbox/menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbox/menu.c')
-rw-r--r--openbox/menu.c9
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);
}