Scrollbars respond to mouse dragging more naturally

This commit is contained in:
Sasha Koshka 2023-01-21 01:24:24 -05:00
parent d435f5a6a9
commit 92a9c9370d
2 changed files with 11 additions and 12 deletions

View File

@ -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)

View File

@ -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
} }