diff --git a/src/Background/BackgroundManager.vala b/src/Background/BackgroundManager.vala index 9ff1dd97a..c53b5209f 100644 --- a/src/Background/BackgroundManager.vala +++ b/src/Background/BackgroundManager.vala @@ -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) { @@ -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 ("delegate"); diff --git a/src/ShellClients/PanelWindow.vala b/src/ShellClients/PanelWindow.vala index f05a9b410..502de6465 100644 --- a/src/ShellClients/PanelWindow.vala +++ b/src/ShellClients/PanelWindow.vala @@ -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; @@ -44,8 +44,6 @@ public class Gala.PanelWindow : Object { }); window.stick (); - - clone = new PanelClone (wm, this); } #if HAS_MUTTER46 @@ -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 () { @@ -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 (); } }