X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Factions%2Fresize.c;h=3714e38b0c534af980061140198c9351492cd547;hb=dd8cb753c16a902b46400eb4e80288cbaa25ba99;hp=26951370543a6687539fb18e8c8fa37fdec7247f;hpb=976add593801af58ae6c5e39fd70e1738878bf93;p=chaz%2Fopenbox diff --git a/openbox/actions/resize.c b/openbox/actions/resize.c index 26951370..3714e38b 100644 --- a/openbox/actions/resize.c +++ b/openbox/actions/resize.c @@ -5,6 +5,7 @@ #include "openbox/frame.h" typedef struct { + gboolean corner_specified; guint32 corner; } Options; @@ -15,7 +16,7 @@ static gboolean run_func(ObActionsData *data, gpointer options); static guint32 pick_corner(gint x, gint y, gint cx, gint cy, gint cw, gint ch, gboolean shaded); -void action_resize_startup() +void action_resize_startup(void) { actions_register("Resize", setup_func, @@ -33,6 +34,8 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) if ((n = parse_find_node("edge", node))) { gchar *s = parse_string(doc, n); + + o->corner_specified = TRUE; if (!g_ascii_strcasecmp(s, "top")) o->corner = prop_atoms.net_wm_moveresize_size_top; else if (!g_ascii_strcasecmp(s, "bottom")) @@ -49,6 +52,9 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) o->corner = prop_atoms.net_wm_moveresize_size_bottomleft; else if (!g_ascii_strcasecmp(s, "bottomright")) o->corner = prop_atoms.net_wm_moveresize_size_bottomright; + else + o->corner_specified = FALSE; + g_free(s); } return o; @@ -72,7 +78,7 @@ static gboolean run_func(ObActionsData *data, gpointer options) if (!data->button) corner = prop_atoms.net_wm_moveresize_size_keyboard; - else if (o->corner) + else if (o->corner_specified) corner = o->corner; /* it was specified in the binding */ else corner = pick_corner(data->x, data->y,