X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Factions%2Fdesktop.c;h=75949be2e5fc2d1c40622f07e87a75b676a2a461;hb=e5c7c95f2db1eef776d5acd3db46334fb932e3a6;hp=3132a4fc253573453ab0107162de6b4a8b15caea;hpb=cfa96390e88eae67e8e5b29598f597303849002c;p=chaz%2Fopenbox diff --git a/openbox/actions/desktop.c b/openbox/actions/desktop.c index 3132a4fc..75949be2 100644 --- a/openbox/actions/desktop.c +++ b/openbox/actions/desktop.c @@ -21,12 +21,12 @@ typedef struct { gboolean wrap; ObDirection dir; } rel; - } + }; gboolean send; gboolean follow; } Options; -static gpointer setup_switch_func(ObParseInst *i, xmlDocPtr doc, +static gpointer setup_go_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); static gpointer setup_send_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); @@ -34,13 +34,13 @@ static gboolean run_func(ObActionsData *data, gpointer options); void action_desktop_startup() { - actions_register("SwitchToDesktop", setup_switch_func, g_free, run_func, + actions_register("GoToDesktop", setup_go_func, g_free, run_func, NULL, NULL); actions_register("SendToDesktop", setup_send_func, g_free, run_func, NULL, NULL); } -static gpointer setup_switch_func(ObParseInst *i, xmlDocPtr doc, +static gpointer setup_go_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) { xmlNodePtr n; @@ -55,8 +55,7 @@ static gpointer setup_switch_func(ObParseInst *i, xmlDocPtr doc, if ((n = parse_find_node("to", node))) { gchar *s = parse_string(doc, n); - if (!g_ascii_strcasecmp(s, "last") || - !g_ascii_strcasecmp(s, "previous")) + if (!g_ascii_strcasecmp(s, "last")) o->type = LAST; else if (!g_ascii_strcasecmp(s, "next")) { o->type = RELATIVE; @@ -104,7 +103,10 @@ static gpointer setup_switch_func(ObParseInst *i, xmlDocPtr doc, static gpointer setup_send_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) { - Options *o = setup_switch_func(i, doc, node); + xmlNodePtr n; + Options *o; + + o = setup_go_func(i, doc, node); o->send = TRUE; o->follow = TRUE; @@ -120,7 +122,7 @@ static gboolean run_func(ObActionsData *data, gpointer options) Options *o = options; guint d; - + switch (o->type) { case LAST: @@ -130,10 +132,8 @@ static gboolean run_func(ObActionsData *data, gpointer options) d = o->abs.desktop; break; case RELATIVE: - d = screen_cycle_desktop(o->abs.dir, - o->abs.wrap, - o->abs.linear, - FALSE, TRUE, FALSE); + d = screen_find_desktop(screen_desktop, + o->rel.dir, o->rel.wrap, o->rel.linear); break; }