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:
Kirill Chibisov 2023-10-21 11:09:53 +04:00 committed by GitHub
parent d35c3bea42
commit 2edcd09704
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 5 deletions

View file

@ -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,