summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMark McLoughlin <mark@skynet.ie>2002-08-14 00:08:30 +0000
committerMark McLoughlin <mmclouglin@src.gnome.org>2002-08-14 00:08:30 +0000
commit689bcd14aaf67deaa4917aa0edb68b67be86b67f (patch)
tree9942135e98fef39ad7087280da8196d4aba4e60f /src
parent42440b17e8e1f25cacca31eedaa2562750c4cb56 (diff)
downloadmetacity-689bcd14aaf67deaa4917aa0edb68b67be86b67f.tar.gz
metacity-689bcd14aaf67deaa4917aa0edb68b67be86b67f.tar.bz2
move from workspace.c. (update_num_workspaces): set the hint here. Fixes
2002-08-14 Mark McLoughlin <mark@skynet.ie> * src/screen.c: (set_number_of_spaces_hint), move from workspace.c. (update_num_workspaces): set the hint here. Fixes #90123. * src/workspace.c: (meta_workspace_new), (meta_workspace_free): don't set the hint here. (update_num_workspaces): move to screen.c
Diffstat (limited to 'src')
-rw-r--r--src/screen.c27
-rw-r--r--src/workspace.c26
2 files changed, 23 insertions, 30 deletions
diff --git a/src/screen.c b/src/screen.c
index 9319f7f..90f728b 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -744,6 +744,27 @@ meta_screen_get_n_workspaces (MetaScreen *screen)
return i;
}
+static int
+set_number_of_spaces_hint (MetaScreen *screen,
+ int n_spaces)
+{
+ unsigned long data[1];
+
+ if (screen->closing > 0)
+ return 0;
+
+ data[0] = n_spaces;
+
+ meta_verbose ("Setting _NET_NUMBER_OF_DESKTOPS to %ld\n", data[0]);
+
+ meta_error_trap_push (screen->display);
+ XChangeProperty (screen->display->xdisplay, screen->xroot,
+ screen->display->atom_net_number_of_desktops,
+ XA_CARDINAL,
+ 32, PropModeReplace, (guchar*) data, 1);
+ return meta_error_trap_pop (screen->display);
+}
+
static void
update_num_workspaces (MetaScreen *screen)
{
@@ -818,16 +839,14 @@ update_num_workspaces (MetaScreen *screen)
g_list_free (extras);
- /* Add missing workspaces. FIXME This will keep setting the
- * number-of-workspaces root window property on each workspace
- * creation, kind of a lame thing
- */
while (i < new_num)
{
meta_workspace_new (screen);
++i;
}
+ set_number_of_spaces_hint (screen, new_num);
+
meta_screen_queue_workarea_recalc (screen);
}
diff --git a/src/workspace.c b/src/workspace.c
index 1e9e5b6..dedde22 100644
--- a/src/workspace.c
+++ b/src/workspace.c
@@ -27,7 +27,6 @@
void meta_workspace_queue_calc_showing (MetaWorkspace *workspace);
-static int set_number_of_spaces_hint (MetaScreen *screen);
static int set_active_space_hint (MetaScreen *screen);
MetaWorkspace*
@@ -51,9 +50,6 @@ meta_workspace_new (MetaScreen *screen)
workspace->name = g_strdup_printf (_("Workspace %d"),
meta_workspace_index (workspace) + 1);
- /* Update hint for current number of workspaces */
- set_number_of_spaces_hint (screen);
-
return workspace;
}
@@ -94,8 +90,6 @@ meta_workspace_free (MetaWorkspace *workspace)
g_free (workspace);
- /* Update hint for current number of workspaces */
- set_number_of_spaces_hint (screen);
/* don't bother to reset names, pagers can just ignore
* extra ones
*/
@@ -309,26 +303,6 @@ meta_workspace_list_windows (MetaWorkspace *workspace)
}
static int
-set_number_of_spaces_hint (MetaScreen *screen)
-{
- unsigned long data[1];
-
- if (screen->closing > 0)
- return 0;
-
- data[0] = meta_screen_get_n_workspaces (screen);
-
- meta_verbose ("Setting _NET_NUMBER_OF_DESKTOPS to %ld\n", data[0]);
-
- meta_error_trap_push (screen->display);
- XChangeProperty (screen->display->xdisplay, screen->xroot,
- screen->display->atom_net_number_of_desktops,
- XA_CARDINAL,
- 32, PropModeReplace, (guchar*) data, 1);
- return meta_error_trap_pop (screen->display);
-}
-
-static int
set_active_space_hint (MetaScreen *screen)
{
unsigned long data[1];