X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Factions%2Fresize.c;h=f6858d2d2046edf6667bb94aa319f05dd08ce534;hb=HEAD;hp=3df44b6cfa035d81604dc8b790a402f46ea941a5;hpb=d18d9c9379e3387073fc9346e9857fdde077b985;p=chaz%2Fopenbox diff --git a/openbox/actions/resize.c b/openbox/actions/resize.c index 3df44b6c..f6858d2d 100644 --- a/openbox/actions/resize.c +++ b/openbox/actions/resize.c @@ -10,6 +10,7 @@ typedef struct { } Options; static gpointer setup_func(xmlNodePtr node); +static void free_func(gpointer o); static gboolean run_func(ObActionsData *data, gpointer options); static guint32 pick_corner(gint x, gint y, gint cx, gint cy, gint cw, gint ch, @@ -17,7 +18,7 @@ static guint32 pick_corner(gint x, gint y, gint cx, gint cy, gint cw, gint ch, void action_resize_startup(void) { - actions_register("Resize", setup_func, g_free, run_func); + actions_register("Resize", setup_func, free_func, run_func); } static gpointer setup_func(xmlNodePtr node) @@ -25,10 +26,10 @@ static gpointer setup_func(xmlNodePtr node) xmlNodePtr n; Options *o; - o = g_new0(Options, 1); + o = g_slice_new0(Options); - if ((n = obt_parse_find_node(node, "edge"))) { - gchar *s = obt_parse_node_string(n); + if ((n = obt_xml_find_node(node, "edge"))) { + gchar *s = obt_xml_node_string(n); o->corner_specified = TRUE; if (!g_ascii_strcasecmp(s, "top")) @@ -55,6 +56,11 @@ static gpointer setup_func(xmlNodePtr node) return o; } +static void free_func(gpointer o) +{ + g_slice_free(Options, o); +} + /* Always return FALSE because its not interactive */ static gboolean run_func(ObActionsData *data, gpointer options) {