diff --git a/bin/nwg-drawer b/bin/nwg-drawer index 5d654c5..d76b8c7 100755 Binary files a/bin/nwg-drawer and b/bin/nwg-drawer differ diff --git a/main.go b/main.go index 3a0d778..050790d 100644 --- a/main.go +++ b/main.go @@ -365,9 +365,7 @@ func main() { resultWindow, _ = gtk.ScrolledWindowNew(nil, nil) resultWindow.SetEvents(int(gdk.ALL_EVENTS_MASK)) resultWindow.SetPolicy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) - /*resultWindow.Connect("enter-notify-event", func() { - cancelClose() - })*/ + resultWindow.Connect("button-release-event", func(sw *gtk.ScrolledWindow, e *gdk.Event) bool { btnEvent := gdk.EventButtonNewFromEvent(e) if btnEvent.Button() == 1 || btnEvent.Button() == 3 { @@ -459,17 +457,17 @@ func restoreStateAndHide() { timeStart1 := time.Now() win.Hide() - // 1. clear search + // clear search searchEntry.SetText("") - // 2. clear category filter (in gotk3 it means: rebuild, as we have no filtering here) + // clear category filter (in gotk3 it means: rebuild, as we have no filtering here) appFlowBox = setUpAppsFlowBox(nil, "") for _, btn := range catButtons { btn.SetImagePosition(gtk.POS_LEFT) btn.SetSizeRequest(0, 0) } - // 3. scroll to the top + // scroll to the top resultWindow.GetVAdjustment().SetValue(0) t := time.Now() diff --git a/tools.go b/tools.go index 741ec34..c1d06a5 100644 --- a/tools.go +++ b/tools.go @@ -27,19 +27,6 @@ func wayland() bool { return os.Getenv("WAYLAND_DISPLAY") != "" || os.Getenv("XDG_SESSION_TYPE") == "wayland" } -/* -Window leave-notify-event event quits the program with glib Timeout 500 ms. -We might have left the window by accident, so let's clear the timeout if window re-entered. -Furthermore - hovering a widget triggers window leave-notify-event event, and the timeout -needs to be cleared as well. -*/ -/*func cancelClose() { - if src > 0 { - glib.SourceRemove(src) - src = 0 - } -}*/ - func createPixbuf(icon string, size int) (*gdk.Pixbuf, error) { iconTheme, err := gtk.IconThemeGetDefault() if err != nil { @@ -367,7 +354,7 @@ func parseDesktopFiles(desktopFiles []string) string { if entry.NoDisplay { hidden++ // We still need hidden entries, so `continue` is disallowed here - // Fixes introduced in #19 + // Fixes bug introduced in #19 } id2entry[entry.DesktopID] = entry @@ -569,13 +556,6 @@ func launch(command string, terminal bool) { } else { gtk.MainQuit() } - - /*go cmd.Run() - - glib.TimeoutAdd(uint(150), func() bool { - gtk.MainQuit() - return false - })*/ } func open(filePath string, xdgOpen bool) { diff --git a/uicomponents.go b/uicomponents.go index c4ff2c6..b4e4e7f 100644 --- a/uicomponents.go +++ b/uicomponents.go @@ -87,11 +87,6 @@ func setUpPinnedFlowBox() *gtk.FlowBox { item.(*gtk.Widget).SetCanFocus(false) }) } - /*flowBox.Connect("enter-notify-event", func() { - cancelClose() - })*/ - - //flowBox.ShowAll() return flowBox } @@ -110,9 +105,7 @@ func setUpCategoriesButtonBox() *gtk.EventBox { } eventBox, _ := gtk.EventBoxNew() - /*eventBox.Connect("enter-notify-event", func() { - cancelClose() - })*/ + hBox, _ := gtk.BoxNew(gtk.ORIENTATION_HORIZONTAL, 0) eventBox.Add(hBox) button, _ := gtk.ButtonNewWithLabel("All") @@ -291,9 +284,6 @@ func setUpFileSearchResultContainer() *gtk.FlowBox { } flowBox, _ := gtk.FlowBoxNew() flowBox.SetProperty("orientation", gtk.ORIENTATION_VERTICAL) - /*flowBox.Connect("enter-notify-event", func() { - cancelClose() - })*/ fileSearchResultWrapper.PackStart(flowBox, false, false, 10) return flowBox @@ -396,9 +386,6 @@ func setUpSearchEntry() *gtk.SearchEntry { } } }) - /*searchEntry.Connect("focus-in-event", func() { - searchEntry.SetText("") - })*/ return searchEntry }