1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00

Fixed scrolling direction with mouse wheel for horizontal scrollers

This commit is contained in:
dan
2001-05-09 00:37:07 +00:00
parent 41c0e64eac
commit 19ad865f49
2 changed files with 26 additions and 16 deletions

View File

@@ -51,6 +51,7 @@ Changes since wmaker 0.64.0:
- fixed a bug that made the scroller knob jump backwards when dragged (this - fixed a bug that made the scroller knob jump backwards when dragged (this
bug had no relation with the behavior that #define STRICT_NEXT_BEHAVIOUR bug had no relation with the behavior that #define STRICT_NEXT_BEHAVIOUR
attempts to accomplish). attempts to accomplish).
- fixed scrolling direction with mouse wheel for horizontal scroller.
changes since wmaker 0.63.1: changes since wmaker 0.63.1:

View File

@@ -798,6 +798,7 @@ static void
handleActionEvents(XEvent *event, void *data) handleActionEvents(XEvent *event, void *data)
{ {
Scroller *sPtr = (Scroller*)data; Scroller *sPtr = (Scroller*)data;
int wheelDecrement, wheelIncrement;
int id, dd; int id, dd;
@@ -810,7 +811,6 @@ handleActionEvents(XEvent *event, void *data)
switch (event->type) { switch (event->type) {
case EnterNotify: case EnterNotify:
break; break;
case LeaveNotify: case LeaveNotify:
@@ -826,7 +826,16 @@ handleActionEvents(XEvent *event, void *data)
/* FIXME: change Mod1Mask with something else */ /* FIXME: change Mod1Mask with something else */
if (sPtr->flags.documentFullyVisible) if (sPtr->flags.documentFullyVisible)
break; break;
if (event->xbutton.button==WINGsConfiguration.mouseWheelUp) {
if (sPtr->flags.horizontal) {
wheelDecrement = WINGsConfiguration.mouseWheelDown;
wheelIncrement = WINGsConfiguration.mouseWheelUp;
} else {
wheelDecrement = WINGsConfiguration.mouseWheelUp;
wheelIncrement = WINGsConfiguration.mouseWheelDown;
}
if (event->xbutton.button == wheelDecrement) {
if (event->xbutton.state & ControlMask) { if (event->xbutton.state & ControlMask) {
sPtr->flags.hitPart = WSDecrementPage; sPtr->flags.hitPart = WSDecrementPage;
} else if (event->xbutton.state & ShiftMask) { } else if (event->xbutton.state & ShiftMask) {
@@ -839,7 +848,7 @@ handleActionEvents(XEvent *event, void *data)
WMPostNotificationName(WMScrollerDidScrollNotification, sPtr, WMPostNotificationName(WMScrollerDidScrollNotification, sPtr,
NULL); NULL);
} }
} else if (event->xbutton.button==WINGsConfiguration.mouseWheelDown) { } else if (event->xbutton.button == wheelIncrement) {
if (event->xbutton.state & ControlMask) { if (event->xbutton.state & ControlMask) {
sPtr->flags.hitPart = WSIncrementPage; sPtr->flags.hitPart = WSIncrementPage;
} else if (event->xbutton.state & ShiftMask) { } else if (event->xbutton.state & ShiftMask) {