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.
This commit is contained in:
Mark McLoughlin 2002-08-04 20:17:37 +00:00 committed by Mark McLoughlin
parent 583596178f
commit 8984fd358b
3 changed files with 31 additions and 10 deletions

View File

@ -1,3 +1,16 @@
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.
2002-08-04 Havoc Pennington <hp@redhat.com> 2002-08-04 Havoc Pennington <hp@redhat.com>
* src/theme.c (free_menu_ops): use MetaMenuIconType not button * src/theme.c (free_menu_ops): use MetaMenuIconType not button

View File

@ -342,6 +342,7 @@ meta_screen_new (MetaDisplay *display,
screen->work_area_idle = 0; screen->work_area_idle = 0;
screen->active_workspace = NULL;
screen->rows_of_workspaces = 1; screen->rows_of_workspaces = 1;
screen->columns_of_workspaces = -1; screen->columns_of_workspaces = -1;
screen->vertical_workspaces = FALSE; screen->vertical_workspaces = FALSE;
@ -476,7 +477,7 @@ meta_screen_new (MetaDisplay *display,
/* Screens must have at least one workspace at all times, /* Screens must have at least one workspace at all times,
* so create that required workspace. * so create that required workspace.
*/ */
screen->active_workspace = meta_workspace_new (screen); meta_workspace_activate (meta_workspace_new (screen));
update_num_workspaces (screen); update_num_workspaces (screen);
screen->all_keys_grabbed = FALSE; screen->all_keys_grabbed = FALSE;
@ -955,28 +956,32 @@ meta_screen_ensure_workspace_popup (MetaScreen *screen)
entries[len].icon = NULL; entries[len].icon = NULL;
meta_screen_calc_workspace_layout (screen, len, &rows, &cols); meta_screen_calc_workspace_layout (screen, len, &rows, &cols);
if (screen->vertical_workspaces) 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) for (j = 0; j < cols; ++j)
{ {
MetaWorkspace *workspace; MetaWorkspace *workspace;
k = i + (j * rows); k = i + (j * rows);
workspace = meta_display_get_workspace_by_index (screen->display, if (k >= len)
k); break;
workspace = meta_display_get_workspace_by_index (screen->display, k);
g_assert (workspace); g_assert (workspace);
entries[i].key = (MetaTabEntryKey) workspace; entries[iter].key = (MetaTabEntryKey) workspace;
entries[i].title = workspace->name; entries[iter].title = workspace->name;
entries[i].icon = NULL; entries[iter].icon = NULL;
iter++;
} }
} }
g_assert (iter == len);
} }
else else
{ {

View File

@ -219,7 +219,10 @@ meta_workspace_activate (MetaWorkspace *workspace)
workspace->screen->active_workspace = workspace; workspace->screen->active_workspace = workspace;
set_active_space_hint (workspace->screen); set_active_space_hint (workspace->screen);
if (old == NULL)
return;
meta_workspace_queue_calc_showing (old); meta_workspace_queue_calc_showing (old);
meta_workspace_queue_calc_showing (workspace); meta_workspace_queue_calc_showing (workspace);