Skip to content

Commit 0559a45

Browse files
authored
Merge branch 'main' into leolost/move-to-old-ws
2 parents 85a2100 + e0cd37a commit 0559a45

File tree

5 files changed

+17
-34
lines changed

5 files changed

+17
-34
lines changed

data/gala.metainfo.xml.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<issue url="https://github.com/elementary/gala/issues/2088">Invisible window clones</issue>
4545
<issue url="https://github.com/elementary/gala/issues/2113">gnome-session-x11-services-ready.target isn't started on Wayland session</issue>
4646
<issue url="https://github.com/elementary/gala/issues/2131">Unthemed cursor style and glitchy menus on some applications</issue>
47+
<issue url="https://github.com/elementary/gala/issues/2154">Windows do not display correctly after moving between workspaces</issue>
4748
<issue url="https://github.com/elementary/gala/issues/2159">Crash when moving windows between workspaces and using gestures to switch</issue>
4849
<issue url="https://github.com/elementary/gala/issues/2169">Text UI based Scaling: Tiny Titlebars in XWayland Apps</issue>
4950
<issue url="https://github.com/elementary/gala/issues/2171">PiP dragging doesn't start until after mouse is released</issue>

src/Gestures/GesturePropertyTransition.vala

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ public class Gala.GesturePropertyTransition : Object {
8484
* to the final position. If with_gesture is false it will just ease to the {@link to_value}.
8585
* #this will keep itself alive until the animation finishes so it is safe to immediatly unref it after creation and calling start.
8686
*
87-
* @param done_callback a callback for when the transition finishes. It is guaranteed to be called exactly once.
87+
* @param done_callback a callback for when the transition finishes. This shouldn't be used for setting state, instead state should
88+
* be set immediately on {@link GestureTracker.OnEnd} not only once the animation ends to allow for interrupting the animation by starting a new gesture.
89+
* done_callback will only be called if the animation finishes, not if it is interrupted e.g. by starting a new animation for the same property,
90+
* destroying the actor or removing the transition.
8891
*/
8992
public void start (bool with_gesture, owned DoneCallback? done_callback = null) {
9093
ref ();
@@ -179,8 +182,8 @@ public class Gala.GesturePropertyTransition : Object {
179182
}
180183
}
181184

182-
private void finish () {
183-
if (done_callback != null) {
185+
private void finish (bool callback = true) {
186+
if (done_callback != null && callback) {
184187
done_callback ();
185188
}
186189

src/ScreenshotManager.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ namespace Gala {
155155
var rect = window.get_frame_rect ();
156156
#if HAS_MUTTER45
157157
if (!include_frame) {
158-
#if else
158+
#else
159159
if ((include_frame && window.is_client_decorated ()) ||
160160
(!include_frame && !window.is_client_decorated ())) {
161161
#endif

src/Widgets/WindowClone.vala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ public class Gala.WindowClone : Clutter.Actor {
266266
update_hover_widgets (false);
267267
toggle_shadow (false);
268268
});
269+
270+
if (should_fade ()) {
271+
new GesturePropertyTransition (this, gesture_tracker, "opacity", null, 0u).start (with_gesture);
272+
}
269273
}
270274

271275
/**
@@ -294,6 +298,7 @@ public class Gala.WindowClone : Clutter.Actor {
294298
new GesturePropertyTransition (this, gesture_tracker, "y", intial_y, (float) rect.y).start (with_gesture);
295299
new GesturePropertyTransition (this, gesture_tracker, "width", (float) initial_width, (float) rect.width).start (with_gesture);
296300
new GesturePropertyTransition (this, gesture_tracker, "height", (float) initial_height, (float) rect.height).start (with_gesture);
301+
new GesturePropertyTransition (this, gesture_tracker, "opacity", null, 255u).start (with_gesture);
297302
new GesturePropertyTransition (this, gesture_tracker, "shadow-opacity", (uint8) 0, (uint8) 255).start (with_gesture);
298303
new GesturePropertyTransition (window_icon, gesture_tracker, "opacity", 0u, 255u).start (with_gesture, () => {
299304
update_hover_widgets (false);

src/WindowManager.vala

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,29 +1922,7 @@ namespace Gala {
19221922
}
19231923
main_container.add_child (static_windows);
19241924

1925-
// if we have a move action, pack that window to the static ones
1926-
if (moving != null) {
1927-
unowned var moving_actor = (Meta.WindowActor) moving.get_compositor_private ();
1928-
1929-
windows.prepend (moving_actor);
1930-
parents.prepend (moving_actor.get_parent ());
1931-
1932-
moving_actor.set_translation (-clone_offset_x, -clone_offset_y, 0);
1933-
clutter_actor_reparent (moving_actor, static_windows);
1934-
}
1935-
19361925
unowned var grabbed_window = window_grab_tracker.current_window;
1937-
1938-
if (grabbed_window != null) {
1939-
unowned var moving_actor = (Meta.WindowActor) grabbed_window.get_compositor_private ();
1940-
1941-
windows.prepend (moving_actor);
1942-
parents.prepend (moving_actor.get_parent ());
1943-
1944-
moving_actor.set_translation (-clone_offset_x, -clone_offset_y, 0);
1945-
clutter_actor_reparent (moving_actor, static_windows);
1946-
}
1947-
19481926
var to_has_fullscreened = false;
19491927
var from_has_fullscreened = false;
19501928

@@ -1960,15 +1938,11 @@ namespace Gala {
19601938
continue;
19611939
}
19621940

1963-
if (!window.showing_on_its_workspace () ||
1964-
move_primary_only && !window.is_on_primary_monitor () ||
1965-
window == moving ||
1966-
window == grabbed_window) {
1967-
1941+
if (!window.showing_on_its_workspace () || move_primary_only && !window.is_on_primary_monitor ()) {
19681942
continue;
19691943
}
19701944

1971-
if (window.on_all_workspaces) {
1945+
if (window.on_all_workspaces || window == moving || window == grabbed_window) {
19721946
// notifications use their own group and are always on top
19731947
if (NotificationStack.is_notification (window)) {
19741948
continue;
@@ -1980,8 +1954,8 @@ namespace Gala {
19801954
clutter_actor_reparent (actor, static_windows);
19811955
actor.set_translation (-clone_offset_x, -clone_offset_y, 0);
19821956

1983-
// Don't fade docks they just stay where they are
1984-
if (window.window_type == DOCK) {
1957+
// Don't fade docks and moving/grabbed windows they just stay where they are
1958+
if (window.window_type == DOCK || window == moving || window == grabbed_window) {
19851959
continue;
19861960
}
19871961

0 commit comments

Comments
 (0)