focus a window on desktop switch

This commit is contained in:
Dana Jansens 2003-03-27 23:05:54 +00:00
parent 047fe67215
commit 8cc7c8b430

View file

@ -258,6 +258,7 @@ void screen_set_desktop(guint num)
{
GList *it;
guint old;
XEvent e;
g_assert(num < screen_num_desktops);
@ -267,6 +268,8 @@ void screen_set_desktop(guint num)
if (old == num) return;
g_message("Moving to desktop %d", num+1);
/* show windows before hiding the rest to lessen the enter/leave events */
/* show windows from top to bottom */
@ -283,6 +286,12 @@ void screen_set_desktop(guint num)
engine_frame_hide(c->frame);
}
/* focus the last focused window on the desktop, and ignore enter events
from the switch so it doesnt mess with the focus */
XSync(ob_display, FALSE);
while (XCheckTypedEvent(ob_display, EnterNotify, &e));
focus_fallback(TRUE);
dispatch_ob(Event_Ob_Desktop, num, old);
}