mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
screen: Simplify meta_screen_get_workspace_by_index
This commit is contained in:
parent
7adfaceccf
commit
320f38de47
@ -1055,27 +1055,7 @@ MetaWorkspace*
|
||||
meta_screen_get_workspace_by_index (MetaScreen *screen,
|
||||
int idx)
|
||||
{
|
||||
GList *tmp;
|
||||
int i;
|
||||
|
||||
/* should be robust, idx is maybe from an app */
|
||||
if (idx < 0)
|
||||
return NULL;
|
||||
|
||||
i = 0;
|
||||
tmp = screen->workspaces;
|
||||
while (tmp != NULL)
|
||||
{
|
||||
MetaWorkspace *w = tmp->data;
|
||||
|
||||
if (i == idx)
|
||||
return w;
|
||||
|
||||
++i;
|
||||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return g_list_nth_data (screen->workspaces, idx);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user