summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMark McLoughlin <mark@skynet.ie>2002-08-04 20:17:37 +0000
committerMark McLoughlin <mmclouglin@src.gnome.org>2002-08-04 20:17:37 +0000
commit8984fd358b29c2286a0f4763a297205645366dd0 (patch)
tree8a78dc056f679d6e5afc18e5d347a6d46ad9bbb0 /src
parent583596178ff110e80bfd41a7ed1c2fb5a062ad9f (diff)
downloadmetacity-8984fd358b29c2286a0f4763a297205645366dd0.tar.gz
metacity-8984fd358b29c2286a0f4763a297205645366dd0.tar.bz2
set active_workspace to NULL. Also actually activate the first workspace
2002-08-02 Mark McLoughlin <mark@skynet.ie> * 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.
Diffstat (limited to 'src')
-rw-r--r--src/screen.c23
-rw-r--r--src/workspace.c5
2 files changed, 18 insertions, 10 deletions
diff --git a/src/screen.c b/src/screen.c
index e35ca43..c2b7497 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 f5ca089..1e9e5b6 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);