Patrick Ziegler

Results 237 comments of Patrick Ziegler

Caused by https://github.com/eclipse-egit/egit/commit/ec960817dc4b0b6e303df506e0d37858a5bbe25d

I can only report what I'm seeing. But the issue is definitely the result of this CSS class: ```css .MPartStack.active .MPart Form Composite Section Tree.org-eclipse-egit-ui-StagingView { background-color: #FFFFFF; } ```

> I can only report what I'm seeing. But the issue is definitely the result of this CSS class: > > .MPartStack.active .MPart Form Composite Section Tree.org-eclipse-egit-ui-StagingView { > background-color:...

> When setBackground() is called on a Tree widget (triggered by CSS styling from Eclipse's active part stack), GTK may grab focus to the widget during the CSS application process:...

> [@ptziegler](https://github.com/ptziegler) just a wild guess, maybe just always call `defaultBackground()` > > ``` > @Override > GdkRGBA getContextBackgroundGdkRGBA () { > if (background != null) { > defaultBackground(); >...

> if (background != null && background != defaultBackground()) { The colors are are genuinely different: (255, 255, 255) and (248, 248, 248), to be precise. And even then, I...

I think I've pieced together what exactly is going wrong here. The CSS styling is a little bit of a red herring. It is the symptom, rather than the cause....

Here's a small reproducer: ```java import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableItem; import org.eclipse.swt.widgets.Tree; import org.eclipse.swt.widgets.TreeItem; public...

Maybe this is too simplistic, but what about putting the `GTK3.gtk_style_context_invalidate(context)` in a `Display.asyncExec()`? This way all pending events are processed before the context is invalidated and the issue disappears.

Those were the tests that were originally failing when the call to `gtk_style_context_invalidate` was removed: ``` [Test Result](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/) (19 failures ) [org.eclipse.ui.tests.dialogs.UIDialogsAuto.testCopyMoveProject](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/UIDialogsAuto/testCopyMoveProject/) [org.eclipse.ui.tests.dialogs.UIDialogsAuto.testEditorSelection](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/UIDialogsAuto/testEditorSelection/) [org.eclipse.ui.tests.dialogs.UIWizardsAuto.testNewProjectPage1](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/UIWizardsAuto/testNewProjectPage1/) [org.eclipse.ui.tests.dialogs.UIWizardsAuto.testNewProjectPage2](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/UIWizardsAuto/testNewProjectPage2/) [org.eclipse.ui.tests.dialogs.DeprecatedUIWizardsAuto.testNewProjectPage1](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/DeprecatedUIWizardsAuto/testNewProjectPage1/) [org.eclipse.ui.tests.dialogs.DeprecatedUIWizardsAuto.testNewProjectPage2](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/DeprecatedUIWizardsAuto/testNewProjectPage2/) [org.eclipse.ui.tests.dialogs.UIPreferencesAuto.testDefaultTextEditorPref](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/UIPreferencesAuto/testDefaultTextEditorPref/) [org.eclipse.ui.tests.dialogs.UIPreferencesAuto.testPerspectivesPref](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/UIPreferencesAuto/testPerspectivesPref/) [org.eclipse.ui.tests.dialogs.UIPreferencesAuto.testAppearancePref](https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1299/3/testReport/junit/org.eclipse.ui.tests.dialogs/UIPreferencesAuto/testAppearancePref/)...