Skip to content

Commit

Permalink
Fix double shown on start
Browse files Browse the repository at this point in the history
  • Loading branch information
leolost2605 committed Oct 12, 2024
1 parent 52f71ef commit a9e6b0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
20 changes: 2 additions & 18 deletions src/DisplayPlug.vala
Original file line number Diff line number Diff line change
Expand Up @@ -81,30 +81,14 @@ public class Display.Plug : Switchboard.Plug {
box = new Gtk.Box (VERTICAL, 0);
box.append (headerbar);
box.append (stack);

stack.notify["visible-child"].connect (() => {
if (stack.visible_child == displays_view) {
displays_view.displays_overlay.show_windows ();
} else {
displays_view.displays_overlay.hide_windows ();
}
});
}

return box;
}

public override void shown () {
if (stack.visible_child == displays_view) {
displays_view.displays_overlay.show_windows ();
} else {
displays_view.displays_overlay.hide_windows ();
}
}
public override void shown () { } //Do nothing

public override void hidden () {
displays_view.displays_overlay.hide_windows ();
}
public override void hidden () { } //Do nothing

public override void search_callback (string location) {
stack.visible_child_name = location;
Expand Down
3 changes: 3 additions & 0 deletions src/Widgets/DisplaysOverlay.vala
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ public class Display.DisplaysOverlay : Gtk.Box {
rescan_displays ();

overlay.get_child_position.connect (get_child_position);

map.connect (show_windows);
unmap.connect (hide_windows);
}

static construct {
Expand Down

0 comments on commit a9e6b0a

Please sign in to comment.