Currently for popups menus windows of type GTK_WINDOW_POPUP are used, but this is not possible with GTK4 anymore. The way to create a popup window is using GtkPopover. If we want to mimic GTK combo boxes, we likely would need to reimplement parts of GtkTreePopover, which is the internal widget used as the popup part of combo boxes. On the other hand, we may be able to put the widget currently used inside a GtkPopover instead of inside the popup GtkWindow, apply the same CSS classes that GtkComboBox uses, and maybe that would be already good. Note that ideally we want to use the same code for both GTK3 and GTK4, as it was done recently for context menus in bug #170553 :)
Created attachment 400806 [details] Patch
Comment on attachment 400806 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=400806&action=review > Source/WebKit/UIProcess/gtk/WebPopupMenuProxyGtk.cpp:335 > + GdkRectangle windowRect = { rect.x(), rect.y(), rect.width(), rect.height() }; This exact same line is repeated below, so I would take it out of the “#if USE(GTK4)” guard.
(In reply to Adrian Perez from comment #2) > Comment on attachment 400806 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=400806&action=review > > > Source/WebKit/UIProcess/gtk/WebPopupMenuProxyGtk.cpp:335 > > + GdkRectangle windowRect = { rect.x(), rect.y(), rect.width(), rect.height() }; > > This exact same line is repeated below, so I would take it out of > the “#if USE(GTK4)” guard. Yes, but inside a GTK_CHECK_VERSION(3, 24, 0) if
(In reply to Carlos Garcia Campos from comment #3) > (In reply to Adrian Perez from comment #2) > > Comment on attachment 400806 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=400806&action=review > > > > > Source/WebKit/UIProcess/gtk/WebPopupMenuProxyGtk.cpp:335 > > > + GdkRectangle windowRect = { rect.x(), rect.y(), rect.width(), rect.height() }; > > > > This exact same line is repeated below, so I would take it out of > > the “#if USE(GTK4)” guard. > > Yes, but inside a GTK_CHECK_VERSION(3, 24, 0) if You are right, all good then!
Committed r262414: <https://trac.webkit.org/changeset/262414>