--- a/pidgin/libpidgin.c Mon Oct 18 21:21:38 2021 -0500
+++ b/pidgin/libpidgin.c Mon Oct 18 22:41:34 2021 -0500
@@ -232,6 +232,8 @@
theme = gtk_icon_theme_get_default();
path = g_build_filename(PURPLE_DATADIR, "pidgin", "icons", NULL);
@@ -305,6 +307,7 @@
ui = purple_debug_get_ui();
purple_debug_set_ui(NULL);
g_application_quit(g_application_get_default());
--- a/pidgin/pidginapplication.c Mon Oct 18 21:21:38 2021 -0500
+++ b/pidgin/pidginapplication.c Mon Oct 18 22:41:34 2021 -0500
@@ -481,6 +481,8 @@
+ pidgin_debug_init_handler(); provider = gtk_css_provider_new();
search_path = g_build_filename(purple_config_dir(), "gtk-3.0.css", NULL);
--- a/pidgin/pidgindebug.c Mon Oct 18 21:21:38 2021 -0500
+++ b/pidgin/pidgindebug.c Mon Oct 18 22:41:34 2021 -0500
@@ -70,6 +70,7 @@
static PidginDebugWindow *debug_win = NULL;
+static guint debug_enabled_timer = 0; @@ -79,7 +80,6 @@
guint debug_enabled_timer;
-static void pidgin_debug_ui_finalize(GObject *gobject);
static void pidgin_debug_ui_interface_init(PurpleDebugUiInterface *iface);
G_DEFINE_TYPE_WITH_CODE(PidginDebugUi, pidgin_debug_ui, G_TYPE_OBJECT,
@@ -671,37 +671,27 @@
debug_enabled_timeout_cb(gpointer data)
- PidginDebugUi *ui = PIDGIN_DEBUG_UI(data);
- ui->debug_enabled_timer = 0;
+ gboolean enabled = GPOINTER_TO_INT(data); - pidgin_debug_window_show();
+ debug_enabled_timer = 0;
-debug_disabled_timeout_cb(gpointer data)
- PidginDebugUi *ui = PIDGIN_DEBUG_UI(data);
- ui->debug_enabled_timer = 0;
- pidgin_debug_window_hide();
+ pidgin_debug_window_show(); + pidgin_debug_window_hide(); -debug_enabled_cb(const char *name, PurplePrefType type,
- gconstpointer value, gpointer data)
+debug_enabled_cb(G_GNUC_UNUSED const gchar *name, + G_GNUC_UNUSED PurplePrefType type, - PidginDebugUi *ui = PIDGIN_DEBUG_UI(data);
- if (GPOINTER_TO_INT(value))
- ui->debug_enabled_timer = g_timeout_add(0, debug_enabled_timeout_cb, data);
- ui->debug_enabled_timer = g_timeout_add(0, debug_disabled_timeout_cb, data);
+ debug_enabled_timer = g_timeout_add(0, debug_enabled_timeout_cb, @@ -824,47 +814,6 @@
pidgin_debug_ui_init(PidginDebugUi *self)
- /* Debug window preferences. */
- * NOTE: This must be set before prefs are loaded, and the callbacks
- * set after they are loaded, since prefs sets the enabled
- * preference here and that loads the window, which calls the
- * configure event, which overrides the width and height! :P
- purple_prefs_add_none(PIDGIN_PREFS_ROOT "/debug");
- /* Controls printing to the debug window */
- purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/debug/enabled", FALSE);
- purple_prefs_add_int(PIDGIN_PREFS_ROOT "/debug/filterlevel", PURPLE_DEBUG_ALL);
- purple_prefs_add_int(PIDGIN_PREFS_ROOT "/debug/style", GTK_TOOLBAR_BOTH_HORIZ);
- purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/debug/toolbar", TRUE);
- purple_prefs_add_int(PIDGIN_PREFS_ROOT "/debug/width", 450);
- purple_prefs_add_int(PIDGIN_PREFS_ROOT "/debug/height", 250);
- purple_prefs_add_string(PIDGIN_PREFS_ROOT "/debug/regex", "");
- purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/debug/filter", FALSE);
- purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/debug/invert", FALSE);
- purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/debug/case_insensitive", FALSE);
- purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/debug/highlight", FALSE);
- purple_prefs_connect_callback(NULL, PIDGIN_PREFS_ROOT "/debug/enabled",
- debug_enabled_cb, self);
- g_log_set_writer_func(pidgin_debug_g_log_handler, NULL, NULL);
-pidgin_debug_ui_finalize(GObject *gobject)
- PidginDebugUi *self = PIDGIN_DEBUG_UI(gobject);
- if (self->debug_enabled_timer != 0)
- g_source_remove(self->debug_enabled_timer);
- self->debug_enabled_timer = 0;
- G_OBJECT_CLASS(pidgin_debug_ui_parent_class)->finalize(gobject);
@@ -996,9 +945,6 @@
pidgin_debug_ui_class_init(PidginDebugUiClass *klass)
- GObjectClass *object_class = G_OBJECT_CLASS(klass);
- object_class->finalize = pidgin_debug_ui_finalize;
@@ -1007,6 +953,55 @@
return g_object_new(PIDGIN_TYPE_DEBUG_UI, NULL);
+pidgin_debug_init_handler(void) + g_log_set_writer_func(pidgin_debug_g_log_handler, NULL, NULL); + /* Debug window preferences. */ + * NOTE: This must be set before prefs are loaded, and the callbacks + * set after they are loaded, since prefs sets the enabled + * preference here and that loads the window, which calls the + * configure event, which overrides the width and height! :P + purple_prefs_add_none(PIDGIN_PREFS_ROOT "/debug"); + /* Controls printing to the debug window */ + purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/debug/enabled", FALSE); + purple_prefs_add_int(PIDGIN_PREFS_ROOT "/debug/filterlevel", + purple_prefs_add_int(PIDGIN_PREFS_ROOT "/debug/style", + GTK_TOOLBAR_BOTH_HORIZ); + purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/debug/toolbar", TRUE); + purple_prefs_add_int(PIDGIN_PREFS_ROOT "/debug/width", 450); + purple_prefs_add_int(PIDGIN_PREFS_ROOT "/debug/height", 250); + purple_prefs_add_string(PIDGIN_PREFS_ROOT "/debug/regex", ""); + purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/debug/filter", FALSE); + purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/debug/invert", FALSE); + purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/debug/case_insensitive", FALSE); + purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/debug/highlight", FALSE); + purple_prefs_connect_callback(NULL, PIDGIN_PREFS_ROOT "/debug/enabled", + debug_enabled_cb, NULL); +pidgin_debug_uninit(void) + if (debug_enabled_timer != 0) { + g_source_remove(debug_enabled_timer); + debug_enabled_timer = 0; pidgin_debug_get_handle() {
--- a/pidgin/pidgindebug.h Mon Oct 18 21:21:38 2021 -0500
+++ b/pidgin/pidgindebug.h Mon Oct 18 22:41:34 2021 -0500
@@ -42,6 +42,36 @@
G_DECLARE_FINAL_TYPE(PidginDebugWindow, pidgin_debug_window, PIDGIN, DEBUG_WINDOW, GtkWindow)
+ * pidgin_debug_init_handler: + * Initialize handler for GLib logging system. + * This must be called early if you want to capture logs at startup, and avoid +void pidgin_debug_init_handler(void); + * Perform necessary initializations. +void pidgin_debug_init(void); + * Perform necessary uninitializations. +void pidgin_debug_uninit(void); * Initializes the GTK debug system.