Bug 170680

Summary: [GTK] Opening a popup menu does not pre-select the active item
Product: WebKit Reporter: Adrian Perez <aperez>
Component: WebKitGTKAssignee: Adrian Perez <aperez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, bburg, bugs-noreply, cdumez, cgarcia, commit-queue, mcatanzaro, ysuzuki
Priority: P2    
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=171492
Attachments:
Description Flags
Good: GtkComboBox popped up after clicking
none
Bad: WebKitGTK+ popup menu popped up after clicking
none
Patch none

Adrian Perez
Reported 2017-04-10 10:09:33 PDT
Created attachment 306698 [details] Good: GtkComboBox popped up after clicking When clicking a GtkComboBox, the popup menu appears with the “active” item below the mouse pointer *and* also pre-selected (e.g. blue background and white text for the Adwaita theme). We try to mimic this behaviour in popup menus from web pages, and WebKitGTK+ already uses a GtkMenu to provide the same look, replicating some of the code in “gtkcombobox.c” to calculate the positioning for the menu. Unfortunately, the “active” item does *NOT* get pre-selected in the WebKitGTK+ popup menus.
Attachments
Good: GtkComboBox popped up after clicking (32.41 KB, image/png)
2017-04-10 10:09 PDT, Adrian Perez
no flags
Bad: WebKitGTK+ popup menu popped up after clicking (43.13 KB, image/png)
2017-04-10 10:10 PDT, Adrian Perez
no flags
Patch (1.75 KB, patch)
2017-04-10 10:29 PDT, Adrian Perez
no flags
Adrian Perez
Comment 1 2017-04-10 10:10:10 PDT
Created attachment 306700 [details] Bad: WebKitGTK+ popup menu popped up after clicking
Adrian Perez
Comment 2 2017-04-10 10:12:06 PDT
If the explanation is not completely clear, please do check the attached images, IMHO they greatly help to understand how our popups are not behaving exactly the same as the ones from GTK+ we are trying to mimic.
Adrian Perez
Comment 3 2017-04-10 10:29:34 PDT
Adrian Perez
Comment 4 2017-04-10 10:35:43 PDT
(In reply to Adrian Perez from comment #2) > If the explanation is not completely clear, please do check the > attached images, IMHO they greatly help to understand how our > popups are not behaving exactly the same as the ones from GTK+ > we are trying to mimic. A patch for having the active item pre-selected on popup is now attached to bug #170553 :-)
Michael Catanzaro
Comment 5 2017-04-10 10:37:55 PDT
Comment on attachment 306703 [details] Patch I wonder if this will break layout tests. Please watch the bots.
WebKit Commit Bot
Comment 6 2017-04-10 10:55:53 PDT
Comment on attachment 306703 [details] Patch Clearing flags on attachment: 306703 Committed r215188: <http://trac.webkit.org/changeset/215188>
WebKit Commit Bot
Comment 7 2017-04-10 10:55:55 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.