meta_screen_append_new_workspace()

This commit is contained in:
Tomas Frydrych 2008-10-24 11:11:28 +01:00
parent d1635d13cb
commit b5ac24e9c1
2 changed files with 26 additions and 0 deletions

View File

@ -1125,6 +1125,28 @@ meta_screen_remove_workspace (MetaScreen *screen, MetaWorkspace *workspace,
meta_screen_queue_workarea_recalc (screen); meta_screen_queue_workarea_recalc (screen);
} }
MetaWorkspace *
meta_screen_append_new_workspace (MetaScreen *screen, gboolean activate,
guint32 timestamp)
{
MetaWorkspace *w;
/* This also adds the workspace to the screen list */
w = meta_workspace_new (screen);
if (!w)
return NULL;
if (activate)
meta_workspace_activate (w, timestamp);
set_number_of_spaces_hint (screen, g_list_length (screen->workspaces));
meta_screen_queue_workarea_recalc (screen);
return w;
}
static void static void
update_num_workspaces (MetaScreen *screen, update_num_workspaces (MetaScreen *screen,

View File

@ -53,4 +53,8 @@ void meta_screen_remove_workspace (MetaScreen *screen,
MetaWorkspace *workspace, MetaWorkspace *workspace,
guint32 timestamp); guint32 timestamp);
MetaWorkspace *meta_screen_append_new_workspace (MetaScreen *screen,
gboolean activate,
guint32 timestamp);
#endif #endif