Split screen->tab_popup and screen->ws_popup

http://bugzilla.gnome.org/show_bug.cgi?id=580917
This commit is contained in:
Dan Winship 2009-04-27 10:49:03 -04:00
parent cbf4be04fc
commit 7b522c0de8
3 changed files with 18 additions and 17 deletions

View File

@ -2730,7 +2730,7 @@ process_workspace_switch_grab (MetaDisplay *display,
{ {
MetaWorkspace *workspace; MetaWorkspace *workspace;
if (screen != display->grab_screen || !screen->tab_popup) if (screen != display->grab_screen || !screen->ws_popup)
return FALSE; return FALSE;
if (event->type == KeyRelease && if (event->type == KeyRelease &&
@ -2740,7 +2740,7 @@ process_workspace_switch_grab (MetaDisplay *display,
MetaWorkspace *target_workspace; MetaWorkspace *target_workspace;
target_workspace = target_workspace =
(MetaWorkspace *) meta_ui_tab_popup_get_selected (screen->tab_popup); (MetaWorkspace *) meta_ui_tab_popup_get_selected (screen->ws_popup);
meta_topic (META_DEBUG_KEYBINDINGS, meta_topic (META_DEBUG_KEYBINDINGS,
"Ending workspace tab operation, primary modifier released\n"); "Ending workspace tab operation, primary modifier released\n");
@ -2777,7 +2777,7 @@ process_workspace_switch_grab (MetaDisplay *display,
/* select the next workspace in the tabpopup */ /* select the next workspace in the tabpopup */
workspace = workspace =
(MetaWorkspace *) meta_ui_tab_popup_get_selected (screen->tab_popup); (MetaWorkspace *) meta_ui_tab_popup_get_selected (screen->ws_popup);
if (workspace) if (workspace)
{ {
@ -2818,7 +2818,7 @@ process_workspace_switch_grab (MetaDisplay *display,
if (target_workspace) if (target_workspace)
{ {
meta_ui_tab_popup_select (screen->tab_popup, meta_ui_tab_popup_select (screen->ws_popup,
(MetaTabEntryKey) target_workspace); (MetaTabEntryKey) target_workspace);
meta_topic (META_DEBUG_KEYBINDINGS, meta_topic (META_DEBUG_KEYBINDINGS,
"Tab key pressed, moving tab focus in popup\n"); "Tab key pressed, moving tab focus in popup\n");
@ -2836,7 +2836,7 @@ process_workspace_switch_grab (MetaDisplay *display,
meta_topic (META_DEBUG_KEYBINDINGS, meta_topic (META_DEBUG_KEYBINDINGS,
"Ending workspace tabbing & focusing default window; uninteresting key pressed\n"); "Ending workspace tabbing & focusing default window; uninteresting key pressed\n");
workspace = workspace =
(MetaWorkspace *) meta_ui_tab_popup_get_selected (screen->tab_popup); (MetaWorkspace *) meta_ui_tab_popup_get_selected (screen->ws_popup);
meta_workspace_focus_default_window (workspace, NULL, event->xkey.time); meta_workspace_focus_default_window (workspace, NULL, event->xkey.time);
return FALSE; return FALSE;
} }
@ -3460,10 +3460,10 @@ handle_workspace_switch (MetaDisplay *display,
if (grabbed_before_release && !meta_prefs_get_no_tab_popup ()) if (grabbed_before_release && !meta_prefs_get_no_tab_popup ())
{ {
meta_screen_ensure_workspace_popup (screen); meta_screen_ensure_workspace_popup (screen);
meta_ui_tab_popup_select (screen->tab_popup, (MetaTabEntryKey) next); meta_ui_tab_popup_select (screen->ws_popup, (MetaTabEntryKey) next);
/* only after selecting proper space */ /* only after selecting proper space */
meta_ui_tab_popup_set_showing (screen->tab_popup, TRUE); meta_ui_tab_popup_set_showing (screen->ws_popup, TRUE);
} }
} }

View File

@ -80,7 +80,7 @@ struct _MetaScreen
Visual *default_xvisual; Visual *default_xvisual;
MetaRectangle rect; /* Size of screen; rect.x & rect.y are always 0 */ MetaRectangle rect; /* Size of screen; rect.x & rect.y are always 0 */
MetaUI *ui; MetaUI *ui;
MetaTabPopup *tab_popup; MetaTabPopup *tab_popup, *ws_popup;
MetaWorkspace *active_workspace; MetaWorkspace *active_workspace;

View File

@ -712,6 +712,7 @@ meta_screen_new (MetaDisplay *display,
screen->xscreen); screen->xscreen);
screen->tab_popup = NULL; screen->tab_popup = NULL;
screen->ws_popup = NULL;
screen->stack = meta_stack_new (screen); screen->stack = meta_stack_new (screen);
@ -1553,7 +1554,7 @@ meta_screen_ensure_workspace_popup (MetaScreen *screen)
int n_workspaces; int n_workspaces;
int current_workspace; int current_workspace;
if (screen->tab_popup || meta_prefs_get_no_tab_popup ()) if (screen->ws_popup || meta_prefs_get_no_tab_popup ())
return; return;
current_workspace = meta_workspace_index (screen->active_workspace); current_workspace = meta_workspace_index (screen->active_workspace);
@ -1599,11 +1600,11 @@ meta_screen_ensure_workspace_popup (MetaScreen *screen)
++i; ++i;
} }
screen->tab_popup = meta_ui_tab_popup_new (entries, screen->ws_popup = meta_ui_tab_popup_new (entries,
screen->number, screen->number,
len, len,
layout.cols, layout.cols,
FALSE); FALSE);
g_free (entries); g_free (entries);
meta_screen_free_workspace_layout (&layout); meta_screen_free_workspace_layout (&layout);
@ -1614,10 +1615,10 @@ meta_screen_ensure_workspace_popup (MetaScreen *screen)
void void
meta_screen_destroy_workspace_popup (MetaScreen *screen) meta_screen_destroy_workspace_popup (MetaScreen *screen)
{ {
if (screen->tab_popup) if (screen->ws_popup)
{ {
meta_ui_tab_popup_free (screen->tab_popup); meta_ui_tab_popup_free (screen->ws_popup);
screen->tab_popup = NULL; screen->ws_popup = NULL;
} }
} }