Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 13 additions & 21 deletions wingpanel-interface/BackgroundManager.vala
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
/*
* Copyright (c) 2011-2015 Wingpanel Developers (http://launchpad.net/wingpanel)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
* SPDX-License-Identifier: GPL-2-or-later
* SPDX-FileCopyrightText: 2011-2015 Wingpanel Developers (http://launchpad.net/wingpanel)
* 2025 elementary, Inc. (https://elementary.io)
*/

public enum BackgroundState {
Expand All @@ -39,11 +26,9 @@ public class WingpanelInterface.BackgroundManager : Object {
public int panel_height { private get; construct; }

private ulong wallpaper_hook_id;

private bool showing_desktop = false;
private unowned Meta.Workspace? current_workspace = null;

private BackgroundState current_state = BackgroundState.LIGHT;

private Utils.ColorInformation? bk_color_info = null;

public BackgroundManager (int panel_height) {
Expand All @@ -63,8 +48,10 @@ public class WingpanelInterface.BackgroundManager : Object {

private void connect_signals () {
unowned Meta.WorkspaceManager manager = Main.display.get_workspace_manager ();
manager.workspace_switched.connect (() => {
update_current_workspace ();
manager.workspace_switched.connect (() => update_current_workspace ());
manager.showing_desktop_changed.connect (() => {
showing_desktop = !showing_desktop;
check_for_state_change (WALLPAPER_TRANSITION_DURATION);
});

var signal_id = GLib.Signal.lookup ("changed", Main.wm.background_group.get_type ());
Expand Down Expand Up @@ -167,6 +154,11 @@ public class WingpanelInterface.BackgroundManager : Object {
* - Else it should be LIGHT.
*/
private void check_for_state_change (uint animation_duration) {
if (showing_desktop && current_state != LIGHT) {
state_changed (current_state = LIGHT, animation_duration);
return;
}

bool has_fullscreen_window = false;
bool has_maximized_window = false;

Expand Down
Loading