Aylur / astal

Building blocks for creating custom desktop shells
https://aylur.github.io/astal/
GNU Lesser General Public License v2.1
220 stars 23 forks source link

Gtk4 layer shell not supported #76

Closed vafu closed 2 days ago

vafu commented 2 days ago

Describe the bug With minimal setup created with agsv2 using gtk4 running the app causes window.vala:52: can not initialize layer shell on window: layer shell not supported

To Reproduce

App.start({ main() { const monitor = App.get_monitors()[0] new Astal.Window({ gdkmonitor: monitor, exclusivity: Astal.Exclusivity.EXCLUSIVE, anchor: Astal.WindowAnchor.TOP | Astal.WindowAnchor.LEFT | Astal.WindowAnchor.RIGHT, application: App, child: new Gtk.Button({ label: "button" }) }) }, })

- `ags run`

**Expected behavior**
button widget shown

**Additional context**

(gjs:181156): CRITICAL : 20:21:53.322: window.vala:52: can not initialize layer shell on window: layer shell not supported tip: running from an xwayland terminal can cause this, for example VsCode (gjs:181156): CRITICAL : 20:21:53.322: window.vala:52: can not set gdkmonitor on window: layer shell not supported tip: running from an xwayland terminal can cause this, for example VsCode (gjs:181156): CRITICAL : 20:21:53.322: window.vala:52: can not set exclusivity on window: layer shell not supported tip: running from an xwayland terminal can cause this, for example VsCode (gjs:181156): CRITICAL : 20:21:53.322: window.vala:52: can not set anchor on window: layer shell not supported tip: running from an xwayland terminal can cause this, for example VsCode


running from foot ^
vafu commented 2 days ago

LD_PRELOAD=/usr/lib/libgtk4-layer-shell.so ags run fixes it, I assume that should be ensured on ags side?

Aylur commented 2 days ago

There is a --gtk4 flag on the run command which does it for you. Unfortunately preloading can't be done in code, so in case of bundling you'll still have to LD_PRELOAD