Giter Site home page Giter Site logo

Examples folder about smithay HOT 6 OPEN

smithay avatar smithay commented on May 25, 2024
Examples folder

from smithay.

Comments (6)

IMFUZZ avatar IMFUZZ commented on May 25, 2024

I also saw that there was a link to some examples in the "Version 0.1 of Smithay" article released on the official website some time ago, but the link is dead since it doesn't exist anymore. (https://github.com/Smithay/smithay/tree/master/examples).

from smithay.

elinorbgr avatar elinorbgr commented on May 25, 2024

We recently moved and fused these examples into an example compositor written using smithay: anvil, which is in the directory with the same name in this repo.

The main reason why we chose to not keep around a few examples additionally to it is that, is that given the current smithay scope is much lower-level compared to wlc or wlroots, a "basic minimal example" needs to be already almost a thousand lines of code.

At this point, the difference between this and an actual reference compositor is pretty small, hence our choice to rather focus on anvil. Granted it could have more comments and documentation, and that's absolutely something that is planned at some point, though our bandwidth is pretty limited and this is lower priority than making things actually work.

Thus, if you are interested, don't hesitate to look at anvil and report whatever is unclear and would need more comments. If you even feel like helping us clarify all this, I'd be happy to answer any questions and/or merge PRs improving anvil's docs. 😉

from smithay.

ddevault avatar ddevault commented on May 25, 2024

I'm not sure you understand how wlroots actually works if you think that Smithay is lower level than it. As far as I can tell Smithay's design is quite similar to wlroots. Honestly until now I thought your approach was reading the wlroots code and making something similar in Rust. Our examples are things like standalone demos of the backends, libinput, output transforms, etc, something I think Smithay would benefit from having as well. Unless you can't actually use any of those features of Smithay alone?

from smithay.

elinorbgr avatar elinorbgr commented on May 25, 2024

from smithay.

ddevault avatar ddevault commented on May 25, 2024

What I mean is that we don't have anything close to wlr_backend_autocreate

For what it's worth, wlr_backend_autocreate basically just picks the Wayland backend if WAYLAND_DISPLAY is set, or the X11 backend if DISPLAY is set, or the DRM+libinput backends if not. Such a function in Smithay would be trivial to add.

As for the renderer abstraction, fair enough. Without something like that, making smaller examples might be too annoying to be worth it.

from smithay.

elinorbgr avatar elinorbgr commented on May 25, 2024

Well, our current status with the "DRM+libinput" backend is that it's still pretty bare-bones, and notably it still requires a fair amount of boilerplate to handle udev correctly. With time we'll get somewhere regarding that, I guess.

So... as a first step, I could try to throw a few winit-based examples, that could only be run as an x11 or wayland client. I still only have that much temporal bandwidth, though.

But yeah, our general design principle is to first integrate as minimal as possible abstractions, and then build new abstractions on top of that. And I feel that we're still too low on backend abstractions to meaningfully be able to present "small examples". But with more time and work, we aim to be able to integrate some of anvil code as proper generic abstractions into smithay, hopefully this would open the door to more meaningful minimal examples.

from smithay.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.