aboutsummaryrefslogtreecommitdiff
path: root/src/handlers/mod.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2023-12-19 13:29:22 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2023-12-19 13:32:13 +0400
commitc29a049245ffa0eb737114774da4c01c09897dfc (patch)
tree508eaab69c37a4257546401def160ed6298b7bae /src/handlers/mod.rs
parentd6b62ad09d049524b5c734f90ea86f6252d32088 (diff)
downloadniri-c29a049245ffa0eb737114774da4c01c09897dfc.tar.gz
niri-c29a049245ffa0eb737114774da4c01c09897dfc.tar.bz2
niri-c29a049245ffa0eb737114774da4c01c09897dfc.zip
Fix some cases of incomplete search for surface output
Most visibly, fixes screen not immediately redrawing upon layer-shell popup commits. There's still a number of places with questionable handling left, mostly to do with subsurfaces (like, find_popup_root_surface() doesn't go up to subsurfaces), and session-lock. I don't have good clients to test these.
Diffstat (limited to 'src/handlers/mod.rs')
-rw-r--r--src/handlers/mod.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs
index 65e7d101..ebf53c62 100644
--- a/src/handlers/mod.rs
+++ b/src/handlers/mod.rs
@@ -80,10 +80,8 @@ delegate_text_input_manager!(State);
impl InputMethodHandler for State {
fn new_popup(&mut self, surface: PopupSurface) {
- if let Some((_, output)) = surface
- .get_parent()
- .and_then(|parent| self.niri.layout.find_window_and_output(&parent.surface))
- {
+ let popup = PopupKind::from(surface.clone());
+ if let Some(output) = self.output_for_popup(&popup) {
let scale = output.current_scale().integer_scale();
let transform = output.current_transform();
let wl_surface = surface.wl_surface();
@@ -91,7 +89,7 @@ impl InputMethodHandler for State {
send_surface_state(wl_surface, data, scale, transform);
});
}
- if let Err(err) = self.niri.popups.track_popup(PopupKind::from(surface)) {
+ if let Err(err) = self.niri.popups.track_popup(popup) {
warn!("error tracking ime popup {err:?}");
}
}