Bug 567215 - [GTK4] Port SWT Combo
Summary: [GTK4] Port SWT Combo
Status: REOPENED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.23   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Joel Majano CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on: 567257 577370
Blocks: 540385
  Show dependency tree
 
Reported: 2020-09-21 13:27 EDT by Soraphol (Paul) Damrongpiriyapong CLA
Modified: 2021-12-06 14:18 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Soraphol (Paul) Damrongpiriyapong CLA 2020-09-21 13:27:27 EDT

    
Comment 1 Eclipse Genie CLA 2020-09-21 16:49:39 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/169689
Comment 3 Eclipse Genie CLA 2021-06-30 11:54:19 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/182657
Comment 5 Eclipse Genie CLA 2021-07-05 11:13:22 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/182765
Comment 7 Joel Majano CLA 2021-12-01 16:10:49 EST
Reopening this bug as CSS is not working correctly in Combo widgets. They are in a better state, but not completely correct yet.
Comment 8 Joel Majano CLA 2021-12-02 14:13:36 EST
After this patch (https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/176058) the Combo CSS almost works correctly however, the drop down menu has no CSS applied to it. The reason for this is that the menuHandle which is used to set its CSS values is not populated. The logic responsible for setting the menuHandle depends on a GTK3 function, this didn't cause any crashes since it first checks for popupHandle, which again is not set in GTK4 as the logic to set it is guarded from GTK4.

TL;DR: Problem is two fold. 

1) Popup handle is not set as the hierarchy for Combo is different from GTK3 to GTK4 (window in GTK3 & popover in GTK4)

2) Due to 1, menuHandle is not populated since the logic checks for popupHandle != 0, thus CSS is never applied to the drop down in a Combo.
Comment 9 Joel Majano CLA 2021-12-02 17:03:15 EST
With menuHandle now not zero, the drop down background is correct. However, it appears that the CSS node "-gtk-secondary-caret-color" is different than in GTK3, which results in an incorrect color when an item is hovered.
Comment 10 Eclipse Genie CLA 2021-12-02 17:48:08 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/188489
Comment 11 Joel Majano CLA 2021-12-02 17:50:53 EST
While the secondary caret color is different, the main issue is that the default GTK4 theme chooses the color when an item is hovered. The default GTK3 theme on my Fedora 35 install defaults to blue when highlighted, while in GTK4 it is an off white color. So for now, a patch can be uploaded as the theme is GTK related, and not an SWT issue.

One outstanding issue is that popupHandle is not mapped. This is not straightforward to fix due to popupHandle being used for more than just setting CSS properties. It is used to add items and other miscellaneous things, so it will have to be revisited later.