From 8984fd358b29c2286a0f4763a297205645366dd0 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Sun, 4 Aug 2002 20:17:37 +0000 Subject: [PATCH] set active_workspace to NULL. Also actually activate the first workspace 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. --- ChangeLog | 13 +++++++++++++ src/screen.c | 23 ++++++++++++++--------- src/workspace.c | 5 ++++- 3 files changed, 31 insertions(+), 10 deletions(-) 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);