GNOME Bugzilla – Bug 746508
ChatView: update toplevel state when parent is set
Last modified: 2015-03-30 00:22:00 UTC
Reproducer: 1) Connect to freenode 2) Wait for nickserv to spam with "this nickname is registered" / "you're now identified for ..." 3) While polari is focused, click on the notification from the shell, opening a private conversation with nickserv (Don't scroll or switch to another app) 4) Observe that even though polari is focused, the dot in the shell is still present, because the messages were not acked 5) Switch to another channel 6) Switch to another app and back to polari (This is a good moment to check that indeed messages were not acked in d-feet) 7) Switch to nickserv 8) Observe that still messages where not acked - nickserv's ChatView still thinks polari is not focused Alternatives to this patch: 1) Stop caching _toplevelFocus and replace with an accessor that queries the widget flags 2) Maybe initialize _toplevelFocus to true instead of false? I don't know if the opposite case works, maybe it's harder to reproduce.
Created attachment 299915 [details] [review] ChatView: update toplevel state when parent is set state-flags-changed will be emitted only when the state flags actually change, and therefore may not fire if the widget is mapped to a window that is already focused. In that case our tracking will get confused and think that the window is not focused, resulting in messages that are not properly acked.
Review of attachment 299915 [details] [review]: Can't quite make up my mind whether I'd prefer one of the alternatives, so let's just go with this ...
Attachment 299915 [details] pushed as 136ae28 - ChatView: update toplevel state when parent is set