1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
3 action.c for the Openbox window manager
4 Copyright (c) 2003 Ben Jansens
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 See the COPYING file for a copy of the GNU General Public License.
22 #include "moveresize.h"
38 inline void client_action_start(union ActionData
*data
)
40 if (config_focus_follow
)
41 if (data
->any
.context
!= OB_FRAME_CONTEXT_CLIENT
&& !data
->any
.button
)
42 grab_pointer(TRUE
, OB_CURSOR_NONE
);
45 inline void client_action_end(union ActionData
*data
)
47 if (config_focus_follow
)
48 if (data
->any
.context
!= OB_FRAME_CONTEXT_CLIENT
) {
49 if (!data
->any
.button
) {
50 grab_pointer(FALSE
, OB_CURSOR_NONE
);
54 /* usually this is sorta redundant, but with a press action
55 the enter event will come as a GrabNotify which is
56 ignored, so this will handle that case */
57 if ((c
= client_under_pointer()))
58 event_enter_client(c
);
66 void (*func
)(union ActionData
*);
67 void (*setup
)(ObAction
**, ObUserAction uact
);
70 static ObAction
*action_new(void (*func
)(union ActionData
*data
))
72 ObAction
*a
= g_new0(ObAction
, 1);
79 void action_ref(ObAction
*a
)
84 void action_unref(ObAction
*a
)
86 if (a
== NULL
) return;
88 if (--a
->ref
> 0) return;
90 /* deal with pointers */
91 if (a
->func
== action_execute
|| a
->func
== action_restart
)
92 g_free(a
->data
.execute
.path
);
93 else if (a
->func
== action_showmenu
)
94 g_free(a
->data
.showmenu
.name
);
99 ObAction
* action_copy(const ObAction
*src
)
101 ObAction
*a
= action_new(src
->func
);
105 /* deal with pointers */
106 if (a
->func
== action_execute
|| a
->func
== action_restart
)
107 a
->data
.execute
.path
= g_strdup(a
->data
.execute
.path
);
108 else if (a
->func
== action_showmenu
)
109 a
->data
.showmenu
.name
= g_strdup(a
->data
.showmenu
.name
);
114 void setup_action_directional_focus_north(ObAction
**a
, ObUserAction uact
)
116 (*a
)->data
.interdiraction
.inter
.any
.interactive
= TRUE
;
117 (*a
)->data
.interdiraction
.direction
= OB_DIRECTION_NORTH
;
118 (*a
)->data
.interdiraction
.dialog
= TRUE
;
121 void setup_action_directional_focus_east(ObAction
**a
, ObUserAction uact
)
123 (*a
)->data
.interdiraction
.inter
.any
.interactive
= TRUE
;
124 (*a
)->data
.interdiraction
.direction
= OB_DIRECTION_EAST
;
125 (*a
)->data
.interdiraction
.dialog
= TRUE
;
128 void setup_action_directional_focus_south(ObAction
**a
, ObUserAction uact
)
130 (*a
)->data
.interdiraction
.inter
.any
.interactive
= TRUE
;
131 (*a
)->data
.interdiraction
.direction
= OB_DIRECTION_SOUTH
;
132 (*a
)->data
.interdiraction
.dialog
= TRUE
;
135 void setup_action_directional_focus_west(ObAction
**a
, ObUserAction uact
)
137 (*a
)->data
.interdiraction
.inter
.any
.interactive
= TRUE
;
138 (*a
)->data
.interdiraction
.direction
= OB_DIRECTION_WEST
;
139 (*a
)->data
.interdiraction
.dialog
= TRUE
;
142 void setup_action_directional_focus_northeast(ObAction
**a
, ObUserAction uact
)
144 (*a
)->data
.interdiraction
.inter
.any
.interactive
= TRUE
;
145 (*a
)->data
.interdiraction
.direction
= OB_DIRECTION_NORTHEAST
;
146 (*a
)->data
.interdiraction
.dialog
= TRUE
;
149 void setup_action_directional_focus_southeast(ObAction
**a
, ObUserAction uact
)
151 (*a
)->data
.interdiraction
.inter
.any
.interactive
= TRUE
;
152 (*a
)->data
.interdiraction
.direction
= OB_DIRECTION_SOUTHEAST
;
153 (*a
)->data
.interdiraction
.dialog
= TRUE
;
156 void setup_action_directional_focus_southwest(ObAction
**a
, ObUserAction uact
)
158 (*a
)->data
.interdiraction
.inter
.any
.interactive
= TRUE
;
159 (*a
)->data
.interdiraction
.direction
= OB_DIRECTION_SOUTHWEST
;
160 (*a
)->data
.interdiraction
.dialog
= TRUE
;
163 void setup_action_directional_focus_northwest(ObAction
**a
, ObUserAction uact
)
165 (*a
)->data
.interdiraction
.inter
.any
.interactive
= TRUE
;
166 (*a
)->data
.interdiraction
.direction
= OB_DIRECTION_NORTHWEST
;
167 (*a
)->data
.interdiraction
.dialog
= TRUE
;
170 void setup_action_send_to_desktop(ObAction
**a
, ObUserAction uact
)
172 (*a
)->data
.sendto
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
173 (*a
)->data
.sendto
.follow
= TRUE
;
176 void setup_action_send_to_desktop_prev(ObAction
**a
, ObUserAction uact
)
178 (*a
)->data
.sendtodir
.inter
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
179 (*a
)->data
.sendtodir
.inter
.any
.interactive
= TRUE
;
180 (*a
)->data
.sendtodir
.dir
= OB_DIRECTION_WEST
;
181 (*a
)->data
.sendtodir
.linear
= TRUE
;
182 (*a
)->data
.sendtodir
.wrap
= TRUE
;
183 (*a
)->data
.sendtodir
.follow
= TRUE
;
186 void setup_action_send_to_desktop_next(ObAction
**a
, ObUserAction uact
)
188 (*a
)->data
.sendtodir
.inter
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
189 (*a
)->data
.sendtodir
.inter
.any
.interactive
= TRUE
;
190 (*a
)->data
.sendtodir
.dir
= OB_DIRECTION_EAST
;
191 (*a
)->data
.sendtodir
.linear
= TRUE
;
192 (*a
)->data
.sendtodir
.wrap
= TRUE
;
193 (*a
)->data
.sendtodir
.follow
= TRUE
;
196 void setup_action_send_to_desktop_left(ObAction
**a
, ObUserAction uact
)
198 (*a
)->data
.sendtodir
.inter
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
199 (*a
)->data
.sendtodir
.inter
.any
.interactive
= TRUE
;
200 (*a
)->data
.sendtodir
.dir
= OB_DIRECTION_WEST
;
201 (*a
)->data
.sendtodir
.linear
= FALSE
;
202 (*a
)->data
.sendtodir
.wrap
= TRUE
;
203 (*a
)->data
.sendtodir
.follow
= TRUE
;
206 void setup_action_send_to_desktop_right(ObAction
**a
, ObUserAction uact
)
208 (*a
)->data
.sendtodir
.inter
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
209 (*a
)->data
.sendtodir
.inter
.any
.interactive
= TRUE
;
210 (*a
)->data
.sendtodir
.dir
= OB_DIRECTION_EAST
;
211 (*a
)->data
.sendtodir
.linear
= FALSE
;
212 (*a
)->data
.sendtodir
.wrap
= TRUE
;
213 (*a
)->data
.sendtodir
.follow
= TRUE
;
216 void setup_action_send_to_desktop_up(ObAction
**a
, ObUserAction uact
)
218 (*a
)->data
.sendtodir
.inter
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
219 (*a
)->data
.sendtodir
.inter
.any
.interactive
= TRUE
;
220 (*a
)->data
.sendtodir
.dir
= OB_DIRECTION_NORTH
;
221 (*a
)->data
.sendtodir
.linear
= FALSE
;
222 (*a
)->data
.sendtodir
.wrap
= TRUE
;
223 (*a
)->data
.sendtodir
.follow
= TRUE
;
226 void setup_action_send_to_desktop_down(ObAction
**a
, ObUserAction uact
)
228 (*a
)->data
.sendtodir
.inter
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
229 (*a
)->data
.sendtodir
.inter
.any
.interactive
= TRUE
;
230 (*a
)->data
.sendtodir
.dir
= OB_DIRECTION_SOUTH
;
231 (*a
)->data
.sendtodir
.linear
= FALSE
;
232 (*a
)->data
.sendtodir
.wrap
= TRUE
;
233 (*a
)->data
.sendtodir
.follow
= TRUE
;
236 void setup_action_desktop(ObAction
**a
, ObUserAction uact
)
238 (*a
)->data
.desktop
.inter
.any
.interactive
= FALSE
;
241 void setup_action_desktop_prev(ObAction
**a
, ObUserAction uact
)
243 (*a
)->data
.desktopdir
.inter
.any
.interactive
= TRUE
;
244 (*a
)->data
.desktopdir
.dir
= OB_DIRECTION_WEST
;
245 (*a
)->data
.desktopdir
.linear
= TRUE
;
246 (*a
)->data
.desktopdir
.wrap
= TRUE
;
249 void setup_action_desktop_next(ObAction
**a
, ObUserAction uact
)
251 (*a
)->data
.desktopdir
.inter
.any
.interactive
= TRUE
;
252 (*a
)->data
.desktopdir
.dir
= OB_DIRECTION_EAST
;
253 (*a
)->data
.desktopdir
.linear
= TRUE
;
254 (*a
)->data
.desktopdir
.wrap
= TRUE
;
257 void setup_action_desktop_left(ObAction
**a
, ObUserAction uact
)
259 (*a
)->data
.desktopdir
.inter
.any
.interactive
= TRUE
;
260 (*a
)->data
.desktopdir
.dir
= OB_DIRECTION_WEST
;
261 (*a
)->data
.desktopdir
.linear
= FALSE
;
262 (*a
)->data
.desktopdir
.wrap
= TRUE
;
265 void setup_action_desktop_right(ObAction
**a
, ObUserAction uact
)
267 (*a
)->data
.desktopdir
.inter
.any
.interactive
= TRUE
;
268 (*a
)->data
.desktopdir
.dir
= OB_DIRECTION_EAST
;
269 (*a
)->data
.desktopdir
.linear
= FALSE
;
270 (*a
)->data
.desktopdir
.wrap
= TRUE
;
273 void setup_action_desktop_up(ObAction
**a
, ObUserAction uact
)
275 (*a
)->data
.desktopdir
.inter
.any
.interactive
= TRUE
;
276 (*a
)->data
.desktopdir
.dir
= OB_DIRECTION_NORTH
;
277 (*a
)->data
.desktopdir
.linear
= FALSE
;
278 (*a
)->data
.desktopdir
.wrap
= TRUE
;
281 void setup_action_desktop_down(ObAction
**a
, ObUserAction uact
)
283 (*a
)->data
.desktopdir
.inter
.any
.interactive
= TRUE
;
284 (*a
)->data
.desktopdir
.dir
= OB_DIRECTION_SOUTH
;
285 (*a
)->data
.desktopdir
.linear
= FALSE
;
286 (*a
)->data
.desktopdir
.wrap
= TRUE
;
289 void setup_action_cycle_windows_next(ObAction
**a
, ObUserAction uact
)
291 (*a
)->data
.cycle
.inter
.any
.interactive
= TRUE
;
292 (*a
)->data
.cycle
.linear
= FALSE
;
293 (*a
)->data
.cycle
.forward
= TRUE
;
294 (*a
)->data
.cycle
.dialog
= TRUE
;
297 void setup_action_cycle_windows_previous(ObAction
**a
, ObUserAction uact
)
299 (*a
)->data
.cycle
.inter
.any
.interactive
= TRUE
;
300 (*a
)->data
.cycle
.linear
= FALSE
;
301 (*a
)->data
.cycle
.forward
= FALSE
;
302 (*a
)->data
.cycle
.dialog
= TRUE
;
305 void setup_action_movetoedge_north(ObAction
**a
, ObUserAction uact
)
307 (*a
)->data
.diraction
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
308 (*a
)->data
.diraction
.direction
= OB_DIRECTION_NORTH
;
311 void setup_action_movetoedge_south(ObAction
**a
, ObUserAction uact
)
313 (*a
)->data
.diraction
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
314 (*a
)->data
.diraction
.direction
= OB_DIRECTION_SOUTH
;
317 void setup_action_movetoedge_east(ObAction
**a
, ObUserAction uact
)
319 (*a
)->data
.diraction
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
320 (*a
)->data
.diraction
.direction
= OB_DIRECTION_EAST
;
323 void setup_action_movetoedge_west(ObAction
**a
, ObUserAction uact
)
325 (*a
)->data
.diraction
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
326 (*a
)->data
.diraction
.direction
= OB_DIRECTION_WEST
;
329 void setup_action_growtoedge_north(ObAction
**a
, ObUserAction uact
)
331 (*a
)->data
.diraction
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
332 (*a
)->data
.diraction
.direction
= OB_DIRECTION_NORTH
;
335 void setup_action_growtoedge_south(ObAction
**a
, ObUserAction uact
)
337 (*a
)->data
.diraction
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
338 (*a
)->data
.diraction
.direction
= OB_DIRECTION_SOUTH
;
341 void setup_action_growtoedge_east(ObAction
**a
, ObUserAction uact
)
343 (*a
)->data
.diraction
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
344 (*a
)->data
.diraction
.direction
= OB_DIRECTION_EAST
;
347 void setup_action_growtoedge_west(ObAction
**a
, ObUserAction uact
)
349 (*a
)->data
.diraction
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
350 (*a
)->data
.diraction
.direction
= OB_DIRECTION_WEST
;
353 void setup_action_top_layer(ObAction
**a
, ObUserAction uact
)
355 (*a
)->data
.layer
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
356 (*a
)->data
.layer
.layer
= 1;
359 void setup_action_normal_layer(ObAction
**a
, ObUserAction uact
)
361 (*a
)->data
.layer
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
362 (*a
)->data
.layer
.layer
= 0;
365 void setup_action_bottom_layer(ObAction
**a
, ObUserAction uact
)
367 (*a
)->data
.layer
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
368 (*a
)->data
.layer
.layer
= -1;
371 void setup_action_move(ObAction
**a
, ObUserAction uact
)
373 (*a
)->data
.moveresize
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
374 (*a
)->data
.moveresize
.move
= TRUE
;
375 (*a
)->data
.moveresize
.keyboard
=
376 (uact
== OB_USER_ACTION_NONE
||
377 uact
== OB_USER_ACTION_KEYBOARD_KEY
||
378 uact
== OB_USER_ACTION_MENU_SELECTION
);
381 void setup_action_resize(ObAction
**a
, ObUserAction uact
)
383 (*a
)->data
.moveresize
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
384 (*a
)->data
.moveresize
.move
= FALSE
;
385 (*a
)->data
.moveresize
.keyboard
=
386 (uact
== OB_USER_ACTION_NONE
||
387 uact
== OB_USER_ACTION_KEYBOARD_KEY
||
388 uact
== OB_USER_ACTION_MENU_SELECTION
);
391 void setup_action_showmenu(ObAction
**a
, ObUserAction uact
)
393 (*a
)->data
.showmenu
.any
.client_action
= OB_CLIENT_ACTION_OPTIONAL
;
394 /* you cannot call ShowMenu from inside a menu, cuz the menu code makes
395 assumptions that there is only one menu (and submenus) open at
397 if (uact
== OB_USER_ACTION_MENU_SELECTION
) {
403 void setup_client_action(ObAction
**a
, ObUserAction uact
)
405 (*a
)->data
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
408 ActionString actionstrings
[] =
416 "directionalfocusnorth",
417 action_directional_focus
,
418 setup_action_directional_focus_north
421 "directionalfocuseast",
422 action_directional_focus
,
423 setup_action_directional_focus_east
426 "directionalfocussouth",
427 action_directional_focus
,
428 setup_action_directional_focus_south
431 "directionalfocuswest",
432 action_directional_focus
,
433 setup_action_directional_focus_west
436 "directionalfocusnortheast",
437 action_directional_focus
,
438 setup_action_directional_focus_northeast
441 "directionalfocussoutheast",
442 action_directional_focus
,
443 setup_action_directional_focus_southeast
446 "directionalfocussouthwest",
447 action_directional_focus
,
448 setup_action_directional_focus_southwest
451 "directionalfocusnorthwest",
452 action_directional_focus
,
453 setup_action_directional_focus_northwest
477 action_focus_order_to_bottom
,
532 action_toggle_omnipresent
,
537 action_move_relative_horz
,
542 action_move_relative_vert
,
547 action_move_to_center
,
551 "resizerelativehorz",
552 action_resize_relative_horz
,
556 "resizerelativevert",
557 action_resize_relative_vert
,
562 action_move_relative
,
567 action_resize_relative
,
572 action_maximize_full
,
577 action_unmaximize_full
,
581 "togglemaximizefull",
582 action_toggle_maximize_full
,
587 action_maximize_horz
,
592 action_unmaximize_horz
,
596 "togglemaximizehorz",
597 action_toggle_maximize_horz
,
602 action_maximize_vert
,
607 action_unmaximize_vert
,
611 "togglemaximizevert",
612 action_toggle_maximize_vert
,
617 action_toggle_fullscreen
,
622 action_send_to_desktop
,
623 setup_action_send_to_desktop
627 action_send_to_desktop_dir
,
628 setup_action_send_to_desktop_next
631 "sendtodesktopprevious",
632 action_send_to_desktop_dir
,
633 setup_action_send_to_desktop_prev
636 "sendtodesktopright",
637 action_send_to_desktop_dir
,
638 setup_action_send_to_desktop_right
642 action_send_to_desktop_dir
,
643 setup_action_send_to_desktop_left
647 action_send_to_desktop_dir
,
648 setup_action_send_to_desktop_up
652 action_send_to_desktop_dir
,
653 setup_action_send_to_desktop_down
663 setup_action_desktop_next
668 setup_action_desktop_prev
673 setup_action_desktop_right
678 setup_action_desktop_left
683 setup_action_desktop_up
688 setup_action_desktop_down
692 action_toggle_decorations
,
706 "toggledockautohide",
707 action_toggle_dockautohide
,
712 action_toggle_show_desktop
,
722 action_unshow_desktop
,
748 setup_action_showmenu
752 action_send_to_layer
,
753 setup_action_top_layer
758 setup_action_top_layer
762 action_send_to_layer
,
763 setup_action_normal_layer
767 action_send_to_layer
,
768 setup_action_bottom_layer
771 "togglealwaysonbottom",
773 setup_action_bottom_layer
777 action_cycle_windows
,
778 setup_action_cycle_windows_next
782 action_cycle_windows
,
783 setup_action_cycle_windows_previous
788 setup_action_movetoedge_north
793 setup_action_movetoedge_south
798 setup_action_movetoedge_west
803 setup_action_movetoedge_east
808 setup_action_growtoedge_north
813 setup_action_growtoedge_south
818 setup_action_growtoedge_west
823 setup_action_growtoedge_east
832 /* only key bindings can be interactive. thus saith the xor.
833 because of how the mouse is grabbed, mouse events dont even get
834 read during interactive events, so no dice! >:) */
835 #define INTERACTIVE_LIMIT(a, uact) \
836 if (uact != OB_USER_ACTION_KEYBOARD_KEY) \
837 a->data.any.interactive = FALSE;
839 ObAction
*action_from_string(const gchar
*name
, ObUserAction uact
)
842 gboolean exist
= FALSE
;
845 for (i
= 0; actionstrings
[i
].name
; i
++)
846 if (!g_ascii_strcasecmp(name
, actionstrings
[i
].name
)) {
848 a
= action_new(actionstrings
[i
].func
);
849 if (actionstrings
[i
].setup
)
850 actionstrings
[i
].setup(&a
, uact
);
852 INTERACTIVE_LIMIT(a
, uact
);
856 g_warning("Invalid action '%s' requested. No such action exists.",
859 g_warning("Invalid use of action '%s'. Action will be ignored.", name
);
863 ObAction
*action_parse(ObParseInst
*i
, xmlDocPtr doc
, xmlNodePtr node
,
867 ObAction
*act
= NULL
;
870 if (parse_attr_string("name", node
, &actname
)) {
871 if ((act
= action_from_string(actname
, uact
))) {
872 if (act
->func
== action_execute
|| act
->func
== action_restart
) {
873 if ((n
= parse_find_node("execute", node
->xmlChildrenNode
))) {
874 gchar
*s
= parse_string(doc
, n
);
875 act
->data
.execute
.path
= parse_expand_tilde(s
);
878 } else if (act
->func
== action_showmenu
) {
879 if ((n
= parse_find_node("menu", node
->xmlChildrenNode
)))
880 act
->data
.showmenu
.name
= parse_string(doc
, n
);
881 } else if (act
->func
== action_move_relative_horz
||
882 act
->func
== action_move_relative_vert
||
883 act
->func
== action_resize_relative_horz
||
884 act
->func
== action_resize_relative_vert
) {
885 if ((n
= parse_find_node("delta", node
->xmlChildrenNode
)))
886 act
->data
.relative
.deltax
= parse_int(doc
, n
);
887 } else if (act
->func
== action_move_relative
) {
888 if ((n
= parse_find_node("x", node
->xmlChildrenNode
)))
889 act
->data
.relative
.deltax
= parse_int(doc
, n
);
890 if ((n
= parse_find_node("y", node
->xmlChildrenNode
)))
891 act
->data
.relative
.deltay
= parse_int(doc
, n
);
892 } else if (act
->func
== action_resize_relative
) {
893 if ((n
= parse_find_node("left", node
->xmlChildrenNode
)))
894 act
->data
.relative
.deltaxl
= parse_int(doc
, n
);
895 if ((n
= parse_find_node("up", node
->xmlChildrenNode
)))
896 act
->data
.relative
.deltayu
= parse_int(doc
, n
);
897 if ((n
= parse_find_node("right", node
->xmlChildrenNode
)))
898 act
->data
.relative
.deltax
= parse_int(doc
, n
);
899 if ((n
= parse_find_node("down", node
->xmlChildrenNode
)))
900 act
->data
.relative
.deltay
= parse_int(doc
, n
);
901 } else if (act
->func
== action_desktop
) {
902 if ((n
= parse_find_node("desktop", node
->xmlChildrenNode
)))
903 act
->data
.desktop
.desk
= parse_int(doc
, n
);
904 if (act
->data
.desktop
.desk
> 0) act
->data
.desktop
.desk
--;
905 if ((n
= parse_find_node("dialog", node
->xmlChildrenNode
)))
906 act
->data
.desktop
.inter
.any
.interactive
=
908 } else if (act
->func
== action_send_to_desktop
) {
909 if ((n
= parse_find_node("desktop", node
->xmlChildrenNode
)))
910 act
->data
.sendto
.desk
= parse_int(doc
, n
);
911 if (act
->data
.sendto
.desk
> 0) act
->data
.sendto
.desk
--;
912 if ((n
= parse_find_node("follow", node
->xmlChildrenNode
)))
913 act
->data
.sendto
.follow
= parse_bool(doc
, n
);
914 } else if (act
->func
== action_desktop_dir
) {
915 if ((n
= parse_find_node("wrap", node
->xmlChildrenNode
)))
916 act
->data
.desktopdir
.wrap
= parse_bool(doc
, n
);
917 if ((n
= parse_find_node("dialog", node
->xmlChildrenNode
)))
918 act
->data
.desktopdir
.inter
.any
.interactive
=
920 } else if (act
->func
== action_send_to_desktop_dir
) {
921 if ((n
= parse_find_node("wrap", node
->xmlChildrenNode
)))
922 act
->data
.sendtodir
.wrap
= parse_bool(doc
, n
);
923 if ((n
= parse_find_node("follow", node
->xmlChildrenNode
)))
924 act
->data
.sendtodir
.follow
= parse_bool(doc
, n
);
925 if ((n
= parse_find_node("dialog", node
->xmlChildrenNode
)))
926 act
->data
.sendtodir
.inter
.any
.interactive
=
928 } else if (act
->func
== action_activate
) {
929 if ((n
= parse_find_node("here", node
->xmlChildrenNode
)))
930 act
->data
.activate
.here
= parse_bool(doc
, n
);
931 } else if (act
->func
== action_cycle_windows
) {
932 if ((n
= parse_find_node("linear", node
->xmlChildrenNode
)))
933 act
->data
.cycle
.linear
= parse_bool(doc
, n
);
934 if ((n
= parse_find_node("dialog", node
->xmlChildrenNode
)))
935 act
->data
.cycle
.dialog
= parse_bool(doc
, n
);
936 } else if (act
->func
== action_directional_focus
) {
937 if ((n
= parse_find_node("dialog", node
->xmlChildrenNode
)))
938 act
->data
.cycle
.dialog
= parse_bool(doc
, n
);
939 } else if (act
->func
== action_raise
||
940 act
->func
== action_lower
||
941 act
->func
== action_raiselower
||
942 act
->func
== action_shadelower
||
943 act
->func
== action_unshaderaise
) {
944 if ((n
= parse_find_node("group", node
->xmlChildrenNode
)))
945 act
->data
.stacking
.group
= parse_bool(doc
, n
);
947 INTERACTIVE_LIMIT(act
, uact
);
954 void action_run_list(GSList
*acts
, ObClient
*c
, ObFrameContext context
,
955 guint state
, guint button
, gint x
, gint y
,
956 gboolean cancel
, gboolean done
)
960 gboolean inter
= FALSE
;
966 screen_pointer_pos(&x
, &y
);
968 if (grab_on_keyboard())
971 for (it
= acts
; it
; it
= g_slist_next(it
)) {
973 if (a
->data
.any
.interactive
) {
980 /* sometimes when we execute another app as an action,
981 it won't work right unless we XUngrabKeyboard first,
982 even though we grabbed the key/button Asychronously.
983 e.g. "gnome-panel-control --main-menu" */
984 XUngrabKeyboard(ob_display
, event_lasttime
);
987 for (it
= acts
; it
; it
= g_slist_next(it
)) {
990 if (!(a
->data
.any
.client_action
== OB_CLIENT_ACTION_ALWAYS
&& !c
)) {
991 a
->data
.any
.c
= a
->data
.any
.client_action
? c
: NULL
;
992 a
->data
.any
.context
= context
;
996 a
->data
.any
.button
= button
;
998 if (a
->data
.any
.interactive
) {
999 a
->data
.inter
.cancel
= cancel
;
1000 a
->data
.inter
.final
= done
;
1001 if (!(cancel
|| done
))
1002 if (!keyboard_interactive_grab(state
, a
->data
.any
.c
, a
))
1006 /* XXX UGLY HACK race with motion event starting a move and the
1007 button release gettnig processed first. answer: don't queue
1008 moveresize starts. UGLY HACK XXX */
1009 if (a
->data
.any
.interactive
|| a
->func
== action_moveresize
) {
1010 /* interactive actions are not queued */
1013 ob_main_loop_queue_action(ob_main_loop
, a
);
1018 void action_run_string(const gchar
*name
, struct _ObClient
*c
)
1023 a
= action_from_string(name
, OB_USER_ACTION_NONE
);
1026 l
= g_slist_append(NULL
, a
);
1028 action_run(l
, c
, 0);
1031 void action_execute(union ActionData
*data
)
1034 gchar
*cmd
, **argv
= 0;
1035 if (data
->execute
.path
) {
1036 cmd
= g_filename_from_utf8(data
->execute
.path
, -1, NULL
, NULL
, NULL
);
1038 if (!g_shell_parse_argv (cmd
, NULL
, &argv
, &e
)) {
1039 g_warning("failed to execute '%s': %s",
1043 if (!g_spawn_async(NULL
, argv
, NULL
, G_SPAWN_SEARCH_PATH
|
1044 G_SPAWN_DO_NOT_REAP_CHILD
,
1045 NULL
, NULL
, NULL
, &e
)) {
1046 g_warning("failed to execute '%s': %s",
1054 g_warning("failed to convert '%s' from utf8", data
->execute
.path
);
1059 void action_activate(union ActionData
*data
)
1061 client_activate(data
->activate
.any
.c
, data
->activate
.here
);
1064 void action_focus(union ActionData
*data
)
1066 /* if using focus_delay, stop the timer now so that focus doesn't go moving
1068 event_halt_focus_delay();
1070 client_focus(data
->client
.any
.c
);
1073 void action_unfocus (union ActionData
*data
)
1075 if (data
->client
.any
.c
== focus_client
);
1076 focus_fallback(OB_FOCUS_FALLBACK_UNFOCUSING
);
1079 void action_iconify(union ActionData
*data
)
1081 client_action_start(data
);
1082 client_iconify(data
->client
.any
.c
, TRUE
, TRUE
);
1083 client_action_end(data
);
1086 void action_focus_order_to_bottom(union ActionData
*data
)
1088 focus_order_to_bottom(data
->client
.any
.c
);
1091 void action_raiselower(union ActionData
*data
)
1093 ObClient
*c
= data
->client
.any
.c
;
1095 gboolean raise
= FALSE
;
1097 for (it
= stacking_list
; it
; it
= g_list_next(it
)) {
1098 if (WINDOW_IS_CLIENT(it
->data
)) {
1099 ObClient
*cit
= it
->data
;
1101 if (cit
== c
) break;
1102 if (client_normal(cit
) == client_normal(c
) &&
1103 cit
->layer
== c
->layer
&&
1104 cit
->frame
->visible
&&
1105 !client_search_transient(c
, cit
))
1107 if (RECT_INTERSECTS_RECT(cit
->frame
->area
, c
->frame
->area
)) {
1121 void action_raise(union ActionData
*data
)
1123 client_action_start(data
);
1124 stacking_raise(CLIENT_AS_WINDOW(data
->client
.any
.c
), data
->stacking
.group
);
1125 client_action_end(data
);
1128 void action_unshaderaise(union ActionData
*data
)
1130 if (data
->client
.any
.c
->shaded
)
1131 action_unshade(data
);
1136 void action_shadelower(union ActionData
*data
)
1138 if (data
->client
.any
.c
->shaded
)
1144 void action_lower(union ActionData
*data
)
1146 client_action_start(data
);
1147 stacking_lower(CLIENT_AS_WINDOW(data
->client
.any
.c
), data
->stacking
.group
);
1148 client_action_end(data
);
1151 void action_close(union ActionData
*data
)
1153 client_close(data
->client
.any
.c
);
1156 void action_kill(union ActionData
*data
)
1158 client_kill(data
->client
.any
.c
);
1161 void action_shade(union ActionData
*data
)
1163 client_action_start(data
);
1164 client_shade(data
->client
.any
.c
, TRUE
);
1165 client_action_end(data
);
1168 void action_unshade(union ActionData
*data
)
1170 client_action_start(data
);
1171 client_shade(data
->client
.any
.c
, FALSE
);
1172 client_action_end(data
);
1175 void action_toggle_shade(union ActionData
*data
)
1177 client_action_start(data
);
1178 client_shade(data
->client
.any
.c
, !data
->client
.any
.c
->shaded
);
1179 client_action_end(data
);
1182 void action_toggle_omnipresent(union ActionData
*data
)
1184 client_set_desktop(data
->client
.any
.c
,
1185 data
->client
.any
.c
->desktop
== DESKTOP_ALL
?
1186 screen_desktop
: DESKTOP_ALL
, FALSE
);
1189 void action_move_relative_horz(union ActionData
*data
)
1191 ObClient
*c
= data
->relative
.any
.c
;
1192 client_action_start(data
);
1193 client_move(c
, c
->area
.x
+ data
->relative
.deltax
, c
->area
.y
);
1194 client_action_end(data
);
1197 void action_move_relative_vert(union ActionData
*data
)
1199 ObClient
*c
= data
->relative
.any
.c
;
1200 client_action_start(data
);
1201 client_move(c
, c
->area
.x
, c
->area
.y
+ data
->relative
.deltax
);
1202 client_action_end(data
);
1205 void action_move_to_center(union ActionData
*data
)
1207 ObClient
*c
= data
->client
.any
.c
;
1209 area
= screen_area_monitor(c
->desktop
, 0);
1210 client_action_start(data
);
1211 client_move(c
, area
->width
/ 2 - c
->area
.width
/ 2,
1212 area
->height
/ 2 - c
->area
.height
/ 2);
1213 client_action_end(data
);
1216 void action_resize_relative_horz(union ActionData
*data
)
1218 ObClient
*c
= data
->relative
.any
.c
;
1219 client_action_start(data
);
1221 c
->area
.width
+ data
->relative
.deltax
* c
->size_inc
.width
,
1223 client_action_end(data
);
1226 void action_resize_relative_vert(union ActionData
*data
)
1228 ObClient
*c
= data
->relative
.any
.c
;
1230 client_action_start(data
);
1231 client_resize(c
, c
->area
.width
, c
->area
.height
+
1232 data
->relative
.deltax
* c
->size_inc
.height
);
1233 client_action_end(data
);
1237 void action_move_relative(union ActionData
*data
)
1239 ObClient
*c
= data
->relative
.any
.c
;
1240 client_action_start(data
);
1241 client_move(c
, c
->area
.x
+ data
->relative
.deltax
, c
->area
.y
+
1242 data
->relative
.deltay
);
1243 client_action_end(data
);
1246 void action_resize_relative(union ActionData
*data
)
1248 ObClient
*c
= data
->relative
.any
.c
;
1249 client_action_start(data
);
1250 client_move_resize(c
,
1251 c
->area
.x
- data
->relative
.deltaxl
* c
->size_inc
.width
,
1252 c
->area
.y
- data
->relative
.deltayu
* c
->size_inc
.height
,
1253 c
->area
.width
+ data
->relative
.deltax
* c
->size_inc
.width
1254 + data
->relative
.deltaxl
* c
->size_inc
.width
,
1255 c
->area
.height
+ data
->relative
.deltay
* c
->size_inc
.height
1256 + data
->relative
.deltayu
* c
->size_inc
.height
);
1257 client_action_end(data
);
1260 void action_maximize_full(union ActionData
*data
)
1262 client_action_start(data
);
1263 client_maximize(data
->client
.any
.c
, TRUE
, 0, TRUE
);
1264 client_action_end(data
);
1267 void action_unmaximize_full(union ActionData
*data
)
1269 client_action_start(data
);
1270 client_maximize(data
->client
.any
.c
, FALSE
, 0, TRUE
);
1271 client_action_end(data
);
1274 void action_toggle_maximize_full(union ActionData
*data
)
1276 client_action_start(data
);
1277 client_maximize(data
->client
.any
.c
,
1278 !(data
->client
.any
.c
->max_horz
||
1279 data
->client
.any
.c
->max_vert
),
1281 client_action_end(data
);
1284 void action_maximize_horz(union ActionData
*data
)
1286 client_action_start(data
);
1287 client_maximize(data
->client
.any
.c
, TRUE
, 1, TRUE
);
1288 client_action_end(data
);
1291 void action_unmaximize_horz(union ActionData
*data
)
1293 client_action_start(data
);
1294 client_maximize(data
->client
.any
.c
, FALSE
, 1, TRUE
);
1295 client_action_end(data
);
1298 void action_toggle_maximize_horz(union ActionData
*data
)
1300 client_action_start(data
);
1301 client_maximize(data
->client
.any
.c
,
1302 !data
->client
.any
.c
->max_horz
, 1, TRUE
);
1303 client_action_end(data
);
1306 void action_maximize_vert(union ActionData
*data
)
1308 client_action_start(data
);
1309 client_maximize(data
->client
.any
.c
, TRUE
, 2, TRUE
);
1310 client_action_end(data
);
1313 void action_unmaximize_vert(union ActionData
*data
)
1315 client_action_start(data
);
1316 client_maximize(data
->client
.any
.c
, FALSE
, 2, TRUE
);
1317 client_action_end(data
);
1320 void action_toggle_maximize_vert(union ActionData
*data
)
1322 client_action_start(data
);
1323 client_maximize(data
->client
.any
.c
,
1324 !data
->client
.any
.c
->max_vert
, 2, TRUE
);
1325 client_action_end(data
);
1328 void action_toggle_fullscreen(union ActionData
*data
)
1330 client_action_start(data
);
1331 client_fullscreen(data
->client
.any
.c
,
1332 !(data
->client
.any
.c
->fullscreen
), TRUE
);
1333 client_action_end(data
);
1336 void action_send_to_desktop(union ActionData
*data
)
1338 ObClient
*c
= data
->sendto
.any
.c
;
1340 if (!client_normal(c
)) return;
1342 if (data
->sendto
.desk
< screen_num_desktops
||
1343 data
->sendto
.desk
== DESKTOP_ALL
) {
1344 client_set_desktop(c
, data
->sendto
.desk
, data
->sendto
.follow
);
1345 if (data
->sendto
.follow
)
1346 screen_set_desktop(data
->sendto
.desk
);
1350 void action_desktop(union ActionData
*data
)
1352 static guint first
= (unsigned) -1;
1354 if (data
->inter
.any
.interactive
&& first
== (unsigned) -1)
1355 first
= screen_desktop
;
1357 if (!data
->inter
.any
.interactive
||
1358 (!data
->inter
.cancel
&& !data
->inter
.final
))
1360 if (data
->desktop
.desk
< screen_num_desktops
||
1361 data
->desktop
.desk
== DESKTOP_ALL
)
1363 screen_set_desktop(data
->desktop
.desk
);
1364 if (data
->inter
.any
.interactive
)
1365 screen_desktop_popup(data
->desktop
.desk
, TRUE
);
1367 } else if (data
->inter
.cancel
) {
1368 screen_set_desktop(first
);
1371 if (!data
->inter
.any
.interactive
|| data
->inter
.final
) {
1372 screen_desktop_popup(0, FALSE
);
1373 first
= (unsigned) -1;
1377 void action_desktop_dir(union ActionData
*data
)
1381 d
= screen_cycle_desktop(data
->desktopdir
.dir
,
1382 data
->desktopdir
.wrap
,
1383 data
->desktopdir
.linear
,
1384 data
->desktopdir
.inter
.any
.interactive
,
1385 data
->desktopdir
.inter
.final
,
1386 data
->desktopdir
.inter
.cancel
);
1387 if (!data
->sendtodir
.inter
.any
.interactive
||
1388 !data
->sendtodir
.inter
.final
||
1389 data
->sendtodir
.inter
.cancel
)
1391 screen_set_desktop(d
);
1395 void action_send_to_desktop_dir(union ActionData
*data
)
1397 ObClient
*c
= data
->sendtodir
.inter
.any
.c
;
1400 if (!client_normal(c
)) return;
1402 d
= screen_cycle_desktop(data
->sendtodir
.dir
, data
->sendtodir
.wrap
,
1403 data
->sendtodir
.linear
,
1404 data
->sendtodir
.inter
.any
.interactive
,
1405 data
->sendtodir
.inter
.final
,
1406 data
->sendtodir
.inter
.cancel
);
1407 if (!data
->sendtodir
.inter
.any
.interactive
||
1408 !data
->sendtodir
.inter
.final
||
1409 data
->sendtodir
.inter
.cancel
)
1411 client_set_desktop(c
, d
, data
->sendtodir
.follow
);
1412 if (data
->sendtodir
.follow
)
1413 screen_set_desktop(d
);
1417 void action_desktop_last(union ActionData
*data
)
1419 screen_set_desktop(screen_last_desktop
);
1422 void action_toggle_decorations(union ActionData
*data
)
1424 ObClient
*c
= data
->client
.any
.c
;
1426 client_action_start(data
);
1427 client_set_undecorated(c
, !c
->undecorated
);
1428 client_action_end(data
);
1431 static guint32
pick_corner(gint x
, gint y
, gint cx
, gint cy
, gint cw
, gint ch
)
1433 if (config_resize_four_corners
) {
1434 if (x
- cx
> cw
/ 2) {
1435 if (y
- cy
> ch
/ 2)
1436 return prop_atoms
.net_wm_moveresize_size_bottomright
;
1438 return prop_atoms
.net_wm_moveresize_size_topright
;
1440 if (y
- cy
> ch
/ 2)
1441 return prop_atoms
.net_wm_moveresize_size_bottomleft
;
1443 return prop_atoms
.net_wm_moveresize_size_topleft
;
1446 if (x
- cx
> cw
* 2 / 3) {
1447 if (y
- cy
> ch
* 2 / 3)
1448 return prop_atoms
.net_wm_moveresize_size_bottomright
;
1449 else if (y
- cy
< ch
/ 3)
1450 return prop_atoms
.net_wm_moveresize_size_topright
;
1452 return prop_atoms
.net_wm_moveresize_size_right
;
1453 } else if (x
- cx
< cw
/ 3) {
1454 if (y
- cy
> ch
* 2 / 3)
1455 return prop_atoms
.net_wm_moveresize_size_bottomleft
;
1456 else if (y
- cy
< ch
/ 3)
1457 return prop_atoms
.net_wm_moveresize_size_topleft
;
1459 return prop_atoms
.net_wm_moveresize_size_left
;
1461 if (y
- cy
> ch
* 2 / 3)
1462 return prop_atoms
.net_wm_moveresize_size_bottom
;
1463 else if (y
- cy
< ch
/ 3)
1464 return prop_atoms
.net_wm_moveresize_size_top
;
1466 return prop_atoms
.net_wm_moveresize_move
;
1470 void action_moveresize(union ActionData
*data
)
1472 ObClient
*c
= data
->moveresize
.any
.c
;
1475 if (!client_normal(c
)) return;
1477 if (data
->moveresize
.keyboard
) {
1478 corner
= (data
->moveresize
.move
?
1479 prop_atoms
.net_wm_moveresize_move_keyboard
:
1480 prop_atoms
.net_wm_moveresize_size_keyboard
);
1482 corner
= (data
->moveresize
.move
?
1483 prop_atoms
.net_wm_moveresize_move
:
1484 pick_corner(data
->any
.x
, data
->any
.y
,
1485 c
->frame
->area
.x
, c
->frame
->area
.y
,
1486 /* use the client size because the frame
1487 can be differently sized (shaded
1488 windows) and we want this based on the
1490 c
->area
.width
+ c
->frame
->size
.left
+
1491 c
->frame
->size
.right
,
1492 c
->area
.height
+ c
->frame
->size
.top
+
1493 c
->frame
->size
.bottom
));
1496 moveresize_start(c
, data
->any
.x
, data
->any
.y
, data
->any
.button
, corner
);
1499 void action_reconfigure(union ActionData
*data
)
1504 void action_restart(union ActionData
*data
)
1506 ob_restart_other(data
->execute
.path
);
1509 void action_exit(union ActionData
*data
)
1514 void action_showmenu(union ActionData
*data
)
1516 if (data
->showmenu
.name
) {
1517 menu_show(data
->showmenu
.name
, data
->any
.x
, data
->any
.y
,
1518 data
->showmenu
.any
.c
);
1522 void action_cycle_windows(union ActionData
*data
)
1524 /* if using focus_delay, stop the timer now so that focus doesn't go moving
1526 event_halt_focus_delay();
1528 focus_cycle(data
->cycle
.forward
, data
->cycle
.linear
, data
->any
.interactive
,
1530 data
->cycle
.inter
.final
, data
->cycle
.inter
.cancel
);
1533 void action_directional_focus(union ActionData
*data
)
1535 /* if using focus_delay, stop the timer now so that focus doesn't go moving
1537 event_halt_focus_delay();
1539 focus_directional_cycle(data
->interdiraction
.direction
,
1540 data
->any
.interactive
,
1541 data
->interdiraction
.dialog
,
1542 data
->interdiraction
.inter
.final
,
1543 data
->interdiraction
.inter
.cancel
);
1546 void action_movetoedge(union ActionData
*data
)
1549 ObClient
*c
= data
->diraction
.any
.c
;
1551 x
= c
->frame
->area
.x
;
1552 y
= c
->frame
->area
.y
;
1554 switch(data
->diraction
.direction
) {
1555 case OB_DIRECTION_NORTH
:
1556 y
= client_directional_edge_search(c
, OB_DIRECTION_NORTH
);
1558 case OB_DIRECTION_WEST
:
1559 x
= client_directional_edge_search(c
, OB_DIRECTION_WEST
);
1561 case OB_DIRECTION_SOUTH
:
1562 y
= client_directional_edge_search(c
, OB_DIRECTION_SOUTH
) -
1563 c
->frame
->area
.height
;
1565 case OB_DIRECTION_EAST
:
1566 x
= client_directional_edge_search(c
, OB_DIRECTION_EAST
) -
1567 c
->frame
->area
.width
;
1570 g_assert_not_reached();
1572 frame_frame_gravity(c
->frame
, &x
, &y
);
1573 client_action_start(data
);
1574 client_move(c
, x
, y
);
1575 client_action_end(data
);
1578 void action_growtoedge(union ActionData
*data
)
1580 gint x
, y
, width
, height
, dest
;
1581 ObClient
*c
= data
->diraction
.any
.c
;
1584 //FIXME growtoedge resizes shaded windows to 0 height
1588 a
= screen_area(c
->desktop
);
1589 x
= c
->frame
->area
.x
;
1590 y
= c
->frame
->area
.y
;
1591 width
= c
->frame
->area
.width
;
1592 height
= c
->frame
->area
.height
;
1594 switch(data
->diraction
.direction
) {
1595 case OB_DIRECTION_NORTH
:
1596 dest
= client_directional_edge_search(c
, OB_DIRECTION_NORTH
);
1598 height
= c
->frame
->area
.height
/ 2;
1600 height
= c
->frame
->area
.y
+ c
->frame
->area
.height
- dest
;
1604 case OB_DIRECTION_WEST
:
1605 dest
= client_directional_edge_search(c
, OB_DIRECTION_WEST
);
1607 width
= c
->frame
->area
.width
/ 2;
1609 width
= c
->frame
->area
.x
+ c
->frame
->area
.width
- dest
;
1613 case OB_DIRECTION_SOUTH
:
1614 dest
= client_directional_edge_search(c
, OB_DIRECTION_SOUTH
);
1615 if (a
->y
+ a
->height
== y
+ c
->frame
->area
.height
) {
1616 height
= c
->frame
->area
.height
/ 2;
1617 y
= a
->y
+ a
->height
- height
;
1619 height
= dest
- c
->frame
->area
.y
;
1620 y
+= (height
- c
->frame
->area
.height
) % c
->size_inc
.height
;
1621 height
-= (height
- c
->frame
->area
.height
) % c
->size_inc
.height
;
1623 case OB_DIRECTION_EAST
:
1624 dest
= client_directional_edge_search(c
, OB_DIRECTION_EAST
);
1625 if (a
->x
+ a
->width
== x
+ c
->frame
->area
.width
) {
1626 width
= c
->frame
->area
.width
/ 2;
1627 x
= a
->x
+ a
->width
- width
;
1629 width
= dest
- c
->frame
->area
.x
;
1630 x
+= (width
- c
->frame
->area
.width
) % c
->size_inc
.width
;
1631 width
-= (width
- c
->frame
->area
.width
) % c
->size_inc
.width
;
1634 g_assert_not_reached();
1636 frame_frame_gravity(c
->frame
, &x
, &y
);
1637 width
-= c
->frame
->size
.left
+ c
->frame
->size
.right
;
1638 height
-= c
->frame
->size
.top
+ c
->frame
->size
.bottom
;
1639 client_action_start(data
);
1640 client_move_resize(c
, x
, y
, width
, height
);
1641 client_action_end(data
);
1644 void action_send_to_layer(union ActionData
*data
)
1646 client_set_layer(data
->layer
.any
.c
, data
->layer
.layer
);
1649 void action_toggle_layer(union ActionData
*data
)
1651 ObClient
*c
= data
->layer
.any
.c
;
1653 client_action_start(data
);
1654 if (data
->layer
.layer
< 0)
1655 client_set_layer(c
, c
->below
? 0 : -1);
1656 else if (data
->layer
.layer
> 0)
1657 client_set_layer(c
, c
->above
? 0 : 1);
1658 client_action_end(data
);
1661 void action_toggle_dockautohide(union ActionData
*data
)
1663 config_dock_hide
= !config_dock_hide
;
1667 void action_toggle_show_desktop(union ActionData
*data
)
1669 screen_show_desktop(!screen_showing_desktop
);
1672 void action_show_desktop(union ActionData
*data
)
1674 screen_show_desktop(TRUE
);
1677 void action_unshow_desktop(union ActionData
*data
)
1679 screen_show_desktop(FALSE
);