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 710297 - undo notification shouldn't timeout if pointer is above it
undo notification shouldn't timeout if pointer is above it
Status: RESOLVED FIXED
Product: libgd
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: libgd maintainer(s)
libgd maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-10-16 16:13 UTC by Matthias Clasen
Modified: 2015-03-03 13:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
notification: Use G_SOURCE_CONTINUE/REMOVE for clarity (1.12 KB, patch)
2015-02-27 16:56 UTC, Kalev Lember
committed Details | Review
notification: Keep it visible while the pointer is hovering over it (3.91 KB, patch)
2015-02-27 16:56 UTC, Kalev Lember
reviewed Details | Review
notification: Use gtk_window_(un)register_window (1.62 KB, patch)
2015-02-27 16:56 UTC, Kalev Lember
committed Details | Review
notification: Break out two functions (2.32 KB, patch)
2015-03-01 17:53 UTC, Kalev Lember
committed Details | Review
notification: Don't timeout if a pointer is above the notification (2.69 KB, patch)
2015-03-01 17:53 UTC, Kalev Lember
committed Details | Review

Description Matthias Clasen 2013-10-16 16:13:51 UTC
(from Montreal summit session)

The undo notification goes away way too fast. In general, notifications should not go away while the pointer is hovering over it.
Comment 1 Kalev Lember 2015-02-27 16:56:05 UTC
Created attachment 298102 [details] [review]
notification: Use G_SOURCE_CONTINUE/REMOVE for clarity
Comment 2 Kalev Lember 2015-02-27 16:56:12 UTC
Created attachment 298103 [details] [review]
notification: Keep it visible while the pointer is hovering over it
Comment 3 Kalev Lember 2015-02-27 16:56:21 UTC
Created attachment 298104 [details] [review]
notification: Use gtk_window_(un)register_window
Comment 4 Kalev Lember 2015-02-27 16:58:29 UTC
The 2nd patch is the actual fix, 1st and 3rd are just unrelated cleanups I did while looking at the code.
Comment 5 Debarshi Ray 2015-02-27 17:07:41 UTC
Review of attachment 298102 [details] [review]:

Looks good to me. Thanks, Kalev.
Comment 6 Debarshi Ray 2015-02-27 17:16:04 UTC
Review of attachment 298104 [details] [review]:

Looks good to me.
Comment 7 Debarshi Ray 2015-02-27 17:30:04 UTC
Review of attachment 298103 [details] [review]:

I would have preferred an approach where we queue an auto-hide when the pointer leaves the notification, and unqueue it when it enters. Here is an example of how gnome-documents controls the overlaid chrome while previewing: https://git.gnome.org/browse/gnome-documents/tree/src/preview.js#n644

If I understand correctly, with this patch, it is possible for the notification to get hidden almost immediately after the pointer leaves. eg., if gd_notification_timeout_cb happens to get invoked as soon as the pointer left. This can be a bit jarring for the user.
Comment 8 Cosimo Cecchi 2015-02-27 17:32:26 UTC
Review of attachment 298103 [details] [review]:

I agree with Debarshi here, that sounds like a better approach.
Comment 9 Kalev Lember 2015-03-01 16:57:47 UTC
Attachment 298102 [details] pushed as 0c1d758 - notification: Use G_SOURCE_CONTINUE/REMOVE for clarity
Attachment 298104 [details] pushed as 3dbcd6a - notification: Use gtk_window_(un)register_window
Comment 10 Kalev Lember 2015-03-01 17:52:41 UTC
(In reply to Debarshi Ray from comment #7)
> Review of attachment 298103 [details] [review] [review]:
> 
> I would have preferred an approach where we queue an auto-hide when the
> pointer leaves the notification, and unqueue it when it enters. Here is an
> example of how gnome-documents controls the overlaid chrome while
> previewing:
> https://git.gnome.org/browse/gnome-documents/tree/src/preview.js#n644
> 
> If I understand correctly, with this patch, it is possible for the
> notification to get hidden almost immediately after the pointer leaves. eg.,
> if gd_notification_timeout_cb happens to get invoked as soon as the pointer
> left. This can be a bit jarring for the user.

Thanks, I've switched this to use the same logic now.

I'm a bit unsure how long the timeout should be when an user moves the pointer away from the notification. Perhaps it should be shorter than the regular timeout?

Anyway, this can be tuned later. I've used the same timeout length for now.
Comment 11 Kalev Lember 2015-03-01 17:53:13 UTC
Created attachment 298218 [details] [review]
notification: Break out two functions
Comment 12 Kalev Lember 2015-03-01 17:53:20 UTC
Created attachment 298219 [details] [review]
notification: Don't timeout if a pointer is above the notification
Comment 13 Debarshi Ray 2015-03-03 12:12:58 UTC
Review of attachment 298218 [details] [review]:

Makes sense. Thanks, Kalev.
Comment 14 Debarshi Ray 2015-03-03 12:25:41 UTC
Review of attachment 298219 [details] [review]:

Looks good to me.

::: libgd/gd-notification.c
@@ +452,3 @@
+  GdNotificationPrivate *priv = notification->priv;
+
+  if ((event->window == priv->bin_window) &&

I don't know if this check is required, but Kalev showed me that GtkButton is doing the same. Doesn't hurt, I guess.
Comment 15 Kalev Lember 2015-03-03 13:26:25 UTC
Thanks Rishi!

Attachment 298218 [details] pushed as a4d5a10 - notification: Break out two functions
Attachment 298219 [details] pushed as b33b9a0 - notification: Don't timeout if a pointer is above the notification