all repos — openbox @ ade3b4dd69cf275bbaf5de663e1b723d6c073eb1

openbox fork - make it a bit more like ryudo

Make the edge detection fully include monitor edges.

This fixes the move-to-edge behaviour, when moving past the edge of a monitor,
the window will stop with its tail edge against the inside of the monitor's
edge.
Dana Jansens danakj@orodu.net
commit

ade3b4dd69cf275bbaf5de663e1b723d6c073eb1

parent

e0015160f0bc79ef0ad2de1ad7cc9bb389ccddc9

1 files changed, 15 insertions(+), 20 deletions(-)

jump to
M openbox/client.copenbox/client.c

@@ -4237,39 +4237,26 @@ gint my_edge_start, gint my_edge_size,

gint *dest, gboolean *near_edge) { GList *it; - Rect *a, *mon; + Rect *a; Rect dock_area; gint edge; + guint i; a = screen_area(self->desktop, SCREEN_AREA_ALL_MONITORS, &self->frame->area); - mon = screen_area(self->desktop, SCREEN_AREA_ONE_MONITOR, - &self->frame->area); switch (dir) { case OB_DIRECTION_NORTH: - if (my_head >= RECT_TOP(*mon) + 1) - edge = RECT_TOP(*mon) - 1; - else - edge = RECT_TOP(*a) - 1; + edge = RECT_TOP(*a) - 1; break; case OB_DIRECTION_SOUTH: - if (my_head <= RECT_BOTTOM(*mon) - 1) - edge = RECT_BOTTOM(*mon) + 1; - else - edge = RECT_BOTTOM(*a) + 1; + edge = RECT_BOTTOM(*a) + 1; break; case OB_DIRECTION_EAST: - if (my_head <= RECT_RIGHT(*mon) - 1) - edge = RECT_RIGHT(*mon) + 1; - else - edge = RECT_RIGHT(*a) + 1; + edge = RECT_RIGHT(*a) + 1; break; case OB_DIRECTION_WEST: - if (my_head >= RECT_LEFT(*mon) + 1) - edge = RECT_LEFT(*mon) - 1; - else - edge = RECT_LEFT(*a) - 1; + edge = RECT_LEFT(*a) - 1; break; default: g_assert_not_reached();

@@ -4278,6 +4265,15 @@ /* default to the far edge, then narrow it down */

*dest = edge; *near_edge = TRUE; + /* search for edges of monitors */ + for (i = 0; i < screen_num_monitors; ++i) { + Rect *area = screen_area(self->desktop, i, NULL); + detect_edge(*area, dir, my_head, my_size, my_edge_start, + my_edge_size, dest, near_edge); + g_free(area); + } + + /* search for edges of clients */ for (it = client_list; it; it = g_list_next(it)) { ObClient *cur = it->data;

@@ -4299,7 +4295,6 @@ dock_get_area(&dock_area);

detect_edge(dock_area, dir, my_head, my_size, my_edge_start, my_edge_size, dest, near_edge); g_free(a); - g_free(mon); } void client_find_move_directional(ObClient *self, ObDirection dir,