fix(wayland): fix issue with tiled and maximized window

Potential fix for #6262
This commit is contained in:
Aliaksandr Truš authored and Wez Furlong committed 2025-02-08 13:26:35 -07:00
1 parent 444ed2309a
commit 80b9ffd14c
1 file changed
+3 -32
+3 -32
View File
@@ -588,11 +588,8 @@ impl WaylandWindowInner {
}
fn refresh_frame(&mut self) {
if let Some(window) = self.window.as_mut() {
if self.window_frame.is_dirty() && !self.window_frame.is_hidden() {
self.window_frame.draw();
}
window.wl_surface().commit();
if self.window_frame.is_dirty() && !self.window_frame.is_hidden() {
self.window_frame.draw();
}
}
@@ -854,6 +851,7 @@ impl WaylandWindowInner {
let height =
NonZeroU32::new(pixel_height as u32).unwrap_or(NonZeroU32::new(1).unwrap());
self.window_frame.resize(width, height);
pending.refresh_decorations = true
}
let (x, y) = self.window_frame.location();
self.window
@@ -915,7 +913,6 @@ impl WaylandWindowInner {
}
}
}
self.refresh_frame();
self.do_paint().unwrap();
}
}
@@ -1247,7 +1244,6 @@ impl WaylandState {
.window_by_id(window_id)
.expect("Inner Window should exist");
let is_frame_hidden = window_inner.borrow().window_frame.is_hidden();
let p = window_inner.borrow().pending_event.clone();
let mut pending_event = p.lock().unwrap();
@@ -1284,31 +1280,6 @@ impl WaylandState {
state |= WindowState::MAXIMIZED;
}
// For MAXIMIZED and FULL_SCREEN window configure contains Windowed size.
// Replacing it with Wayland suggested bounds.
if state.intersects(WindowState::MAXIMIZED | WindowState::FULL_SCREEN) {
if let Some((w, h)) = configure.suggested_bounds {
pending_event.configure.replace((w, h));
}
} else if configure
.state
.contains(SCTKWindowState::TILED_TOP | SCTKWindowState::TILED_BOTTOM)
&& is_frame_hidden
{
// Tiled window without borders will take exactly half of the screen.
if let Some((w, h)) = configure.suggested_bounds {
pending_event.configure.replace((w / 2, h));
}
} else if configure
.state
.contains(SCTKWindowState::TILED_LEFT | SCTKWindowState::TILED_RIGHT)
&& is_frame_hidden
{
// Tiled window without borders will take exactly half of the screen.
if let Some((w, h)) = configure.suggested_bounds {
pending_event.configure.replace((w, h / 2));
}
}
log::debug!(
"Config: self.window_state={:?}, states: {:?} {:?}",
pending_event.window_state,