RESOLVED FIXED Bug 162603
[GTK] Switch to use GMenu internally in the context menu implementation
https://bugs.webkit.org/show_bug.cgi?id=162603
Summary [GTK] Switch to use GMenu internally in the context menu implementation
Carlos Garcia Campos
Reported 2016-09-27 03:50:23 PDT
I always resisted to do this because GtkAction is superior and by far a lot easier to use than all GAction and GMenu APIs, but soon GTK+ will remove all deprecated APIs, so we need a solution for GtkAction.
Attachments
Patch (25.46 KB, patch)
2016-09-27 04:03 PDT, Carlos Garcia Campos
mcatanzaro: review+
Carlos Garcia Campos
Comment 1 2016-09-27 04:03:24 PDT
Michael Catanzaro
Comment 2 2016-09-27 05:54:51 PDT
Comment on attachment 289933 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=289933&action=review Thank you! > Source/WebKit2/ChangeLog:8 > + Switch to use GAction instead of GtkAtion internally, but still keeping a GtkAction associated to the GAction, GtkAtion -> GtkAction > Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.cpp:160 > + GUniquePtr<char> actionName(g_strdup_printf("action-%" G_GUINT64_FORMAT, ++actionID)); Nit: since it's a uint64_t rather than a guint64, I would print it with PRIu64 > Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.h:64 > + HashMap<unsigned long, void*> m_signalHandlers; I don't understand, why use void* instead of GAction*? GAction* would obviously be safer.
Carlos Garcia Campos
Comment 3 2016-09-28 00:15:54 PDT
(In reply to comment #2) > Comment on attachment 289933 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=289933&action=review > > Thank you! > > > Source/WebKit2/ChangeLog:8 > > + Switch to use GAction instead of GtkAtion internally, but still keeping a GtkAction associated to the GAction, > > GtkAtion -> GtkAction > > > Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.cpp:160 > > + GUniquePtr<char> actionName(g_strdup_printf("action-%" G_GUINT64_FORMAT, ++actionID)); > > Nit: since it's a uint64_t rather than a guint64, I would print it with > PRIu64 > > > Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.h:64 > > + HashMap<unsigned long, void*> m_signalHandlers; > > I don't understand, why use void* instead of GAction*? GAction* would > obviously be safer. To avoid casts between GAction - GSimpleAction. I don't think there any risk in using void*, g_signal_handler_disconnect expects a gpointer, and this is used privately only.
Carlos Garcia Campos
Comment 4 2016-09-28 00:51:35 PDT
Michael Catanzaro
Comment 5 2016-09-28 00:57:26 PDT
(In reply to comment #3) > To avoid casts between GAction - GSimpleAction. I don't think there any risk > in using void*, g_signal_handler_disconnect expects a gpointer, and this is > used privately only. Well it's your choice, but I would use casts there as usual.
Note You need to log in before you can comment on or make changes to this bug.