Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't connect to Meta.Display.restacked #1588

Merged
merged 1 commit into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/Widgets/MonitorClone.vala
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ namespace Gala {

window_container = new WindowCloneContainer (wm, gesture_tracker);
window_container.window_selected.connect ((w) => { window_selected (w); });
display.restacked.connect (window_container.restack_windows);

display.window_entered_monitor.connect (window_entered);
display.window_left_monitor.connect (window_left);
Expand Down Expand Up @@ -74,7 +73,6 @@ namespace Gala {
~MonitorClone () {
display.window_entered_monitor.disconnect (window_entered);
display.window_left_monitor.disconnect (window_left);
display.restacked.disconnect (window_container.restack_windows);
}

/**
Expand All @@ -92,16 +90,16 @@ namespace Gala {
* Animate the windows from their old location to a tiled layout
*/
public void open (bool with_gesture = false, bool is_cancel_animation = false) {
window_container.restack_windows ();
window_container.open (null, with_gesture, is_cancel_animation);
// background.opacity = 0; TODO consider this option
}

/**
* Animate the windows back to their old location
*/
public void close (bool with_gesture = false, bool is_cancel_animation = false) {
window_container.restack_windows ();
window_container.close (with_gesture, is_cancel_animation);
background.opacity = 255;
}

private void window_left (int window_monitor, Meta.Window window) {
Expand Down
7 changes: 4 additions & 3 deletions src/Widgets/WorkspaceClone.vala
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ namespace Gala {
window_container = new WindowCloneContainer (wm, gesture_tracker);
window_container.window_selected.connect ((w) => { window_selected (w); });
window_container.set_size (monitor_geometry.width, monitor_geometry.height);
display.restacked.connect (window_container.restack_windows);

icon_group = new IconGroup (wm, workspace);
icon_group.selected.connect (() => selected (true));
Expand Down Expand Up @@ -234,8 +233,6 @@ namespace Gala {
~WorkspaceClone () {
unowned Meta.Display display = workspace.get_display ();

display.restacked.disconnect (window_container.restack_windows);

display.window_entered_monitor.disconnect (window_entered_monitor);
display.window_left_monitor.disconnect (window_left_monitor);
workspace.window_added.disconnect (add_window);
Expand Down Expand Up @@ -340,6 +337,8 @@ namespace Gala {

opened = true;

window_container.restack_windows ();

var scale_factor = InternalUtils.get_ui_scaling_factor ();
var display = workspace.get_display ();

Expand Down Expand Up @@ -420,6 +419,8 @@ namespace Gala {

opened = false;

window_container.restack_windows ();

var initial_x = is_cancel_animation ? x : multitasking_view_x ();
var target_x = multitasking_view_x () + current_x_overlap ();

Expand Down