From 12682f0bcc81c8544cd0c80fe1da984b49eaa0f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20De=20Canni=C3=A8re?= Date: Wed, 1 Jun 2022 13:40:02 +0200 Subject: [PATCH] Taskbar: Add toggle_show_desktop() This function is added to separate the desktop toggling functionality from the "Show Desktop" button in the taskbar and to enable calling this behaviour via a keyboard shortcut in a later commit. --- Userland/Services/Taskbar/TaskbarWindow.cpp | 5 +++++ Userland/Services/Taskbar/TaskbarWindow.h | 1 + 2 files changed, 6 insertions(+) diff --git a/Userland/Services/Taskbar/TaskbarWindow.cpp b/Userland/Services/Taskbar/TaskbarWindow.cpp index cf0773b8bb..0d5e09014d 100644 --- a/Userland/Services/Taskbar/TaskbarWindow.cpp +++ b/Userland/Services/Taskbar/TaskbarWindow.cpp @@ -109,6 +109,11 @@ void TaskbarWindow::config_string_did_change(String const& domain, String const& } void TaskbarWindow::show_desktop_button_clicked(unsigned) +{ + toggle_show_desktop(); +} + +void TaskbarWindow::toggle_show_desktop() { GUI::ConnectionToWindowManagerServer::the().async_toggle_show_desktop(); } diff --git a/Userland/Services/Taskbar/TaskbarWindow.h b/Userland/Services/Taskbar/TaskbarWindow.h index 656f4873a5..4fe8a11650 100644 --- a/Userland/Services/Taskbar/TaskbarWindow.h +++ b/Userland/Services/Taskbar/TaskbarWindow.h @@ -30,6 +30,7 @@ public: private: explicit TaskbarWindow(NonnullRefPtr start_menu); static void show_desktop_button_clicked(unsigned); + static void toggle_show_desktop(); void set_quick_launch_button_data(GUI::Button&, String const&, NonnullRefPtr); void on_screen_rects_change(Vector const&, size_t); NonnullRefPtr create_button(WindowIdentifier const&);