From fa32adf16ce190fd20fc75cbe37551fc1cc3f89f Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Wed, 14 Sep 2005 17:05:53 +0000 Subject: fix menus to show on the screen the mouse cursor spawned them from --- openbox/menu.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'openbox/menu.c') 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); } -- cgit v1.2.3