- d = translate_row_col(r, c);
- if (d < screen_num_desktops)
- screen_cycle_desktop(d, data->desktopdir.final,
- data->desktopdir.cancel);
-}
-
-void action_send_to_desktop_right(union ActionData *data)
-{
- ObClient *cl = data->sendto.c;
- guint r, c, d;
-
- 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;
- }
- d = translate_row_col(r, c);
- if (d < screen_num_desktops) {
- client_set_desktop(cl, d, data->sendtodir.follow);
- if (data->sendtodir.follow)
- screen_cycle_desktop(d, data->desktopdir.final,
- data->desktopdir.cancel);
- }
-}
-
-void action_desktop_left(union ActionData *data)
-{
- guint r, c, d;
-
- cur_row_col(&r, &c);
- --c;
- if (c >= screen_desktop_layout.columns) {
- if (!data->desktopdir.wrap) return;
- c = screen_desktop_layout.columns - 1;
- }
- d = translate_row_col(r, c);
- if (d >= screen_num_desktops) {
- if (!data->desktopdir.wrap) return;
- --c;
- }
- d = translate_row_col(r, c);
- if (d < screen_num_desktops)
- screen_cycle_desktop(d, data->desktopdir.final,
- data->desktopdir.cancel);
-}
-
-void action_send_to_desktop_left(union ActionData *data)
-{
- ObClient *cl = data->sendto.c;
- guint r, c, d;
-
- 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;
- }
- d = translate_row_col(r, c);
- if (d < screen_num_desktops) {
- client_set_desktop(cl, d, data->sendtodir.follow);
- if (data->sendtodir.follow)
- screen_cycle_desktop(d, data->desktopdir.final,
- data->desktopdir.cancel);
- }
-}
-
-void action_desktop_down(union ActionData *data)
-{
- guint r, c, d;
-
- cur_row_col(&r, &c);
- ++r;
- if (r >= screen_desktop_layout.rows) {
- if (!data->desktopdir.wrap) return;
- r = 0;
- }
- d = translate_row_col(r, c);
- if (d >= screen_num_desktops) {
- if (!data->desktopdir.wrap) return;
- ++r;
- }
- d = translate_row_col(r, c);
- if (d < screen_num_desktops)
- screen_cycle_desktop(d, data->desktopdir.final,
- data->desktopdir.cancel);
-}
-
-void action_send_to_desktop_down(union ActionData *data)
-{
- guint r, c, d;
-
- if (data->sendtodir.c) {
- cur_row_col(&r, &c);
- ++r;
- if (r >= screen_desktop_layout.rows) {
- if (!data->sendtodir.wrap) return;
- r = 0;
- }
- d = translate_row_col(r, c);
- if (d >= screen_num_desktops) {
- if (!data->sendtodir.wrap) return;
- ++r;
- }
- 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_cycle_desktop(d, data->desktopdir.final,
- data->desktopdir.cancel);
- }
- }
-}
-
-void action_desktop_up(union ActionData *data)
-{
- guint r, c, d;
-
- cur_row_col(&r, &c);
- --r;
- if (r >= screen_desktop_layout.rows) {
- if (!data->desktopdir.wrap) return;
- r = screen_desktop_layout.rows - 1;
- }
- d = translate_row_col(r, c);
- if (d >= screen_num_desktops) {
- if (!data->desktopdir.wrap) return;
- --r;
- }
- d = translate_row_col(r, c);
- if (d < screen_num_desktops)
- screen_cycle_desktop(d, data->desktopdir.final,
- data->desktopdir.cancel);
-}
-
-void action_send_to_desktop_up(union ActionData *data)
-{
- guint r, c, d;
-
- if (data->sendtodir.c) {
- cur_row_col(&r, &c);
- --r;
- if (r >= screen_desktop_layout.rows) {
- if (!data->sendtodir.wrap) return;
- r = screen_desktop_layout.rows - 1;
- }
- d = translate_row_col(r, c);
- if (d >= screen_num_desktops) {
- if (!data->sendtodir.wrap) return;
- --r;
- }
- 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_cycle_desktop(d, data->desktopdir.final,
- data->desktopdir.cancel);
- }
- }
-}
-#endif
-
-void action_toggle_decorations(union ActionData *data)
-{
- ObClient *c = data->client.c;
-
- if (!c) return;
-
- c->decorate = !c->decorate;
- client_setup_decor_and_functions(c);
-}
-
-void action_moveresize(union ActionData *data)
-{
- ObClient *c = data->moveresize.c;
-
- if (!c || !client_normal(c)) return;
-
- moveresize_start(c, data->moveresize.x, data->moveresize.y,
- data->moveresize.button, data->moveresize.corner);
-}
-
-void action_restart(union ActionData *data)
-{
- ob_restart_other(data->execute.path);
-}
-
-void action_exit(union ActionData *data)
-{
- ob_exit();
-}
-
-void action_showmenu(union ActionData *data)
-{
- if (data->showmenu.name) {
- menu_show(data->showmenu.name, data->showmenu.x, data->showmenu.y,
- data->showmenu.c);
- }
-}
-
-void action_cycle_windows(union ActionData *data)
-{
- ObClient *c;
-
- c = focus_cycle(data->cycle.forward, data->cycle.linear, data->cycle.final,
- data->cycle.cancel);