mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Merge pull request #927 from tchebb/log-gtk-tree
Add debug log message to print each bar's widget tree
This commit is contained in:
commit
881bb62f88
10
src/bar.cpp
10
src/bar.cpp
@ -460,6 +460,16 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config)
|
||||
|
||||
setupWidgets();
|
||||
window.show_all();
|
||||
|
||||
if (spdlog::should_log(spdlog::level::debug)) {
|
||||
// Unfortunately, this function isn't in the C++ bindings, so we have to call the C version.
|
||||
char* gtk_tree = gtk_style_context_to_string(
|
||||
window.get_style_context()->gobj(),
|
||||
(GtkStyleContextPrintFlags)(GTK_STYLE_CONTEXT_PRINT_RECURSE |
|
||||
GTK_STYLE_CONTEXT_PRINT_SHOW_STYLE));
|
||||
spdlog::debug("GTK widget tree:\n{}", gtk_tree);
|
||||
g_free(gtk_tree);
|
||||
}
|
||||
}
|
||||
|
||||
void waybar::Bar::onMap(GdkEventAny*) {
|
||||
|
Loading…
Reference in New Issue
Block a user