GTK3 with Wayland bugs using WindowTypeHint.DESKTOP, set_keep_below and GLArea

related to this my simple application

download from there - there only cube_lines_shader.py single python script

Tested on Ubuntu 20.10 and OpenSUSE Tumbleweed everything updated.

Maybe im missing something but I see it as bugs:

  1. This code/flags ignored using Wayland:
    window.set_type_hint(Gdk.WindowTypeHint.DESKTOP)
    window.set_keep_below(True)

  2. When used any of the lines above and Gtk.GLArea widget and set
    os.environ['GDK_BACKEND'] = 'x11'
    then FPS in that Gtk.GLArea is very low (1-2 fps)

Testing:

  1. Launch python3 cube_lines_shader.py in Wayland and you see that window will be on top of everything like on this screenshot when in X11 window will be below always.

  2. Edit USE_WAYLAND=True to USE_WAYLAND=False in cube_lines_shader.py, and launch python3 cube_lines_shader.py in Wayland.
    This will force X11 on Wayland and Window correctly will be displayed on “desktop below everything else” but FPS will be very low.

Maybe this is bugs.

Now I’m sure others can add more detail but my understanding is both are somewhat expected behaviour, if nothing else wayland doesn’t have a root/desktop window and set_keep_below is documented to only “work” on X11

if Wayland does not have root/desktop window

then how it work when os.environ['GDK_BACKEND'] = 'x11' is set? it make window below everything
and everything is fine except when using GLArea FPS become “broken”
I tried to override draw event for GLArea, FPS is fine until I call any OpenGL function in draw function.

Because then the app is running under X11 (via XWayland) not Wayland :slight_smile:

Because then the app is running under X11 (via XWayland) not Wayland

if I understand it still Wayland that emulate X11 so Wayland has function to make Window on below everything
if I understand it correctly, can be wrong

No, “Wayland” as a protocol does not have a method for changing the stacking order of a window.

GNOME Shell, as a display server using Wayland, can take X11 surfaces and change their stacking order if they use the X API to do so—but that’s up to GNOME Shell.

1 Like

GNOME Shell, as a display server using Wayland, can take X11 surfaces and change their stacking order if they use the X API to do so—but that’s up to GNOME Shell.

thanks!

if I understand without using X11 I need to communicate with Gnome Shell and make it put my window on below of everything, thanks il look into it tomorrow.

There’s no such mechanism exposed to Wayland clients. Wayland clients do not have access to the stacking order as maintained by the window manager, and do not have the API to influence that stacking order either.

That functionality is only available to the window manager, and exposed to the user through the UI controls of the window manager. Client applications cannot do that.

Thanks for answers.

I thought I can get window list from Gnome Shell and manipulate with its focus event (ofc its very bad to do it, but if ther no other way to do it…idk)

I dont want to make useless flood, last question I think:
Gnome Shell and/or Wayland does not have any way to make Window below everything?

As a user command? No. There’s only “always on top”.

Programmatically? No, as I already told you.

If you want to create an “animated background” for GNOME that works on every display server, and that does not get throttled by the window manager, you will need to write it as a Shell extension, not as a separate client application.

I need OpenGL or Vulkan shaders support, I did not saw any examples of using shaders in Gnome Shell extensions

I tried to search and did not found any info of using OpenGL/Vulkan in extensions

GNOME Shell is a GL-based compositor, but you don’t use GL directly: you can use the Cogl API, and the Clutter effects API.

GNOME Shell already uses GLSL shaders for some of its rendering, so you can look at those.

1 Like

thank you!
il look into it

I think it related to the topic:
https://wiki.gnome.org/Projects/GnomeShell/Extensions/StepByStepTutorial
link in the end
All code to download or modify
goes nowhere, this user does not exist on github

valid link I think is
https://github.com/HDBaggy/StepByStepTutorial

Projects/GnomeShell/Extensions/StepByStepTutorial - GNOME Wiki!

This is a very old tutorial, as the notice at the top says. Please visit Extensions | GNOME JavaScript instead and request (or contribute) additional tutorials at Issues · Evan Welsh / gjs-guide · GitLab.

Documentation for Cogl and Clutter for JavaScript bindings used in extensions can be found at https://gjs-docs.gnome.org/.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.