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.
This commit is contained in:
Axel Dörfler
2016-12-29 00:27:48 +01:00
parent e8cfcb1f60
commit 2060602c78
+6 -6
View File
@@ -489,15 +489,15 @@ WorkspacesView::MessageReceived(BMessage* message)
case B_MOUSE_WHEEL_CHANGED: case B_MOUSE_WHEEL_CHANGED:
{ {
WorkspacesWindow *window; WorkspacesWindow* window
window = dynamic_cast<WorkspacesWindow *>(Window()); = dynamic_cast<WorkspacesWindow*>(Window());
if (window && !window->SwitchOnWheel()) if (window == NULL || !window->SwitchOnWheel())
break; break;
float dy = message->FindFloat("be:wheel_delta_y"); float deltaY = message->FindFloat("be:wheel_delta_y");
if (dy > 0.1) if (deltaY > 0.1)
activate_workspace(current_workspace() + 1); activate_workspace(current_workspace() + 1);
else if (dy < -0.1) else if (deltaY < -0.1)
activate_workspace(current_workspace() - 1); activate_workspace(current_workspace() - 1);
break; break;
} }