util/root: Log source location of call without root

This commit is contained in:
Sophie Herold 2025-12-09 14:55:14 +01:00
parent 70adf7597b
commit 3e69dc4c6f
2 changed files with 5 additions and 2 deletions

View file

@ -20,13 +20,15 @@ use gtk::prelude::*;
use crate::widgets::{LpEditWindow, LpWindow};
pub trait ParentWindow: WidgetExt {
#[track_caller]
fn window(&self) -> LpWindow {
let result = self.root().and_downcast();
if result.is_none() {
log::error!(
"Couldn't find LpWindow for {self:?}. mapped={}",
self.is_mapped()
"Couldn't find LpWindow for {self:?}. mapped={}. caller={}",
self.is_mapped(),
std::panic::Location::caller(),
);
}