mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-26 22:53:15 -04:00
On X11, fix cursor_hittest not reloaded on Resize
The cursor hittest was not reloaded on window size changes, only when `Window::request_inner_size` was called leading to regions of the window being not clickable. Also, don't try to apply hittest logic when user never requested a hittest. Links: https://github.com/alacritty/alacritty/pull/7220
This commit is contained in:
@@ -484,6 +484,7 @@ impl<T: 'static> EventProcessor<T> {
|
||||
}
|
||||
|
||||
let mut shared_state_lock = window.shared_state_lock();
|
||||
let hittest = shared_state_lock.cursor_hittest;
|
||||
|
||||
// This is a hack to ensure that the DPI adjusted resize is actually applied on all WMs. KWin
|
||||
// doesn't need this, but Xfwm does. The hack should not be run on other WMs, since tiling
|
||||
@@ -501,6 +502,11 @@ impl<T: 'static> EventProcessor<T> {
|
||||
// Unlock shared state to prevent deadlock in callback below
|
||||
drop(shared_state_lock);
|
||||
|
||||
// Reload hittest.
|
||||
if hittest.unwrap_or(false) {
|
||||
let _ = window.set_cursor_hittest(true);
|
||||
}
|
||||
|
||||
if resized {
|
||||
callback(Event::WindowEvent {
|
||||
window_id,
|
||||
|
||||
Reference in New Issue
Block a user