mirror of
https://github.com/elementary/gala.git
synced 2024-12-25 18:24:05 +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.Actor out_group;
|
||||||
Clutter.Rectangle black; //black border between workspaces
|
Clutter.Rectangle black; //black border between workspaces
|
||||||
Clutter.Clone wallpaper;
|
Clutter.Clone wallpaper;
|
||||||
Clutter.Clone panel;
|
|
||||||
|
|
||||||
public override void switch_workspace (int from, int to, MotionDirection direction)
|
public override void switch_workspace (int from, int to, MotionDirection direction)
|
||||||
{
|
{
|
||||||
|
@ -181,6 +181,9 @@ namespace Gala
|
|||||||
void dim_windows ()
|
void dim_windows ()
|
||||||
{
|
{
|
||||||
window_list.foreach ((window) => {
|
window_list.foreach ((window) => {
|
||||||
|
if (window.window_type != Meta.WindowType.NORMAL)
|
||||||
|
return;
|
||||||
|
|
||||||
var actor = window.get_compositor_private () as Clutter.Actor;
|
var actor = window.get_compositor_private () as Clutter.Actor;
|
||||||
if (actor == null)
|
if (actor == null)
|
||||||
return;
|
return;
|
||||||
|
@ -294,7 +294,8 @@ namespace Gala
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
screen.get_workspace_by_index (idx).activate (display.get_current_time ());
|
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)
|
public override bool key_press_event (Clutter.KeyEvent event)
|
||||||
@ -404,11 +405,13 @@ namespace Gala
|
|||||||
|
|
||||||
workspaces.add_child (group);
|
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.x = width / 2 - workspaces.width / 2;
|
||||||
workspaces.y = 25;
|
workspaces.y = 25;
|
||||||
|
|
||||||
workspace = screen.get_active_workspace ().index ();
|
|
||||||
|
|
||||||
current_workspace.y = workspaces.y - 5;
|
current_workspace.y = workspaces.y - 5;
|
||||||
|
|
||||||
visible = true;
|
visible = true;
|
||||||
@ -417,6 +420,11 @@ namespace Gala
|
|||||||
animate (Clutter.AnimationMode.EASE_OUT_QUAD, 250, y : area.height - height, opacity : 255)
|
animate (Clutter.AnimationMode.EASE_OUT_QUAD, 250, y : area.height - height, opacity : 255)
|
||||||
.completed.connect (() => {
|
.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 ()
|
public new void hide ()
|
||||||
|
Loading…
Reference in New Issue
Block a user