mirror of
https://codeberg.org/waydeer/layer-shika.git
synced 2025-12-23 13:35:56 +00:00
fix: popup surface commit when update size
This commit is contained in:
parent
adc9344b85
commit
dac315b589
3 changed files with 40 additions and 7 deletions
|
|
@ -141,11 +141,13 @@ impl PopupSurface {
|
||||||
|
|
||||||
pub fn update_viewport_size(&self, logical_width: i32, logical_height: i32) {
|
pub fn update_viewport_size(&self, logical_width: i32, logical_height: i32) {
|
||||||
if let Some(ref vp) = self.viewport {
|
if let Some(ref vp) = self.viewport {
|
||||||
info!(
|
log::debug!(
|
||||||
"Updating popup viewport destination to logical size: {}x{}",
|
"Updating popup viewport destination to logical size: {}x{}",
|
||||||
logical_width, logical_height
|
logical_width,
|
||||||
|
logical_height
|
||||||
);
|
);
|
||||||
vp.set_destination(logical_width, logical_height);
|
vp.set_destination(logical_width, logical_height);
|
||||||
|
self.surface.commit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -236,11 +236,26 @@ impl SlintCallbackContract {
|
||||||
popup_key
|
popup_key
|
||||||
);
|
);
|
||||||
|
|
||||||
if let Some(popup_window) = popup_manager_for_resize
|
if let Some(popup_manager) = popup_manager_for_resize.upgrade() {
|
||||||
.upgrade()
|
if let Some(popup_window) = popup_manager.get_popup_window(popup_key) {
|
||||||
.and_then(|mgr| mgr.get_popup_window(popup_key))
|
popup_window.request_resize(width, height);
|
||||||
{
|
|
||||||
popup_window.request_resize(width, height);
|
#[allow(clippy::cast_possible_truncation)]
|
||||||
|
#[allow(clippy::cast_possible_wrap)]
|
||||||
|
let logical_width = width as i32;
|
||||||
|
#[allow(clippy::cast_possible_truncation)]
|
||||||
|
#[allow(clippy::cast_possible_wrap)]
|
||||||
|
let logical_height = height as i32;
|
||||||
|
|
||||||
|
popup_manager.update_popup_viewport(popup_key, logical_width, logical_height);
|
||||||
|
log::debug!(
|
||||||
|
"Updated popup viewport to logical size: {}x{} (from direct resize to {}x{})",
|
||||||
|
logical_width,
|
||||||
|
logical_height,
|
||||||
|
width,
|
||||||
|
height
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Value::Void
|
Value::Void
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -355,6 +355,22 @@ impl ShellContext<'_> {
|
||||||
} else if size_changed {
|
} else if size_changed {
|
||||||
if let Some(popup_window) = popup_manager.get_popup_window(handle.key()) {
|
if let Some(popup_window) = popup_manager.get_popup_window(handle.key()) {
|
||||||
popup_window.request_resize(width, height);
|
popup_window.request_resize(width, height);
|
||||||
|
|
||||||
|
#[allow(clippy::cast_possible_truncation)]
|
||||||
|
#[allow(clippy::cast_possible_wrap)]
|
||||||
|
let logical_width = width as i32;
|
||||||
|
#[allow(clippy::cast_possible_truncation)]
|
||||||
|
#[allow(clippy::cast_possible_wrap)]
|
||||||
|
let logical_height = height as i32;
|
||||||
|
|
||||||
|
popup_manager.update_popup_viewport(handle.key(), logical_width, logical_height);
|
||||||
|
log::debug!(
|
||||||
|
"Updated popup viewport to logical size: {}x{} (from resize to {}x{})",
|
||||||
|
logical_width,
|
||||||
|
logical_height,
|
||||||
|
width,
|
||||||
|
height
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue