Reorganize tab popup code a bit more cleanly.

Rather than trying to reverse-engineer what kind of tab/workspace
popup to create from within meta_display_begin_grab_op(), just create
the popup directly from do_choose_window()/handle_workspace_switch()
after completing the grab, since they already know which kind they
want.

Also add meta_screen_destroy_tab_popup()/_destroy_workspace_popup()
rather than having meta_display_end_grab_op() poke into MetaScreen's
internals itself.

http://bugzilla.gnome.org/show_bug.cgi?id=580917
This commit is contained in:
Dan Winship
2009-04-27 10:01:30 -04:00
parent f55509aadd
commit cbf4be04fc
4 changed files with 32 additions and 48 deletions

View File

@@ -3512,48 +3512,6 @@ meta_display_begin_grab_op (MetaDisplay *display,
meta_stack_get_positions (screen->stack);
}
/* Do this last, after everything is set up. */
switch (op)
{
case META_GRAB_OP_KEYBOARD_TABBING_NORMAL:
meta_screen_ensure_tab_popup (screen,
META_TAB_LIST_NORMAL,
META_TAB_SHOW_ICON);
break;
case META_GRAB_OP_KEYBOARD_ESCAPING_NORMAL:
meta_screen_ensure_tab_popup (screen,
META_TAB_LIST_NORMAL,
META_TAB_SHOW_INSTANTLY);
break;
case META_GRAB_OP_KEYBOARD_TABBING_DOCK:
meta_screen_ensure_tab_popup (screen,
META_TAB_LIST_DOCKS,
META_TAB_SHOW_ICON);
break;
case META_GRAB_OP_KEYBOARD_ESCAPING_DOCK:
meta_screen_ensure_tab_popup (screen,
META_TAB_LIST_DOCKS,
META_TAB_SHOW_INSTANTLY);
break;
case META_GRAB_OP_KEYBOARD_TABBING_GROUP:
meta_screen_ensure_tab_popup (screen,
META_TAB_LIST_GROUP,
META_TAB_SHOW_ICON);
break;
case META_GRAB_OP_KEYBOARD_ESCAPING_GROUP:
meta_screen_ensure_tab_popup (screen,
META_TAB_LIST_GROUP,
META_TAB_SHOW_INSTANTLY);
case META_GRAB_OP_KEYBOARD_WORKSPACE_SWITCHING:
meta_screen_ensure_workspace_popup (screen);
break;
default:
break;
}
if (display->grab_window)
{
meta_window_refresh_resize_popup (display->grab_window);
@@ -3593,11 +3551,10 @@ meta_display_end_grab_op (MetaDisplay *display,
if (GRAB_OP_IS_WINDOW_SWITCH (display->grab_op) ||
display->grab_op == META_GRAB_OP_KEYBOARD_WORKSPACE_SWITCHING)
{
if (display->grab_screen->tab_popup)
{
meta_ui_tab_popup_free (display->grab_screen->tab_popup);
display->grab_screen->tab_popup = NULL;
}
if (GRAB_OP_IS_WINDOW_SWITCH (display->grab_op))
meta_screen_destroy_tab_popup (display->grab_screen);
else
meta_screen_destroy_workspace_popup (display->grab_screen);
/* If the ungrab here causes an EnterNotify, ignore it for
* sloppy focus