Bug 242407 - no tray icon for knotes
Summary: no tray icon for knotes
Status: RESOLVED WORKSFORME
Alias: None
Product: knotes
Classification: Applications
Component: general (show other bugs)
Version: 4.10.0
Platform: Ubuntu Linux
: HI grave
Target Milestone: ---
Assignee: Aurelien Gateau
URL:
Keywords:
: 266169 314136 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-06-21 21:10 UTC by Hans Überacher
Modified: 2013-07-08 16:04 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.10.4


Attachments
xsession-errors from login over killall -11 knotes until knotes --nofork (1.57 MB, text/plain)
2013-02-21 22:54 UTC, uran238
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hans Überacher 2010-06-21 21:10:10 UTC
Version:           unspecified (using KDE 4.4.2) 
OS:                Linux

Version: 3.9

After boot, 9 times out of 10 there's a knotes process but no tray icon. I have to kill the process and re-start it to make the icon appear again and be able to use the application

Reproducible: Always



Expected Results:  
should start with a tray icon

OS: Linux (x86_64) release 2.6.32-22-generic
Compiler: cc
Comment 1 Ralf Hansen 2010-10-21 18:11:28 UTC
I can confirm this error. I have 155 notes stored in knotes now.

It's one of my most unliked KDE errors.

I use Fedora 13 x86_64 with kdebase-4.4.5-1.fc13.x86_64 and kdepim-4.4.6-3.fc13.x86_64.

knotes --version :
Qt: 4.6.3
KDE: 4.4.5 (KDE 4.4.5)
KNotes: 3.9
Comment 2 Dave 2010-12-15 22:54:29 UTC
Since updating to 4.5.85, I am having the same problem. In addition, if I try to use knotes with the "invisible" icon, it takes half a dozen clicks to get it to respond at all. I use this applet extensively so it would be a great relief to get this working correctly again.
Comment 3 Christophe Marin 2011-02-13 16:27:10 UTC
*** Bug 266169 has been marked as a duplicate of this bug. ***
Comment 4 Tilman Vogel 2012-01-31 16:26:29 UTC
Confirming on openSUSE 11.4 with KDE 4.8 (knotes-4.8.0-325.2.x86_64). This problem has been present since a long time and it is extremely annoying.
Comment 5 Myriam Schweingruber 2012-09-06 21:48:56 UTC
Setting status to confirmed.
Comment 6 Allen Winter 2013-02-08 17:20:53 UTC
Aurlien,
Since you added KStatusNotiferItem code to knotes, I wonder if you could take a look and see if somehow the implementation needs tweaking in order to fix this bug.

Would you take a look please?
Comment 7 Aurelien Gateau 2013-02-14 09:45:51 UTC
I can't reproduce this with KDE SC 4.10.

I added knotes to the applications launched at startup through System Settings "Startup and Shutdown" then logged out and back: knotes icon was there. Same result after a second logout and a reboot.

When you get this bug: is there an empty spot which can be right-clicked to get knotes menu, or is the icon completely missing?

The StatusNotifierItem (SNI) code in knotes does not do anything fancy, I suspect the bug might be caused by knotes registering itself before Plasma is ready to show the icon. The Plasma code handling these icons have been rewritten in 4.10, so it is possible the bug got fixed by this rewrite. Can you still reproduce it with 4.10? 

If so, it would help a lot if you could do this:

- Start kdebugdialog, make sure "299 kdeui (KNotification)" is checked
- Logout and back to reproduce the bug
- Attach the file ~/.xsession-errors to this bug report

Now that the bug has been reproduced, do this:

1. Make sure qdbus is installed

2. Check knotes has registered an SNI. From the terminal, run this:

qdbus org.kde.StatusNotifierItem-$(pidof knotes)-1

It should print:

/
/MenuBar
/StatusNotifierItem

3. Check the SNI told the world about its icon. Run this:

qdbus org.kde.StatusNotifierItem-$(pidof knotes)-1 /StatusNotifierItem org.kde.StatusNotifierItem.IconName

It should print:

knotes

4. Check the SNI told the world it is active. Run this:

qdbus org.kde.StatusNotifierItem-$(pidof knotes)-1 /StatusNotifierItem org.kde.StatusNotifierItem.Status

It should print:

Active
Comment 8 Myriam Schweingruber 2013-02-14 09:58:23 UTC
This is actually about KDE 4.10, and while I still had an empty spot before that up until KDE 4.9, now Knotes has completely disappeared, it shows up when I remove all previous settings from $HOME/.kde/, but as soon as I copy back the $HOME/.kde/share/apps/knotes/ folder it disappears again.

I have no way of accessing my old notes anymore since KDE 4.8 btw, despite having all the backups, and that really is a serious showstopper as I use Knotes in my daily work. See also bug 314136
Comment 9 Myriam Schweingruber 2013-02-14 09:59:26 UTC
Setting status correctly.
Comment 10 Aurelien Gateau 2013-02-14 10:30:34 UTC
So this may be specific to KNotes after all. Is it only happening at startup for you, or even after restarting knotes?

I don't really know the way this application works, but I assume you have the following files in ~/.kde/share/apps/knotes:

- notes/libkcal-*
- notes.ics

Do you have anything else in there?

Assuming there is nothing else, does the bug go away if you quit knotes, remove all notes/libkcal-* files and restart knotes?

Can you post the results of the steps I listed in my previous comment?
Comment 11 Myriam Schweingruber 2013-02-14 10:59:39 UTC
Actually the $HOME/$kde/share/apps/knotes/notes/ folder contained an image file, removing that solved the problem, the icon is showing now. So this bug is solved.

The problem with not being able to access my old notes persists, though, how can I get those back? That is subject of bug 314495
Comment 12 Myriam Schweingruber 2013-02-14 11:00:36 UTC
*** Bug 314136 has been marked as a duplicate of this bug. ***
Comment 13 uran238 2013-02-21 22:54:55 UTC
Created attachment 77499 [details]
xsession-errors from login over killall -11 knotes until knotes --nofork
Comment 14 uran238 2013-02-21 22:55:55 UTC
This bug seems racy to me. 
The device I see this error on has a slow hyperthreating cpu (atom) and a ssd. So during startup the cpu is the limiting factor and there are probably lots of context switches.
I have seen the issue of a transparent knotes icon on another pc with older versions, but this is a different bug and I only have seen it with kde 4.10, and there is no icon at all.
Sometimes (rare) I'm able to reproduce this bug without a reboot and every single time. And the last time I had this, there were trouble with dbus. Gwenview for example was complaining about this "...did not receive a reply..." error and the window showed up after some minutes.

This time I can't see any dbus problems. I did the qdbus commands and the results were exactly as described. I already had set up the kdebugdialog stuff. So enjoy my bloated .xsessions-errors. I did kill knotes with signal 11, so the crash is fine. After that knotes ran flawlessly.

Application: KNotes (knotes), signal: Segmentation fault
Using host libthread_db library "/lib/libthread_db.so.1".
[KCrash Handler]
#7  0xb77a2424 in __kernel_vsyscall ()
#8  0x41108283 in poll () from /lib/libc.so.6
#9  0xb53c68b8 in g_poll (fds=0x8c54828, nfds=5, timeout=31200) at gpoll.c:132
#10 0xb53b74a9 in g_main_context_poll (context=0x8b9c200, timeout=31200, priority=2147483647, fds=0x8c54828, n_fds=5) at gmain.c:3584
#11 0xb53b6d9b in g_main_context_iterate (context=0x8b9c200, block=1, dispatch=1, self=0x8b9ce00) at gmain.c:3285
#12 0xb53b6ea6 in g_main_context_iteration (context=0x8b9c200, may_block=1) at gmain.c:3351
#13 0xb5c4f50d in QEventDispatcherGlib::processEvents (this=0x8b9a558, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#14 0xb6295b53 in QGuiEventDispatcherGlib::processEvents (this=0x8b9a558, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#15 0xb5c164d1 in QEventLoop::processEvents (this=0xbf8a17dc, flags=...) at kernel/qeventloop.cpp:149
#16 0xb5c1664e in QEventLoop::exec (this=0xbf8a17dc, flags=...) at kernel/qeventloop.cpp:204
#17 0xb5c18ea1 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1218
#18 0xb61c967b in QApplication::exec () at kernel/qapplication.cpp:3823
#19 0x0805dfab in main (argc=3, argv=0xbf8a1964) at /var/tmp/portage/kde-base/knotes-4.10.0/work/knotes-4.10.0/knotes/main.cpp:67

What's very interesting is that the only difference between the backtraces from knotes with and without a systray icon is (beside from addresses) at stackframe 13. If the icon is there it is at qeventdispatcher_glib.cpp:426, if not it's still at :424
(gentoo qt-core-4.8.4-r1)
424    bool result = g_main_context_iteration(d->mainContext, canWait);
425    while (!result && canWait)
426        result = g_main_context_iteration(d->mainContext, canWait);

What scares me a bit is this warning I get sometimes on starting some kde apps, but very reliably when starting knotes:
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.

I did also get the following warning, because knotes wasn't able to cope with the 2 dottet version number(4.7.4), but this has nothing to do with this bug, and I was able to reproduce this bug, when changing the version to 4.7
knotes(2743) KNotesLegacy::convertKNotes1Config: The file " "/home/firetwister/.kde4/share/apps/knotes/notes/libkcal-2094664078.275" " lacks version information but is not a valid KNotes 1 config file either!
Comment 15 uran238 2013-02-22 18:12:31 UTC
The warning:
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
Is known and seems to be harmless:
https://bugs.kde.org/show_bug.cgi?id=297020
Comment 16 uran238 2013-02-24 15:40:00 UTC
I was now able to reproduce this bug on my other machine for the first time.
Comment 17 pv 2013-03-21 15:36:32 UTC
Running a new install of opensuse 12.3 and knotes 4.10, I have _no_ icon in the systemtray.
The appearance of this icon with its ability to search the notes is the _key_ for useful usage of knotes!
In the past, logging in to KDE twice the icon finally popped up. Now it seems to be gone forever ...

So, this bug is _not_ resolved!
Comment 18 Myriam Schweingruber 2013-03-21 15:44:14 UTC
Same here, this onyl worked a fed days, now the tray icon has disappeared again, reopening.

Raising the bug importance and type as this makes knotes pretty unsuable.
Comment 19 Myriam Schweingruber 2013-05-13 10:58:50 UTC
(In reply to comment #18)
> Same here, this onyl worked a fed days, now the tray icon has disappeared
> again, reopening.
> 
> Raising the bug importance and type as this makes knotes pretty unsuable.

Still valid for KDE 4.10.3...
Comment 20 Joaquin Ferrero 2013-07-04 00:06:28 UTC
openSUSE 12.3 (x86_64) Dartmouth
KDE v4.10.3-1.30.9-x86_64

The knotes icon is showed again after a plasma-desktop crash at updating the wallpaper (Astronomy Picture of the Day).

So, I suspect that one workaround for this is:

Alt+F2, write & execute the command:

    kquitapp plasma-desktop

Wait for plasma dying. Alt+F2 again, write & execute the command:

    plasma-desktop
Comment 21 pv 2013-07-07 17:10:37 UTC
This workaround is OK - but is this the solution?
Comment 22 Myriam Schweingruber 2013-07-08 16:04:55 UTC
I can't reproduce this anymore since KDE 4.10.4, so I guess this is finally fixed.

FWIW: I did a fresh installation on this laptop with KDE 4.10.4 and only copied back the data files.