openbox/actions/decorations.c \
openbox/actions/desktop.c \
openbox/actions/directionalcyclewindows.c \
+ openbox/actions/directionaldesktop.c \
openbox/actions/directionaltargetwindow.c \
openbox/actions/execute.c \
openbox/actions/exit.c \
action_send_to_desktop_dir,
setup_action_send_to_desktop_down
},
- {
- "desktopnext",
- action_desktop_dir,
- setup_action_desktop_next
- },
- {
- "desktopprevious",
- action_desktop_dir,
- setup_action_desktop_prev
- },
- {
- "desktopright",
- action_desktop_dir,
- setup_action_desktop_right
- },
- {
- "desktopleft",
- action_desktop_dir,
- setup_action_desktop_left
- },
- {
- "desktopup",
- action_desktop_dir,
- setup_action_desktop_up
- },
- {
- "desktopdown",
- action_desktop_dir,
- setup_action_desktop_down
- },
{
"toggledockautohide",
action_toggle_dockautohide,
if (act->data.sendto.desk > 0) act->data.sendto.desk--;
if ((n = parse_find_node("follow", node->xmlChildrenNode)))
act->data.sendto.follow = parse_bool(doc, n);
- } else if (act->func == action_desktop_dir) {
- if ((n = parse_find_node("wrap", node->xmlChildrenNode)))
- act->data.desktopdir.wrap = parse_bool(doc, n);
- if ((n = parse_find_node("dialog", node->xmlChildrenNode)))
- act->data.desktopdir.inter.any.interactive =
- parse_bool(doc, n);
} else if (act->func == action_send_to_desktop_dir) {
if ((n = parse_find_node("wrap", node->xmlChildrenNode)))
act->data.sendtodir.wrap = parse_bool(doc, n);
action_resize_startup();
action_decorations_startup();
action_desktop_startup();
+ action_directionaldesktop_startup();
}
void action_resize_startup();
void action_decorations_startup();
void action_desktop_startup();
+void action_directionaldesktop_startup();
#endif
void action_desktop_startup()
{
- actions_register("desktop",
+ actions_register("Desktop",
setup_func,
free_func,
run_func,
o->desktop_windows = parse_bool(doc, n);
if ((n = parse_find_node("direction", node))) {
gchar *s = parse_string(doc, n);
- if (!g_ascii_strcasecmp(s, "north"))
+ if (!g_ascii_strcasecmp(s, "north") ||
+ !g_ascii_strcasecmp(s, "up"))
o->direction = OB_DIRECTION_NORTH;
else if (!g_ascii_strcasecmp(s, "northwest"))
o->direction = OB_DIRECTION_NORTHWEST;
else if (!g_ascii_strcasecmp(s, "northeast"))
o->direction = OB_DIRECTION_NORTHEAST;
- else if (!g_ascii_strcasecmp(s, "west"))
+ else if (!g_ascii_strcasecmp(s, "west") ||
+ !g_ascii_strcasecmp(s, "left"))
o->direction = OB_DIRECTION_WEST;
- else if (!g_ascii_strcasecmp(s, "east"))
+ else if (!g_ascii_strcasecmp(s, "east") ||
+ !g_ascii_strcasecmp(s, "right"))
o->direction = OB_DIRECTION_EAST;
- else if (!g_ascii_strcasecmp(s, "south"))
+ else if (!g_ascii_strcasecmp(s, "south") ||
+ !g_ascii_strcasecmp(s, "down"))
o->direction = OB_DIRECTION_NORTH;
else if (!g_ascii_strcasecmp(s, "southwest"))
o->direction = OB_DIRECTION_NORTHWEST;
--- /dev/null
+#include "openbox/actions.h"
+#include "openbox/screen.h"
+#include <glib.h>
+
+typedef struct {
+ gboolean linear;
+ gboolean wrap;
+ ObDirection dir;
+} Options;
+
+static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node);
+static void free_func(gpointer options);
+static gboolean run_func(ObActionsData *data, gpointer options);
+
+void action_directionaldesktop_startup()
+{
+ actions_register("DirectionalDesktop",
+ setup_func,
+ free_func,
+ run_func,
+ NULL, NULL);
+}
+
+static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node)
+{
+ xmlNodePtr n;
+ Options *o;
+
+ o = g_new0(Options, 1);
+ o->wrap = TRUE;
+ o->dir = OB_DIRECTION_EAST;
+
+ if ((n = parse_find_node("wrap", node)))
+ o->wrap = parse_bool(doc, n);
+ if ((n = parse_find_node("direction", node))) {
+ gchar *s = parse_string(doc, n);
+ if (!g_ascii_strcasecmp(s, "next")) {
+ o->linear = TRUE;
+ o->dir = OB_DIRECTION_EAST;
+ }
+ else if (!g_ascii_strcasecmp(s, "previous")) {
+ o->linear = TRUE;
+ o->dir = OB_DIRECTION_WEST;
+ }
+ else if (!g_ascii_strcasecmp(s, "north") ||
+ !g_ascii_strcasecmp(s, "up"))
+ o->dir = OB_DIRECTION_NORTH;
+ else if (!g_ascii_strcasecmp(s, "south") ||
+ !g_ascii_strcasecmp(s, "down"))
+ o->dir = OB_DIRECTION_SOUTH;
+ else if (!g_ascii_strcasecmp(s, "west") ||
+ !g_ascii_strcasecmp(s, "left"))
+ o->dir = OB_DIRECTION_WEST;
+ else if (!g_ascii_strcasecmp(s, "east") ||
+ !g_ascii_strcasecmp(s, "right"))
+ o->dir = OB_DIRECTION_EAST;
+ g_free(s);
+ }
+
+ return o;
+}
+
+static void free_func(gpointer options)
+{
+ Options *o = options;
+
+ g_free(o);
+}
+
+/* Always return FALSE because its not interactive */
+static gboolean run_func(ObActionsData *data, gpointer options)
+{
+ Options *o = options;
+ guint d;
+
+ d = screen_cycle_desktop(o->dir,
+ o->wrap,
+ o->linear,
+ FALSE, TRUE, FALSE);
+ if (d != screen_desktop)
+ screen_set_desktop(d, TRUE);
+
+ return FALSE;
+}
o->desktop_windows = parse_bool(doc, n);
if ((n = parse_find_node("direction", node))) {
gchar *s = parse_string(doc, n);
- if (!g_ascii_strcasecmp(s, "north"))
+ if (!g_ascii_strcasecmp(s, "north") ||
+ !g_ascii_strcasecmp(s, "up"))
o->direction = OB_DIRECTION_NORTH;
else if (!g_ascii_strcasecmp(s, "northwest"))
o->direction = OB_DIRECTION_NORTHWEST;
else if (!g_ascii_strcasecmp(s, "northeast"))
o->direction = OB_DIRECTION_NORTHEAST;
- else if (!g_ascii_strcasecmp(s, "west"))
+ else if (!g_ascii_strcasecmp(s, "west") ||
+ !g_ascii_strcasecmp(s, "left"))
o->direction = OB_DIRECTION_WEST;
- else if (!g_ascii_strcasecmp(s, "east"))
+ else if (!g_ascii_strcasecmp(s, "east") ||
+ !g_ascii_strcasecmp(s, "right"))
o->direction = OB_DIRECTION_EAST;
- else if (!g_ascii_strcasecmp(s, "south"))
+ else if (!g_ascii_strcasecmp(s, "south") ||
+ !g_ascii_strcasecmp(s, "down"))
o->direction = OB_DIRECTION_NORTH;
else if (!g_ascii_strcasecmp(s, "southwest"))
o->direction = OB_DIRECTION_NORTHWEST;