fix: skip resize if size is unchanged

This commit is contained in:
Ashley Wulber 2025-10-23 17:06:53 -04:00
parent 70b9736dc7
commit fd2220775b
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820
2 changed files with 25 additions and 0 deletions

View file

@ -273,6 +273,11 @@ pub struct SctkPopup {
impl SctkPopup {
pub(crate) fn set_size(&mut self, w: u32, h: u32, token: u32) {
let guard = self.common.lock().unwrap();
if guard.size.width == w && guard.size.height == h {
return;
}
drop(guard);
// update geometry
self.popup
.xdg_surface()
@ -285,6 +290,9 @@ impl SctkPopup {
pub(crate) fn update_viewport(&mut self, w: u32, h: u32) {
let common = self.common.lock().unwrap();
if common.size.width == w && common.size.height == h {
return;
}
if let Some(viewport) = common.wp_viewport.as_ref() {
// Set inner size without the borders.
viewport.set_destination(w as i32, h as i32);