mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-31 11:08:25 -05:00
surface: improve role precommit hook
Now the role precommit hook is called before the commit, not on wl_surface.commit request, and takes a state which is to be applied.
This commit is contained in:
parent
617eb4fb93
commit
50827ed7f5
7 changed files with 20 additions and 18 deletions
|
|
@ -852,15 +852,15 @@ static void xwayland_surface_role_commit(struct wlr_surface *wlr_surface) {
|
|||
}
|
||||
}
|
||||
|
||||
static void xwayland_surface_role_precommit(struct wlr_surface *wlr_surface) {
|
||||
static void xwayland_surface_role_precommit(struct wlr_surface *wlr_surface,
|
||||
const struct wlr_surface_state *state) {
|
||||
assert(wlr_surface->role == &xwayland_surface_role);
|
||||
struct wlr_xwayland_surface *surface = wlr_surface->role_data;
|
||||
if (surface == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (wlr_surface->pending.committed & WLR_SURFACE_STATE_BUFFER &&
|
||||
wlr_surface->pending.buffer == NULL) {
|
||||
if (state->committed & WLR_SURFACE_STATE_BUFFER && state->buffer == NULL) {
|
||||
// This is a NULL commit
|
||||
if (surface->mapped) {
|
||||
wlr_signal_emit_safe(&surface->events.unmap, surface);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue