1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
3 action.c for the Openbox window manager
4 Copyright (c) 2006 Mikael Magnusson
5 Copyright (c) 2003-2007 Dana Jansens
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 See the COPYING file for a copy of the GNU General Public License.
23 #include "focus_cycle.h"
24 #include "moveresize.h"
37 #include "startupnotify.h"
47 void (*func
)(union ActionData
*);
48 void (*setup
)(ObAction
**, ObUserAction uact
);
51 static ObAction
*action_new(void (*func
)(union ActionData
*data
))
53 ObAction
*a
= g_new0(ObAction
, 1);
60 void action_ref(ObAction
*a
)
65 void action_unref(ObAction
*a
)
67 if (a
== NULL
) return;
69 if (--a
->ref
> 0) return;
71 /* deal with pointers */
72 if (a
->func
== action_execute
|| a
->func
== action_restart
)
73 g_free(a
->data
.execute
.path
);
74 else if (a
->func
== action_debug
)
75 g_free(a
->data
.debug
.string
);
76 else if (a
->func
== action_showmenu
)
77 g_free(a
->data
.showmenu
.name
);
82 ObAction
* action_copy(const ObAction
*src
)
84 ObAction
*a
= action_new(src
->func
);
88 /* deal with pointers */
89 if (a
->func
== action_execute
|| a
->func
== action_restart
)
90 a
->data
.execute
.path
= g_strdup(a
->data
.execute
.path
);
91 else if (a
->func
== action_debug
)
92 a
->data
.debug
.string
= g_strdup(a
->data
.debug
.string
);
93 else if (a
->func
== action_showmenu
)
94 a
->data
.showmenu
.name
= g_strdup(a
->data
.showmenu
.name
);
99 void setup_action_directional_focus_north(ObAction
**a
, ObUserAction uact
)
101 (*a
)->data
.interdiraction
.inter
.any
.interactive
= TRUE
;
102 (*a
)->data
.interdiraction
.direction
= OB_DIRECTION_NORTH
;
103 (*a
)->data
.interdiraction
.dialog
= TRUE
;
104 (*a
)->data
.interdiraction
.dock_windows
= FALSE
;
105 (*a
)->data
.interdiraction
.desktop_windows
= FALSE
;
108 void setup_action_directional_focus_east(ObAction
**a
, ObUserAction uact
)
110 (*a
)->data
.interdiraction
.inter
.any
.interactive
= TRUE
;
111 (*a
)->data
.interdiraction
.direction
= OB_DIRECTION_EAST
;
112 (*a
)->data
.interdiraction
.dialog
= TRUE
;
113 (*a
)->data
.interdiraction
.dock_windows
= FALSE
;
114 (*a
)->data
.interdiraction
.desktop_windows
= FALSE
;
117 void setup_action_directional_focus_south(ObAction
**a
, ObUserAction uact
)
119 (*a
)->data
.interdiraction
.inter
.any
.interactive
= TRUE
;
120 (*a
)->data
.interdiraction
.direction
= OB_DIRECTION_SOUTH
;
121 (*a
)->data
.interdiraction
.dialog
= TRUE
;
122 (*a
)->data
.interdiraction
.dock_windows
= FALSE
;
123 (*a
)->data
.interdiraction
.desktop_windows
= FALSE
;
126 void setup_action_directional_focus_west(ObAction
**a
, ObUserAction uact
)
128 (*a
)->data
.interdiraction
.inter
.any
.interactive
= TRUE
;
129 (*a
)->data
.interdiraction
.direction
= OB_DIRECTION_WEST
;
130 (*a
)->data
.interdiraction
.dialog
= TRUE
;
131 (*a
)->data
.interdiraction
.dock_windows
= FALSE
;
132 (*a
)->data
.interdiraction
.desktop_windows
= FALSE
;
135 void setup_action_directional_focus_northeast(ObAction
**a
, ObUserAction uact
)
137 (*a
)->data
.interdiraction
.inter
.any
.interactive
= TRUE
;
138 (*a
)->data
.interdiraction
.direction
= OB_DIRECTION_NORTHEAST
;
139 (*a
)->data
.interdiraction
.dialog
= TRUE
;
140 (*a
)->data
.interdiraction
.dock_windows
= FALSE
;
141 (*a
)->data
.interdiraction
.desktop_windows
= FALSE
;
144 void setup_action_directional_focus_southeast(ObAction
**a
, ObUserAction uact
)
146 (*a
)->data
.interdiraction
.inter
.any
.interactive
= TRUE
;
147 (*a
)->data
.interdiraction
.direction
= OB_DIRECTION_SOUTHEAST
;
148 (*a
)->data
.interdiraction
.dialog
= TRUE
;
149 (*a
)->data
.interdiraction
.dock_windows
= FALSE
;
150 (*a
)->data
.interdiraction
.desktop_windows
= FALSE
;
153 void setup_action_directional_focus_southwest(ObAction
**a
, ObUserAction uact
)
155 (*a
)->data
.interdiraction
.inter
.any
.interactive
= TRUE
;
156 (*a
)->data
.interdiraction
.direction
= OB_DIRECTION_SOUTHWEST
;
157 (*a
)->data
.interdiraction
.dialog
= TRUE
;
158 (*a
)->data
.interdiraction
.dock_windows
= FALSE
;
159 (*a
)->data
.interdiraction
.desktop_windows
= FALSE
;
162 void setup_action_directional_focus_northwest(ObAction
**a
, ObUserAction uact
)
164 (*a
)->data
.interdiraction
.inter
.any
.interactive
= TRUE
;
165 (*a
)->data
.interdiraction
.direction
= OB_DIRECTION_NORTHWEST
;
166 (*a
)->data
.interdiraction
.dialog
= TRUE
;
167 (*a
)->data
.interdiraction
.dock_windows
= FALSE
;
168 (*a
)->data
.interdiraction
.desktop_windows
= FALSE
;
171 void setup_action_send_to_desktop(ObAction
**a
, ObUserAction uact
)
173 (*a
)->data
.sendto
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
174 (*a
)->data
.sendto
.follow
= TRUE
;
177 void setup_action_send_to_desktop_prev(ObAction
**a
, ObUserAction uact
)
179 (*a
)->data
.sendtodir
.inter
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
180 (*a
)->data
.sendtodir
.inter
.any
.interactive
= TRUE
;
181 (*a
)->data
.sendtodir
.dir
= OB_DIRECTION_WEST
;
182 (*a
)->data
.sendtodir
.linear
= TRUE
;
183 (*a
)->data
.sendtodir
.wrap
= TRUE
;
184 (*a
)->data
.sendtodir
.follow
= TRUE
;
187 void setup_action_send_to_desktop_next(ObAction
**a
, ObUserAction uact
)
189 (*a
)->data
.sendtodir
.inter
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
190 (*a
)->data
.sendtodir
.inter
.any
.interactive
= TRUE
;
191 (*a
)->data
.sendtodir
.dir
= OB_DIRECTION_EAST
;
192 (*a
)->data
.sendtodir
.linear
= TRUE
;
193 (*a
)->data
.sendtodir
.wrap
= TRUE
;
194 (*a
)->data
.sendtodir
.follow
= TRUE
;
197 void setup_action_send_to_desktop_left(ObAction
**a
, ObUserAction uact
)
199 (*a
)->data
.sendtodir
.inter
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
200 (*a
)->data
.sendtodir
.inter
.any
.interactive
= TRUE
;
201 (*a
)->data
.sendtodir
.dir
= OB_DIRECTION_WEST
;
202 (*a
)->data
.sendtodir
.linear
= FALSE
;
203 (*a
)->data
.sendtodir
.wrap
= TRUE
;
204 (*a
)->data
.sendtodir
.follow
= TRUE
;
207 void setup_action_send_to_desktop_right(ObAction
**a
, ObUserAction uact
)
209 (*a
)->data
.sendtodir
.inter
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
210 (*a
)->data
.sendtodir
.inter
.any
.interactive
= TRUE
;
211 (*a
)->data
.sendtodir
.dir
= OB_DIRECTION_EAST
;
212 (*a
)->data
.sendtodir
.linear
= FALSE
;
213 (*a
)->data
.sendtodir
.wrap
= TRUE
;
214 (*a
)->data
.sendtodir
.follow
= TRUE
;
217 void setup_action_send_to_desktop_up(ObAction
**a
, ObUserAction uact
)
219 (*a
)->data
.sendtodir
.inter
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
220 (*a
)->data
.sendtodir
.inter
.any
.interactive
= TRUE
;
221 (*a
)->data
.sendtodir
.dir
= OB_DIRECTION_NORTH
;
222 (*a
)->data
.sendtodir
.linear
= FALSE
;
223 (*a
)->data
.sendtodir
.wrap
= TRUE
;
224 (*a
)->data
.sendtodir
.follow
= TRUE
;
227 void setup_action_send_to_desktop_down(ObAction
**a
, ObUserAction uact
)
229 (*a
)->data
.sendtodir
.inter
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
230 (*a
)->data
.sendtodir
.inter
.any
.interactive
= TRUE
;
231 (*a
)->data
.sendtodir
.dir
= OB_DIRECTION_SOUTH
;
232 (*a
)->data
.sendtodir
.linear
= FALSE
;
233 (*a
)->data
.sendtodir
.wrap
= TRUE
;
234 (*a
)->data
.sendtodir
.follow
= TRUE
;
237 void setup_action_desktop(ObAction
**a
, ObUserAction uact
)
240 (*a)->data.desktop.inter.any.interactive = FALSE;
244 void setup_action_desktop_prev(ObAction
**a
, ObUserAction uact
)
246 (*a
)->data
.desktopdir
.inter
.any
.interactive
= TRUE
;
247 (*a
)->data
.desktopdir
.dir
= OB_DIRECTION_WEST
;
248 (*a
)->data
.desktopdir
.linear
= TRUE
;
249 (*a
)->data
.desktopdir
.wrap
= TRUE
;
252 void setup_action_desktop_next(ObAction
**a
, ObUserAction uact
)
254 (*a
)->data
.desktopdir
.inter
.any
.interactive
= TRUE
;
255 (*a
)->data
.desktopdir
.dir
= OB_DIRECTION_EAST
;
256 (*a
)->data
.desktopdir
.linear
= TRUE
;
257 (*a
)->data
.desktopdir
.wrap
= TRUE
;
260 void setup_action_desktop_left(ObAction
**a
, ObUserAction uact
)
262 (*a
)->data
.desktopdir
.inter
.any
.interactive
= TRUE
;
263 (*a
)->data
.desktopdir
.dir
= OB_DIRECTION_WEST
;
264 (*a
)->data
.desktopdir
.linear
= FALSE
;
265 (*a
)->data
.desktopdir
.wrap
= TRUE
;
268 void setup_action_desktop_right(ObAction
**a
, ObUserAction uact
)
270 (*a
)->data
.desktopdir
.inter
.any
.interactive
= TRUE
;
271 (*a
)->data
.desktopdir
.dir
= OB_DIRECTION_EAST
;
272 (*a
)->data
.desktopdir
.linear
= FALSE
;
273 (*a
)->data
.desktopdir
.wrap
= TRUE
;
276 void setup_action_desktop_up(ObAction
**a
, ObUserAction uact
)
278 (*a
)->data
.desktopdir
.inter
.any
.interactive
= TRUE
;
279 (*a
)->data
.desktopdir
.dir
= OB_DIRECTION_NORTH
;
280 (*a
)->data
.desktopdir
.linear
= FALSE
;
281 (*a
)->data
.desktopdir
.wrap
= TRUE
;
284 void setup_action_desktop_down(ObAction
**a
, ObUserAction uact
)
286 (*a
)->data
.desktopdir
.inter
.any
.interactive
= TRUE
;
287 (*a
)->data
.desktopdir
.dir
= OB_DIRECTION_SOUTH
;
288 (*a
)->data
.desktopdir
.linear
= FALSE
;
289 (*a
)->data
.desktopdir
.wrap
= TRUE
;
292 void setup_action_movefromedge_north(ObAction
**a
, ObUserAction uact
)
294 (*a
)->data
.diraction
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
295 (*a
)->data
.diraction
.direction
= OB_DIRECTION_NORTH
;
296 (*a
)->data
.diraction
.hang
= TRUE
;
299 void setup_action_movefromedge_south(ObAction
**a
, ObUserAction uact
)
301 (*a
)->data
.diraction
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
302 (*a
)->data
.diraction
.direction
= OB_DIRECTION_SOUTH
;
303 (*a
)->data
.diraction
.hang
= TRUE
;
306 void setup_action_movefromedge_east(ObAction
**a
, ObUserAction uact
)
308 (*a
)->data
.diraction
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
309 (*a
)->data
.diraction
.direction
= OB_DIRECTION_EAST
;
310 (*a
)->data
.diraction
.hang
= TRUE
;
313 void setup_action_movefromedge_west(ObAction
**a
, ObUserAction uact
)
315 (*a
)->data
.diraction
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
316 (*a
)->data
.diraction
.direction
= OB_DIRECTION_WEST
;
317 (*a
)->data
.diraction
.hang
= TRUE
;
320 void setup_action_movetoedge_north(ObAction
**a
, ObUserAction uact
)
322 (*a
)->data
.diraction
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
323 (*a
)->data
.diraction
.direction
= OB_DIRECTION_NORTH
;
324 (*a
)->data
.diraction
.hang
= FALSE
;
327 void setup_action_movetoedge_south(ObAction
**a
, ObUserAction uact
)
329 (*a
)->data
.diraction
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
330 (*a
)->data
.diraction
.direction
= OB_DIRECTION_SOUTH
;
331 (*a
)->data
.diraction
.hang
= FALSE
;
334 void setup_action_movetoedge_east(ObAction
**a
, ObUserAction uact
)
336 (*a
)->data
.diraction
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
337 (*a
)->data
.diraction
.direction
= OB_DIRECTION_EAST
;
338 (*a
)->data
.diraction
.hang
= FALSE
;
341 void setup_action_movetoedge_west(ObAction
**a
, ObUserAction uact
)
343 (*a
)->data
.diraction
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
344 (*a
)->data
.diraction
.direction
= OB_DIRECTION_WEST
;
345 (*a
)->data
.diraction
.hang
= FALSE
;
348 void setup_action_growtoedge_north(ObAction
**a
, ObUserAction uact
)
350 (*a
)->data
.diraction
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
351 (*a
)->data
.diraction
.direction
= OB_DIRECTION_NORTH
;
354 void setup_action_growtoedge_south(ObAction
**a
, ObUserAction uact
)
356 (*a
)->data
.diraction
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
357 (*a
)->data
.diraction
.direction
= OB_DIRECTION_SOUTH
;
360 void setup_action_growtoedge_east(ObAction
**a
, ObUserAction uact
)
362 (*a
)->data
.diraction
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
363 (*a
)->data
.diraction
.direction
= OB_DIRECTION_EAST
;
366 void setup_action_growtoedge_west(ObAction
**a
, ObUserAction uact
)
368 (*a
)->data
.diraction
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
369 (*a
)->data
.diraction
.direction
= OB_DIRECTION_WEST
;
372 void setup_action_top_layer(ObAction
**a
, ObUserAction uact
)
374 (*a
)->data
.layer
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
375 (*a
)->data
.layer
.layer
= 1;
378 void setup_action_normal_layer(ObAction
**a
, ObUserAction uact
)
380 (*a
)->data
.layer
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
381 (*a
)->data
.layer
.layer
= 0;
384 void setup_action_bottom_layer(ObAction
**a
, ObUserAction uact
)
386 (*a
)->data
.layer
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
387 (*a
)->data
.layer
.layer
= -1;
390 void setup_action_resize(ObAction
**a
, ObUserAction uact
)
392 (*a
)->data
.moveresize
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
393 (*a
)->data
.moveresize
.keyboard
=
394 (uact
== OB_USER_ACTION_NONE
||
395 uact
== OB_USER_ACTION_KEYBOARD_KEY
||
396 uact
== OB_USER_ACTION_MENU_SELECTION
);
397 (*a
)->data
.moveresize
.corner
= 0;
400 void setup_action_addremove_desktop_current(ObAction
**a
, ObUserAction uact
)
402 (*a
)->data
.addremovedesktop
.current
= TRUE
;
405 void setup_action_addremove_desktop_last(ObAction
**a
, ObUserAction uact
)
407 (*a
)->data
.addremovedesktop
.current
= FALSE
;
410 void setup_client_action(ObAction
**a
, ObUserAction uact
)
412 (*a
)->data
.any
.client_action
= OB_CLIENT_ACTION_ALWAYS
;
415 ActionString actionstrings
[] =
418 "directionalfocusnorth",
419 action_directional_focus
,
420 setup_action_directional_focus_north
423 "directionalfocuseast",
424 action_directional_focus
,
425 setup_action_directional_focus_east
428 "directionalfocussouth",
429 action_directional_focus
,
430 setup_action_directional_focus_south
433 "directionalfocuswest",
434 action_directional_focus
,
435 setup_action_directional_focus_west
438 "directionalfocusnortheast",
439 action_directional_focus
,
440 setup_action_directional_focus_northeast
443 "directionalfocussoutheast",
444 action_directional_focus
,
445 setup_action_directional_focus_southeast
448 "directionalfocussouthwest",
449 action_directional_focus
,
450 setup_action_directional_focus_southwest
453 "directionalfocusnorthwest",
454 action_directional_focus
,
455 setup_action_directional_focus_northwest
489 action_toggle_omnipresent
,
494 action_move_relative_horz
,
498 "resizerelativevert",
499 action_resize_relative_vert
,
504 action_resize_relative
,
509 action_send_to_desktop
,
510 setup_action_send_to_desktop
514 action_send_to_desktop_dir
,
515 setup_action_send_to_desktop_next
518 "sendtodesktopprevious",
519 action_send_to_desktop_dir
,
520 setup_action_send_to_desktop_prev
523 "sendtodesktopright",
524 action_send_to_desktop_dir
,
525 setup_action_send_to_desktop_right
529 action_send_to_desktop_dir
,
530 setup_action_send_to_desktop_left
534 action_send_to_desktop_dir
,
535 setup_action_send_to_desktop_up
539 action_send_to_desktop_dir
,
540 setup_action_send_to_desktop_down
550 setup_action_desktop_next
555 setup_action_desktop_prev
560 setup_action_desktop_right
565 setup_action_desktop_left
570 setup_action_desktop_up
575 setup_action_desktop_down
579 action_toggle_decorations
,
588 "toggledockautohide",
589 action_toggle_dockautohide
,
599 action_send_to_layer
,
600 setup_action_top_layer
605 setup_action_top_layer
609 action_send_to_layer
,
610 setup_action_normal_layer
614 action_send_to_layer
,
615 setup_action_bottom_layer
618 "togglealwaysonbottom",
620 setup_action_bottom_layer
625 setup_action_movefromedge_north
630 setup_action_movefromedge_south
635 setup_action_movefromedge_west
640 setup_action_movefromedge_east
645 setup_action_movetoedge_north
650 setup_action_movetoedge_south
655 setup_action_movetoedge_west
660 setup_action_movetoedge_east
665 setup_action_growtoedge_north
670 setup_action_growtoedge_south
675 setup_action_growtoedge_west
680 setup_action_growtoedge_east
685 setup_action_addremove_desktop_last
689 action_remove_desktop
,
690 setup_action_addremove_desktop_last
695 setup_action_addremove_desktop_current
698 "removedesktopcurrent",
699 action_remove_desktop
,
700 setup_action_addremove_desktop_current
709 /* only key bindings can be interactive. thus saith the xor.
710 because of how the mouse is grabbed, mouse events dont even get
711 read during interactive events, so no dice! >:) */
712 #define INTERACTIVE_LIMIT(a, uact) \
713 if (uact != OB_USER_ACTION_KEYBOARD_KEY) \
714 a->data.any.interactive = FALSE;
716 ObAction
*action_from_string(const gchar
*name
, ObUserAction uact
)
719 gboolean exist
= FALSE
;
722 for (i
= 0; actionstrings
[i
].name
; i
++)
723 if (!g_ascii_strcasecmp(name
, actionstrings
[i
].name
)) {
725 a
= action_new(actionstrings
[i
].func
);
726 if (actionstrings
[i
].setup
)
727 actionstrings
[i
].setup(&a
, uact
);
729 INTERACTIVE_LIMIT(a
, uact
);
733 g_message(_("Invalid action '%s' requested. No such action exists."),
736 g_message(_("Invalid use of action '%s'. Action will be ignored."),
741 ObAction
*action_parse(ObParseInst
*i
, xmlDocPtr doc
, xmlNodePtr node
,
745 ObAction
*act
= NULL
;
748 if (parse_attr_string("name", node
, &actname
)) {
749 if ((act
= action_from_string(actname
, uact
))) {
750 } else if (act
->func
== action_resize_relative
) {
751 if ((n
= parse_find_node("left", node
->xmlChildrenNode
)))
752 act
->data
.relative
.deltaxl
= parse_int(doc
, n
);
753 if ((n
= parse_find_node("up", node
->xmlChildrenNode
)))
754 act
->data
.relative
.deltayu
= parse_int(doc
, n
);
755 if ((n
= parse_find_node("right", node
->xmlChildrenNode
)))
756 act
->data
.relative
.deltax
= parse_int(doc
, n
);
757 if ((n
= parse_find_node("down", node
->xmlChildrenNode
)))
758 act
->data
.relative
.deltay
= parse_int(doc
, n
);
759 } else if (act
->func
== action_desktop
) {
760 if ((n
= parse_find_node("desktop", node
->xmlChildrenNode
)))
761 act
->data
.desktop
.desk
= parse_int(doc
, n
);
762 if (act
->data
.desktop
.desk
> 0) act
->data
.desktop
.desk
--;
764 if ((n = parse_find_node("dialog", node->xmlChildrenNode)))
765 act->data.desktop.inter.any.interactive =
768 } else if (act
->func
== action_send_to_desktop
) {
769 if ((n
= parse_find_node("desktop", node
->xmlChildrenNode
)))
770 act
->data
.sendto
.desk
= parse_int(doc
, n
);
771 if (act
->data
.sendto
.desk
> 0) act
->data
.sendto
.desk
--;
772 if ((n
= parse_find_node("follow", node
->xmlChildrenNode
)))
773 act
->data
.sendto
.follow
= parse_bool(doc
, n
);
774 } else if (act
->func
== action_desktop_dir
) {
775 if ((n
= parse_find_node("wrap", node
->xmlChildrenNode
)))
776 act
->data
.desktopdir
.wrap
= parse_bool(doc
, n
);
777 if ((n
= parse_find_node("dialog", node
->xmlChildrenNode
)))
778 act
->data
.desktopdir
.inter
.any
.interactive
=
780 } else if (act
->func
== action_send_to_desktop_dir
) {
781 if ((n
= parse_find_node("wrap", node
->xmlChildrenNode
)))
782 act
->data
.sendtodir
.wrap
= parse_bool(doc
, n
);
783 if ((n
= parse_find_node("follow", node
->xmlChildrenNode
)))
784 act
->data
.sendtodir
.follow
= parse_bool(doc
, n
);
785 if ((n
= parse_find_node("dialog", node
->xmlChildrenNode
)))
786 act
->data
.sendtodir
.inter
.any
.interactive
=
788 } else if (act
->func
== action_directional_focus
) {
789 if ((n
= parse_find_node("dialog", node
->xmlChildrenNode
)))
790 act
->data
.interdiraction
.dialog
= parse_bool(doc
, n
);
791 if ((n
= parse_find_node("panels", node
->xmlChildrenNode
)))
792 act
->data
.interdiraction
.dock_windows
= parse_bool(doc
, n
);
793 if ((n
= parse_find_node("desktop", node
->xmlChildrenNode
)))
794 act
->data
.interdiraction
.desktop_windows
=
796 } else if (act
->func
== action_resize
) {
797 if ((n
= parse_find_node("edge", node
->xmlChildrenNode
))) {
798 gchar
*s
= parse_string(doc
, n
);
799 if (!g_ascii_strcasecmp(s
, "top"))
800 act
->data
.moveresize
.corner
=
801 prop_atoms
.net_wm_moveresize_size_top
;
802 else if (!g_ascii_strcasecmp(s
, "bottom"))
803 act
->data
.moveresize
.corner
=
804 prop_atoms
.net_wm_moveresize_size_bottom
;
805 else if (!g_ascii_strcasecmp(s
, "left"))
806 act
->data
.moveresize
.corner
=
807 prop_atoms
.net_wm_moveresize_size_left
;
808 else if (!g_ascii_strcasecmp(s
, "right"))
809 act
->data
.moveresize
.corner
=
810 prop_atoms
.net_wm_moveresize_size_right
;
811 else if (!g_ascii_strcasecmp(s
, "topleft"))
812 act
->data
.moveresize
.corner
=
813 prop_atoms
.net_wm_moveresize_size_topleft
;
814 else if (!g_ascii_strcasecmp(s
, "topright"))
815 act
->data
.moveresize
.corner
=
816 prop_atoms
.net_wm_moveresize_size_topright
;
817 else if (!g_ascii_strcasecmp(s
, "bottomleft"))
818 act
->data
.moveresize
.corner
=
819 prop_atoms
.net_wm_moveresize_size_bottomleft
;
820 else if (!g_ascii_strcasecmp(s
, "bottomright"))
821 act
->data
.moveresize
.corner
=
822 prop_atoms
.net_wm_moveresize_size_bottomright
;
825 INTERACTIVE_LIMIT(act
, uact
);
832 void action_run_list(GSList
*acts
, ObClient
*c
, ObFrameContext context
,
833 guint state
, guint button
, gint x
, gint y
, Time time
,
834 gboolean cancel
, gboolean done
)
843 screen_pointer_pos(&x
, &y
);
845 for (it
= acts
; it
; it
= g_slist_next(it
)) {
848 if (!(a
->data
.any
.client_action
== OB_CLIENT_ACTION_ALWAYS
&& !c
)) {
849 a
->data
.any
.c
= a
->data
.any
.client_action
? c
: NULL
;
850 a
->data
.any
.context
= context
;
854 a
->data
.any
.button
= button
;
856 a
->data
.any
.time
= time
;
858 if (a
->data
.any
.interactive
) {
859 a
->data
.inter
.cancel
= cancel
;
860 a
->data
.inter
.final
= done
;
861 if (!(cancel
|| done
))
862 if (!keyboard_interactive_grab(state
, a
->data
.any
.c
, a
))
866 /* XXX UGLY HACK race with motion event starting a move and the
867 button release gettnig processed first. answer: don't queue
868 moveresize starts. UGLY HACK XXX
870 XXX ALSO don't queue showmenu events, because on button press
871 events we need to know if a mouse grab is going to take place,
872 and set the button to 0, so that later motion events don't think
873 that a drag is going on. since showmenu grabs the pointer..
875 if (a
->data
.any
.interactive
|| a
->func
== action_move
||
876 a
->func
== action_resize
|| a
->func
== action_showmenu
)
878 /* interactive actions are not queued */
880 } else if (a
->func
== action_focus
||
881 a
->func
== action_activate
||
882 a
->func
== action_showmenu
)
884 /* XXX MORE UGLY HACK
885 actions from clicks on client windows are NOT queued.
886 this solves the mysterious click-and-drag-doesnt-work
887 problem. it was because the window gets focused and stuff
888 after the button event has already been passed through. i
889 dont really know why it should care but it does and it makes
892 however this very bogus ! !
893 we want to send the button press to the window BEFORE
894 we do the action because the action might move the windows
895 (eg change desktops) and then the button press ends up on
896 the completely wrong window !
897 so, this is just for that bug, and it will only NOT queue it
898 if it is a focusing action that can be used with the mouse
901 also with the menus, there is a race going on. if the
902 desktop wants to pop up a menu, and we do too, we send them
903 the button before we pop up the menu, so they pop up their
904 menu first. but not always. if we pop up our menu before
905 sending them the button press, then the result is
908 XXX further more. focus actions are not queued at all,
909 because if you bind focus->showmenu, the menu will get
910 hidden to do the focusing
914 ob_main_loop_queue_action(ob_main_loop
, a
);
919 void action_run_string(const gchar
*name
, struct _ObClient
*c
, Time time
)
924 a
= action_from_string(name
, OB_USER_ACTION_NONE
);
927 l
= g_slist_append(NULL
, a
);
929 action_run(l
, c
, 0, time
);
932 void action_unshaderaise(union ActionData
*data
)
934 if (data
->client
.any
.c
->shaded
)
935 action_unshade(data
);
940 void action_shadelower(union ActionData
*data
)
942 if (data
->client
.any
.c
->shaded
)
948 void action_kill(union ActionData
*data
)
950 client_kill(data
->client
.any
.c
);
953 void action_shade(union ActionData
*data
)
955 client_action_start(data
);
956 client_shade(data
->client
.any
.c
, TRUE
);
957 client_action_end(data
, config_focus_under_mouse
);
960 void action_unshade(union ActionData
*data
)
962 client_action_start(data
);
963 client_shade(data
->client
.any
.c
, FALSE
);
964 client_action_end(data
, config_focus_under_mouse
);
967 void action_toggle_shade(union ActionData
*data
)
969 client_action_start(data
);
970 client_shade(data
->client
.any
.c
, !data
->client
.any
.c
->shaded
);
971 client_action_end(data
, config_focus_under_mouse
);
974 void action_toggle_omnipresent(union ActionData
*data
)
976 client_set_desktop(data
->client
.any
.c
,
977 data
->client
.any
.c
->desktop
== DESKTOP_ALL
?
978 screen_desktop
: DESKTOP_ALL
, FALSE
, TRUE
);
981 void action_resize_relative_horz(union ActionData
*data
)
983 ObClient
*c
= data
->relative
.any
.c
;
984 client_action_start(data
);
986 c
->area
.width
+ data
->relative
.deltax
* c
->size_inc
.width
,
988 client_action_end(data
, FALSE
);
991 void action_resize_relative_vert(union ActionData
*data
)
993 ObClient
*c
= data
->relative
.any
.c
;
995 client_action_start(data
);
996 client_resize(c
, c
->area
.width
, c
->area
.height
+
997 data
->relative
.deltax
* c
->size_inc
.height
);
998 client_action_end(data
, FALSE
);
1002 void action_move_relative(union ActionData
*data
)
1004 ObClient
*c
= data
->relative
.any
.c
;
1005 client_action_start(data
);
1006 client_move(c
, c
->area
.x
+ data
->relative
.deltax
, c
->area
.y
+
1007 data
->relative
.deltay
);
1008 client_action_end(data
, FALSE
);
1011 void action_resize_relative(union ActionData
*data
)
1013 ObClient
*c
= data
->relative
.any
.c
;
1014 gint x
, y
, ow
, xoff
, nw
, oh
, yoff
, nh
, lw
, lh
;
1016 client_action_start(data
);
1021 xoff
= -data
->relative
.deltaxl
* c
->size_inc
.width
;
1022 nw
= ow
+ data
->relative
.deltax
* c
->size_inc
.width
1023 + data
->relative
.deltaxl
* c
->size_inc
.width
;
1024 oh
= c
->area
.height
;
1025 yoff
= -data
->relative
.deltayu
* c
->size_inc
.height
;
1026 nh
= oh
+ data
->relative
.deltay
* c
->size_inc
.height
1027 + data
->relative
.deltayu
* c
->size_inc
.height
;
1029 g_print("deltax %d %d x %d ow %d xoff %d nw %d\n",
1030 data
->relative
.deltax
,
1031 data
->relative
.deltaxl
,
1034 client_try_configure(c
, &x
, &y
, &nw
, &nh
, &lw
, &lh
, TRUE
);
1035 xoff
= xoff
== 0 ? 0 : (xoff
< 0 ? MAX(xoff
, ow
-nw
) : MIN(xoff
, ow
-nw
));
1036 yoff
= yoff
== 0 ? 0 : (yoff
< 0 ? MAX(yoff
, oh
-nh
) : MIN(yoff
, oh
-nh
));
1037 client_move_resize(c
, x
+ xoff
, y
+ yoff
, nw
, nh
);
1038 client_action_end(data
, FALSE
);
1041 void action_send_to_desktop(union ActionData
*data
)
1043 ObClient
*c
= data
->sendto
.any
.c
;
1045 if (!client_normal(c
)) return;
1047 if (data
->sendto
.desk
< screen_num_desktops
||
1048 data
->sendto
.desk
== DESKTOP_ALL
) {
1049 client_set_desktop(c
, data
->sendto
.desk
, data
->sendto
.follow
, FALSE
);
1050 if (data
->sendto
.follow
&& data
->sendto
.desk
!= screen_desktop
)
1051 screen_set_desktop(data
->sendto
.desk
, TRUE
);
1055 void action_desktop(union ActionData
*data
)
1057 /* XXX add the interactive/dialog option back again once the dialog
1058 has been made to not use grabs */
1059 if (data
->desktop
.desk
< screen_num_desktops
||
1060 data
->desktop
.desk
== DESKTOP_ALL
)
1062 screen_set_desktop(data
->desktop
.desk
, TRUE
);
1063 if (data
->inter
.any
.interactive
)
1064 screen_desktop_popup(data
->desktop
.desk
, TRUE
);
1068 void action_desktop_dir(union ActionData
*data
)
1072 d
= screen_cycle_desktop(data
->desktopdir
.dir
,
1073 data
->desktopdir
.wrap
,
1074 data
->desktopdir
.linear
,
1075 data
->desktopdir
.inter
.any
.interactive
,
1076 data
->desktopdir
.inter
.final
,
1077 data
->desktopdir
.inter
.cancel
);
1078 /* only move the desktop when the action is complete. if we switch
1079 desktops during the interactive action, focus will move but with
1080 NotifyWhileGrabbed and applications don't like that. */
1081 if (!data
->sendtodir
.inter
.any
.interactive
||
1082 (data
->sendtodir
.inter
.final
&& !data
->sendtodir
.inter
.cancel
))
1084 if (d
!= screen_desktop
)
1085 screen_set_desktop(d
, TRUE
);
1089 void action_send_to_desktop_dir(union ActionData
*data
)
1091 ObClient
*c
= data
->sendtodir
.inter
.any
.c
;
1094 if (!client_normal(c
)) return;
1096 d
= screen_cycle_desktop(data
->sendtodir
.dir
, data
->sendtodir
.wrap
,
1097 data
->sendtodir
.linear
,
1098 data
->sendtodir
.inter
.any
.interactive
,
1099 data
->sendtodir
.inter
.final
,
1100 data
->sendtodir
.inter
.cancel
);
1101 /* only move the desktop when the action is complete. if we switch
1102 desktops during the interactive action, focus will move but with
1103 NotifyWhileGrabbed and applications don't like that. */
1104 if (!data
->sendtodir
.inter
.any
.interactive
||
1105 (data
->sendtodir
.inter
.final
&& !data
->sendtodir
.inter
.cancel
))
1107 client_set_desktop(c
, d
, data
->sendtodir
.follow
, FALSE
);
1108 if (data
->sendtodir
.follow
&& d
!= screen_desktop
)
1109 screen_set_desktop(d
, TRUE
);
1113 void action_desktop_last(union ActionData
*data
)
1115 if (screen_last_desktop
< screen_num_desktops
)
1116 screen_set_desktop(screen_last_desktop
, TRUE
);
1119 void action_toggle_decorations(union ActionData
*data
)
1121 ObClient
*c
= data
->client
.any
.c
;
1123 client_action_start(data
);
1124 client_set_undecorated(c
, !c
->undecorated
);
1125 client_action_end(data
, FALSE
);
1128 static guint32
pick_corner(gint x
, gint y
, gint cx
, gint cy
, gint cw
, gint ch
,
1131 /* let's make x and y client relative instead of screen relative */
1133 y
= ch
- (y
- cy
); /* y is inverted, 0 is at the bottom of the window */
1136 #define A -4*X + 7*ch/3
1137 #define B 4*X -15*ch/9
1138 #define C -X/4 + 2*ch/3
1139 #define D X/4 + 5*ch/12
1140 #define E X/4 + ch/3
1141 #define F -X/4 + 7*ch/12
1142 #define G 4*X - 4*ch/3
1143 #define H -4*X + 8*ch/3
1144 #define a (y > 5*ch/9)
1145 #define b (x < 4*cw/9)
1146 #define c (x > 5*cw/9)
1147 #define d (y < 4*ch/9)
1150 Each of these defines (except X which is just there for fun), represents
1151 the equation of a line. The lines they represent are shown in the diagram
1152 below. Checking y against these lines, we are able to choose a region
1153 of the window as shown.
1155 +---------------------A-------|-------|-------B---------------------+
1162 | northwest | A north B | northeast |
1165 C---------------------+----A--+-------+--B----+---------------------D
1166 |CCCCCCC | A B | DDDDDDD|
1167 | CCCCCCCC | A | | B | DDDDDDDD |
1168 | CCCCCCC A B DDDDDDD |
1169 - - - - - - - - - - - +CCCCCCC+aaaaaaa+DDDDDDD+ - - - - - - - - - - - -
1171 | west | b move c | east | ad
1173 - - - - - - - - - - - +EEEEEEE+ddddddd+FFFFFFF+- - - - - - - - - - - -
1174 | EEEEEEE G H FFFFFFF |
1175 | EEEEEEEE | G | | H | FFFFFFFF |
1176 |EEEEEEE | G H | FFFFFFF|
1177 E---------------------+----G--+-------+--H----+---------------------F
1180 | southwest | G south H | southeast |
1187 +---------------------G-------|-------|-------H---------------------+
1191 /* for shaded windows, you can only resize west/east and move */
1193 return prop_atoms
.net_wm_moveresize_size_left
;
1195 return prop_atoms
.net_wm_moveresize_size_right
;
1196 return prop_atoms
.net_wm_moveresize_move
;
1199 if (y
< A
&& y
>= C
)
1200 return prop_atoms
.net_wm_moveresize_size_topleft
;
1201 else if (y
>= A
&& y
>= B
&& a
)
1202 return prop_atoms
.net_wm_moveresize_size_top
;
1203 else if (y
< B
&& y
>= D
)
1204 return prop_atoms
.net_wm_moveresize_size_topright
;
1205 else if (y
< C
&& y
>= E
&& b
)
1206 return prop_atoms
.net_wm_moveresize_size_left
;
1207 else if (y
< D
&& y
>= F
&& c
)
1208 return prop_atoms
.net_wm_moveresize_size_right
;
1209 else if (y
< E
&& y
>= G
)
1210 return prop_atoms
.net_wm_moveresize_size_bottomleft
;
1211 else if (y
< G
&& y
< H
&& d
)
1212 return prop_atoms
.net_wm_moveresize_size_bottom
;
1213 else if (y
>= H
&& y
< F
)
1214 return prop_atoms
.net_wm_moveresize_size_bottomright
;
1216 return prop_atoms
.net_wm_moveresize_move
;
1233 void action_resize(union ActionData
*data
)
1235 ObClient
*c
= data
->moveresize
.any
.c
;
1238 if (data
->moveresize
.keyboard
)
1239 corner
= prop_atoms
.net_wm_moveresize_size_keyboard
;
1240 else if (data
->moveresize
.corner
)
1241 corner
= data
->moveresize
.corner
; /* it was specified in the binding */
1243 corner
= pick_corner(data
->any
.x
, data
->any
.y
,
1244 c
->frame
->area
.x
, c
->frame
->area
.y
,
1245 /* use the client size because the frame
1246 can be differently sized (shaded
1247 windows) and we want this based on the
1249 c
->area
.width
+ c
->frame
->size
.left
+
1250 c
->frame
->size
.right
,
1251 c
->area
.height
+ c
->frame
->size
.top
+
1252 c
->frame
->size
.bottom
, c
->shaded
);
1254 moveresize_start(c
, data
->any
.x
, data
->any
.y
, data
->any
.button
, corner
);
1257 void action_directional_focus(union ActionData
*data
)
1259 /* if using focus_delay, stop the timer now so that focus doesn't go moving
1261 event_halt_focus_delay();
1263 focus_directional_cycle(data
->interdiraction
.direction
,
1264 data
->interdiraction
.dock_windows
,
1265 data
->interdiraction
.desktop_windows
,
1266 data
->any
.interactive
,
1267 data
->interdiraction
.dialog
,
1268 data
->interdiraction
.inter
.final
,
1269 data
->interdiraction
.inter
.cancel
);
1272 void action_movetoedge(union ActionData
*data
)
1275 ObClient
*c
= data
->diraction
.any
.c
;
1277 x
= c
->frame
->area
.x
;
1278 y
= c
->frame
->area
.y
;
1280 switch(data
->diraction
.direction
) {
1281 case OB_DIRECTION_NORTH
:
1282 y
= client_directional_edge_search(c
, OB_DIRECTION_NORTH
,
1283 data
->diraction
.hang
)
1284 - (data
->diraction
.hang
? c
->frame
->area
.height
: 0);
1286 case OB_DIRECTION_WEST
:
1287 x
= client_directional_edge_search(c
, OB_DIRECTION_WEST
,
1288 data
->diraction
.hang
)
1289 - (data
->diraction
.hang
? c
->frame
->area
.width
: 0);
1291 case OB_DIRECTION_SOUTH
:
1292 y
= client_directional_edge_search(c
, OB_DIRECTION_SOUTH
,
1293 data
->diraction
.hang
)
1294 - (data
->diraction
.hang
? 0 : c
->frame
->area
.height
);
1296 case OB_DIRECTION_EAST
:
1297 x
= client_directional_edge_search(c
, OB_DIRECTION_EAST
,
1298 data
->diraction
.hang
)
1299 - (data
->diraction
.hang
? 0 : c
->frame
->area
.width
);
1302 g_assert_not_reached();
1304 frame_frame_gravity(c
->frame
, &x
, &y
, c
->area
.width
, c
->area
.height
);
1305 client_action_start(data
);
1306 client_move(c
, x
, y
);
1307 client_action_end(data
, FALSE
);
1310 void action_growtoedge(union ActionData
*data
)
1312 gint x
, y
, width
, height
, dest
;
1313 ObClient
*c
= data
->diraction
.any
.c
;
1316 a
= screen_area(c
->desktop
, SCREEN_AREA_ALL_MONITORS
, &c
->frame
->area
);
1317 x
= c
->frame
->area
.x
;
1318 y
= c
->frame
->area
.y
;
1319 /* get the unshaded frame's dimensions..if it is shaded */
1320 width
= c
->area
.width
+ c
->frame
->size
.left
+ c
->frame
->size
.right
;
1321 height
= c
->area
.height
+ c
->frame
->size
.top
+ c
->frame
->size
.bottom
;
1323 switch(data
->diraction
.direction
) {
1324 case OB_DIRECTION_NORTH
:
1325 if (c
->shaded
) break; /* don't allow vertical resize if shaded */
1327 dest
= client_directional_edge_search(c
, OB_DIRECTION_NORTH
, FALSE
);
1329 height
= height
/ 2;
1331 height
= c
->frame
->area
.y
+ height
- dest
;
1335 case OB_DIRECTION_WEST
:
1336 dest
= client_directional_edge_search(c
, OB_DIRECTION_WEST
, FALSE
);
1340 width
= c
->frame
->area
.x
+ width
- dest
;
1344 case OB_DIRECTION_SOUTH
:
1345 if (c
->shaded
) break; /* don't allow vertical resize if shaded */
1347 dest
= client_directional_edge_search(c
, OB_DIRECTION_SOUTH
, FALSE
);
1348 if (a
->y
+ a
->height
== y
+ c
->frame
->area
.height
) {
1349 height
= c
->frame
->area
.height
/ 2;
1350 y
= a
->y
+ a
->height
- height
;
1352 height
= dest
- c
->frame
->area
.y
;
1353 y
+= (height
- c
->frame
->area
.height
) % c
->size_inc
.height
;
1354 height
-= (height
- c
->frame
->area
.height
) % c
->size_inc
.height
;
1356 case OB_DIRECTION_EAST
:
1357 dest
= client_directional_edge_search(c
, OB_DIRECTION_EAST
, FALSE
);
1358 if (a
->x
+ a
->width
== x
+ c
->frame
->area
.width
) {
1359 width
= c
->frame
->area
.width
/ 2;
1360 x
= a
->x
+ a
->width
- width
;
1362 width
= dest
- c
->frame
->area
.x
;
1363 x
+= (width
- c
->frame
->area
.width
) % c
->size_inc
.width
;
1364 width
-= (width
- c
->frame
->area
.width
) % c
->size_inc
.width
;
1367 g_assert_not_reached();
1369 width
-= c
->frame
->size
.left
+ c
->frame
->size
.right
;
1370 height
-= c
->frame
->size
.top
+ c
->frame
->size
.bottom
;
1371 frame_frame_gravity(c
->frame
, &x
, &y
, width
, height
);
1372 client_action_start(data
);
1373 client_move_resize(c
, x
, y
, width
, height
);
1374 client_action_end(data
, FALSE
);
1378 void action_send_to_layer(union ActionData
*data
)
1380 client_set_layer(data
->layer
.any
.c
, data
->layer
.layer
);
1383 void action_toggle_layer(union ActionData
*data
)
1385 ObClient
*c
= data
->layer
.any
.c
;
1387 client_action_start(data
);
1388 if (data
->layer
.layer
< 0)
1389 client_set_layer(c
, c
->below
? 0 : -1);
1390 else if (data
->layer
.layer
> 0)
1391 client_set_layer(c
, c
->above
? 0 : 1);
1392 client_action_end(data
, config_focus_under_mouse
);
1395 void action_toggle_dockautohide(union ActionData
*data
)
1397 config_dock_hide
= !config_dock_hide
;
1401 void action_add_desktop(union ActionData
*data
)
1403 client_action_start(data
);
1404 screen_set_num_desktops(screen_num_desktops
+1);
1406 /* move all the clients over */
1407 if (data
->addremovedesktop
.current
) {
1410 for (it
= client_list
; it
; it
= g_list_next(it
)) {
1411 ObClient
*c
= it
->data
;
1412 if (c
->desktop
!= DESKTOP_ALL
&& c
->desktop
>= screen_desktop
)
1413 client_set_desktop(c
, c
->desktop
+1, FALSE
, TRUE
);
1417 client_action_end(data
, config_focus_under_mouse
);
1420 void action_remove_desktop(union ActionData
*data
)
1422 guint rmdesktop
, movedesktop
;
1423 GList
*it
, *stacking_copy
;
1425 if (screen_num_desktops
< 2) return;
1427 client_action_start(data
);
1429 /* what desktop are we removing and moving to? */
1430 if (data
->addremovedesktop
.current
)
1431 rmdesktop
= screen_desktop
;
1433 rmdesktop
= screen_num_desktops
- 1;
1434 if (rmdesktop
< screen_num_desktops
- 1)
1435 movedesktop
= rmdesktop
+ 1;
1437 movedesktop
= rmdesktop
;
1439 /* make a copy of the list cuz we're changing it */
1440 stacking_copy
= g_list_copy(stacking_list
);
1441 for (it
= g_list_last(stacking_copy
); it
; it
= g_list_previous(it
)) {
1442 if (WINDOW_IS_CLIENT(it
->data
)) {
1443 ObClient
*c
= it
->data
;
1444 guint d
= c
->desktop
;
1445 if (d
!= DESKTOP_ALL
&& d
>= movedesktop
) {
1446 client_set_desktop(c
, c
->desktop
- 1, TRUE
, TRUE
);
1447 ob_debug("moving window %s\n", c
->title
);
1449 /* raise all the windows that are on the current desktop which
1451 if ((screen_desktop
== rmdesktop
- 1 ||
1452 screen_desktop
== rmdesktop
) &&
1453 (d
== DESKTOP_ALL
|| d
== screen_desktop
))
1455 stacking_raise(CLIENT_AS_WINDOW(c
));
1456 ob_debug("raising window %s\n", c
->title
);
1461 /* act like we're changing desktops */
1462 if (screen_desktop
< screen_num_desktops
- 1) {
1463 gint d
= screen_desktop
;
1464 screen_desktop
= screen_last_desktop
;
1465 screen_set_desktop(d
, TRUE
);
1466 ob_debug("fake desktop change\n");
1469 screen_set_num_desktops(screen_num_desktops
-1);
1471 client_action_end(data
, config_focus_under_mouse
);