From 2060602c78f98fc97023c3c84d65e8434c85e0ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 29 Dec 2016 00:24:02 +0100 Subject: [PATCH] Workspaces: Turn off wheel switch for replicant. * It's turned off by default for the app, so I see no reason why the replicant should have it. It's annoying to use, as my touchpad obviously scrolls when moving the mouse while having a button pressed. * A cleaner solution would be to read the settings once if there is no WorkspacesWindow, and use the setting from there instead. --- src/apps/workspaces/Workspaces.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/apps/workspaces/Workspaces.cpp b/src/apps/workspaces/Workspaces.cpp index c17140939e..0a39e72a95 100644 --- a/src/apps/workspaces/Workspaces.cpp +++ b/src/apps/workspaces/Workspaces.cpp @@ -489,15 +489,15 @@ WorkspacesView::MessageReceived(BMessage* message) case B_MOUSE_WHEEL_CHANGED: { - WorkspacesWindow *window; - window = dynamic_cast(Window()); - if (window && !window->SwitchOnWheel()) + WorkspacesWindow* window + = dynamic_cast(Window()); + if (window == NULL || !window->SwitchOnWheel()) break; - float dy = message->FindFloat("be:wheel_delta_y"); - if (dy > 0.1) + float deltaY = message->FindFloat("be:wheel_delta_y"); + if (deltaY > 0.1) activate_workspace(current_workspace() + 1); - else if (dy < -0.1) + else if (deltaY < -0.1) activate_workspace(current_workspace() - 1); break; } @@ -1049,7 +1049,7 @@ WorkspacesApp::ArgvReceived(int32 argc, char **argv) BView* instantiate_deskbar_item() { // Calculate the correct size of the Deskbar replicant first - + BScreen screen; float screenWidth = screen.Frame().Width(); float screenHeight = screen.Frame().Height();