mirror of
https://github.com/izzy2lost/xenia-edge.git
synced 2026-07-06 00:20:26 -07:00
[UI] Fix letterboxing on Linux/Wayland
This commit is contained in:
@@ -71,6 +71,11 @@ class Surface {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Updates the cached size for surfaces that don't query size dynamically.
|
||||
// Called by the window when resizing. Default implementation is a no-op
|
||||
// for surfaces that query their size dynamically (e.g., XCB, Win32).
|
||||
virtual void SetSize(uint32_t width, uint32_t height) {}
|
||||
|
||||
protected:
|
||||
Surface() = default;
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ class WaylandWindowSurface final : public Surface {
|
||||
wl_display* display() const { return display_; }
|
||||
wl_surface* surface() const { return surface_; }
|
||||
|
||||
void SetSize(uint32_t width, uint32_t height) {
|
||||
void SetSize(uint32_t width, uint32_t height) override {
|
||||
width_ = width;
|
||||
height_ = height;
|
||||
}
|
||||
|
||||
@@ -501,6 +501,10 @@ bool Window::OnActualSizeUpdate(
|
||||
actual_physical_height_ = new_physical_height;
|
||||
// The listeners may reference the presenter, update the presenter first.
|
||||
if (presenter_surface_) {
|
||||
// Update surface size for surfaces that cache dimensions (e.g., Wayland).
|
||||
// This must be done before OnSurfaceResizeFromUIThread so the presenter
|
||||
// gets the correct size when it queries the surface.
|
||||
presenter_surface_->SetSize(new_physical_width, new_physical_height);
|
||||
presenter_->OnSurfaceResizeFromUIThread();
|
||||
}
|
||||
UISetupEvent e(this);
|
||||
|
||||
Reference in New Issue
Block a user