Skip to content

Commit ec728e7

Browse files
committed
Fix dark styling for popup shells in workspace selection
Use display.addFilter instead of addListener for SWT.Show so the listener actually fires for child popup shells (e.g. the content proposal popup in the workspace selection combo). Re-apply styles asynchronously to cover widgets populated after the Show event. Reproducible on Windows; not reproducible on Linux.
1 parent 6b7c2ac commit ec728e7

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

  • bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application

bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/IDEApplication.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -901,9 +901,16 @@ protected void initializeDefaultTheme(Display display) {
901901
darkThemeShowListener = event -> {
902902
if (event.widget instanceof Shell shell) {
903903
applyDarkStyles(shell);
904+
// Re-apply after the current event to cover popup shells (e.g. content
905+
// proposal) whose content is populated after the SWT.Show event fires.
906+
display.asyncExec(() -> {
907+
if (!shell.isDisposed()) {
908+
applyDarkStyles(shell);
909+
}
910+
});
904911
}
905912
};
906-
display.addListener(SWT.Show, darkThemeShowListener);
913+
display.addFilter(SWT.Show, darkThemeShowListener);
907914
}
908915
}
909916

@@ -914,7 +921,7 @@ protected void initializeDefaultTheme(Display display) {
914921
*/
915922
protected void resetEarlyDarkTheme(Display display) {
916923
if (darkThemeShowListener != null) {
917-
display.removeListener(SWT.Show, darkThemeShowListener);
924+
display.removeFilter(SWT.Show, darkThemeShowListener);
918925
darkThemeShowListener = null;
919926
}
920927
if (isDark) {

0 commit comments

Comments
 (0)