mirror of
https://github.com/elementary/gala.git
synced 2024-12-28 19:55:40 +03:00
Fix workspaces nudging all the time
This commit is contained in:
parent
f93a5dec32
commit
257e45de07
@ -204,12 +204,16 @@ namespace Gala
|
||||
void switch_to_next_workspace (MotionDirection direction)
|
||||
{
|
||||
var display = screen.get_display ();
|
||||
var old_index = screen.get_active_workspace_index ();
|
||||
var neighbor = screen.get_active_workspace ().get_neighbor (direction);
|
||||
|
||||
neighbor.activate (display.get_current_time ());
|
||||
|
||||
//if we didnt switch, show a nudge-over animation
|
||||
if (screen.get_active_workspace () == neighbor) {
|
||||
// if we didnt switch, show a nudge-over animation. need to take the indices
|
||||
// here since the changing only applies after the animation ends
|
||||
if (old_index == 0 && direction == MotionDirection.LEFT ||
|
||||
old_index == screen.n_workspaces - 1 && direction == MotionDirection.RIGHT) {
|
||||
|
||||
var dest = direction == MotionDirection.LEFT ? 32.0f : -32.0f;
|
||||
Compositor.get_window_group_for_screen (screen).animate (Clutter.AnimationMode.LINEAR, 100, x:dest);
|
||||
Clutter.Threads.Timeout.add (210, () => {
|
||||
|
Loading…
Reference in New Issue
Block a user