diff --git a/ChangeLog b/ChangeLog index d6a74bdbe..d59efa4ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2002-08-02 Mark McLoughlin + + * src/screen.c: (meta_screen_new): set active_workspace + to NULL. Also actually activate the first workspace instead + of just setting active_workspace. Fixes #87367. + (meta_screen_ensure_workspace_popup): don't re-use our + iterator for setting the entries list, stop iterating + when we've gone beyond the last workspace (there may + be empty spaces in the last row). + + * src/workspace.c: (meta_workspace_activate): if no workspace + was previously activated, return. + 2002-08-04 Havoc Pennington * src/theme.c (free_menu_ops): use MetaMenuIconType not button diff --git a/src/screen.c b/src/screen.c index e35ca43fd..c2b74970e 100644 --- a/src/screen.c +++ b/src/screen.c @@ -342,6 +342,7 @@ meta_screen_new (MetaDisplay *display, screen->work_area_idle = 0; + screen->active_workspace = NULL; screen->rows_of_workspaces = 1; screen->columns_of_workspaces = -1; screen->vertical_workspaces = FALSE; @@ -476,7 +477,7 @@ meta_screen_new (MetaDisplay *display, /* Screens must have at least one workspace at all times, * so create that required workspace. */ - screen->active_workspace = meta_workspace_new (screen); + meta_workspace_activate (meta_workspace_new (screen)); update_num_workspaces (screen); screen->all_keys_grabbed = FALSE; @@ -955,28 +956,32 @@ meta_screen_ensure_workspace_popup (MetaScreen *screen) entries[len].icon = NULL; meta_screen_calc_workspace_layout (screen, len, &rows, &cols); - + if (screen->vertical_workspaces) { - int j, k; + int j, k, iter; - for (i = 0; i < rows; ++i) + for (i = 0, iter = 0; i < rows; ++i) { for (j = 0; j < cols; ++j) { MetaWorkspace *workspace; k = i + (j * rows); - workspace = meta_display_get_workspace_by_index (screen->display, - k); + if (k >= len) + break; + workspace = meta_display_get_workspace_by_index (screen->display, k); g_assert (workspace); - entries[i].key = (MetaTabEntryKey) workspace; - entries[i].title = workspace->name; - entries[i].icon = NULL; + entries[iter].key = (MetaTabEntryKey) workspace; + entries[iter].title = workspace->name; + entries[iter].icon = NULL; + iter++; } } + + g_assert (iter == len); } else { diff --git a/src/workspace.c b/src/workspace.c index f5ca089e8..1e9e5b6a3 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -219,7 +219,10 @@ meta_workspace_activate (MetaWorkspace *workspace) workspace->screen->active_workspace = workspace; set_active_space_hint (workspace->screen); - + + if (old == NULL) + return; + meta_workspace_queue_calc_showing (old); meta_workspace_queue_calc_showing (workspace);