wmww / gtk-layer-shell

A library to create panels and other desktop components for Wayland using the Layer Shell protocol
GNU General Public License v3.0
323 stars 16 forks source link

Some errors with gtk 3.24.26 #113

Closed charlie39 closed 2 years ago

charlie39 commented 2 years ago

Arch linux is on gtk 3.24.30 and perhaps that's why such issues are being reported. I am facing this issue and also someone else reported the same there. So i build version 3.24.26 with the old version of PKGBUILD . And now i am getting

Gdk-Message: 01:27:01.209: Error 2 (No such file or directory) dispatching to Wayland display.

. I get this while launching waybar which uses gtk layer shell. Just reporting This is the output of waybar -l trace

[2021-11-03 01:28:49.574] [debug] GTK widget tree:
window#waybar.background.eDP-1.:dir(ltr)
  decoration:dir(ltr)
  box.horizontal:dir(ltr)
    box.horizontal.modules-left:dir(ltr)
      widget:dir(ltr)
        box#tags.horizontal:dir(ltr)
          button.flat.text-button:dir(ltr)
            label:dir(ltr)
          button.flat.text-button:dir(ltr)
            label:dir(ltr)
          button.flat.text-button:dir(ltr)
            label:dir(ltr)
          button.flat.text-button:dir(ltr)
            label:dir(ltr)
          button.flat.text-button:dir(ltr)
            label:dir(ltr)
    box.horizontal.modules-center:dir(ltr)
    box.horizontal.modules-right:dir(ltr)
      widget:dir(ltr)
        label#mpd:dir(ltr)
      widget:dir(ltr)
        label#pulseaudio:dir(ltr)
      widget:dir(ltr)
        label#network:dir(ltr)
      widget:dir(ltr)
        label#cpu:dir(ltr)
      widget:dir(ltr)
        label#memory:dir(ltr)
      widget:dir(ltr)
        label#temperature:dir(ltr)
      widget:dir(ltr)
        label#backlight:dir(ltr)
      widget:dir(ltr)
        label#battery:dir(ltr)
      widget:dir(ltr)
        label#clock:dir(ltr)

Gdk-Message: 01:28:49.574: Error 2 (No such file or directory) dispatching to Wayland display.

This seems related to gtk layer shell and gtk so reporting here

wmww commented 2 years ago

Need to release a new version with official support for GTK 3.24.30, but I doubt that;s the problem. gtk-layer-demo doesn't have any problems for me. I tried to build Waybar to reproduce, but hit https://github.com/Alexays/Waybar/issues/1306.

charlie39 commented 2 years ago

@wmww I wanted to get to the bottom of the 'incompatibilies' between gtk layer shell and gtk as you mentioned in the compatibility.md What is the underlying problem that requires gtk layer shell to hack around to make it compatible with gtk ? I am not into gtk programming but use some tools to depends on it and I wanted to read about if there's any docs you can refer. Why can't gtk make it smooth for gtk layer shell ? Is not one of those standard protocol ? What do others use instead of gtk layer shell ? Is gtk-layer-shell an alternative to xdg-deskyop-portal?

wmww commented 2 years ago

GTK Layer Shell is not an alternative to xdg-deskyop-portal. It's an implementation of the Layer Shell Wayland protocol. As far as I know there are only two implementations of Layer Shell for GTK, this and the Purism one (which doesn't support popups as well, and AFAIK isn't intended for use outside of their projects).

Layer Shell is needed for making Wayland surfaces behave like panels, notifications, desktop backgrounds, etc. Other GTK apps don't use it and GTK doesn't officially support it because they don't need to do these things. The GNOME/GTK devs are generally of the opinion that these things should be provided by the shell instead of applications, so they do not care much to supports protocols like Layer Shell.

The compatibility issues are because gtk-layer-shell reads and manipulates private GTK structures. If these structures change, it may cause a crash. We support all previous GTK versions, but can't guarantee we work with unknown future versions. In practice the structures we rely on rarely change, and up though current git master there have been no changes in GTK that should break gtk-layer-shell v0.6.0. Some docs are here: https://github.com/wmww/gtk-layer-shell/blob/master/compatibility.md.

wmww commented 2 years ago

It seems they've concluded https://github.com/Alexays/Waybar/issues/1280 is not an issue with gtk-layer-shell, closing.

charlie39 commented 2 years ago

... The GNOME/GTK devs are generally of the opinion that these things should be provided by the shell ...

By shell they mean a GUI shell like gnome shell I assume. So is this why this only concerns with those who doesn't use a GUI shell , like the standalone window manager put there. Is that correct ?

Yes the waybar issue seems to be with their official release. The git version from AUR is working fine , thanks

charlie39 commented 2 years ago

Also, what would be the equivalent of layer shell in X ? Or is this something new in Wayland ?

wmww commented 2 years ago

By shell they mean a GUI shell like gnome shell I assume. So is this why this only concerns with those who doesn't use a GUI shell , like the standalone window manager put there. Is that correct ?

Yes

Also, what would be the equivalent of layer shell in X ? Or is this something new in Wayland ?

I believe there's something called struts in X11 which can be used to accomplish a similar thing. An app would need to link to an X11 library, and implementing the behavior would probably be more complicated than using GTK Layer Shell.