[Xfce4-commits] <xfwm4:master> Reverting from desktop view may not focus the top most window (bug #8173)
Olivier Fourdan
noreply at xfce.org
Tue Dec 6 18:14:01 CET 2011
Updating branch refs/heads/master
to c9c2e5e8874e3288b73eb96306bd99965adf17e4 (commit)
from c9e725c4752ea2ad9c36e2ef7f5363015f267cfd (commit)
commit c9c2e5e8874e3288b73eb96306bd99965adf17e4
Author: Olivier Fourdan <fourdan at xfce.org>
Date: Tue Dec 6 17:57:41 2011 +0100
Reverting from desktop view may not focus the top most window (bug #8173)
src/client.c | 18 +++++++++++++++---
src/focus.c | 4 +++-
src/workspaces.c | 2 +-
3 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/src/client.c b/src/client.c
index 3804770..ff0deb8 100644
--- a/src/client.c
+++ b/src/client.c
@@ -2031,7 +2031,7 @@ clientFrameAll (ScreenInfo *screen_info)
{
XFree (wins);
}
- clientFocusTop (screen_info, WIN_LAYER_NORMAL, myDisplayGetCurrentTime (display_info));
+ clientFocusTop (screen_info, WIN_LAYER_FULLSCREEN, myDisplayGetCurrentTime (display_info));
xfwmWindowDelete (&shield);
myDisplayUngrabServer (display_info);
XSync (display_info->dpy, FALSE);
@@ -2437,7 +2437,7 @@ clientToggleShowDesktop (ScreenInfo *screen_info)
}
FLAG_UNSET (c->xfwm_flags, XFWM_FLAG_WAS_SHOWN);
}
- clientFocusTop (screen_info, WIN_LAYER_NORMAL, myDisplayGetCurrentTime (screen_info->display_info));
+ clientFocusTop (screen_info, WIN_LAYER_FULLSCREEN, myDisplayGetCurrentTime (screen_info->display_info));
}
}
@@ -2614,11 +2614,23 @@ clientSetLayer (Client * c, guint l)
}
}
g_list_free (list_of_windows);
+
if (clientGetLastRaise (c->screen_info) == c)
{
clientClearLastRaise (c->screen_info);
}
- clientRaise (c, None);
+
+ c2 = clientGetFocusOrPending ();
+ if (c2 && (c2 != c) && (c2->win_layer == c->win_layer))
+ {
+ TRACE ("Placing %s under %s", c->name, c2->name);
+ clientLower (c, c2->frame);
+ }
+ else
+ {
+ TRACE ("Placing %s on top of its layer %i", c->name, c->win_layer);
+ clientRaise (c, None);
+ }
}
void
diff --git a/src/focus.c b/src/focus.c
index 5b02c59..74f7e73 100644
--- a/src/focus.c
+++ b/src/focus.c
@@ -488,16 +488,17 @@ clientUpdateFocus (ScreenInfo *screen_info, Client * c, unsigned short flags)
TRACE ("entering clientUpdateFocus");
c2 = ((client_focus != c) ? client_focus : NULL);
- pending_focus = NULL;
if ((c) && !clientAcceptFocus (c))
{
TRACE ("SKIP_FOCUS set for client \"%s\" (0x%lx)", c->name, c->window);
+ pending_focus = NULL;
return;
}
if ((c) && (c == client_focus) && !(flags & FOCUS_FORCE))
{
TRACE ("client \"%s\" (0x%lx) is already focused, ignoring request", c->name, c->window);
+ pending_focus = NULL;
return;
}
@@ -537,6 +538,7 @@ clientUpdateFocus (ScreenInfo *screen_info, Client * c, unsigned short flags)
}
clientSetNetActiveWindow (screen_info, c, 0);
clientClearDelayedFocus ();
+ pending_focus = NULL;
}
void
diff --git a/src/workspaces.c b/src/workspaces.c
index 2ed704a..fb19ab0 100644
--- a/src/workspaces.c
+++ b/src/workspaces.c
@@ -395,7 +395,7 @@ workspaceSwitch (ScreenInfo *screen_info, gint new_ws, Client * c2, gboolean upd
}
else
{
- clientFocusTop (screen_info, WIN_LAYER_NORMAL, timestamp);
+ clientFocusTop (screen_info, WIN_LAYER_FULLSCREEN, timestamp);
}
}
}
More information about the Xfce4-commits
mailing list