Scrollbars respond to mouse dragging more naturally
This commit is contained in:
parent
d435f5a6a9
commit
92a9c9370d
@ -272,10 +272,7 @@ func (window *Window) compressMotionNotify (
|
|||||||
typedEvent, ok := untypedEvent.Event.(xproto.MotionNotifyEvent)
|
typedEvent, ok := untypedEvent.Event.(xproto.MotionNotifyEvent)
|
||||||
if !ok { continue }
|
if !ok { continue }
|
||||||
|
|
||||||
if firstEvent.Event == typedEvent.Event &&
|
if firstEvent.Event == typedEvent.Event {
|
||||||
typedEvent.Detail >= 4 &&
|
|
||||||
typedEvent.Detail <= 7 {
|
|
||||||
|
|
||||||
lastEvent = typedEvent
|
lastEvent = typedEvent
|
||||||
defer func (index int) {
|
defer func (index int) {
|
||||||
xevent.DequeueAt(window.backend.connection, index)
|
xevent.DequeueAt(window.backend.connection, index)
|
||||||
|
|||||||
@ -20,7 +20,7 @@ type ScrollContainer struct {
|
|||||||
exists bool
|
exists bool
|
||||||
enabled bool
|
enabled bool
|
||||||
dragging bool
|
dragging bool
|
||||||
dragOffset image.Point
|
dragOffset int
|
||||||
gutter image.Rectangle
|
gutter image.Rectangle
|
||||||
bar image.Rectangle
|
bar image.Rectangle
|
||||||
}
|
}
|
||||||