On X11, reload DPI on _XSETTINGS_SETTINGS

This also fixes the deadlock when such reload may happen.

Fixes: #3383
Signed-off-by: John Nunley <dev@notgull.net>
Signed-off-by: Kirill Chibisov <contact@kchibisov.com>
This commit is contained in:
John Nunley 2024-01-30 04:52:29 -08:00 committed by GitHub
parent db1ca45a17
commit df8805c0d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 439 additions and 19 deletions

View file

@ -10,6 +10,7 @@ mod monitor;
pub mod util;
mod window;
mod xdisplay;
mod xsettings;
pub(crate) use self::{
monitor::{MonitorHandle, VideoModeHandle},
@ -889,6 +890,9 @@ pub enum X11Error {
/// Could not find a matching X11 visual for this visualid
NoSuchVisual(xproto::Visualid),
/// Unable to parse xsettings.
XsettingsParse(xsettings::ParserError),
}
impl fmt::Display for X11Error {
@ -913,6 +917,9 @@ impl fmt::Display for X11Error {
visualid
)
}
X11Error::XsettingsParse(err) => {
write!(f, "Failed to parse xsettings: {:?}", err)
}
}
}
}
@ -981,6 +988,12 @@ impl From<ReplyOrIdError> for X11Error {
}
}
impl From<xsettings::ParserError> for X11Error {
fn from(value: xsettings::ParserError) -> Self {
Self::XsettingsParse(value)
}
}
/// The underlying x11rb connection that we are using.
type X11rbConnection = x11rb::xcb_ffi::XCBConnection;