mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
Fixed scrolling direction with mouse wheel for horizontal scrollers
This commit is contained in:
@@ -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:
|
||||||
@@ -65,7 +66,7 @@ changes since wmaker 0.63.1:
|
|||||||
- Fixed a bug that caused sigsegv for a WMList with more than 32767 items.
|
- Fixed a bug that caused sigsegv for a WMList with more than 32767 items.
|
||||||
- Added an example of how to create a server type program with WMConnection.
|
- Added an example of how to create a server type program with WMConnection.
|
||||||
- added WMOpenScreen()
|
- added WMOpenScreen()
|
||||||
|
|
||||||
|
|
||||||
changes since wmaker 0.62.1:
|
changes since wmaker 0.62.1:
|
||||||
............................
|
............................
|
||||||
|
|||||||
@@ -798,22 +798,22 @@ 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;
|
||||||
|
|
||||||
|
|
||||||
/* check if we're really dealing with a scroller, as something
|
/* check if we're really dealing with a scroller, as something
|
||||||
* might have gone wrong in the event dispatching stuff */
|
* might have gone wrong in the event dispatching stuff */
|
||||||
CHECK_CLASS(sPtr, WC_Scroller);
|
CHECK_CLASS(sPtr, WC_Scroller);
|
||||||
|
|
||||||
id = sPtr->flags.incrDown;
|
id = sPtr->flags.incrDown;
|
||||||
dd = sPtr->flags.decrDown;
|
dd = sPtr->flags.decrDown;
|
||||||
|
|
||||||
switch (event->type) {
|
switch (event->type) {
|
||||||
case EnterNotify:
|
case EnterNotify:
|
||||||
|
break;
|
||||||
break;
|
|
||||||
|
case LeaveNotify:
|
||||||
case LeaveNotify:
|
|
||||||
if (sPtr->timerID) {
|
if (sPtr->timerID) {
|
||||||
WMDeleteTimerHandler(sPtr->timerID);
|
WMDeleteTimerHandler(sPtr->timerID);
|
||||||
sPtr->timerID = NULL;
|
sPtr->timerID = NULL;
|
||||||
@@ -821,12 +821,21 @@ handleActionEvents(XEvent *event, void *data)
|
|||||||
sPtr->flags.incrDown = 0;
|
sPtr->flags.incrDown = 0;
|
||||||
sPtr->flags.decrDown = 0;
|
sPtr->flags.decrDown = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ButtonPress:
|
case ButtonPress:
|
||||||
/* 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) {
|
||||||
@@ -836,10 +845,10 @@ handleActionEvents(XEvent *event, void *data)
|
|||||||
}
|
}
|
||||||
if (sPtr->action) {
|
if (sPtr->action) {
|
||||||
(*sPtr->action)(sPtr, sPtr->clientData);
|
(*sPtr->action)(sPtr, sPtr->clientData);
|
||||||
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) {
|
||||||
@@ -865,7 +874,7 @@ handleActionEvents(XEvent *event, void *data)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
if (sPtr->flags.draggingKnob) {
|
if (sPtr->flags.draggingKnob) {
|
||||||
if (sPtr->action) {
|
if (sPtr->action) {
|
||||||
(*sPtr->action)(sPtr, sPtr->clientData);
|
(*sPtr->action)(sPtr, sPtr->clientData);
|
||||||
@@ -882,7 +891,7 @@ handleActionEvents(XEvent *event, void *data)
|
|||||||
sPtr->flags.draggingKnob = 0;
|
sPtr->flags.draggingKnob = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MotionNotify:
|
case MotionNotify:
|
||||||
handleMotion(sPtr, event->xbutton.x, event->xbutton.y);
|
handleMotion(sPtr, event->xbutton.x, event->xbutton.y);
|
||||||
if (sPtr->timerID && sPtr->flags.hitPart != WSIncrementLine
|
if (sPtr->timerID && sPtr->flags.hitPart != WSIncrementLine
|
||||||
&& sPtr->flags.hitPart != WSDecrementLine) {
|
&& sPtr->flags.hitPart != WSDecrementLine) {
|
||||||
|
|||||||
Reference in New Issue
Block a user