Compare commits

...
Sign in to create a new pull request.

3 commits

Author SHA1 Message Date
Smit Barmase
f7a8003458
remove arch and handle fedora 2025-08-13 18:01:40 +05:30
Smit Barmase
8d61979a82
fix 2025-08-13 17:49:37 +05:30
Smit Barmase
2a7e815bfa
version check 2025-08-13 17:26:39 +05:30

View file

@ -427,7 +427,15 @@ impl X11Client {
let xcb_connection = Rc::new(xcb_connection);
let ximc = X11rbClient::init(Rc::clone(&xcb_connection), x_root_index, None).ok();
// bug in ibus causes it to crash, which results in us not receiving xim callbacks, see #29083
let ximc = if get_package_version("ibus")
.as_deref()
.map_or(false, |version| version.starts_with("1.5.32~rc2-1"))
{
None
} else {
X11rbClient::init(Rc::clone(&xcb_connection), x_root_index, None).ok()
};
let xim_handler = if ximc.is_some() {
Some(XimHandler::new())
} else {
@ -2488,3 +2496,31 @@ fn get_dpi_factor((width_px, height_px): (u32, u32), (width_mm, height_mm): (u64
fn valid_scale_factor(scale_factor: f32) -> bool {
scale_factor.is_sign_positive() && scale_factor.is_normal()
}
fn get_package_version(name: &str) -> Option<String> {
use util::command::new_std_command;
if let Ok(output) = new_std_command("dpkg-query")
.args(["-W", "-f=${Version}", &name])
.output()
{
if output.status.success() {
if let Ok(version) = std::str::from_utf8(&output.stdout) {
return Some(version.trim().to_string());
}
}
}
if let Ok(output) = new_std_command("rpm")
.args(["-q", "--qf", "%{VERSION}-%{RELEASE}", &name])
.output()
{
if output.status.success() {
if let Ok(version) = std::str::from_utf8(&output.stdout) {
return Some(version.trim().to_string());
}
}
}
None
}