After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 746508 - ChatView: update toplevel state when parent is set
ChatView: update toplevel state when parent is set
Status: RESOLVED FIXED
Product: polari
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Polari maintainers
Polari maintainers
Depends on:
Blocks:
 
 
Reported: 2015-03-20 06:15 UTC by Giovanni Campagna
Modified: 2015-03-30 00:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ChatView: update toplevel state when parent is set (1.33 KB, patch)
2015-03-20 06:15 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2015-03-20 06:15:37 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.
Comment 1 Giovanni Campagna 2015-03-20 06:15:39 UTC
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.
Comment 2 Florian Müllner 2015-03-23 22:20:04 UTC
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 ...
Comment 3 Giovanni Campagna 2015-03-30 00:21:58 UTC
Attachment 299915 [details] pushed as 136ae28 - ChatView: update toplevel state when parent is set