check if window scrolled #110

This commit is contained in:
piotr
2024-02-06 03:21:42 +01:00
parent 631b651eed
commit 6b39eba14c
2 changed files with 19 additions and 2 deletions

View File

@@ -264,11 +264,18 @@ func flowBoxButton(entry desktopEntry) *gtk.Button {
r := substring(desc, 0, 117)
desc = fmt.Sprintf("%s…", string(r))
}
button.Connect("button-press-event", func() {
beenScrolled = false
})
button.Connect("button-release-event", func(btn *gtk.Button, e *gdk.Event) bool {
btnEvent := gdk.EventButtonNewFromEvent(e)
if btnEvent.Button() == 1 {
launch(exec, terminal)
return true
if !beenScrolled {
launch(exec, terminal)
return true
}
} else if btnEvent.Button() == 3 {
pinItem(ID)
return true