Skip to content

Conversation

@nouritsu
Copy link

@nouritsu nouritsu commented Jan 4, 2026

Tested on NixOS 25.11 running Hyprland (commit: e5d20b56bcad78df42c9060a5d330274b0a6e510).
A demo can be found on discord.

Drafting this pull request because this will be my first contribution to a non-rust project, it likely needs a lot of changes :)

fix #4009

- add config options to choose a window's layer on wayland
- add wlr-layer-shell-unstable-v1 protocol
- handle layer related config flags (must be set before window creation)

fix raysan5#4009
- add documentation for FLAG_WAYLAND_LAYER_*
@nouritsu nouritsu changed the title [rcore] Add opening window on selected surface [rcore] Allow opening window on selected surface Jan 4, 2026
@nouritsu
Copy link
Author

nouritsu commented Jan 4, 2026

An application of this change is demonstrated by this demo. Woomer is able to spawn itself on the "overlay" layer, allowing it to work as an overlay rather than a forced fullscreen window, this fixes a bug highlighted here.

This change would enable developers to create wallpaper engines, application launchers, logout menus, lockscreens and more using only raylib (on Wayland, anyways)

It may be possible to extend the layering functionality to other compositors, for example

Note that these are not consistent with Wayland or with each-other.

I think it is possible to design non platform specific flags which rely on common functionality, like (names could be better)

  • FLAG_WINDOW_Z_INF which will render the window above every other window
  • FLAG_WINDOW_Z_ZERO which will render the window below every other window

But then we end up losing some functionality for Wayland since there is no way to spawn a window on Layer level 1 (bottom), so raylib applications like status bars may not be on the conventionally correct layer.

@raysan5
Copy link
Owner

raysan5 commented Jan 5, 2026

@nouritsu I'm afriad this change involves lots of changes on GLFW side and should be implemented in GLFW project to avoid overriding it when a new release is issued (if that ever happens...). Also note that raylib.h does not expose platform-specific flags, those flags should be defined in some other way (maybe in config.h).

Also note that now raylib on Wayland has several issues related to windowing system. A future project would be adding a custom rcore_desktop_wayland platform layer to remove GLFW dependency and have more control over this kind of changes but that represents a considerable amount of work...

I'm closing this PR but it can be a reference for anyone with those specific requirements willing to implement it on their forks. Thanks for the reference implementation!

@raysan5 raysan5 closed this Jan 5, 2026
@nouritsu
Copy link
Author

nouritsu commented Jan 5, 2026

@raysan5 That's fair enough. I'm not sure if I currently have the skills or understanding to be able to make the changes you highlighted. However, I'll keep learning and if the opportunity ever presents, contribute to raylib!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[rcore] Allow opening wayland layer surfaces with raylib

2 participants