all repos — openbox @ 0efe52a12bdf838363b061c05a537a56f8daceae

openbox fork - make it a bit more like ryudo

fix the minipager for exotic orientations
Mikael Magnusson mikachu@comhem.se
commit

0efe52a12bdf838363b061c05a537a56f8daceae

parent

a908e04818e2d9eab3e3d8049c573e8d9ddcd0b8

1 files changed, 46 insertions(+), 51 deletions(-)

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

@@ -276,7 +276,6 @@ gpointer data)

{ ObPagerPopup *self = data; gint x, y; - guint i; guint rown, n; guint horz_inc; guint vert_inc;

@@ -301,64 +300,64 @@

if (eachw <= 0 || eachh <= 0) return; - switch (screen_desktop_layout.start_corner) { - case OB_CORNER_TOPLEFT: - n = 0; - switch (screen_desktop_layout.orientation) { - case OB_ORIENTATION_HORZ: + switch (screen_desktop_layout.orientation) { + case OB_ORIENTATION_HORZ: + switch (screen_desktop_layout.start_corner) { + case OB_CORNER_TOPLEFT: + n = 0; horz_inc = 1; vert_inc = screen_desktop_layout.columns; break; - case OB_ORIENTATION_VERT: - horz_inc = screen_desktop_layout.rows; - vert_inc = 1; - break; - } - break; - case OB_CORNER_TOPRIGHT: - n = screen_desktop_layout.columns; - switch (screen_desktop_layout.orientation) { - case OB_ORIENTATION_HORZ: + case OB_CORNER_TOPRIGHT: + n = screen_desktop_layout.columns - 1; horz_inc = -1; vert_inc = screen_desktop_layout.columns; break; - case OB_ORIENTATION_VERT: - horz_inc = -screen_desktop_layout.rows; - vert_inc = 1; + case OB_CORNER_BOTTOMRIGHT: + n = screen_desktop_layout.rows * screen_desktop_layout.columns - 1; + horz_inc = -1; + vert_inc = -screen_desktop_layout.columns; break; - } - break; - case OB_CORNER_BOTTOMLEFT: - n = screen_desktop_layout.rows; - switch (screen_desktop_layout.orientation) { - case OB_ORIENTATION_HORZ: + case OB_CORNER_BOTTOMLEFT: + n = (screen_desktop_layout.rows - 1) * screen_desktop_layout.columns; horz_inc = 1; vert_inc = -screen_desktop_layout.columns; break; - case OB_ORIENTATION_VERT: + default: + g_assert_not_reached(); + } + break; + case OB_ORIENTATION_VERT: + switch (screen_desktop_layout.start_corner) { + case OB_CORNER_TOPLEFT: + n = 0; horz_inc = screen_desktop_layout.rows; - vert_inc = -1; + vert_inc = 1; break; - } - break; - case OB_CORNER_BOTTOMRIGHT: - n = MAX(self->desks, - screen_desktop_layout.rows * screen_desktop_layout.columns); - switch (screen_desktop_layout.orientation) { - case OB_ORIENTATION_HORZ: - horz_inc = -1; - vert_inc = -screen_desktop_layout.columns; + case OB_CORNER_TOPRIGHT: + n = screen_desktop_layout.rows * (screen_desktop_layout.columns - 1); + horz_inc = -screen_desktop_layout.rows; + vert_inc = 1; break; - case OB_ORIENTATION_VERT: + case OB_CORNER_BOTTOMRIGHT: + n = screen_desktop_layout.rows * screen_desktop_layout.columns - 1; horz_inc = -screen_desktop_layout.rows; vert_inc = -1; break; + case OB_CORNER_BOTTOMLEFT: + n = screen_desktop_layout.rows - 1; + horz_inc = screen_desktop_layout.rows; + vert_inc = -1; + break; + default: + g_assert_not_reached(); } break; + default: + g_assert_not_reached(); } rown = n; - i = 0; for (r = 0, y = 0; r < screen_desktop_layout.rows; ++r, y += eachh + ob_rr_theme->bwidth) {

@@ -367,21 +366,17 @@ ++c, x += eachw + ob_rr_theme->bwidth)

{ RrAppearance *a; - if (i >= self->desks) - break; - - a = (n == self->curdesk ? self->hilight : self->unhilight); - - a->surface.parent = self->popup->a_bg; - a->surface.parentx = x + px; - a->surface.parenty = y + py; - XMoveResizeWindow(ob_display, self->wins[i], - x + px, y + py, eachw, eachh); - RrPaint(a, self->wins[i], eachw, eachh); + if (n < self->desks) { + a = (n == self->curdesk ? self->hilight : self->unhilight); + a->surface.parent = self->popup->a_bg; + a->surface.parentx = x + px; + a->surface.parenty = y + py; + XMoveResizeWindow(ob_display, self->wins[n], + x + px, y + py, eachw, eachh); + RrPaint(a, self->wins[n], eachw, eachh); + } n += horz_inc; - - ++i; } n = rown += vert_inc; }