Skip to content

Commit

Permalink
Merge branch 'master' into leolost/fix-barriers
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit authored May 26, 2024
2 parents 3c0f513 + fe650bf commit b155e0c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
3 changes: 1 addition & 2 deletions src/Background/BackgroundManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Gala.BackgroundManager : Meta.BackgroundGroup, Gala.BackgroundManag
}

private BackgroundSource background_source;
private Meta.BackgroundActor background_actor;
private Meta.BackgroundActor? background_actor;
private Meta.BackgroundActor? new_background_actor = null;

public BackgroundManager (WindowManager wm, int monitor_index, bool control_position = true) {
Expand Down Expand Up @@ -88,7 +88,6 @@ public class Gala.BackgroundManager : Meta.BackgroundGroup, Gala.BackgroundManag

new_background_actor = create_background_actor ();
var new_content = (Meta.BackgroundContent)new_background_actor.content;
new_background_actor.visible = background_actor.visible;

var background = new_content.background.get_data<unowned Background> ("delegate");

Expand Down
23 changes: 13 additions & 10 deletions src/ShellClients/PanelWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class Gala.PanelWindow : Object {

private Barrier? barrier;

private PanelClone clone;
private PanelClone? clone = null;

private int width = -1;
private int height = -1;
Expand All @@ -44,8 +44,6 @@ public class Gala.PanelWindow : Object {
});

window.stick ();

clone = new PanelClone (wm, this);
}

#if HAS_MUTTER46
Expand All @@ -71,14 +69,14 @@ public class Gala.PanelWindow : Object {
this.height = height;

position_window ();
set_hide_mode (clone.hide_mode); // Resetup barriers etc.
set_hide_mode (clone == null ? Pantheon.Desktop.HideMode.NEVER : clone.hide_mode); // Resetup barriers etc.
}

public void update_anchor (Meta.Side anchor) {
this.anchor = anchor;

position_window ();
set_hide_mode (clone.hide_mode); // Resetup barriers etc.
set_hide_mode (clone == null ? Pantheon.Desktop.HideMode.NEVER : clone.hide_mode); // Resetup barriers etc.
}

private void position_window () {
Expand Down Expand Up @@ -130,15 +128,20 @@ public class Gala.PanelWindow : Object {
}

public void set_hide_mode (Pantheon.Desktop.HideMode hide_mode) {
clone.hide_mode = hide_mode;

destroy_barrier ();

if (hide_mode != NEVER) {
if (hide_mode == NEVER) {
clone = null;
make_exclusive ();
} else {
unmake_exclusive ();

if (clone == null) {
clone = new PanelClone (wm, this);
}
clone.hide_mode = hide_mode;

setup_barrier ();
} else {
make_exclusive ();
}
}

Expand Down

0 comments on commit b155e0c

Please sign in to comment.