Taskbar icon not changing after sleep/hibernation. Windows 10

Hello.

This happens on Windows 10 but not sure this was ever a problem with older Windows versions.

I have this problem with updating taskbar icon in accordance with different state of the application. The application pulls from server what state it should be in or the application does change state by it self. This changes icon in taskbar.

I have noticed when laptop is set into sleep or hibernation and then back from sleep/hibernation for example this is happening:

Most of the time this works good but sometimes it has the tendency to stop updating icon in taskbar when debugging application the icon is changed in program like it is working normally but the icon never changes in taskbar then I tried restarting Windows Explorer in Task Manager and after restart the application icon in taskbar will have right icon.

So my guess it has something to do with Windows 10 since restarting Windows Explorer process solves this?

Here is the code that updates icon.

def update_icon(self):        
    self.SetIcon(
        wx.Icon(
            self.empl.get_icon(get_small=False),
            wx.BITMAP_TYPE_ICO),
        self.empl.get_traybar_text())

Yes, that’s possible. I’ve noticed that Explorer can be very busy with high CPU utilization for a significant time during wake up situations, so it’s possible that it misses some messages and so it assumes that the application is no longer responding properly. Does it require a restart of Explorer or does just mousing over the icon cause it to update?

I apologize that this is not wxPython-related, but this topic reminds me of a problem that bugs the heck out of me, and I wonder whether others have the same issue -

I hibernate my (Win10) laptop all the time when carrying it between clients; it’s much more convenient, and somewhat faster, than shutting down/starting up. However, it still takes 30-60 seconds to hibernate (I have no idea what causes the variation), and sometimes I get impatient and close the lid before the power light goes out. Once in a while, this results in the machine going to sleep before it finishes hibernating. Hijinks ensue when I try to wake the machine up again: at best it wakes up only long enough to finish hibernating and I have to wake it up again, and at worst I’ve had to sit through a long, long chksk/repair sequence.

Has anybody else had a similar experience, and if so, how have you mitigated it? (I’ve set “Close the lid” to “Do nothing” when the laptop is plugged in, but I actually do want it to sleep if I close the lid while on battery.)

Sorry again for threadjacking.

Hi Robin.

Restart of Explorer is required. Hover with mouse does nothing.

I have been testing this now when I get the chance and what I found out that this is somehow related to when laptop is removed from a dock (does not need to go to hibernate or sleep).
After laptop is removed from dock I need to restart Explorer to get icon updated but program is working right just icon not updating.

There are 3 monitors connected to the dock. Maybe this has something to do with that resolution or scaling is changing when laptop is removed from dock?

Probably, there has also been a report of a similar issue when switching to a HiDPI screen.

If you are able to, please test with a 4.1 preview build. This is likely a wxWidgets issue, so if it’s still a problem in 4.1 then check at https://trac.wxwidgets.org/ and see if it’s been reported already, and if not add a new ticket about it.

Same results with 4.1.

Looked this up on wxWidgets. This is a known issue in wxWidgets and has been fixed but not released yet.
https://trac.wxwidgets.org/ticket/18588#no1

Thanks. That will get pulled in automatically the next time I update the wxWidgets submodule in the wxPython source tree. (Soonish)

1 Like