mirror of
https://github.com/gosticks/PaperWM.git
synced 2026-06-28 21:20:06 +00:00
utils:trace: don't require a metawindow
This commit is contained in:
committed by
Tor Hedin Brønner
parent
d4e24b1ee9
commit
950efe04e0
19
utils.js
19
utils.js
@@ -347,9 +347,22 @@ var tweener = {
|
||||
}
|
||||
};
|
||||
|
||||
function isMetaWindow(obj) {
|
||||
return obj && obj.window_type && obj.get_compositor_private;
|
||||
}
|
||||
|
||||
function trace(topic, ...args) {
|
||||
windowTrace(topic, ...args);
|
||||
if (!topic.match(/.*/)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isMetaWindow(args[0])) {
|
||||
windowTrace(topic, ...args);
|
||||
} else {
|
||||
let trace = shortTrace(1).join(" < ");
|
||||
let extraInfo = args.length > 0 ? "\n\t" + args.map(x => x.toString()).join("\n\t") : ""
|
||||
log(topic, trace, extraInfo);
|
||||
}
|
||||
}
|
||||
|
||||
let existingWindows = new Set();
|
||||
@@ -359,10 +372,6 @@ function windowTrace(topic, metaWindow, ...rest) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!topic.match(/.*/)) {
|
||||
return;
|
||||
}
|
||||
|
||||
log(topic, infoMetaWindow(metaWindow).join("\n"), ...rest.join("\n"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user