Compare commits

...

1 Commits

Author SHA1 Message Date
Smit Barmase
2c52e0b614 fix ime popup position on linux 2025-09-05 04:54:33 +05:30
2 changed files with 6 additions and 4 deletions

View File

@@ -646,9 +646,10 @@ impl WaylandWindowStatePtr {
}
}
pub fn get_ime_area(&self) -> Option<Bounds<Pixels>> {
pub fn get_ime_area(&self) -> Option<Bounds<ScaledPixels>> {
let mut state = self.state.borrow_mut();
let mut bounds: Option<Bounds<Pixels>> = None;
let scale_factor = state.scale;
if let Some(mut input_handler) = state.input_handler.take() {
drop(state);
if let Some(selection) = input_handler.marked_text_range() {
@@ -656,7 +657,7 @@ impl WaylandWindowStatePtr {
}
self.state.borrow_mut().input_handler = Some(input_handler);
}
bounds
bounds.map(|b| b.scale(scale_factor))
}
pub fn set_size_and_scale(&self, size: Option<Size<Pixels>>, scale: Option<f32>) {

View File

@@ -1019,9 +1019,10 @@ impl X11WindowStatePtr {
}
}
pub fn get_ime_area(&self) -> Option<Bounds<Pixels>> {
pub fn get_ime_area(&self) -> Option<Bounds<ScaledPixels>> {
let mut state = self.state.borrow_mut();
let mut bounds: Option<Bounds<Pixels>> = None;
let scale_factor = state.scale_factor;
if let Some(mut input_handler) = state.input_handler.take() {
drop(state);
if let Some(selection) = input_handler.selected_text_range(true) {
@@ -1030,7 +1031,7 @@ impl X11WindowStatePtr {
let mut state = self.state.borrow_mut();
state.input_handler = Some(input_handler);
};
bounds
bounds.map(|b| b.scale(scale_factor))
}
pub fn set_bounds(&self, bounds: Bounds<i32>) -> anyhow::Result<()> {