Xfce4-notifyd fading out

Version 0.3.1 of xfce4-notifyd has added a hidden option named "do-fadeout". That means that this ugly hack isn't required any longer. To disable the fading all you have to do is change the value to "false" using xconf-query:

xfconf-query -c xfce4-notifyd -p /do-fadeout -n -t bool -s false

Whoever is using xfce4-notifyd with a compositor has probably noticed that there's an independent fade-out going on for every notification pop-up. Apparently it's built into xfce4-notifyd itself and it's the standard behaviour if xfce4-notifyd is running on a composited desktop.

I wasn't the only one complaining about it as it turns out. There's also a bug report on the Xfce bug tracker. Unfortunately, there's no solution for this or a compile time option which would disable it.

Being slightly curious, I decided to check out the source code and see if there's a really, really obvious part responsible for the fading out. It didn't take long for me to find someting that looked promising. At line 627, in this file, there's an xfce_notify_window_expire_timeout() function. Since I have literally zero C programming knowledge, I decided to just remove a few lines from it and see what happens.

Weirdly enough, it worked. The notification pop-ups disappeared instantly, without that unnecessary fade-out. Everything else seemed to work as intended, but I haven't had enough time to test it for potential side-effects.

--- xfce4-notifyd-0.2.4/xfce4-notifyd/xfce-notify-window.c  2013-04-21 16:42:08.000000000 +0200
+++ xfce-notify-window.c    2016-05-09 17:47:19.730137584 +0200
@@ -631,18 +631,9 @@

     window->expire_id = 0;

-    fade_transparent =
-        gdk_screen_is_composited(gtk_window_get_screen(GTK_WINDOW(window)));
-
-    if(fade_transparent) {
-        window->fade_id = g_timeout_add(FADE_CHANGE_TIMEOUT,
-                                        xfce_notify_window_fade_timeout,
-                                        window);
-    } else {
-        /* it might be 800ms early, but that's ok */
-        g_signal_emit(G_OBJECT(window), signals[SIG_CLOSED], 0,
-                      XFCE_NOTIFY_CLOSE_REASON_EXPIRED);
-    }
+    /* it might be 800ms early, but that's ok */
+    g_signal_emit(G_OBJECT(window), signals[SIG_CLOSED], 0,
+                    XFCE_NOTIFY_CLOSE_REASON_EXPIRED);

     return FALSE;
 }