Giter Site home page Giter Site logo

smithay-egui's Introduction

Smithay

Crates.io docs.rs Build Status Join the chat on matrix at #smithay:matrix.org Join the chat via bridge on #smithay on libera.chat

A smithy for rusty wayland compositors

Goals

Smithay aims to provide building blocks to create wayland compositors in Rust. While not being a full-blown compositor, it'll provide objects and interfaces implementing common functionalities that pretty much any compositor will need, in a generic fashion.

It supports the core Wayland protocols, the official protocol extensions, and some external extensions, such as those made by and for wlroots and KDE

Also:

  • Documented: Smithay strives to maintain a clear and detailed documentation of its API and its functionalities. Compiled documentations are available on docs.rs for released versions, and here for the master branch.
  • Safety: Smithay will target to be safe to use, because Rust.
  • Modularity: Smithay is not a framework, and will not be constraining. If there is a part you don't want to use, you should not be forced to use it.
  • High-level: You should be able to not have to worry about gory low-level stuff (but Smithay won't stop you if you really want to dive into it).

Anvil

Smithay as a compositor library has its own sample compositor: anvil.

To get informations about it and how you can run it visit anvil README

Other compositors that use Smithay

  • Cosmic: Next generation Cosmic desktop environment
  • Catacomb: A Wayland Mobile Compositor
  • MagmaWM: A versatile and customizable Wayland Compositor
  • Niri: A scrollable-tiling Wayland compositor
  • Strata: A cutting-edge, robust and sleek Wayland compositor
  • Pinnacle: A WIP Wayland compositor, inspired by AwesomeWM
  • Sudbury: Compositor designed for ChromeOS
  • wprs: Like xpra, but for Wayland, and written in Rust.

System Dependencies

(This list can depend on features you enable)

  • libwayland
  • libxkbcommon
  • libudev
  • libinput
  • libgbm
  • libseat
  • xwayland

Contact us

If you have questions or want to discuss the project with us, our main chatroom is on Matrix: #smithay:matrix.org.

smithay-egui's People

Contributors

dragonnn avatar drakulix avatar ids1024 avatar songww avatar vixea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

smithay-egui's Issues

example integrate crashed.

os: Debian Testing
wm: cosmic-comp
teminal: kitty
command: cargo run --example integrate
last log:

Jan 06 15:57:16.143 DEBG [GL] Buffer detailed info: Buffer object 4 (bound to GL_ELEMENT_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations., smithay_module: renderer_gles2, smithay_module: backend_winit
Jan 06 15:57:16.144 DEBG [GL] Buffer detailed info: Buffer object 2 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations., smithay_module: renderer_gles2, smithay_module: backend_winit
Jan 06 15:57:16.148 ERRO [EGL] 0x300d (BAD_SURFACE) eglStreamFlushNV: EGL_BAD_SURFACE error: In eglSwapBuffers: Invalid EGLSurface (0x5589411d4151)
, backend: egl
Jan 06 15:57:16.149 ERRO [EGL] 0x3003 (BAD_ALLOC) eglCreatePlatformWindowSurfaceEXT: EGL_BAD_ALLOC error: In internal function: Additional INFO may be available
, backend: egl
Error: The context has been lost, it needs to be recreated: EGL failed to allocate resources for the requested operation.

Integrate with data_device

egui supports copy&paste operations, we want to (optionally?) integrate with smithay::wayland::data_device to copy/paste text from/into egui and between clients.

Handle text input

smithay-egui currently just forwards keycodes to egui, because that is the only thing we are getting from smithay.

To fix this, we have to mimic, what a wayland-client would do and initialize xkbcommon and track the keyboard state based on the events we get from smithay.

sctk already has this implemented and might be a good starting point to copy over some code:

SeatHandler trait not satisfied

I don't understand why I am getting these errors.
I am copying the example but getting compilation errors

But I don't get it, EguiState does implement those.
All I can imagine is that rust can't find a link between mu integration::State and EguiState, which would cause the generics of the impl blocks to fail.

Any clue as to what I can do to fix this?

error[E0277]: the trait bound `EguiState: KeyboardTarget<integration::State>` is not satisfied
   --> launcher/src/integration.rs:34:26
    |
34  |     type KeyboardFocus = EguiState;
    |                          ^^^^^^^^^ the trait `KeyboardTarget<integration::State>` is not implemented for `EguiState`
    |
    = help: the following other types implement trait `KeyboardTarget<D>`:
              WlSurface
              smithay::desktop::LayerSurface
              smithay::desktop::Window
              smithay::xwayland::X11Surface
note: required by a bound in `smithay::input::SeatHandler::KeyboardFocus`
   --> /root/.cargo/git/checkouts/smithay-b5a338d5236320f6/d8600f2/src/input/mod.rs:129:25
    |
129 |     type KeyboardFocus: KeyboardTarget<Self> + 'static;
    |                         ^^^^^^^^^^^^^^^^^^^^ required by this bound in `SeatHandler::KeyboardFocus`

error[E0277]: the trait bound `EguiState: PointerTarget<integration::State>` is not satisfied
   --> launcher/src/integration.rs:35:25
    |
35  |     type PointerFocus = EguiState;
    |                         ^^^^^^^^^ the trait `PointerTarget<integration::State>` is not implemented for `EguiState`
    |
    = help: the following other types implement trait `PointerTarget<D>`:
              WlSurface
              smithay::desktop::LayerSurface
              smithay::desktop::Window
              smithay::xwayland::X11Surface
note: required by a bound in `smithay::input::SeatHandler::PointerFocus`
   --> /root/.cargo/git/checkouts/smithay-b5a338d5236320f6/d8600f2/src/input/mod.rs:131:24
    |
131 |     type PointerFocus: PointerTarget<Self> + 'static;
    |                        ^^^^^^^^^^^^^^^^^^^ required by this bound in `SeatHandler::PointerFocus`

Change the renderer

Currently we using egui_glow to render egui inside smithay.

This has some short-comings, because the logic is backwards. egui_glow expects the Painter to be initialized once and stores the Context internally. We don't have a single context in smithay, but rather every time the ui gets rendered a different context might be used. So instead of re-initializing glow every single render call, we want to utilize the context provide inside run via the Renderer.

That probably means just re-implementing the egui_glow using raw GL inside smithay-egui.

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.