mirror of
https://github.com/elementary/gala.git
synced 2024-12-25 10:13:04 +03:00
Fix startup position of workspace indicator in workspaceview
This commit is contained in:
parent
8f84a9be7a
commit
713b736185
@ -425,7 +425,6 @@ namespace Gala
|
||||
Clutter.Actor out_group;
|
||||
Clutter.Rectangle black; //black border between workspaces
|
||||
Clutter.Clone wallpaper;
|
||||
Clutter.Clone panel;
|
||||
|
||||
public override void switch_workspace (int from, int to, MotionDirection direction)
|
||||
{
|
||||
|
@ -181,6 +181,9 @@ namespace Gala
|
||||
void dim_windows ()
|
||||
{
|
||||
window_list.foreach ((window) => {
|
||||
if (window.window_type != Meta.WindowType.NORMAL)
|
||||
return;
|
||||
|
||||
var actor = window.get_compositor_private () as Clutter.Actor;
|
||||
if (actor == null)
|
||||
return;
|
||||
|
@ -294,7 +294,8 @@ namespace Gala
|
||||
return;
|
||||
|
||||
screen.get_workspace_by_index (idx).activate (display.get_current_time ());
|
||||
workspace = idx;
|
||||
if (workspaces.x != 0)
|
||||
workspace = idx;
|
||||
}
|
||||
|
||||
public override bool key_press_event (Clutter.KeyEvent event)
|
||||
@ -404,11 +405,13 @@ namespace Gala
|
||||
|
||||
workspaces.add_child (group);
|
||||
}
|
||||
|
||||
var new_idx = screen.get_active_workspace ().index ();
|
||||
|
||||
bool recalc = current_workspace.x == 0;
|
||||
workspaces.x = width / 2 - workspaces.width / 2;
|
||||
workspaces.y = 25;
|
||||
|
||||
workspace = screen.get_active_workspace ().index ();
|
||||
|
||||
current_workspace.y = workspaces.y - 5;
|
||||
|
||||
visible = true;
|
||||
@ -417,6 +420,11 @@ namespace Gala
|
||||
animate (Clutter.AnimationMode.EASE_OUT_QUAD, 250, y : area.height - height, opacity : 255)
|
||||
.completed.connect (() => {
|
||||
});
|
||||
|
||||
if (recalc)
|
||||
current_workspace.x = width / 2 - workspaces.width / 2 + (workspaces.get_children ().nth_data (0).width+12)*new_idx - 5;
|
||||
else
|
||||
workspace = new_idx;
|
||||
}
|
||||
|
||||
public new void hide ()
|
||||
|
Loading…
Reference in New Issue
Block a user