window: Clean up the set_focused_internal function

Move things out of an indentation layer, and reshuffle
things around.

https://bugzilla.gnome.org/show_bug.cgi?id=647706
This commit is contained in:
Jasper St. Pierre 2012-12-16 22:24:15 -05:00
parent 696d9d2fa9
commit e430e051b7

View File

@ -7214,8 +7214,9 @@ meta_window_set_focused_internal (MetaWindow *window,
{
if (focused)
{
if (window != window->display->focus_window)
{
if (window == window->display->focus_window)
return;
meta_topic (META_DEBUG_FOCUS,
"* Focus --> %s\n", window->desc);
window->display->focus_window = window;
@ -7284,20 +7285,12 @@ meta_window_set_focused_internal (MetaWindow *window,
meta_window_propagate_focus_appearance (window, TRUE);
}
}
else
{
if (window == window->display->focus_window)
{
meta_topic (META_DEBUG_FOCUS,
"%s is now the previous focus window due to being focused out or unmapped\n",
window->desc);
meta_topic (META_DEBUG_FOCUS,
"* Focus --> NULL (was %s)\n", window->desc);
if (window != window->display->focus_window)
return;
meta_window_propagate_focus_appearance (window, FALSE);
window->display->focus_window = NULL;
g_object_notify (G_OBJECT (window->display), "focus-window");
window->has_focus = FALSE;
@ -7318,7 +7311,6 @@ meta_window_set_focused_internal (MetaWindow *window,
!meta_prefs_get_raise_on_click ())
meta_display_grab_focus_window_button (window->display, window);
}
}
}
void