+#include "debug.h"
#include "client.h"
#include "focus.h"
#include "moveresize.h"
act->func == action_desktop_up ||
act->func == action_desktop_down) {
if ((n = parse_find_node("wrap", node->xmlChildrenNode))) {
- g_message("WRAP %d", parse_bool(doc, n));
act->data.desktopdir.wrap = parse_bool(doc, n);
}
} else if (act->func == action_send_to_desktop_right ||
act->data.sendtodir.follow = parse_bool(doc, n);
}
}
+ g_free(actname);
}
return act;
}
void action_send_to_desktop(union ActionData *data)
{
- if (data->sendto.c) {
- if (data->sendto.desk < screen_num_desktops ||
- data->sendto.desk == DESKTOP_ALL) {
- client_set_desktop(data->desktop.c,
- data->sendto.desk, data->sendto.follow);
- if (data->sendto.follow) screen_set_desktop(data->sendto.desk);
- }
+ ObClient *c = data->sendto.c;
+
+ if (!c || !client_normal(c)) return;
+
+ if (data->sendto.desk < screen_num_desktops ||
+ data->sendto.desk == DESKTOP_ALL) {
+ client_set_desktop(c, data->sendto.desk, data->sendto.follow);
+ if (data->sendto.follow) screen_set_desktop(data->sendto.desk);
}
}
void action_send_to_desktop_right(union ActionData *data)
{
+ ObClient *cl = data->sendto.c;
guint r, c, d;
- if (data->sendtodir.c) {
- cur_row_col(&r, &c);
+ if (!cl || !client_normal(cl)) return;
+
+ cur_row_col(&r, &c);
+ ++c;
+ if (c >= screen_desktop_layout.columns) {
+ if (!data->sendtodir.wrap) return;
+ c = 0;
+ }
+ d = translate_row_col(r, c);
+ if (d >= screen_num_desktops) {
+ if (!data->sendtodir.wrap) return;
++c;
- if (c >= screen_desktop_layout.columns) {
- if (!data->sendtodir.wrap) return;
- c = 0;
- }
- d = translate_row_col(r, c);
- if (d >= screen_num_desktops) {
- if (!data->sendtodir.wrap) return;
- ++c;
- }
- d = translate_row_col(r, c);
- if (d < screen_num_desktops) {
- client_set_desktop(data->sendtodir.c, d, data->sendtodir.follow);
- if (data->sendtodir.follow) screen_set_desktop(d);
- }
+ }
+ d = translate_row_col(r, c);
+ if (d < screen_num_desktops) {
+ client_set_desktop(cl, d, data->sendtodir.follow);
+ if (data->sendtodir.follow) screen_set_desktop(d);
}
}
void action_send_to_desktop_left(union ActionData *data)
{
+ ObClient *cl = data->sendto.c;
guint r, c, d;
- if (data->sendtodir.c) {
- cur_row_col(&r, &c);
+ if (!cl || !client_normal(cl)) return;
+
+ cur_row_col(&r, &c);
+ --c;
+ if (c >= screen_desktop_layout.columns) {
+ if (!data->sendtodir.wrap) return;
+ c = screen_desktop_layout.columns - 1;
+ }
+ d = translate_row_col(r, c);
+ if (d >= screen_num_desktops) {
+ if (!data->sendtodir.wrap) return;
--c;
- if (c >= screen_desktop_layout.columns) {
- if (!data->sendtodir.wrap) return;
- c = screen_desktop_layout.columns - 1;
- }
- d = translate_row_col(r, c);
- if (d >= screen_num_desktops) {
- if (!data->sendtodir.wrap) return;
- --c;
- }
- d = translate_row_col(r, c);
- if (d < screen_num_desktops) {
- client_set_desktop(data->sendtodir.c, d, data->sendtodir.follow);
- if (data->sendtodir.follow) screen_set_desktop(d);
- }
+ }
+ d = translate_row_col(r, c);
+ if (d < screen_num_desktops) {
+ client_set_desktop(cl, d, data->sendtodir.follow);
+ if (data->sendtodir.follow) screen_set_desktop(d);
}
}
if (!c) return;
- c->disabled_decorations = c->disabled_decorations ? 0 : ~0;
+ c->decorate = !c->decorate;
client_setup_decor_and_functions(c);
}
void action_restart(union ActionData *data)
{
- ob_restart_path = g_strdup(data->execute.path);
- ob_shutdown = ob_restart = TRUE;
+ ob_restart_other(data->execute.path);
}
void action_exit(union ActionData *data)
{
- ob_shutdown = TRUE;
+ ob_exit();
}
void action_showmenu(union ActionData *data)