--- a/pidgin/pidginapplication.c Tue Sep 27 01:39:29 2022 -0500
+++ b/pidgin/pidginapplication.c Tue Sep 27 02:36:20 2022 -0500
@@ -95,33 +95,6 @@
*****************************************************************************/
- * pidgin_application_get_active_window:
- * Calls gtk_application_get_active_window to get the active window. If that
- * returns NULL, fallback to the first window of gtk_application_get_windows,
- * and if that fails, returns NULL.
-pidgin_application_get_active_window(PidginApplication *application) {
- GtkApplication *gtk_application = NULL;
- GtkWindow *window = NULL;
- gtk_application = GTK_APPLICATION(application);
- window = gtk_application_get_active_window(gtk_application);
- if(!GTK_IS_WINDOW(window)) {
- windows = gtk_application_get_windows(gtk_application);
- window = windows->data;
* pidgin_application_present_transient_window:
* @application: The application instance.
* @window: The [class@Gtk.Window] to present.
@@ -1052,3 +1025,25 @@
+pidgin_application_get_active_window(PidginApplication *application) { + GtkApplication *gtk_application = NULL; + GtkWindow *window = NULL; + g_return_val_if_fail(PIDGIN_IS_APPLICATION(application), NULL); + gtk_application = GTK_APPLICATION(application); + window = gtk_application_get_active_window(gtk_application); + if(!GTK_IS_WINDOW(window)) { + windows = gtk_application_get_windows(gtk_application); + window = windows->data; --- a/pidgin/pidginapplication.h Tue Sep 27 01:39:29 2022 -0500
+++ b/pidgin/pidginapplication.h Tue Sep 27 02:36:20 2022 -0500
@@ -73,6 +73,21 @@
void pidgin_application_add_action_group(PidginApplication *application, const gchar *prefix, GActionGroup *action_group);
+ * pidgin_application_get_active_window: + * @application: The instance. + * Calls [method@Gtk.Application.get_active_window] to get the active window. + * If that returns %NULL, fallback to the first window of + * [method@Gtk.Application.get_windows], and if that fails, return %NULL. + * Returns: (transfer none) (nullable): The active window or %NULL if one could +GtkWindow *pidgin_application_get_active_window(PidginApplication *application); #endif /* PIDGIN_APPLICATION_H */
--- a/pidgin/pidgindebug.c Tue Sep 27 01:39:29 2022 -0500
+++ b/pidgin/pidgindebug.c Tue Sep 27 02:36:20 2022 -0500
@@ -32,12 +32,12 @@
+#include "pidginapplication.h" #include <gdk/gdkkeysyms.h>
-#include "pidginresources.h"
struct _PidginDebugWindow {
@@ -838,11 +838,21 @@
pidgin_debug_window_show(void)
+ GApplication *application = NULL; + PidginApplication *pidgin_application = NULL; + GtkWindow *parent = NULL; + application = g_application_get_default(); + pidgin_application = PIDGIN_APPLICATION(application); + parent = pidgin_application_get_active_window(pidgin_application); debug_win = PIDGIN_DEBUG_WINDOW(
g_object_new(PIDGIN_TYPE_DEBUG_WINDOW, NULL));
+ gtk_window_set_transient_for(GTK_WINDOW(debug_win), parent); - gtk_widget_show(GTK_WIDGET(debug_win));
+ gtk_window_present_with_time(GTK_WINDOW(debug_win), GDK_CURRENT_TIME); purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/debug/enabled", TRUE);