return FALSE;
}
-void client_show(ObClient *self)
+gboolean client_show(ObClient *self)
{
+ gboolean show = FALSE;
if (client_should_show(self)) {
frame_show(self->frame);
+ show = TRUE;
}
/* According to the ICCCM (sec 4.1.3.1) when a window is not visible, it
desktop!
*/
client_change_wm_state(self);
+ return show;
}
-void client_hide(ObClient *self)
+gboolean client_hide(ObClient *self)
{
- if (!client_should_show(self))
+ gboolean hide = FALSE;
+
+ if (!client_should_show(self)) {
frame_hide(self->frame);
+ hide = TRUE;
+ }
/* According to the ICCCM (sec 4.1.3.1) when a window is not visible, it
needs to be in IconicState. This includes when it is on another
desktop!
*/
client_change_wm_state(self);
+ return hide;
}
void client_showhide(ObClient *self)
{
-
- if (client_should_show(self))
- frame_show(self->frame);
- else
- frame_hide(self->frame);
+ if (!client_show(self))
+ client_hide(self);
/* According to the ICCCM (sec 4.1.3.1) when a window is not visible, it
needs to be in IconicState. This includes when it is on another
"Focusing client \"%s\" at time %u\n",
self->title, event_curtime);
- /* if there is a grab going on, then we need to cancel it. if we move
- focus during the grab, applications will get NotifyWhileGrabbed events
- and ignore them !
+ /* if we move focus during a grab, applications will get
+ NotifyWhileGrabbed events and ignore them !
- actions should not rely on being able to move focus during an
- interactive grab.
+ interactive actions should not do anything that can move focus until
+ their finishing.
*/
- if (keyboard_interactively_grabbed())
- keyboard_interactive_cancel();
+ g_assert(keyboard_interactively_grabbed());
error = FALSE;
xerror_set_ignore(TRUE);
*/
void client_set_desktop(ObClient *self, guint target, gboolean donthide);
-/*! Show the client if it should be shown. */
-void client_show(ObClient *self);
+/*! Show the client if it should be shown. Returns if the window is shown. */
+gboolean client_show(ObClient *self);
-/*! Show the client if it should be shown. */
-void client_hide(ObClient *self);
+/*! Show the client if it should be shown. Returns if the window is hidden. */
+gboolean client_hide(ObClient *self);
/*! Show the client if it should be shown, and hide it if it should be
hidden. This is for example, when switching desktops.