Replace pidgin_set_urgent with gtk_window_set_urgency_hint
Testing Done:
Compiled and grepped for usage of the winpidgin functions that were removed.
Reviewed at https://reviews.imfreedom.org/r/161/
--- a/ChangeLog.API Mon Oct 12 23:44:21 2020 -0500
+++ b/ChangeLog.API Tue Oct 13 00:42:59 2020 -0500
@@ -650,6 +650,7 @@
* pidgin_protocol_option_menu_get_selected
* pidgin_set_custom_buddy_icon
* pidgin_set_sensitive_if_input
+ * pidgin_set_urgent, use gtk_window_set_urgency_hint instead. * pidgin_setup_screenname_autocomplete_with_filter
* pidgin_sound_get_event_label
* pidgin_sound_get_event_option
--- a/pidgin/gtkblist.c Mon Oct 12 23:44:21 2020 -0500
+++ b/pidgin/gtkblist.c Tue Oct 13 00:42:59 2020 -0500
@@ -4458,7 +4458,8 @@
gtkblist->headline_callback = NULL;
gtkblist->headline_data = NULL;
gtkblist->headline_destroy = NULL;
- pidgin_set_urgent(GTK_WINDOW(gtkblist->window), FALSE);
+ gtk_window_set_urgency_hint(GTK_WINDOW(gtkblist->window), FALSE); @@ -4965,7 +4966,7 @@
gtk_blist_focused = TRUE;
- pidgin_set_urgent(GTK_WINDOW(gtkblist->window), FALSE);
+ gtk_window_set_urgency_hint(GTK_WINDOW(gtkblist->window), FALSE); gtk_blist_focused = FALSE;
@@ -6722,10 +6723,10 @@
- if (gtkblist->window && !gtk_widget_has_focus(gtkblist->window))
- pidgin_set_urgent(GTK_WINDOW(gtkblist->window), TRUE);
+ if(gtkblist->window && !gtk_widget_has_focus(gtkblist->window)) { + gtk_window_set_urgency_hint(GTK_WINDOW(gtkblist->window), TRUE); --- a/pidgin/gtknotify.c Mon Oct 12 23:44:21 2020 -0500
+++ b/pidgin/gtknotify.c Tue Oct 13 00:42:59 2020 -0500
@@ -640,7 +640,7 @@
mail_window_focus_cb(GtkWidget *widget, GdkEventFocus *focus, gpointer null)
- pidgin_set_urgent(GTK_WINDOW(widget), FALSE);
+ gtk_window_set_urgency_hint(GTK_WINDOW(widget), FALSE); @@ -834,8 +834,9 @@
mail_dialog->in_use = FALSE;
- } else if (!gtk_widget_has_focus(mail_dialog->dialog))
- pidgin_set_urgent(GTK_WINDOW(mail_dialog->dialog), TRUE);
+ } else if(!gtk_widget_has_focus(mail_dialog->dialog)) { + gtk_window_set_urgency_hint(GTK_WINDOW(mail_dialog->dialog), TRUE); --- a/pidgin/gtkutils.c Mon Oct 12 23:44:21 2020 -0500
+++ b/pidgin/gtkutils.c Tue Oct 13 00:42:59 2020 -0500
@@ -1772,15 +1772,6 @@
-void pidgin_set_urgent(GtkWindow *window, gboolean urgent)
- winpidgin_window_flash(window, urgent);
- gtk_window_set_urgency_hint(window, urgent);
pidgin_utils_get_handle(void)
--- a/pidgin/gtkutils.h Mon Oct 12 23:44:21 2020 -0500
+++ b/pidgin/gtkutils.h Tue Oct 13 00:42:59 2020 -0500
@@ -509,16 +509,6 @@
const gchar *key, GtkTreeIter *iter, gpointer data);
- * @window: The window to draw attention to
- * @urgent: Whether to set the urgent hint or not
- * Sets or resets a window to 'urgent,' by setting the URGENT hint in X
- * or blinking in the win32 taskbar
-void pidgin_set_urgent(GtkWindow *window, gboolean urgent);
* pidgin_get_dim_grey_string:
* @widget: The widget to return dim grey for
--- a/pidgin/pidginapplication.c Mon Oct 12 23:44:21 2020 -0500
+++ b/pidgin/pidginapplication.c Tue Oct 13 00:42:59 2020 -0500
@@ -199,10 +199,6 @@
gdk_notify_startup_complete();
/* TODO: Use GtkApplicationWindow or add a window instead */
g_application_hold(application);
--- a/pidgin/plugins/notify.c Mon Oct 12 23:44:21 2020 -0500
+++ b/pidgin/plugins/notify.c Tue Oct 13 00:42:59 2020 -0500
@@ -565,7 +565,7 @@
g_return_if_fail(purplewin != NULL);
g_return_if_fail(purplewin->window != NULL);
- pidgin_set_urgent(GTK_WINDOW(purplewin->window), set);
+ gtk_window_set_urgency_hint(GTK_WINDOW(purplewin->window), set); --- a/pidgin/win32/gtkwin32dep.c Mon Oct 12 23:44:21 2020 -0500
+++ b/pidgin/win32/gtkwin32dep.c Tue Oct 13 00:42:59 2020 -0500
@@ -293,95 +293,6 @@
-static gboolean stop_flashing(GtkWidget *widget, GdkEventFocus *event, gpointer data) {
- GtkWindow *window = data;
- winpidgin_window_flash(window, FALSE);
- if ((handler_id = g_object_get_data(G_OBJECT(window), "flash_stop_handler_id"))) {
- g_signal_handler_disconnect(G_OBJECT(window), (gulong) GPOINTER_TO_UINT(handler_id));
- g_object_steal_data(G_OBJECT(window), "flash_stop_handler_id");
-winpidgin_window_flash(GtkWindow *window, gboolean flash) {
- g_return_if_fail(window != NULL);
- gdkwin = gtk_widget_get_window(GTK_WIDGET(window));
- g_return_if_fail(GDK_IS_WINDOW(gdkwin));
- g_return_if_fail(gdk_window_get_window_type(gdkwin) != GDK_WINDOW_CHILD);
- if (gdk_window_is_destroyed(gdkwin))
- memset(&info, 0, sizeof(FLASHWINFO));
- info.cbSize = sizeof(FLASHWINFO);
- info.hwnd = GDK_WINDOW_HWND(gdkwin);
- if (SystemParametersInfo(SPI_GETFOREGROUNDFLASHCOUNT, 0, &flashCount, 0))
- info.uCount = flashCount;
- info.dwFlags = FLASHW_ALL | FLASHW_TIMER;
- info.dwFlags = FLASHW_STOP;
-winpidgin_conv_blink(PurpleConversation *conv) {
- purple_debug_info("winpidgin", "No conversation found to blink.\n");
- win = pidgin_conv_get_window(PIDGIN_CONVERSATION(conv));
- purple_debug_info("winpidgin", "No conversation windows found to blink.\n");
- window = GTK_WINDOW(win->window);
- /* Don't flash if the window is in the foreground */
- if (GetForegroundWindow() ==
- GDK_WINDOW_HWND(gtk_widget_get_window(GTK_WIDGET(window))))
- winpidgin_window_flash(window, TRUE);
- /* Stop flashing when window receives focus */
- if (g_object_get_data(G_OBJECT(window), "flash_stop_handler_id") == NULL) {
- gulong handler_id = g_signal_connect(G_OBJECT(window), "focus-in-event",
- G_CALLBACK(stop_flashing), window);
- g_object_set_data(G_OBJECT(window), "flash_stop_handler_id", GUINT_TO_POINTER(handler_id));
-winpidgin_conv_im_blink(PurpleConversation *conv, PurpleMessage *pmsg)
- /* Don't flash for our own messages or system messages */
- if (purple_message_get_flags(pmsg) & (PURPLE_MESSAGE_SEND | PURPLE_MESSAGE_SYSTEM))
- if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/win32/blink_im"))
- winpidgin_conv_blink(conv);
void winpidgin_init(void) {
typedef void (__cdecl* LPFNSETLOGFILE)(const LPCSTR);
LPFNSETLOGFILE MySetLogFile;
@@ -417,17 +328,6 @@
purple_debug_misc("winpidgin", "winpidgin_init end\n");
-void winpidgin_post_init(void) {
- purple_prefs_add_none(PIDGIN_PREFS_ROOT "/win32");
- purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/win32/blink_im", TRUE);
- purple_signal_connect(pidgin_conversations_get_handle(),
- "displaying-im-msg", >kwin32_handle, PURPLE_CALLBACK(winpidgin_conv_im_blink),
void winpidgin_cleanup(void) {
--- a/pidgin/win32/gtkwin32dep.h Mon Oct 12 23:44:21 2020 -0500
+++ b/pidgin/win32/gtkwin32dep.h Tue Oct 13 00:42:59 2020 -0500
@@ -44,13 +44,10 @@
void winpidgin_shell_execute(const char *target, const char *verb, const char *clazz);
void winpidgin_ensure_onscreen(GtkWidget *win);
-void winpidgin_conv_blink(PurpleConversation *conv);
-void winpidgin_window_flash(GtkWindow *window, gboolean flash);
DWORD winpidgin_get_lastactive(void);
void winpidgin_init(void);
-void winpidgin_post_init(void);
void winpidgin_cleanup(void);
#endif /* _GTKWIN32DEP_H_ */