fix: dragging pop-ups causes them to stutter
Dragging a pop-up surface around regularly updates it via `SurfaceEvents::xdg_event`. This called `XConnection::set_window_dims`, which was enqueueing many `ConfigureRequest` events. These outdated events would still be processed by XWayland and responded to with `ConfigureNotify`, which updated the surface to an old position, resulting in glitchy behavior. This fix replaces the call of `set_window_dims` in `xdg_event`, instead inserting the new position of the window into the ECS. Then, after all Wayland events have been read, the pending position is popped from the ECS and used to call `set_window_dims` for each window with it. A solution to the issue posed in #314.
This commit is contained in:
parent
1bbd5cae7e
commit
e81e787e1a
2 changed files with 25 additions and 10 deletions
|
|
@ -330,23 +330,20 @@ impl SurfaceEvents {
|
|||
}
|
||||
}
|
||||
|
||||
connection.set_window_dims(
|
||||
window,
|
||||
PendingSurfaceState {
|
||||
x,
|
||||
y,
|
||||
width: width as _,
|
||||
height: height as _,
|
||||
},
|
||||
);
|
||||
window_data.attrs.dims = WindowDims {
|
||||
x: x as i16,
|
||||
y: y as i16,
|
||||
width,
|
||||
height,
|
||||
};
|
||||
|
||||
let pending = PendingSurfaceState {
|
||||
x,
|
||||
y,
|
||||
width: width as _,
|
||||
height: height as _,
|
||||
};
|
||||
drop(query);
|
||||
state.world.insert_one(target, pending).unwrap();
|
||||
update_surface_viewport(&state.world, state.world.query_one(target).unwrap());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue