diff options
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Services/WindowServer/ClientConnection.cpp | 5 | ||||
-rw-r--r-- | Userland/Services/WindowServer/ClientConnection.h | 1 | ||||
-rw-r--r-- | Userland/Services/WindowServer/Compositor.h | 4 | ||||
-rw-r--r-- | Userland/Services/WindowServer/WindowServer.ipc | 2 | ||||
-rw-r--r-- | Userland/Utilities/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Userland/Utilities/wsctl.cpp | 24 |
6 files changed, 36 insertions, 1 deletions
diff --git a/Userland/Services/WindowServer/ClientConnection.cpp b/Userland/Services/WindowServer/ClientConnection.cpp index 4cfb8fa470..3c8f958722 100644 --- a/Userland/Services/WindowServer/ClientConnection.cpp +++ b/Userland/Services/WindowServer/ClientConnection.cpp @@ -1099,4 +1099,9 @@ void ClientConnection::set_window_modified(i32 window_id, bool modified) window.set_modified(modified); } +void ClientConnection::set_flash_flush(bool enabled) +{ + Compositor::the().set_flash_flush(enabled); +} + } diff --git a/Userland/Services/WindowServer/ClientConnection.h b/Userland/Services/WindowServer/ClientConnection.h index 536203049a..2bce8d7f0f 100644 --- a/Userland/Services/WindowServer/ClientConnection.h +++ b/Userland/Services/WindowServer/ClientConnection.h @@ -162,6 +162,7 @@ private: virtual void set_window_modified(i32, bool) override; virtual Messages::WindowServer::IsWindowModifiedResponse is_window_modified(i32) override; virtual Messages::WindowServer::GetDesktopDisplayScaleResponse get_desktop_display_scale(u32) override; + virtual void set_flash_flush(bool) override; Window* window_from_id(i32 window_id); diff --git a/Userland/Services/WindowServer/Compositor.h b/Userland/Services/WindowServer/Compositor.h index 2c8be4aa9a..c493627f38 100644 --- a/Userland/Services/WindowServer/Compositor.h +++ b/Userland/Services/WindowServer/Compositor.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org> * * SPDX-License-Identifier: BSD-2-Clause */ @@ -125,6 +125,8 @@ public: void register_animation(Badge<Animation>, Animation&); void unregister_animation(Badge<Animation>, Animation&); + void set_flash_flush(bool b) { m_flash_flush = b; } + private: Compositor(); void init_bitmaps(); diff --git a/Userland/Services/WindowServer/WindowServer.ipc b/Userland/Services/WindowServer/WindowServer.ipc index 002df1243e..dd7eb53afd 100644 --- a/Userland/Services/WindowServer/WindowServer.ipc +++ b/Userland/Services/WindowServer/WindowServer.ipc @@ -144,4 +144,6 @@ endpoint WindowServer get_double_click_speed() => (int speed) get_desktop_display_scale(u32 screen_index) => (int desktop_display_scale) + + set_flash_flush(bool enabled) =| } diff --git a/Userland/Utilities/CMakeLists.txt b/Userland/Utilities/CMakeLists.txt index 59ff1aba10..0bd01d02a4 100644 --- a/Userland/Utilities/CMakeLists.txt +++ b/Userland/Utilities/CMakeLists.txt @@ -99,3 +99,4 @@ target_link_libraries(zip LibArchive LibCompress LibCrypto) target_link_libraries(cpp-parser LibCpp LibGUI) target_link_libraries(PreprocessorTest LibCpp LibGUI) target_link_libraries(wasm LibWasm LibLine) +target_link_libraries(wsctl LibGUI) diff --git a/Userland/Utilities/wsctl.cpp b/Userland/Utilities/wsctl.cpp new file mode 100644 index 0000000000..6122ecb363 --- /dev/null +++ b/Userland/Utilities/wsctl.cpp @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2021, Andreas Kling <kling@serenityos.org> + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include <LibCore/ArgsParser.h> +#include <LibGUI/Application.h> +#include <LibGUI/WindowServerConnection.h> + +int main(int argc, char** argv) +{ + auto app = GUI::Application::construct(argc, argv); + + int flash_flush = -1; + Core::ArgsParser args_parser; + args_parser.add_option(flash_flush, "Flash flush (repaint) rectangles", "flash-flush", 'f', "0/1"); + args_parser.parse(argc, argv); + + if (flash_flush != -1) { + GUI::WindowServerConnection::the().async_set_flash_flush(flash_flush); + } + return 0; +} |