Bug 285309 - Notification doesn't work on login
Summary: Notification doesn't work on login
Status: RESOLVED FIXED
Alias: None
Product: knetworkmanager
Classification: Miscellaneous
Component: general (show other bugs)
Version: 0.9
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Will Stephenson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-30 11:50 UTC by naraesk
Modified: 2011-11-06 00:15 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 0.9.1_rc1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description naraesk 2011-10-30 11:50:49 UTC
Version:           0.9 (using KDE 4.7.2) 
OS:                Linux

I configure the notifications dialog in systemsetting to start a shell script when a network connection is established. This works as expected. After booting and logon to KDE a network connection is active too, but my script is not started. When I disconnect and connect again, my script is executed. This Problem only exists after booting.

Reproducible: Always

Steps to Reproduce:
Set notifications to execute a script after connecting successfully.
Reboot.

Actual Results:  
Script is not executed.

Expected Results:  
Script should be executed.
Comment 1 Lamarque V. Souza 2011-10-30 12:44:57 UTC
Recent Plasma NM versions only start to report notifications *after* the plasmoid is started, but connections can be initiated earlier than that. If the connection is already initiated when you logon then there will be no notification.
Comment 2 naraesk 2011-10-30 12:50:40 UTC
But the connection is only configured in the NM (static IP, special DNS) and only the current user is allowed to use this connection (no system connection). So it shouldn't be possible to connect successfully other then via NM, is it?
Comment 3 Lamarque V. Souza 2011-10-30 13:02:38 UTC
Being more clearer, there two things that can cause this problem:

1. The fact that connection are started earlier in KDE opening session process (even before the splash screen appears), but Plasma NM's notifications only appear after the plasmoid is started, which takes several seconds after the opening session has started.

2. The connection was started before logging on a KDE session.

Case #1 seems to be the cause of your problem. I need to figure out a way to enable non-visual notifications until the plasmoid is started or queue the notifications to run after the plasmoid is started.

Until then you can use NetworkManager's /etc/NetworkManager/dispatcher.d/ to start your script. The script will be run on root's behalf, so you must use 'su -c' to run it was the user you wish. The scripts there are executed when the connection is established and when it is disconnected.
Comment 4 naraesk 2011-10-30 13:33:18 UTC
Ok. Thanks for your explanation. Seems like point 1 causes the problem, so I'll use a script in the dispatcher directory. 

I understood that this bug is caused by the behaviour of KDE and not the NM. But from my point of view it's still a bug (maybe of another component) … when I set notification to start a script, I want this in every case, not only in some.
Comment 5 Lamarque V. Souza 2011-11-06 00:15:34 UTC
Git commit 48c0936d67e24b897d7d12e935bdd82628a2bb86 by Lamarque V. Souza.
Committed on 06/11/2011 at 01:12.
Pushed by lvsouza into branch 'master'.

Delay kded module initialization until the plasmoid is fully
operational. This make the notification manager catches all
notifications.

BUG: 285309
FIXED-IN: 0.9.1_rc1

M  +4    -3    applet/networkmanager.cpp
M  +43   -41   kded/service.cpp

http://commits.kde.org/networkmanagement/48c0936d67e24b897d7d12e935bdd82628a2bb86