Comments (5)
Hmm, this is difficult to say with such a small amount of code, as it would depend a lot on what's done around. Do you have a minimal example that can be run and reproduces this issue, including the event-loop setup?
For the matter, calling callback.done
directly forwards the API call to the wayland C lib, which is supposed to handle it properly. Does the event appear in the trace if you run your server with the WAYLAND_DEBUG=1
environment variable?
from wayland-rs.
https://github.com/fangyuanziti/wayland-http
All my code placed in this repository. It's a simple compositor with a http API.
Start server
WAYLAND_DEBUG=1 cargo run
Test with a client
WAYLAND_DEBUG=1 weston-simple-damage
The frame
function is placed in src/surface.rs.
from wayland-rs.
Okay, I understand your issue.
Using EventLoop::run()
, your compositor blocks waiting for events coming from the client before processing things further, including flushing your events to the client. And the two processes deadlock each other. You can observe this is you start two instances of weston-simple-damage
for example, the two clients will generate enough events to make your events loop always make progress.
In your case, as you're not guaranteed to have a regular stream of events causing your event loop to progress forward, you should probably use a more explicit handling, like this:
loop {
// wait for client events for at most 50 miliseconds
event_loop.dispatch(Some(50)).unwrap();
display.flush_clients();
}
from wayland-rs.
EventLoop::run()
should be better document to reflect this.
from wayland-rs.
You are right. I will change my main loop code. Thanks for your work 😄
from wayland-rs.
Related Issues (20)
- wayland-client: add easier way to create object from wl_proxy pointer HOT 1
- Proxy tags HOT 3
- wayland-sys vendor feature (request for a `wayland-src` crate) HOT 2
- how to convert a wl_surface pointer to WlSurface HOT 2
- WlRegistry.bind always outputs WlRegistry HOT 5
- Failed build when running with coverage on stable Rust HOT 1
- RFC: Rethinking the design of the crates API HOT 8
- Unable to copy to buffer using ZwlrScreencopyFrameV1 HOT 1
- Apparent misuse of scoped-tls, only appearing on a Raspberry Pi HOT 19
- Feature to avoid usage of `memfd_create` HOT 3
- Backend+client API to take control of proxies HOT 3
- wayland-protocols 0.32 got published without protocols/ HOT 2
- Attaching None to a surface influences surface configuration HOT 3
- illumos is not supported HOT 4
- surface.attach(None, 0, 0) doesn't allow for a re-map of the layer surface. HOT 3
- wayland-server: There is no way to bind to a passed socket FD HOT 1
- Regression in foreign object management
- String arguments should be CString
- Unable to compile my project for linux xorg using winit HOT 4
- Read cursor file directly instead of first to Vec and then through xcursor
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wayland-rs.