Also fixes the off-by-one in toytoolkit that exposed the issue.
break;
case 3: /* move to workspace below */
display = window->display;
- if (display->workspace < display->workspace_count)
+ if (display->workspace < display->workspace_count - 1)
workspace_manager_move_surface(display->workspace_manager,
window->surface,
display->workspace + 1);
get_workspace(struct desktop_shell *shell, unsigned int index)
{
struct workspace **pws = shell->workspaces.array.data;
+ assert(index < shell->workspaces.num);
pws += index;
return *pws;
}
if (workspace == shell->workspaces.current)
return;
+ if (workspace >= shell->workspaces.num)
+ workspace = shell->workspaces.num - 1;
+
from = get_current_workspace(shell);
to = get_workspace(shell, workspace);