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 773349 - toolbar: port from gtk_menu_popup()
toolbar: port from gtk_menu_popup()
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-10-22 12:15 UTC by Ernestas Kulik
Modified: 2016-10-25 14:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
toolbar: port from gtk_menu_popup() (5.87 KB, patch)
2016-10-22 12:15 UTC, Ernestas Kulik
none Details | Review
toolbar: port from gtk_menu_popup() (5.88 KB, patch)
2016-10-22 12:17 UTC, Ernestas Kulik
none Details | Review
toolbar: port from gtk_menu_popup() (6.00 KB, patch)
2016-10-24 14:19 UTC, Ernestas Kulik
none Details | Review
toolbar: port from gtk_menu_popup() (5.80 KB, patch)
2016-10-24 18:50 UTC, Ernestas Kulik
committed Details | Review

Description Ernestas Kulik 2016-10-22 12:15:13 UTC
gtk_menu_popup() was deprecated in GTK+ 3.22. By replacing the call with
one of the recommended ones, some code has also become redundant.
Comment 1 Ernestas Kulik 2016-10-22 12:15:18 UTC
Created attachment 338266 [details] [review]
toolbar: port from gtk_menu_popup()
Comment 2 Ernestas Kulik 2016-10-22 12:17:08 UTC
Created attachment 338267 [details] [review]
toolbar: port from gtk_menu_popup()

gtk_menu_popup() was deprecated in GTK+ 3.22. By replacing the call with
one of the recommended ones, some code has also become redundant.
Comment 3 Carlos Soriano 2016-10-24 14:05:20 UTC
Review of attachment 338267 [details] [review]:

much better

::: src/nautilus-toolbar.c
@@ +254,3 @@
+     * “button-release-event” seems to not get fired at this point,
+     * so call this to squelch the warning about an already-removed source.
+     */

returning FALSE removes the source. The problem is that you want to set the resource id to 0 in your priv data.
This comment is slightly misleading. I think you can just say "reset the resource id" or actually just set the id to 0 directly, although I prefer the function with some comment.
Comment 4 Ernestas Kulik 2016-10-24 14:19:27 UTC
(In reply to Carlos Soriano from comment #3)
> returning FALSE removes the source. The problem is that you want to set the
> resource id to 0 in your priv data.

Oh, yeah, right. I did not even notice.
Comment 5 Ernestas Kulik 2016-10-24 14:19:52 UTC
Created attachment 338348 [details] [review]
toolbar: port from gtk_menu_popup()

gtk_menu_popup() was deprecated in GTK+ 3.22. By replacing the call with
one of the recommended ones, some code has also become redundant.
Comment 6 Carlos Soriano 2016-10-24 16:38:51 UTC
Review of attachment 338348 [details] [review]:

::: src/nautilus-toolbar.c
@@ +255,3 @@
+     * it tries to remove a removed source.
+     * Avoid that by doing the cleaning up ourselves.
+     */

this is common glib/gtk+ handling. Not sure it worth so lengthy comment. Instead, something shorter like "reset the id" would be enough...

@@ +258,3 @@
+    unschedule_menu_popup_timeout (data->self);
+
+    return G_SOURCE_REMOVE;

ah yeah, forgot to mention this. Thanks for noticing!
Comment 7 Ernestas Kulik 2016-10-24 18:50:56 UTC
Created attachment 338367 [details] [review]
toolbar: port from gtk_menu_popup()

gtk_menu_popup() was deprecated in GTK+ 3.22. By replacing the call with
one of the recommended ones, some code has also become redundant.
Comment 8 Ernestas Kulik 2016-10-24 18:52:16 UTC
(In reply to Carlos Soriano from comment #6)
> Not sure it worth so lengthy comment.

Oh my. I never thought I could be too explicit, haha.
Comment 9 Ernestas Kulik 2016-10-24 19:12:58 UTC
Okay, so the ID is cleared in the callbacks of “button-press-event” and “button-release-event“, but, since the latter does not fire after the menu is popped up, it does not get cleared. I was explaining that and not the actual source removal.
Comment 10 Carlos Soriano 2016-10-25 14:56:36 UTC
Review of attachment 338367 [details] [review]:

yeah thanks!
Comment 11 Ernestas Kulik 2016-10-25 14:58:29 UTC
Attachment 338367 [details] pushed as 0782ed9 - toolbar: port from gtk_menu_popup()