Skip to content

Commit

Permalink
Revert "Fix toplevel window resize pingpong (#3575)" and fix better (#…
Browse files Browse the repository at this point in the history
…3599)

Fixes: #3600
Fixes: #3592
Fixes: #3573
  • Loading branch information
AlanGriffiths authored and Saviq committed Sep 25, 2024
1 parent 3ed9b29 commit 89807a6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
16 changes: 13 additions & 3 deletions src/server/frontend_wayland/wayland_surface_observer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,21 @@ void mf::WaylandSurfaceObserver::content_resized_to(ms::Surface const*, geom::Si
run_on_wayland_thread_unless_window_destroyed(
[content_size](Impl* impl, WindowWlSurfaceRole* window)
{
if (impl->requested_size.value_or(impl->window_size) != content_size)
if (impl->requested_size && impl->requested_size == content_size)
{
impl->requested_size = content_size;
window->handle_resize(std::nullopt, content_size);
// We've already requested this size, no action required
return;
}

if (content_size == impl->window_size)
{
// The window manager is accepting the client's window size, no action required
return;
}

// The window manager is changing the client's window size, tell the client
impl->requested_size = content_size;
window->handle_resize(std::nullopt, content_size);
});
}

Expand Down
1 change: 0 additions & 1 deletion src/server/frontend_wayland/wayland_surface_observer.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class WaylandSurfaceObserver : public scene::NullSurfaceObserver
void latest_client_size(geometry::Size window_size)
{
impl->window_size = window_size;
impl->requested_size = {};
}

/// Should only be called from the Wayland thread
Expand Down

0 comments on commit 89807a6

Please sign in to comment.