Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Wayland] Shows desktop in a window rather than in the background #16

Open
probonopd opened this issue Nov 17, 2023 · 4 comments
Open
Labels
wayland Wayland breaks working software by mandating new concepts, leaving it to others to fix the breakage

Comments

@probonopd
Copy link
Owner

probonopd commented Nov 17, 2023

Raspberry Pi OS, when running in Wayland (as it is the default) shows the desktop in a window rather than in the background.

image

In the Xorg session it works correctly.

Some possibly relevant details:

$ env | grep way
WLR_XWAYLAND=/usr/bin/xwayland-xauth
DESKTOP_SESSION=LXDE-pi-wayfire
XDG_SESSION_DESKTOP=LXDE-pi-wayfire
XDG_SESSION_TYPE=wayland
WAYLAND_DISPLAY=wayland-1
GDMSESSION=LXDE-pi-wayfire
WAYFIRE_CONFIG_FILE=/home/user/.config/wayfire.ini

Someone knowledgable in Wayland would need to look at this.

@probonopd probonopd added the wayland Wayland breaks working software by mandating new concepts, leaving it to others to fix the breakage label Nov 17, 2023
@probonopd
Copy link
Owner Author

probonopd commented Nov 17, 2023

It seems like "shell" is Wayland terminology for desktop environment components such as desktop backgrounds, panels, the menu, etc.

https://drewdevault.com/2018/07/29/Wayland-shells.html

The layer-shell is organized into four discrete layers: background, bottom, top, and overlay, which are rendered in that order. Between bottom and top, application windows are displayed. A wallpaper client might choose to go in the bottom layer, while a notification could show on the top layer, and a panel on the bottom layer.

There seems to be a Qt specific implementation:
https://github.com/KDE/layer-shell-qt

Related:

@probonopd
Copy link
Owner Author

probonopd commented Nov 18, 2023

It seems like something along the lines of

https://github.com/johanmalm/tint/blob/2b90a2802cace702c5f848d52adc1cecc13684db/panel.cpp#L15-L42

would need to be done to use the layer shell protocol.
The downside is that we then would have Wayland specific dependencies in Filer, but we could #ifdef them.

#ifdef HAVE_X11
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#endif
#ifdef HAVE_WAYLAND
#include <LayerShellQt/shell.h>
#include <LayerShellQt/window.h>
#endif

which would have the advantage that we possibly wouldn't need to pull Wayland specific code or dependencies into Filer. The downside woud be that it would only work in Wayfire (and Wayfire uses some Gnome stack instead of Qt, which we don't want).

Simply adding

(...)
// Wayland
#include <LayerShellQt/Window>
#include <LayerShellQt/Shell>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    // Wayland
    LayerShellQt::Shell::useLayerShell();
(...)

in main.cpp results all Filer "windows" (including even menus) to be fullscreen and in front of any other windows. This is clearly not what we want! Why is this happening? It should leave all "windows" alone except for the "window" that shall be rendered on the desktop.

@probonopd
Copy link
Owner Author

probonopd commented Nov 26, 2023

If we "just" want to enable Wayfire (a lightweight wlroots-based Wayland compositor used e.g., by Raspberry Pi OS) to run Filer properly, we might be able to do something like @marcusbritanicus has done for LXQt

https://gitlab.com/wayfireplugins/lxqt-desktop-shell/

Not clear how to even build that, asked at https://gitlab.com/wayfireplugins/lxqt-desktop-shell/-/issues/6 and asked more generically over at https://gitlab.com/wayfireplugins/lxqt-desktop-shell/-/issues/7.

@marcusbritanicus
Copy link

@probonopd I've commented on both the issues. Feel free to reach out if you have any other queries. I think it would be easier if you could join me on matrix or discord. Since you're developing a DE (or DE components), it would be great to have you in the room. 🙂

  1. DesQ: Matrix Discord
  2. DFL Matrix Discord

DesQ is my effort to build a Qt-based DE with Wayfire as the compositor
DFL stands for Desktop Framework Libraries, a bunch of light-weight pure Qt libraries useful in building a Qt based DE. This is the equivalent of KDE's Frameworks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wayland Wayland breaks working software by mandating new concepts, leaving it to others to fix the breakage
Projects
None yet
Development

No branches or pull requests

2 participants