event_loop: drop the duplicate on_resize that clobbered physical dimensions with logical ones
Both `LayerShellHandler::configure` and `WindowHandler::configure` called `self.on_configure( w, h )` — which already forwards `app.on_resize( w * sf, h * sf )` in physical pixels — and then immediately called `self.app.on_resize( w, h )` again with the surface-local logical size. The second call won, so on any scale > 1 surface the app saw logical dimensions while the layout pass kept working in physical pixels. On a Librem 5 at scale 2 that meant `screen_width`/`screen_height` came through as 360×720 against a 720×1440 layout: homescreen icons rendered at half their intended footprint and the mobile wallpaper, sized explicitly via `.size( iw_at_h, sh )`, filled only the top half of the screen (the launcher / lockscreen / greeter use `.cover()` so they were unaffected). Remove the redundant `app.on_resize` from both handlers; `on_configure` is the single source of truth for the physical dimensions the app and the layout both expect.
This commit is contained in:
@@ -172,7 +172,6 @@ impl<A: App> LayerShellHandler for AppData<A>
|
||||
Some( super::SurfaceFocus::Main ) | None =>
|
||||
{
|
||||
self.on_configure( w, h );
|
||||
self.app.on_resize( w, h );
|
||||
}
|
||||
Some( super::SurfaceFocus::Overlay( id ) ) =>
|
||||
{
|
||||
@@ -226,7 +225,6 @@ impl<A: App> WindowHandler for AppData<A>
|
||||
let h = configure.new_size.1.map( |v| v.get() ).unwrap_or( hint_h );
|
||||
window.xdg_surface().set_window_geometry( 0, 0, w as i32, h as i32 );
|
||||
self.on_configure( w, h );
|
||||
self.app.on_resize( w, h );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user