| 59 #include "gtkimhtmltoolbar.h" |
59 #include "gtkimhtmltoolbar.h" |
| 60 #include "pidginstock.h" |
60 #include "pidginstock.h" |
| 61 #include "gtkthemes.h" |
61 #include "gtkthemes.h" |
| 62 #include "gtkutils.h" |
62 #include "gtkutils.h" |
| 63 |
63 |
| |
64 #define PIDGIN_TOPLEVEL_REFFED_FLAG "pidgin-toplevel-is-weakly-reffed" |
| |
65 |
| 64 typedef struct { |
66 typedef struct { |
| 65 GtkWidget *menu; |
67 GtkWidget *menu; |
| 66 gint default_item; |
68 gint default_item; |
| 67 } AopMenu; |
69 } AopMenu; |
| 68 |
70 |
| 69 static guint accels_save_timer = 0; |
71 static guint accels_save_timer = 0; |
| |
72 |
| |
73 static GtkWindow *toplevel = NULL; |
| |
74 |
| |
75 static void |
| |
76 toplevel_weak_notify(gpointer null, GtkWindow *window) |
| |
77 { |
| |
78 if (toplevel == window) |
| |
79 toplevel = NULL; |
| |
80 } |
| |
81 |
| |
82 void |
| |
83 pidgin_set_toplevel(GtkWindow *new_toplevel) |
| |
84 { |
| |
85 g_return_if_fail(toplevel != NULL); |
| |
86 g_return_if_fail(GTK_IS_WINDOW(toplevel)); |
| |
87 |
| |
88 if (toplevel) { |
| |
89 g_object_weak_unref(G_OBJECT(toplevel), toplevel_weak_notify, NULL); |
| |
90 toplevel = NULL; |
| |
91 } |
| |
92 |
| |
93 if (new_topleve) { |
| |
94 g_object_weak_ref(G_OBJECT(new_toplevel), toplevel_weak_notify, NULL); |
| |
95 toplevel = new_toplevel; |
| |
96 } |
| |
97 } |
| |
98 |
| |
99 GtkWindow * |
| |
100 pidgin_get_toplevel() |
| |
101 { |
| |
102 return toplevel; |
| |
103 } |
| 70 |
104 |
| 71 static gboolean |
105 static gboolean |
| 72 url_clicked_idle_cb(gpointer data) |
106 url_clicked_idle_cb(gpointer data) |
| 73 { |
107 { |
| 74 purple_notify_uri(NULL, data); |
108 purple_notify_uri(NULL, data); |