Skip to content

Commit 3adb9aa

Browse files
authored
lenemter/session start smooth (#2582)
1 parent 2cc8ce0 commit 3adb9aa

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

src/ShellClients/PanelWindow.vala

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ public class Gala.PanelWindow : ShellWindow, RootTarget {
6969
hide_tracker.hide.connect (hide);
7070
hide_tracker.show.connect (show);
7171

72-
workspace_gesture_controller = new GestureController (CUSTOM, wm);
72+
workspace_gesture_controller = new GestureController (CUSTOM, wm) {
73+
progress = 1.0
74+
};
7375

7476
workspace_hide_tracker = new WorkspaceHideTracker (window.display, update_overlap);
7577
workspace_hide_tracker.switching_workspace_progress_updated.connect ((value) => workspace_gesture_controller.progress = value);
@@ -119,11 +121,12 @@ public class Gala.PanelWindow : ShellWindow, RootTarget {
119121
actor.add_action (new DragDropAction (DESTINATION, "multitaskingview-window"));
120122
}
121123

122-
protected override double get_hidden_progress () {
123-
if (starting) {
124-
return user_gesture_controller.progress;
125-
}
124+
public void animate_start () {
125+
starting = false;
126+
workspace_hide_tracker.recalculate_all_workspaces ();
127+
}
126128

129+
protected override double get_hidden_progress () {
127130
var user_workspace_hidden_progress = double.min (
128131
user_gesture_controller.progress,
129132
workspace_gesture_controller.progress
@@ -139,22 +142,21 @@ public class Gala.PanelWindow : ShellWindow, RootTarget {
139142
public override void propagate (GestureTarget.UpdateType update_type, GestureAction action, double progress) {
140143
workspace_hide_tracker.update (update_type, action, progress);
141144
base.propagate (update_type, action, progress);
142-
143-
if (starting && update_type == END && action == CUSTOM) {
144-
// We were shown for the first time, so we can leave the special starting state
145-
starting = false;
146-
}
147145
}
148146

149147
private void hide () {
150148
user_gesture_controller.goto (1);
151149
}
152150

153-
public void show () {
151+
private void show () {
154152
user_gesture_controller.goto (0);
155153
}
156154

157155
private bool update_overlap (Meta.Workspace workspace) {
156+
if (starting) {
157+
return true;
158+
}
159+
158160
var overlap = false;
159161
var focus_overlap = false;
160162
var focus_maximized_overlap = false;

src/ShellClients/ShellClientsManager.vala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public class Gala.ShellClientsManager : Object, GestureTarget {
117117

118118
starting_panels = 0;
119119
foreach (var window in panel_windows.get_values ()) {
120-
window.show ();
120+
window.animate_start ();
121121
}
122122
}
123123
}
@@ -185,7 +185,7 @@ public class Gala.ShellClientsManager : Object, GestureTarget {
185185

186186
private void on_panel_ready (Meta.WindowActor actor) {
187187
if (starting_panels == 0) {
188-
panel_windows[actor.meta_window].show ();
188+
panel_windows[actor.meta_window].animate_start ();
189189
return;
190190
}
191191

@@ -194,7 +194,7 @@ public class Gala.ShellClientsManager : Object, GestureTarget {
194194

195195
if (starting_panels == 0) {
196196
foreach (var window in panel_windows.get_values ()) {
197-
window.show ();
197+
window.animate_start ();
198198
}
199199
}
200200
}

0 commit comments

Comments
 (0)