window: Properly handle focusing override redirect windows

If an app pops up an OR window and sets input focus to it, like
Steam does, we'll think the focus window is null, causing us to
think the app is not focused.

OR windows should not be special if they get input focus, where
the input focus would be set to NULL. Instead, the window should
be marked as focused.

https://bugzilla.gnome.org/show_bug.cgi?id=647706
This commit is contained in:
Jasper St. Pierre 2013-05-01 17:37:50 -04:00
parent d03ffd801e
commit df8234c5e3
2 changed files with 7 additions and 6 deletions

View File

@ -1980,11 +1980,7 @@ handle_window_focus_event (MetaDisplay *display,
{ {
display->server_focus_window = event->event; display->server_focus_window = event->event;
display->server_focus_serial = serial; display->server_focus_serial = serial;
focus_window = window;
if (window && window->override_redirect)
focus_window = NULL;
else
focus_window = window;
} }
else if (event->evtype == XI_FocusOut) else if (event->evtype == XI_FocusOut)
{ {

View File

@ -7193,6 +7193,8 @@ meta_window_set_focused_internal (MetaWindow *window,
if (focused) if (focused)
{ {
window->has_focus = TRUE; window->has_focus = TRUE;
if (window->override_redirect)
return;
/* Move to the front of the focusing workspace's MRU list. /* Move to the front of the focusing workspace's MRU list.
* We should only be "removing" it from the MRU list if it's * We should only be "removing" it from the MRU list if it's
@ -7258,8 +7260,11 @@ meta_window_set_focused_internal (MetaWindow *window,
} }
else else
{ {
meta_window_propagate_focus_appearance (window, FALSE);
window->has_focus = FALSE; window->has_focus = FALSE;
if (window->override_redirect)
return;
meta_window_propagate_focus_appearance (window, FALSE);
if (!window->attached_focus_window) if (!window->attached_focus_window)
meta_window_appears_focused_changed (window); meta_window_appears_focused_changed (window);