Closed lheimbs closed 2 years ago
Well, I connected the widow to button-release-event
for it to close when clicked outside any icon.
https://github.com/nwg-piotr/nwg-drawer/blob/94c94b8b1e125c00c386d52c738b01dded7d4529/main.go#L420
A swiping action should not result in a mouse click.
This is beyond my control.
It seems GTK fires the button-release-event
event on the end of swipe gestures... Probably some workaround is possible, but without a touch screen on my end it's going to take ages.
Hi Piotr, Thanks for the reply. I'll try to get into this myself but it might take a while since I'm neither experienced with go nor gtk.
The dock/drawer/etc. are great programs btw. and really suit people like me who have a touchscreen device and don't want to use an entire DE like gnome/kde
Thank you, it's great to hear.
I'm currently working hard on integration of all this stuff with a common management app, and some presets to choose from. It's going to be included into the next ArchLabs Linux iso. When I'm on the beta stage of this work, I'll try to get my old netbook back to life, and take a look at the issue. It's got touch screen, unfortunately broken. :/
A similar issue affects scrolling by grabbing the scrollbar with the mouse: when I release the bar, the drawer closes. Even though the aformentioned issue is related to how gtk handles touch swiping, I think the button-release-event part could benefit from a little rework.
If you just want to close the window, without touching the keyboard, it's convenient to be able to just click outside icons.
resultWindow.Connect("button-release-event", func(sw *gtk.ScrolledWindow, e *gdk.Event) bool {
btnEvent := gdk.EventButtonNewFromEvent(e)
if btnEvent.Button() == 1 || btnEvent.Button() == 3 {
if !*resident {
gtk.MainQuit()
} else {
restoreStateAndHide()
}
return true
}
return false
})
For this not to happen on drag end, we could restrict the action to just the right mouse button. What do you think?
Should be "RMB" above. :) @lheimbs, could you build from the issue36
branch and tell me if it helps?
I just tried it and works nicely both while touch swiping and grabbing the scrollbar with the mouse. Thanks!
Very well. I need to wait some time before releasing, as there were too many releases lately. :) Thanks for testing!
Sounds great! You might want to advertise this feature in the README though, so users aren't surprised to see the drawer disappear.
Yes, I will. This will be mentioned in release notes, though, but who reads them?
Describe the bug
When swiping up/down on a touchscreen enabled device the drawer does scroll down while the scrolling action is in progress but immediately exits upon lifting the finger from the touchscreen. Essentially, at the point where the pointer is at the end of the touch action a mouse click is done, which either opens the app the pointer is on or quits the drawer.
To Repoduce
Steps to reproduce the behavior:
Expected behavior
A swiping action should not result in a mouse click. I realize this might be difficult to reproduce without a touch device so i'd happily help to debug this if you are interested in making this work on a touchscreen.
Incidentally, the
nwggrid
works as expectedDesktop (please complete the following information):
go version go1.17.5 linux/amd64
gtk-layer-shell 0.6.0-1
Additional context