Bug 170680 - [GTK] Opening a popup menu does not pre-select the active item
Summary: [GTK] Opening a popup menu does not pre-select the active item
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adrian Perez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-10 10:09 PDT by Adrian Perez
Modified: 2017-05-01 01:37 PDT (History)
8 users (show)

See Also:


Attachments
Good: GtkComboBox popped up after clicking (32.41 KB, image/png)
2017-04-10 10:09 PDT, Adrian Perez
no flags Details
Bad: WebKitGTK+ popup menu popped up after clicking (43.13 KB, image/png)
2017-04-10 10:10 PDT, Adrian Perez
no flags Details
Patch (1.75 KB, patch)
2017-04-10 10:29 PDT, Adrian Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Perez 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.
Comment 1 Adrian Perez 2017-04-10 10:10:10 PDT
Created attachment 306700 [details]
Bad: WebKitGTK+ popup menu popped up after clicking
Comment 2 Adrian Perez 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.
Comment 3 Adrian Perez 2017-04-10 10:29:34 PDT
Created attachment 306703 [details]
Patch
Comment 4 Adrian Perez 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 :-)
Comment 5 Michael Catanzaro 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.
Comment 6 WebKit Commit Bot 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>
Comment 7 WebKit Commit Bot 2017-04-10 10:55:55 PDT
All reviewed patches have been landed.  Closing bug.