all repos — openbox @ 9a3f05a780f8cbfeb68626552d25c48ab0245ca3

openbox fork - make it a bit more like ryudo

don't make interactive desktop cycling switch until you release the mods. this is needed because otherwise focus moves around during the grab and applications get confused. :|
change the pager popup to resize based on the layout so the squares can be bigger
Dana Jansens danakj@orodu.net
commit

9a3f05a780f8cbfeb68626552d25c48ab0245ca3

parent

df45b1e146b31e31f7cdf9142ffc04f44d6c9649

4 files changed, 38 insertions(+), 10 deletions(-)

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

@@ -1546,8 +1546,7 @@ data->desktopdir.inter.any.interactive,

data->desktopdir.inter.final, data->desktopdir.inter.cancel); if (!data->sendtodir.inter.any.interactive || - !data->sendtodir.inter.final || - data->sendtodir.inter.cancel) + (data->sendtodir.inter.final && !data->sendtodir.inter.cancel)) { if (d != screen_desktop) screen_set_desktop(d, TRUE); }

@@ -1566,8 +1565,7 @@ data->sendtodir.inter.any.interactive,

data->sendtodir.inter.final, data->sendtodir.inter.cancel); if (!data->sendtodir.inter.any.interactive || - !data->sendtodir.inter.final || - data->sendtodir.inter.cancel) + (data->sendtodir.inter.final && !data->sendtodir.inter.cancel)) { client_set_desktop(c, d, data->sendtodir.follow); if (data->sendtodir.follow && d != screen_desktop)
M openbox/popup.copenbox/popup.c

@@ -39,6 +39,7 @@ self->gravity = NorthWestGravity;

self->x = self->y = self->textw = self->h = 0; self->a_bg = RrAppearanceCopy(ob_rr_theme->osd_hilite_bg); self->a_text = RrAppearanceCopy(ob_rr_theme->osd_hilite_label); + self->iconwm = self->iconhm = 1; attrib.override_redirect = True; self->bg = XCreateWindow(ob_display, RootWindow(ob_display, ob_screen),

@@ -172,7 +173,7 @@ if (self->h) {

h = self->h; texth = h - emptyy; } else - h = texth + emptyy; + h = texth * self->iconhm + emptyy; if (self->textw) textw = self->textw;

@@ -182,7 +183,8 @@ icony = texty = t + ob_rr_theme->paddingy;

emptyx = l + r + ob_rr_theme->paddingx * 2; if (self->hasicon) { - iconw = iconh = texth; + iconw = texth * self->iconwm; + iconh = texth * self->iconhm; textx += iconw + ob_rr_theme->paddingx; if (textw) emptyx += ob_rr_theme->paddingx; /* between the icon and text */

@@ -322,6 +324,12 @@

popup_delay_show(self->popup, usec, text); } +void icon_popup_icon_size_multiplier(ObIconPopup *self, guint wm, guint hm) +{ + if (wm != 0) self->popup->iconwm = wm; + if (hm != 0) self->popup->iconhm = hm; +} + static void pager_popup_draw_icon(gint px, gint py, gint w, gint h, gpointer data) {

@@ -492,3 +500,9 @@ self->curdesk = desk;

popup_delay_show(self->popup, usec, text); } + +void pager_popup_icon_size_multiplier(ObPagerPopup *self, guint wm, guint hm) +{ + if (wm != 0) self->popup->iconwm = wm; + if (hm != 0) self->popup->iconhm = hm; +}
M openbox/popup.hopenbox/popup.h

@@ -49,6 +49,8 @@ gint textw;

gint h; gint minw; gint maxw; + guint iconwm; /* icon width multiplier. multiplied by the normal width */ + guint iconhm; /* icon height multiplier. multipled by the normal height */ gboolean mapped; gboolean delay_mapped;

@@ -120,6 +122,7 @@ popup_text_width_to_string((p)->popup,(s))

#define icon_popup_text_width_to_strings(p, s, n) \ popup_text_width_to_strings((p)->popup,(s),(n)) #define icon_popup_set_text_align(p, j) popup_set_text_align((p)->popup,(j)) +void icon_popup_icon_size_multiplier(ObIconPopup *self, guint wm, guint hm); ObPagerPopup *pager_popup_new(); void pager_popup_free(ObPagerPopup *self);

@@ -138,5 +141,6 @@ popup_text_width_to_string((p)->popup,(s))

#define pager_popup_text_width_to_strings(p, s, n) \ popup_text_width_to_strings((p)->popup,(s),(n)) #define pager_popup_set_text_align(p, j) popup_set_text_align((p)->popup,(j)) +void pager_popup_icon_size_multiplier(ObPagerPopup *self, guint wm, guint hm); #endif
M openbox/screen.copenbox/screen.c

@@ -641,6 +641,11 @@ } else {

a = screen_physical_area_monitor(0); pager_popup_position(desktop_cycle_popup, CenterGravity, a->x + a->width / 2, a->y + a->height / 2); + pager_popup_icon_size_multiplier(desktop_cycle_popup, + screen_desktop_layout.columns / + screen_desktop_layout.rows, + screen_desktop_layout.rows/ + screen_desktop_layout.columns); pager_popup_max_width(desktop_cycle_popup, MAX(a->width/3, POPUP_WIDTH)); pager_popup_show(desktop_cycle_popup, screen_desktop_names[d], d);

@@ -650,13 +655,15 @@

guint screen_cycle_desktop(ObDirection dir, gboolean wrap, gboolean linear, gboolean dialog, gboolean done, gboolean cancel) { - guint d, r, c; - - d = screen_desktop; + guint r, c; + static guint d = (guint)-1; + guint ret; if ((cancel || done) && dialog) goto show_cycle_dialog; + if (d == (guint)-1) + d = screen_desktop; get_row_col(d, &r, &c); if (linear) {

@@ -772,7 +779,12 @@ if (dialog && !cancel && !done) {

screen_desktop_popup(d, TRUE); } else screen_desktop_popup(0, FALSE); - return d; + ret = d; + + if (!dialog || cancel || done) + d = (guint)-1; + + return ret; } void screen_update_layout()