fix: skip resize if size is unchanged
This commit is contained in:
parent
70b9736dc7
commit
fd2220775b
2 changed files with 25 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue