Support viewport-relative widget sizing
This commit is contained in:
@@ -411,6 +411,7 @@ impl<A: App> AppData<A>
|
||||
// configure.new_size is surface-local (logical), so multiply by the
|
||||
// current buffer scale before handing the dimensions to the app.
|
||||
let sf = self.main.scale_factor.max( 1 ) as u32;
|
||||
self.app.on_scale_changed( sf );
|
||||
self.app.on_resize( w * sf, h * sf );
|
||||
// `on_resize` may flip app-state that the view depends on (apps that
|
||||
// branch on the new dimensions, layout caches keyed by size, …), so
|
||||
|
||||
@@ -99,6 +99,7 @@ impl<A: App> CompositorHandler for AppData<A>
|
||||
// `App::on_resize`.
|
||||
if matches!( focus, super::SurfaceFocus::Main )
|
||||
{
|
||||
self.app.on_scale_changed( new_factor as u32 );
|
||||
self.app.on_resize( pw, ph );
|
||||
self.dirty_caches();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user