]> Dogcows Code - chaz/openbox/blobdiff - openbox/menu.c
fix menus to show on the screen the mouse cursor spawned them from
[chaz/openbox] / openbox / menu.c
index fce49a6feb565ee8092d52c74e68358e8208e33b..33a70b54d8c62a61768cd0e82484ddafbdaf9565 100644 (file)
@@ -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);
 }
This page took 0.02183 seconds and 4 git commands to generate.