Created attachment 7005 patch Thread 1 "xfce4-notifyd-c" received signal SIGSEGV, Segmentation fault. 0x00007ffff48f4b64 in fclose@@GLIBC_2.2.5 () from /usr/lib/libc.so.6 (gdb) bt #0 0x00007ffff48f4b64 in fclose@@GLIBC_2.2.5 () at /usr/lib/libc.so.6 #1 0x000000000040674f in xfce_notify_log_clear () at xfce4-notifyd/xfce-notify-log.c:127 #2 0x00007ffff516bf75 in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0 #3 0x00007ffff517df82 in () at /usr/lib/libgobject-2.0.so.0 #4 0x00007ffff5186bcc in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0 #5 0x00007ffff518745b in g_signal_emit_by_name () at /usr/lib/libgobject-2.0.so.0 #6 0x00007ffff516c1a4 in () at /usr/lib/libgobject-2.0.so.0 #7 0x00007ffff51868bd in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0 #8 0x00007ffff5186faf in g_signal_emit () at /usr/lib/libgobject-2.0.so.0 #9 0x00007ffff6d58cbd in () at /usr/lib/libgtk-3.so.0 #10 0x00007ffff6d58d25 in () at /usr/lib/libgtk-3.so.0
Thanks, pushed to master: https://git.xfce.org/apps/xfce4-notifyd/commit/?id=f8691b209d17748a768a5ce199a2f05890acd78e (FWIW the better fix would be to make at least the log clear button insensitive.)
Created attachment 7029 Update log toolbar buttons sensitivity
(In reply to Simon Steinbeiss from comment #1) > (FWIW the better fix would be to make at least the log clear button > insensitive.) Please see the 2nd patch attached.
Nice work! Just two small comments: 1) please always mention the bug number in the commit message (better traceability) 2) I know it's not necessary to always cast to the correct type if you're passing around a pointer, but this (imo, and I'm only a self-taught programmer) is a little less readable: xfce4_notifyd_log_populate (user_data); than this: GtkWidget *log_listbox = user_data; xfce4_notifyd_log_populate (log_listbox); I have fixed point 1), about 2) I can only say that the various projects in Xfce have very diverse code-bases and I've seen this and that around. C makes you write a lot of LOC anyway, so I usually stick to the latter variant (the Gtk+ devs also seem to do it like that in their example code as well as their code in Gtk+ itself).
Oh, and I forgot, pushed to master: https://git.xfce.org/apps/xfce4-notifyd/commit/?id=4ae77c091721a03233e3d30546f918f96276a41b
OK, I agree regarding 2). Moreover, to make it even more clean, I'd tend to using it like GtkWidget *log_listbox = GTK_WIDGET (user_data); xfce4_notifyd_log_populate (log_listbox); i.e. casting types explicitly rather than implicitly. xfce4-terminal is using this approach. But you're right, this is for the sake of readability only; the compiler allows implicit casting of void* to any other pointer type so from its perspective there's no need in doing that.