-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I send a frame notification without having to interact with the layer #389
Comments
What compositor are you using? That should be fine, or you'll just be able to commit when your timer to update the clock fires after rendering new content. |
I'm using a |
I made a simple example that illustrates the problem (https://github.com/StratusFearMe21/simple-layer), It just uses |
Could you test in another compositor (sway can be run windowed) |
Just attempted to run my example |
Some This is from my I edited this post a little with more and better logs
This is the log from a simple status bar that I know works and does update properly this one specifically
|
I was able to get the frames to update without any user intervention! However, not using the let guard = event_queue.prepare_read().unwrap();
let fd = Generic::new(
guard.connection_fd().as_raw_fd(),
Interest::READ,
Mode::Level,
);
drop(guard);
let event_queue = Rc::new(RefCell::new(event_queue));
let event_queue_loop = Rc::clone(&event_queue);
event_loop
.handle()
.insert_source(fd, move |_, _, data| {
if event_queue_loop
.borrow_mut()
.blocking_dispatch(data)
.is_err()
{
panic!("display_dispatch");
}
Ok(calloop::PostAction::Continue)
})
.unwrap();
{
let mut event_queue = event_queue.borrow_mut();
event_queue.roundtrip(&mut simple_layer).unwrap();
event_queue.flush().unwrap();
}
event_loop
.run(None, &mut simple_layer, move |data| {
let mut event_queue = event_queue.borrow_mut();
event_queue.dispatch_pending(data).unwrap();
event_queue.flush().unwrap();
})
.unwrap(); Could the fact that this worked and the |
Hmm that is odd @elinorbgr do you have an ideas why this could be happening? I'd probably avoid doing that above specifically since it seemed to cause the Nvidia driver to have some issues when talking to Wayland. |
Right now, I'm trying to make a status bar using the
wlr
layer shell protocol. I don't want to ask for a new frame on every frame because my bar spends most of it's time waiting forcalloop
events, so every time the status text needs to change in the bar, I callUnfortunately, I only get the frame notification when I hover the mouse over the bar, then it gets the next frame notification(s). Is there a way that I can initialize new frames without having to hover my mouse over the layer surface or continuously ask for new frames?
The code I'm using is basically exactly the same as the
simple_layer.rs
example (but with thelayer.wl_surface().frame()
calls in thedraw
function commented out, and theWaylandSource
being used instead of theloop
).Thanks in advance for your help, I swear I tried to find this out on my own but I couldn't find any docs or anything online or anything in the codebases I have on my system on how to do this.
The text was updated successfully, but these errors were encountered: