all repos — openbox @ fa32adf16ce190fd20fc75cbe37551fc1cc3f89f

openbox fork - make it a bit more like ryudo

fix menus to show on the screen the mouse cursor spawned them from
Mikael Magnusson mikachu@comhem.se
commit

fa32adf16ce190fd20fc75cbe37551fc1cc3f89f

parent

9df57ff1b5c6f2bc631253cc8a51ec3af7d24d7e

3 files changed, 12 insertions(+), 6 deletions(-)

jump to
M openbox/menu.copenbox/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 @@ client->frame->area.y + client->frame->size.top);

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); }
M openbox/menuframe.copenbox/menuframe.c

@@ -191,12 +191,7 @@ guint i;

gint dx = 0, dy = 0; gint pos, half; - for (i = 0; i < screen_num_monitors; ++i) { - a = screen_physical_area_monitor(i); - if (RECT_INTERSECTS_RECT(*a, self->area)) - break; - } - if (!a) a = screen_physical_area_monitor(0); + a = screen_physical_area_monitor(self->monitor); half = g_list_length(self->entries) / 2; pos = g_list_index(self->entries, self->selected);
M openbox/menuframe.hopenbox/menuframe.h

@@ -64,6 +64,8 @@ gint item_h; /* height of all normal items */

gint text_x; /* offset at which the text appears in the items */ gint text_w; /* width of the text area in the items */ + gint monitor; /* monitor on which to show the menu in xinerama */ + Window title; Window items;