On Wayland, fix min/max inner size setting
The size is only applied on the next `wl_surface::commit` thus we must trigger the redraw.
This commit is contained in:
parent
cf5f4de19e
commit
4d4d6e5052
3 changed files with 17 additions and 5 deletions
|
|
@ -46,6 +46,7 @@ Unreleased` header.
|
||||||
- On X11, reload dpi on `_XSETTINGS_SETTINGS` update.
|
- On X11, reload dpi on `_XSETTINGS_SETTINGS` update.
|
||||||
- On X11, fix deadlock when adjusting DPI and resizing at the same time.
|
- On X11, fix deadlock when adjusting DPI and resizing at the same time.
|
||||||
- On Wayland, fix `Focused(false)` being send when other seats still have window focused.
|
- On Wayland, fix `Focused(false)` being send when other seats still have window focused.
|
||||||
|
- On Wayland, fix `Window::set_{min,max}_inner_size` not always applied.
|
||||||
|
|
||||||
# 0.29.10
|
# 0.29.10
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -332,7 +332,9 @@ impl Window {
|
||||||
self.window_state
|
self.window_state
|
||||||
.lock()
|
.lock()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.set_min_inner_size(min_size)
|
.set_min_inner_size(min_size);
|
||||||
|
// NOTE: Requires commit to be applied.
|
||||||
|
self.request_redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set the maximum inner size for the window.
|
/// Set the maximum inner size for the window.
|
||||||
|
|
@ -343,7 +345,9 @@ impl Window {
|
||||||
self.window_state
|
self.window_state
|
||||||
.lock()
|
.lock()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.set_max_inner_size(max_size)
|
.set_max_inner_size(max_size);
|
||||||
|
// NOTE: Requires commit to be applied.
|
||||||
|
self.request_redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
@ -392,7 +396,10 @@ impl Window {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn set_resizable(&self, resizable: bool) {
|
pub fn set_resizable(&self, resizable: bool) {
|
||||||
self.window_state.lock().unwrap().set_resizable(resizable);
|
if self.window_state.lock().unwrap().set_resizable(resizable) {
|
||||||
|
// NOTE: Requires commit to be applied.
|
||||||
|
self.request_redraw();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
|
||||||
|
|
@ -504,10 +504,12 @@ impl WindowState {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set the resizable state on the window.
|
/// Set the resizable state on the window.
|
||||||
|
///
|
||||||
|
/// Returns `true` when the state was applied.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn set_resizable(&mut self, resizable: bool) {
|
pub fn set_resizable(&mut self, resizable: bool) -> bool {
|
||||||
if self.resizable == resizable {
|
if self.resizable == resizable {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.resizable = resizable;
|
self.resizable = resizable;
|
||||||
|
|
@ -523,6 +525,8 @@ impl WindowState {
|
||||||
if let Some(frame) = self.frame.as_mut() {
|
if let Some(frame) = self.frame.as_mut() {
|
||||||
frame.set_resizable(resizable);
|
frame.set_resizable(resizable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Whether the window is focused by any seat.
|
/// Whether the window is focused by any seat.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue