mirror of
https://github.com/brl/mutter.git
synced 2024-11-28 11:00:54 -05:00
fix it, maybe
2002-05-16 Havoc Pennington <hp@pobox.com> * src/workspace.c (meta_workspace_get_neighbor): fix it, maybe
This commit is contained in:
parent
bb35f88925
commit
82b064ed7d
@ -1,3 +1,7 @@
|
||||
2002-05-16 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* src/workspace.c (meta_workspace_get_neighbor): fix it, maybe
|
||||
|
||||
2002-05-16 Havoc Pennington <hp@redhat.com>
|
||||
|
||||
* src/window.c (constrain_position): lock desktop to position 0,0
|
||||
|
@ -522,8 +522,6 @@ meta_workspace_get_neighbor (MetaWorkspace *workspace,
|
||||
i = meta_workspace_index (workspace);
|
||||
num_workspaces = meta_screen_get_n_workspaces (workspace->screen);
|
||||
|
||||
/* FIXME this code is entirely broken */
|
||||
|
||||
/*
|
||||
* 3 rows, 4 columns, horizontal layout:
|
||||
* +--+--+--+--+
|
||||
@ -568,6 +566,10 @@ meta_workspace_get_neighbor (MetaWorkspace *workspace,
|
||||
rows, cols, workspace->screen->vertical_workspaces,
|
||||
i, num_workspaces, direction);
|
||||
|
||||
|
||||
/* FIXME someone who's better or more patient at math puzzles
|
||||
* should clean this up. ;-)
|
||||
*/
|
||||
if (workspace->screen->vertical_workspaces)
|
||||
{
|
||||
switch (direction)
|
||||
@ -584,7 +586,7 @@ meta_workspace_get_neighbor (MetaWorkspace *workspace,
|
||||
break;
|
||||
case META_MOTION_RIGHT:
|
||||
if ((i + rows) >= num_workspaces)
|
||||
i = i + rows - num_workspaces;
|
||||
i = (i % rows + 1) % rows;
|
||||
else
|
||||
i += rows;
|
||||
break;
|
||||
@ -626,7 +628,7 @@ meta_workspace_get_neighbor (MetaWorkspace *workspace,
|
||||
break;
|
||||
case META_MOTION_DOWN:
|
||||
if ((i + cols) >= num_workspaces)
|
||||
i = i + cols - num_workspaces;
|
||||
i = (i % cols + 1) % cols;
|
||||
else
|
||||
i += cols;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user