nwg-piotr / nwg-menu

MenuStart plugin to nwg-panel, also capable of working standalone
MIT License
67 stars 4 forks source link

Non Gdk X11 support for nwg-menu #18

Closed oniGino closed 1 year ago

oniGino commented 1 year ago

Really enjoy this app however in my testing against non X11 environments I found this app still requires GDKX11 in order to work (Gtk+3.x with X11 support enabled)

Please consider some alternatives to this, it appears its being called in via gotk3/gdk

I'm not a go developer unfortunately so I don't have any patches to propose, I wonder if gtk-layer-shell has some potential alternatives for this? it appears its being used to try and fetch the menu position on the screen.

Thanks

nwg-piotr commented 1 year ago

I know nothing about X11 dependencies of this project. Possibly something indirect? One way or another, it's based on the gotk3 library, and there's no way to change it.

oniGino commented 1 year ago

the problem appears to be in gotk3 - I found a tag "no_x11" which will build gotk3 without requiring gdk/gdkx.h present. However I'm unclear on how your package can conditionally pass this tag to build gotk3.

for context here is the error

/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/b060/_pkg_.a -trimpath "$WORK/b060=>" -p github.com/gotk3/gotk3/pango -lang=go1.14 -installsuffix shared -buildid w9VxCyHTNRjVu88_XytO/w9VxCyHTNRjVu88_XytO -goversion go1.21.3 -c=4 -shared -nolocalimports -importcfg $WORK/b060/importcfg -pack $WORK/b060/_cgo_gotypes.go $WORK/b060/pango-attributes.cgo1.go $WORK/b060/pango-attributes_since_1_44.cgo1.go $WORK/b060/pango-context.cgo1.go $WORK/b060/pango-font.cgo1.go $WORK/b060/pango-glyph-item.cgo1.go $WORK/b060/pango-glyph.cgo1.go $WORK/b060/pango-gravity.cgo1.go $WORK/b060/pango-layout.cgo1.go $WORK/b060/pango-types.cgo1.go $WORK/b060/pango.cgo1.go $WORK/b060/pangocairo.cgo1.go $WORK/b060/_cgo_import.go
cd /var/tmp/portage/gui-apps/nwg-menu-0.1.1/work/go-mod/github.com/gotk3/gotk3@v0.6.0/pango
/usr/lib/go/pkg/tool/linux_amd64/pack r $WORK/b060/_pkg_.a $WORK/b060/_x001.o $WORK/b060/_x002.o $WORK/b060/_x003.o $WORK/b060/_x004.o $WORK/b060/_x005.o $WORK/b060/_x006.o $WORK/b060/_x007.o $WORK/b060/_x008.o $WORK/b060/_x009.o $WORK/b060/_x010.o $WORK/b060/_x011.o $WORK/b060/_x012.o # internal
/usr/lib/go/pkg/tool/linux_amd64/buildid -w $WORK/b060/_pkg_.a # internal
cp $WORK/b060/_pkg_.a /var/tmp/portage/gui-apps/nwg-menu-0.1.1/temp/go-build/25/255fd5ffbcb3c1fbaaff9fb97d546ed4954ff60b8b3387b441095817e6e8fbfe-d # internal
# github.com/gotk3/gotk3/gdk
../go-mod/github.com/gotk3/gotk3@v0.6.0/gdk/screen_x11.go:7:11: fatal error: 'gdk/gdkx.h' file not found
 #include <gdk/gdkx.h>
          ^~~~~~~~~~~~
nwg-piotr commented 1 year ago

Well, I don't think I should dig into it. Most people still need X, including myself (I use JetBrains Java-based IDEs). If it's important to you, try to build locally.

oniGino commented 1 year ago

FYI, yes the problem isn't your code but gotk3, I agree this isn't a popular route, but I think it will rise as an issue again in a year or two when other begin to drop X11. I filed https://github.com/gotk3/gotk3/issues/905 but I doubt it will see much action for a while

feel free to close here, thanks for your quick response.

nwg-piotr commented 1 year ago

Yes, they don't care much. Probably they think that GTK3 is dead. But I'm going to stick to it as long as possible, since libadwaita sucks.