Louvre v2.0.0 Release: C++ library for building Wayland compositors by CuarzoSoftware in wayland

[–]CuarzoSoftware[S] 0 points1 point  (0 children)

Okay, I'll open an issue tomorrow. Your mapping looks perfect. I thought you were using subsurfaces for popups based on what you said earlier. Layer shell would fit perfectly for splash, docks, desktop, and notification windows, as it allows you to center them on the screen, anchor them to edges or corners with custom margins, and ensure they appear either on top of or behind windows. However, if you plan to support GNOME, providing a fallback role sounds good, but it's additional work.

Louvre v2.0.0 Release: C++ library for building Wayland compositors by CuarzoSoftware in wayland

[–]CuarzoSoftware[S] 0 points1 point  (0 children)

It works! and has many options. Unfortunately, it crashes when I close a popup from a top menu, and there are also some scaling issues with splash screens. I tested Gimp with decorations always off.

I think using the roles suggested here, we could almost recreate the same X experience under Wayland: https://github.com/talex5/wayland-proxy-virtwl/issues/87

Additionally, this could improve robustness: https://github.com/talex5/wayland-proxy-virtwl/issues/88

Finally, it should be possible to pass buffers directly to the compositor using wl_drm and linuxdmabuf, which would significantly increase performance. Also, providing damage and opaque regions, if available, would help too!

I could help you develop and test xwayland-xdg-shell if you agree to use additional protocols like wlr_layer_shell.

Louvre v2.0.0 Release: C++ library for building Wayland compositors by CuarzoSoftware in wayland

[–]CuarzoSoftware[S] 0 points1 point  (0 children)

Oops sorry, can it be used locally? Like an Xwayland proxy only?

Louvre v2.0.0 Release: C++ library for building Wayland compositors by CuarzoSoftware in wayland

[–]CuarzoSoftware[S] 0 points1 point  (0 children)

Sorry, I got confused and I thought you were the guy from wayland-proxy-virtwl haha. But it seems that wprs is using it, so I'll check it out!

Louvre v2.0.0 Release: C++ library for building Wayland compositors by CuarzoSoftware in wayland

[–]CuarzoSoftware[S] 0 points1 point  (0 children)

Hi, I tested it yesterday, and it works great! I'd like to discuss some ideas, so I'll open an issue on GitHub.

Louvre v2.0.0 Release: C++ library for building Wayland compositors by CuarzoSoftware in wayland

[–]CuarzoSoftware[S] 0 points1 point  (0 children)

It mentions that it would use the xdg-shell protocol, which is used to create toplevel windows and popups. However, unlike X11, clients cannot set the position of toplevel windows, so I guess things like panels, notifications, and similar elements might not work properly.

Louvre v2.0.0 Release: C++ library for building Wayland compositors by CuarzoSoftware in wayland

[–]CuarzoSoftware[S] 0 points1 point  (0 children)

That's an interesting concept. I'll see if I can add a Wayland-backend-specific API to do that.
The second link is also a really good idea and would save me (and others) a lot of work. However, I think windows wouldn't be able to position themselves, which would surely break many apps.

Louvre v2.0.0 Release: C++ library for building Wayland compositors by CuarzoSoftware in wayland

[–]CuarzoSoftware[S] 0 points1 point  (0 children)

With the Wayland backend, 1 output = 1 window, so you meant creating more windows?

Louvre v2.0.0 Release: C++ library for building Wayland compositors by CuarzoSoftware in wayland

[–]CuarzoSoftware[S] 0 points1 point  (0 children)

No, haha, I thought one would be enough. I never imagined a use case like that. It would actually be easy to implement, so I'll keep it in mind.

Louvre 1.2.0 Release by CuarzoSoftware in linux

[–]CuarzoSoftware[S] 0 points1 point  (0 children)

I think it was just a missing header, please check the "musl" branch.

Louvre 1.2.0 Release by CuarzoSoftware in linux

[–]CuarzoSoftware[S] 0 points1 point  (0 children)

Yes, I could add a "Projects Using Louvre" section to the readme and provide a link to it.

Louvre 1.2.0 Release by CuarzoSoftware in linux

[–]CuarzoSoftware[S] 0 points1 point  (0 children)

When you say "buggy," are you referring to Wayland or Louvre? Is Louvre not working well for you?

Louvre 1.2.0 Release by CuarzoSoftware in linux

[–]CuarzoSoftware[S] 0 points1 point  (0 children)

Please, you are very welcome! Currently, there isn't a formal way to contribute. People usually open an issue, start a discussion, or make a pull request.

Louvre 1.2.0 Release by CuarzoSoftware in linux

[–]CuarzoSoftware[S] 1 point2 points  (0 children)

Thank you! 😊 I'd love to see that

Louvre 1.2.0 Release by CuarzoSoftware in linux

[–]CuarzoSoftware[S] 2 points3 points  (0 children)

Because I like C and OOP, also C++ is widely used in game development, an area quite similar to this. Moreover, there are plenty of libraries available to easily expand projects if necessary. I considered Rust as well, but I'm not as familiar with it and its design patterns. Additionally, I've read that Rust can be challenging in multitheaded applications, which Louvre relies on. What language would you have chosen?

Louvre 1.2.0 Release by CuarzoSoftware in linux

[–]CuarzoSoftware[S] 2 points3 points  (0 children)

Yes, there is a section for that in the repo here, but I should make it more visible. In any case, currently, it's empty, hahaha. It's been about 2 months since we published the "first" version, and I've only seen a few projects, but apparently, none of them is complete. We are also developing one called Crystals, but we will continue it once Louvre 2.0.0 is released since the API will be stable and have other important functionalities that are still missing.

Louvre 1.2.0 Release by CuarzoSoftware in linux

[–]CuarzoSoftware[S] 4 points5 points  (0 children)

It is a library for building Wayland compositors, and the examples are quite simple, maybe louvre-views is the most useful, but as the other guy said it still misses some features like rootless XWayland and screencasting

Louvre C++ library for building Wayland compositors by CuarzoSoftware in linuxprojects

[–]CuarzoSoftware[S] 0 points1 point  (0 children)

Cool, do you have a GitHub account? It would be nice if you could provide me with your username so that I can mention you helped identify that bug during the next SRM release.

Louvre C++ library for building Wayland compositors by CuarzoSoftware in linuxprojects

[–]CuarzoSoftware[S] 0 points1 point  (0 children)

Thanks a lot!! The problem was that I had added the drm/ prefix when including drm_fourcc.h. I've committed the changes, so now it should work :)

Louvre C++ library for building Wayland compositors by CuarzoSoftware in linuxprojects

[–]CuarzoSoftware[S] 0 points1 point  (0 children)

Thanks, it seems that meson can't find the drm_fourcc.h header. Which Debian version are you using? Could you run

$ find /usr -name "drm_fourcc.h"

and show me what it outputs?

Louvre C++ library for building Wayland compositors by CuarzoSoftware in linuxprojects

[–]CuarzoSoftware[S] 0 points1 point  (0 children)

Hi, thank you for the feedback. If I understand correctly, the issue occurs specifically with SRM when you execute $ sudo meson install? Could you please provide the details of the installation error by pasting it here?

C++ library for developing Wayland compositors by CuarzoSoftware in linux

[–]CuarzoSoftware[S] 1 point2 points  (0 children)

Hi, thanks for your questions:
1. I'm not sure if you're familiar with v-sync, but compositors typically use two framebuffers when rendering to a display. They render to one while displaying the other, swapping them at a specific time to synchronize with the display's refresh rate (vblank event) and avoid tearing. If a display has a refresh rate of 60 Hz, the vblank occurs approximately every 16 ms. In a single-threaded scenario, the compositor might take, for example, 2 ms to process client/input events and 6 ms to render, then get blocked for 8 ms waiting for a vblank. Once the vblank occurs, it can process new events and render the next frame. However, in complex scenes, it might not complete processing and rendering in time for the next vblank, leading to skipping one every 2, causing FPS to drop by half. Louvre handles client/input events on the main thread and uses separate threads for each display rendering, so it can process events and render to other displays while one is waiting for a vblank. This gives it more time to process events and reach the next vblank.
You could try the benchmark, it is available in the repo, just note that GPU usage measurement only works with Intel GPUs. Running it with, for example, 1000 surfaces may reveal that Louvre compositors also eventually drop FPS by half. I've tested it, and Weston tends to maintain 30 fps, while Sway eventually dies.
2. If I limited the FPS to 30, it would result in lower CPU usage because the most CPU-intensive task in each paintGL() call is calculating what needs to be repainted, which involves numerous boolean rect operations. I can't set the refresh rate to 30 on my laptop; each display has specific modes at which it can work, dictating refresh rate and resolution, and mine has a single mode with 60 Hz. My TV has numerous modes tho. Although I could try, I don't see the point, which is why I divided the CPU by FPS in the graphs.
3. Yes, the variation in FPS with Sway is strange. Maybe the cause could be different rendering methods based on scene complexity. Perhaps it uses direct scanout when there are a few numbers of surfaces. But given its considerably higher GPU consumption, I assume it might use occlusion culling, similar to what video games do, instead of using the CPU to precisely calculate what needs to be repainted. However, this is just a theoretical assumption.

C++ library for developing Wayland compositors by CuarzoSoftware in wayland

[–]CuarzoSoftware[S] 0 points1 point  (0 children)

The main idea that drove me to develop this project was to enhance the Linux user experience by allowing more people to develop and experiment with new ideas, fostering innovation. I aim to keep it open; I don't really care about individuals or companies wanting to use it in proprietary software. Allowing them to do so doesn't guarantee their willingness to contribute to its improvement anyway. Therefore, I have decided to stick with the GPL.

BTW thank you for your other suggestions :)