andrew-bibb / cmst

QT GUI for Connman
174 stars 37 forks source link

CMST tray icon in non-kde desktop #119

Closed ghost closed 5 years ago

ghost commented 8 years ago

I have Enlightenment E19 and use stalonetray as systray. I do have a bunch of kde and qt libs and apps (qt 5.5). When I try to open it normaly, it start but freezes. When I open it in console, I get "QSystemTrayIcon::setVisible: No Icon set" all the time and makes the app unresponsive.

I don't think it's a CMST issue, since I see the same behaviour in other apps. But I do think CMST should be able to catch this and don't display a tray icon, or something alike.

andrew-bibb commented 8 years ago

This is odd. One of the first things the program does is check to see if it can find a system tray. If not a nice messagebox pops up to tell you that no tray was found and all further code dealing with the tray is skipped Your error is occurring past that point so I'm assuming the tray is being found, but for some reason an icon is not able to be set.

Short term you should be able to start the program with the -d option (cmst -d). This will disable the tray icon completely and should solve the unresponsive problem. This can also be set from the preferences tab so you don't need to do it every time (and provided you also have "Use Start Options" checked in preferences). .

I've started to upgrade my VirtualBox installation and need to bring my basic Arch system on it up to date. Then I'll install enlightenment and stalonetray and see if I can find what is happening. Give me a day or two to get my VitualBox test system up and running and we'll go from there.

ghost commented 8 years ago

Probably i should have mention that the -d option does work.

Again, i have the feeling that the problem is how qt deals with tray icons, specially since they are trying to deprecate xembed (which stalonetray still sports) El nov. 19, 2015 1:32 PM, "andrew-bibb" notifications@github.com escribió:

This is odd. One of the first things the program does is check to see if it can find a system tray. If not a nice messagebox pops up to tell you that no tray was found and all further code dealing with the tray is skipped Your error is occurring past that point so I'm assuming the tray is being found, but for some reason an icon is not able to be set.

Short term you should be able to start the program with the -d option (cmst -d). This will disable the tray icon completely and should solve the unresponsive problem. This can also be set from the preferences tab so you don't need to do it every time (and provided you also have "Use Start Options" checked in preferences). .

I've started to upgrade my VirtualBox installation and need to bring my basic Arch system on it up to date. Then I'll install enlightenment and stalonetray and see if I can find what is happening. Give me a day or two to get my VitualBox test system up and running and we'll go from there.

— Reply to this email directly or view it on GitHub https://github.com/andrew-bibb/cmst/issues/119#issuecomment-158110377.

andrew-bibb commented 8 years ago

OK, I've got a virtual machine up and running with Enlightenment E19 and with Stalonetray downloaded. Question though, how are you starting stalonetray with Enlightenment? Before, after, any special command line arguments or anything I need to match in the conf file?

andrew-bibb commented 8 years ago

So I removed the stalonetray startup command from .xinitrc and started it manually after E19 was up. I got a tray, started CMST and the network icon showed up in the tray almost instantly. The icon seems to work with mouse clicks and the popup menu just the way it is supposed to. Not sure where to go from here as it seems to be working just fine at this end.

ghost commented 8 years ago

Hi Andrew,

First, thanks for taking the time to investigate and respond.

As I said, I don't think this is a CMST issue but rather in QT. Here is what I do and what I see:

I have both stalonetray and cmst set to start when E start, using E's own start method (it's in options -> apps -> start apps). But that's no the problem.

What I've just noticed is that I am forcing these 2 env vars: QT_STYLE_OVERRIDE=breeze and XDG_CURRENT_DESKTOP=kde and is the later the one that triggers the error.

The problem is taht if I don't use those 2 vars, QT5 themes in KDE apps don't work at all (dolphin, gwenview, systemsettings, etc). They lost both style theme and icon theme.

Does it make sense to you?

2015-11-23 23:41 GMT-03:00 andrew-bibb notifications@github.com:

So I removed the stalonetray startup command from .xinitrc and started it manually after E19 was up. I got a tray, started CMST and the network icon showed up in the tray almost instantly. The icon seems to work with mouse clicks and the popup menu just the way it is supposed to. Not sure where to go from here as it seems to be working just fine at this end.

— Reply to this email directly or view it on GitHub https://github.com/andrew-bibb/cmst/issues/119#issuecomment-159135132.

Wido

andrew-bibb commented 8 years ago

This is a huge help. I confirm that setting XDG_CURRENT_DESKTOP=kde causes CMST to hang at startup. As you noted, QT reads that variable to set themes appropriately. I suspect it also uses it to define the system tray. My guess is that when it is set to kde then QT tries to put a tray icon in a Plasma compliant tray, but you are not running that, you're running an xembed compliant tray.

Limited testing so far, but I can disable the xdg_current_desktop check in code when the system tray is created. I tried and it worked fine. Now I need to make sure that doing so does not break anything else, such as real KDE.

andrew-bibb commented 8 years ago

I still need to do more testing in E19 with stalonetray and in KDE, but I've uploaded code to the devel branch which should implement the fix. Can you download from devel, build and test it out at your end?

My programming box uses an xembed tray and I set XDG_CURRENT_DESKTOP=kde on it and the fix worked. My initial testing on KDE on the VM seemed to result in no breakage, but I want to look in more detail before I merge this change into the master branch.

andrew-bibb commented 8 years ago

My testing seemed to indicate no breakage so I've merged the devel branch into master and uploaded the code here.

I'm going to close this assuming I've got it, but if the problem presists please feel free to reopen it.

ghost commented 8 years ago

Hi Andrew,

Sorry I haven't got back to you, but having end of semester, exams and finals, plus work, family....I forgot to get back to you.

I can confirm, from my side, that now is working fine. Thank you! and thanks for the tame you took to look into this!

2015-12-01 21:31 GMT-03:00 andrew-bibb notifications@github.com:

Closed #119 https://github.com/andrew-bibb/cmst/issues/119.

— Reply to this email directly or view it on GitHub https://github.com/andrew-bibb/cmst/issues/119#event-479636615.

Wido

ghost commented 7 years ago

Hi Andres, how are you?

Sorry to re-open this issue but, last week Debian updated cmst to version '2016.10.03-2' and I've think there's been a regression in this issue, as I'm facing the exact same symptoms last time.

When I try to start cmst, having the env vars "XDG_CURRENT_DESKTOP=kde", cmst doesn't start and I see in the console that it starts to print "QSystemTrayIcon::setVisible: No Icon set" over and over again.

Debian has updated lots of qt5/kde5 packages, so I can't actually confirm is an issue on cmst or kde (or debian or enlightenment), but since we have already workied on this, I thought in first asking you and later got downstream..

cheers!

El mié., 2 de dic. de 2015 a la(s) 09:36, Wido wido.gg@gmail.com escribió:

Hi Andrew,

Sorry I haven't got back to you, but having end of semester, exams and finals, plus work, family....I forgot to get back to you.

I can confirm, from my side, that now is working fine. Thank you! and thanks for the tame you took to look into this!

2015-12-01 21:31 GMT-03:00 andrew-bibb notifications@github.com:

Closed #119 https://github.com/andrew-bibb/cmst/issues/119.

— Reply to this email directly or view it on GitHub https://github.com/andrew-bibb/cmst/issues/119#event-479636615.

Wido

Wido

andrew-bibb commented 7 years ago

Last time this was E19. I have a current version of Enlightenment in a VM (unfortunately not here though), but I think that is up to 20 or 21. Which versions of each program are you running? That would be Enlightenment and stalonetray.

I just looked through the code I put in last year for this issue and I haven't touched anything near it since. The regression does not look like it is at this end, but I might still be able to work around whatever it is if I can reproduce it.

ghost commented 7 years ago

You are right, now it's E21.3. But I noticed the error when updating cmst (was working fine till last weekend). Stalonetray it's in version 0.8.1-1. I'm using debian stretch fully up-to-date, with sparky linux repos for enlightenment.

As I said, a bunch of other qt5/kde stuff was updated along. This has also crashed kontact5, but not dolphin or systemsettings5

Now, if I run cmst setting XDG_CURRENT_DESTOP as kde4, gnome or gtk2, it works fine (but doing that breaks my icons in the rest of my qt apps). I also have QT_STYLE_OVERRIDE=breeze, as they tq apps don't pick the style either.

thanks for taking the time to look into it =)

El mar., 22 de nov. de 2016 a la(s) 21:01, andrew-bibb < notifications@github.com> escribió:

Last time this was E19. I have a current version of Enlightenment in a VM (unfortunately not here though), but I think that is up to 20 or 21. Which versions of each program are you running? That would be Enlightenment and stalonetray.

I just looked through the code I put in last year for this issue and I haven't touched anything near it since. The regression does not look like it is at this end, but I might still be able to work around whatever it is if I can reproduce it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/andrew-bibb/cmst/issues/119#issuecomment-262402601, or mute the thread https://github.com/notifications/unsubscribe-auth/ALp_TaVtewMcbqekEOWQ3ytYmhpcsT6Vks5rA4JfgaJpZM4GlhFQ .

Wido

andrew-bibb commented 7 years ago

A bit to report here, but short answer is not looking good. My Enlightenment VM is running 0.21.3-1 and I installed stalonetray 08.3-1, so a bit newer than yours. I set "XDG_CURRENT_DESKTOP=kde" and everything fired up just the way it was supposed to, with CMST putting an icon right in the tray.

Unfortunately I am going to be away from that VM for the next 4 days, and for the week after that it will be very spotty when I can work on it (one of my kids getting married - occupying my time). I want to keep at this, and one of the things I did not have set was the style override. Want to check everything the way you've got set up the best that I can.

ghost commented 7 years ago

Hey, congratulations on you boy/girl getting married!

For the timing, don't worry. I understand this is done in mostly your spare time, so it's fine. I'm using a hack on running cmst in a screen, with then variable modified. I can live with that for the time being.

Thanks!

El mié., 23 de nov. de 2016 a la(s) 20:24, andrew-bibb < notifications@github.com> escribió:

A bit to report here, but short answer is not looking good. My Enlightenment VM is running 0.21.3-1 and I installed stalonetray 08.3-1, so a bit newer than yours. I set "XDG_CURRENT_DESKTOP=kde" and everything fired up just the way it was supposed to, with CMST putting an icon right in the tray.

Unfortunately I am going to be away from that VM for the next 4 days, and for the week after that it will be very spotty when I can work on it (one of my kids getting married - occupying my time). I want to keep at this, and one of the things I did not have set was the style override. Want to check everything the way you've got set up the best that I can.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/andrew-bibb/cmst/issues/119#issuecomment-262654339, or mute the thread https://github.com/notifications/unsubscribe-auth/ALp_TWu4IkX0NRfmsFRjbyoBq5Idkv-Bks5rBMshgaJpZM4GlhFQ .

-- Wido

andrew-bibb commented 7 years ago

I've tried several things, even installed the breeze theme in my Enlightenment VM, and everything works fine. I'm even getting the breeze icons to show up in the tray.

There is one thing not working and may be related. I cannot keep the environment variable QT_STYLE_OVERRIDE set where I want. I set and export to "breeze" in my .xinitrc, but when I check in a console it says it is set to gtk2. I then set and export from a console, it seems to take, but once I start stalonetray (I start it manually) and check in another console window it has reverted to gtk2.

How exactly are you setting that environment variable, and is it holding?

PS: Thanks for the congragulations on the wedding. It was a great time, but exhausting.