From: Dana Jansens Date: Sun, 20 Jan 2008 04:59:40 +0000 (-0500) Subject: Merge branch 'backport' X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=3ae58f457bcdfa90b26dad4c9d192f045874ddae;hp=4b41ac8343efa21a959d81a4db8aea32e5960f10;p=chaz%2Fopenbox Merge branch 'backport' --- diff --git a/data/rc.xml b/data/rc.xml index 3cd88ee8..567ca28b 100644 --- a/data/rc.xml +++ b/data/rc.xml @@ -347,14 +347,24 @@ - - - - + + no + + + + + + + - - + + yes + + + + + @@ -558,23 +568,23 @@ - + previous - + next - + previous - + next - + previous - + next @@ -599,16 +609,16 @@ - + previous - + next - + previous - + next diff --git a/openbox/actions/growtoedge.c b/openbox/actions/growtoedge.c index 69b8ef77..630ead10 100644 --- a/openbox/actions/growtoedge.c +++ b/openbox/actions/growtoedge.c @@ -7,9 +7,11 @@ typedef struct { ObDirection dir; + gboolean shrink; } Options; static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_shrink_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); static void free_func(gpointer options); static gboolean run_func(ObActionsData *data, gpointer options); @@ -20,6 +22,12 @@ void action_growtoedge_startup(void) free_func, run_func, NULL, NULL); + + actions_register("ShrinkToEdge", + setup_shrink_func, + free_func, + run_func, + NULL, NULL); } static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) @@ -29,6 +37,7 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) o = g_new0(Options, 1); o->dir = OB_DIRECTION_NORTH; + o->shrink = FALSE; if ((n = parse_find_node("direction", node))) { gchar *s = parse_string(doc, n); @@ -50,6 +59,16 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) return o; } +static gpointer setup_shrink_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) +{ + Options *o; + + o = setup_func(i, doc, node); + o->shrink = TRUE; + + return o; +} + static void free_func(gpointer options) { Options *o = options; @@ -98,11 +117,13 @@ static gboolean run_func(ObActionsData *data, gpointer options) return FALSE; } - /* try grow */ - client_find_resize_directional(data->client, o->dir, TRUE, - &x, &y, &w, &h); - if (do_grow(data, x, y, w, h)) - return FALSE; + if (!o->shrink) { + /* try grow */ + client_find_resize_directional(data->client, o->dir, TRUE, + &x, &y, &w, &h); + if (do_grow(data, x, y, w, h)) + return FALSE; + } /* we couldn't grow, so try shrink! */ opp = (o->dir == OB_DIRECTION_NORTH ? OB_DIRECTION_SOUTH : diff --git a/openbox/event.h b/openbox/event.h index a8d1aeaf..65ff915b 100644 --- a/openbox/event.h +++ b/openbox/event.h @@ -33,11 +33,6 @@ extern Time event_curtime; /*! The last user-interaction time, as given by the clients */ extern Time event_last_user_time; -/*! The value of the mask for the NumLock modifier */ -extern guint NumLockMask; -/*! The value of the mask for the ScrollLock modifier */ -extern guint ScrollLockMask; - void event_startup(gboolean reconfig); void event_shutdown(gboolean reconfig);