summaryrefslogtreecommitdiff
path: root/Userland/Utilities
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-07-07 22:54:58 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-07 22:56:46 +0200
commitb027466f412408adc6fd18855aa0c631c938d9fd (patch)
tree397d1f4e57fcd4d9be6161737a98c81aeda35960 /Userland/Utilities
parent6032b2cb2b7111e962c47d9dd458be8eba25c093 (diff)
downloadserenity-b027466f412408adc6fd18855aa0c631c938d9fd.zip
WindowServer+wsctl: Add a simple utility for toggling "flash flush"
You can now put the WindowServer into "flash flush" mode by doing: $ wsctl -f 1 To disable it, somewhat obviously: $ wsctl -f 0
Diffstat (limited to 'Userland/Utilities')
-rw-r--r--Userland/Utilities/CMakeLists.txt1
-rw-r--r--Userland/Utilities/wsctl.cpp24
2 files changed, 25 insertions, 0 deletions
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;
+}