Bug 344903 - xfce4-notifyd started on KDE login
Summary: xfce4-notifyd started on KDE login
Status: RESOLVED NOT A BUG
Alias: None
Product: frameworks-knotifications
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Martin Klapetek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-06 14:30 UTC by Konstantin
Modified: 2024-05-06 17:24 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin 2015-03-06 14:30:20 UTC
xfce4-notifyd started at login and owns org.freedesktop.Notifications bus.
I does not know currently, if it happens when some app send notification at login or not.

Reproducible: Always

Steps to Reproduce:
1. Install xfce4-notifyd (or other notification-daemon like notify-osd)
2. Reboot and Login to KDE
3. run notify-send something

Actual Results:  
xfce4-notifyd show notification

Expected Results:  
Plasma Shell must show notification
Comment 1 Martin Klapetek 2015-03-06 14:58:53 UTC
It looks like something is emitting a notification before plasma starts, which sends a dbus message to org.freedesktop.Notification. This in turn activates xfce4-notifyd because it's dbus activatable.

This could possibly be prevented by KNotification checking if it's in a full Plasma session and delaying talking to the server until Plasma is ready. I'll see what we can do.
Comment 2 Konstantin 2015-03-06 15:01:34 UTC
maybe it is a jabber client (but I think this is not a Jabber client bug.)
Comment 3 Martin Klapetek 2015-03-06 15:04:04 UTC
On a second thought, I can only fix KNotification. If anything else will emit a notification before Plasma starts, the dbus activation service file will activate it before Plasma and then there's nothing Plasma can do about it.

Ideally notification displays should be parts of shell rather than having an activatable dbus file. That way it basically hijacks any shell notification service.
Comment 4 Konstantin 2015-03-06 15:07:59 UTC
I think there is a reasonable workaround: watch an owner of org.freedesktop.Notifications bus, and if we are in KDE and plasma runs, kill the owner and install your own daemon.
Comment 5 Martin Klapetek 2015-03-06 15:10:46 UTC
No. Some people actually do prefer using different notification clients.
Comment 6 Konstantin 2015-03-06 15:13:53 UTC
But it can be tuned in settings, like Colibri notifications in KDE4 do.
For example, add a setting named "notification daemon" to default apps (like window manager) and made KDE check for this particular notification daemon. If notification daemon set to Plasma, use workaround. Else do nothing and wait for external daemon.
Comment 7 Martin Klapetek 2015-03-06 15:25:37 UTC
To be honest, this should be up to the 3rd party parts. Ideally xfce4-notifyd should not be dbus activatable but rather autostarted with proper desktops by using the autostart features.

This is (again) not really our fault.
Comment 8 Martin Klapetek 2015-03-16 12:56:50 UTC
So I actually checked our KNotification code and we definitely not start the notification service if it isn't running, so my bet would be that your xfce4-notifyd is either autostarted (by installing the .desktop file into $AUTOSTART folder) or there's something else calling to org.freedesktop.Notifications during session restore, maybe a GNotification (I don't know its code, but given it's not checking for server capabilities, maybe it does not check for the service existence first at all and calls the interface directly, but that's only strong speculation on my side) or some other class, that would cause the xfce4-notifyd to load before Plasma and blocking Plasma's own notifications.

However, there's nothing from Plasma side that would make it auto started. And we can't exactly prevent it either as such situations may be wanted (and I do have reports about that).

So my suggestion is to either remove the dbus .service file for it and/or make sure the app is started only with xfce (it should have its own autostart folder I believe).
Comment 9 FiveYellowMice 2015-04-13 15:31:07 UTC
I get a workaround for it. Edit "/usr/share/dbus-1/services/org.xfce.xfce4-notifyd.Notifications.service" and change the exec key to a script that verifies if it is KDE or not. Here is my "/usr/lib/xfce4/notifyd/xfce4-notifyd-iskde".

#!/bin/bash
# This file is used to prevent xfce4-notifyd startx with kde

if [[ $XDG_CURRENT_DESKTOP = "KDE" ]]
then 
    exit
fi

exec /usr/lib/xfce4/notifyd/xfce4-notifyd