util/root: Log source location of call without root
This commit is contained in:
parent
70adf7597b
commit
3e69dc4c6f
2 changed files with 5 additions and 2 deletions
1
news.d/49.2/changed-track-get-window-errors
Normal file
1
news.d/49.2/changed-track-get-window-errors
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Track the location in source code of errors trying to get the root window.
|
||||||
|
|
@ -20,13 +20,15 @@ use gtk::prelude::*;
|
||||||
use crate::widgets::{LpEditWindow, LpWindow};
|
use crate::widgets::{LpEditWindow, LpWindow};
|
||||||
|
|
||||||
pub trait ParentWindow: WidgetExt {
|
pub trait ParentWindow: WidgetExt {
|
||||||
|
#[track_caller]
|
||||||
fn window(&self) -> LpWindow {
|
fn window(&self) -> LpWindow {
|
||||||
let result = self.root().and_downcast();
|
let result = self.root().and_downcast();
|
||||||
|
|
||||||
if result.is_none() {
|
if result.is_none() {
|
||||||
log::error!(
|
log::error!(
|
||||||
"Couldn't find LpWindow for {self:?}. mapped={}",
|
"Couldn't find LpWindow for {self:?}. mapped={}. caller={}",
|
||||||
self.is_mapped()
|
self.is_mapped(),
|
||||||
|
std::panic::Location::caller(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue