all repos — openbox @ 64c65f3b67364bb82420dbdd05d7e655b1d74d43

openbox fork - make it a bit more like ryudo

adds option to have the popup centered above the window instead of centered, and fix the last occurance of that reversed variable
Mikael Magnusson mikachu@comhem.se
commit

64c65f3b67364bb82420dbdd05d7e655b1d74d43

parent

e8339970d8c319da0a0ac0129f075f86739f3bd3

3 files changed, 26 insertions(+), 7 deletions(-)

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

@@ -42,6 +42,7 @@ gint config_screen_firstdesk;

gboolean config_resize_redraw; gint config_resize_popup_show; +gint config_resize_popup_pos; ObStackingLayer config_dock_layer; gboolean config_dock_floating;

@@ -301,6 +302,12 @@ config_resize_popup_show = 0;

else if (parse_contains("Nonpixel", doc, n)) config_resize_popup_show = 1; } + if ((n = parse_find_node("popupPosition", node))) { + if (parse_contains("Top", doc, n)) + config_resize_popup_pos = 1; + else if (parse_contains("Center", doc, n)) + config_resize_popup_pos = 0; + } } static void parse_dock(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,

@@ -540,7 +547,8 @@

parse_register(i, "desktops", parse_desktops, NULL); config_resize_redraw = TRUE; - config_resize_popup_show = 1; + config_resize_popup_show = 1; /* nonpixel increments */ + config_resize_popup_pos = 0; /* center of client */ parse_register(i, "resize", parse_resize, NULL);
M openbox/config.hopenbox/config.h

@@ -43,7 +43,12 @@ extern ObPlacePolicy config_place_policy;

/*! When true windows' contents are refreshed while they are resized; otherwise they are not updated until the resize is complete */ -extern gboolean config_redraw_resize; +extern gboolean config_resize_redraw; +/*! show move/resize popups? 0 = no, 1 = always, 2 = only + resizing !1 increments */ +extern gint config_resize_popup_show; +/*! where to show the popup, currently above the window or centered */ +extern gint config_resize_popup_pos; /*! The stacking layer the dock will reside in */ extern ObStackingLayer config_dock_layer;
M openbox/moveresize.copenbox/moveresize.c

@@ -77,11 +77,17 @@ {

gchar *text; text = g_strdup_printf(format, a, b); - popup_position(popup, CenterGravity, - c->frame->area.x + c->frame->size.left + - c->area.width / 2, - c->frame->area.y + c->frame->size.top + - c->area.height / 2); + if (config_resize_popup_pos == 1) /* == "Top" */ + popup_position(popup, SouthGravity, + c->frame->area.x + + c->frame->area.width/2, + c->frame->area.y); + else /* == "Center" */ + popup_position(popup, CenterGravity, + c->frame->area.x + c->frame->size.left + + c->area.width / 2, + c->frame->area.y + c->frame->size.top + + c->area.height / 2); popup_show(popup, text); g_free(text); }