lxn / walk

A Windows GUI toolkit for the Go Programming Language
Other
6.78k stars 885 forks source link

Updating window triggers Activating event even when window is not in foreground #764

Open cryptonote-social opened 3 years ago

cryptonote-social commented 3 years ago

I have an app where I want to keep track of when it is "active", aka the "selected app". I gathered that is what the Activating/Deactivating events are intended to track. However, even if I have the app in the background and am actively using, say, Chrome, whenever my background worker thread updates some of the text via SetText in the GUI, the Activating event is triggered. Is this intended behavior? If so is there some way to keep track precisely when an app is in the foreground/front vs not?

I could suspend the background thread and prevent all updates when Deactivating is detected, but I'd like the window to display updates even if it's not in the foreground, just in case part of the window remains visible.