summaryrefslogtreecommitdiff
path: root/Userland/Services/WindowServer/ClientConnection.cpp
diff options
context:
space:
mode:
authorDaniël van de Burgt <209150+thatdutchguy@users.noreply.github.com>2021-04-02 07:08:18 -0700
committerGitHub <noreply@github.com>2021-04-02 16:08:18 +0200
commita106f852d3171ae35a4e09870cbb2aef24c2fd10 (patch)
tree1cf61fdddc03f330edb2d1d27514668521dd993e /Userland/Services/WindowServer/ClientConnection.cpp
parente55b8712d4831296ee8de48d17022f2aab9d7a62 (diff)
downloadserenity-a106f852d3171ae35a4e09870cbb2aef24c2fd10.zip
WindowServer+MouseSettings: Add ability to configure double-click speed (#5876)
This adds a double-click speed slider control to the Mouse Settings panel, and value labels for both the movement speed and double-click speed sliders. To allow for updating and persisting the configured double-click speed through the WindowServer, two IPC calls - `SetDoubleClickSpeed` and `GetDoubleClickSpeed` - have been added.
Diffstat (limited to 'Userland/Services/WindowServer/ClientConnection.cpp')
-rw-r--r--Userland/Services/WindowServer/ClientConnection.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/Userland/Services/WindowServer/ClientConnection.cpp b/Userland/Services/WindowServer/ClientConnection.cpp
index 77ff8e1ab7..c49f8ad26d 100644
--- a/Userland/Services/WindowServer/ClientConnection.cpp
+++ b/Userland/Services/WindowServer/ClientConnection.cpp
@@ -966,6 +966,19 @@ OwnPtr<Messages::WindowServer::GetScrollStepSizeResponse> ClientConnection::hand
{
return make<Messages::WindowServer::GetScrollStepSizeResponse>(Screen::the().scroll_step_size());
}
+OwnPtr<Messages::WindowServer::SetDoubleClickSpeedResponse> ClientConnection::handle(const Messages::WindowServer::SetDoubleClickSpeed& message)
+{
+ if (message.speed() < double_click_speed_min || message.speed() > double_click_speed_max) {
+ did_misbehave("SetDoubleClickSpeed with bad speed");
+ return {};
+ }
+ WindowManager::the().set_double_click_speed(message.speed());
+ return make<Messages::WindowServer::SetDoubleClickSpeedResponse>();
+}
+OwnPtr<Messages::WindowServer::GetDoubleClickSpeedResponse> ClientConnection::handle(const Messages::WindowServer::GetDoubleClickSpeed&)
+{
+ return make<Messages::WindowServer::GetDoubleClickSpeedResponse>(WindowManager::the().double_click_speed());
+}
void ClientConnection::set_unresponsive(bool unresponsive)
{