Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 515777

Summary: GTK's darkmode is not activated when darktheme is enabled
Product: [Eclipse Project] JDT Reporter: Christian Dietrich <christian.dietrich.opensource>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: loskutov, lufimtse, sarika.sinha
Version: 4.7   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Screenshot in Dark Theme none

Description Christian Dietrich CLA 2017-04-25 11:20:03 EDT
Created attachment 267977 [details]
Screenshot in Dark Theme

Debug Hovers have a Strange Coloring in Dark Mode 

- Linux (RHEL) / GTK / KDE

Version: Oxygen Release Milestone 6 (4.7.0 M6)
Build id: 20170316-1528
Comment 1 Sarika Sinha CLA 2017-04-26 06:04:48 EDT
Adding Leo for his comments.
Comment 2 Leo Ufimtsev CLA 2017-04-26 14:41:01 EDT
Let me investigate.
Comment 3 Leo Ufimtsev CLA 2017-04-26 15:11:04 EDT
It seems that the underlying GTK is not switched into dark mode.
Normally 
DarkThemeProcessor calls SWT's OS.setDarkThemePreferred(isDark), but there is an API restriction at the moment:

in 
git:eclipse.platform.ui 
project:org.eclipse.e4.ui.swt.gtk

Complains about:

> Description	Resource	Path	Location	Type
> Access restriction: The method 'OS.setDarkThemePreferred(boolean)' is not API (restriction on required project 'org.eclipse.swt')	DarkThemeProcessor.java	/org.eclipse.e4.ui.swt.gtk/src/org>/eclipse/e4/ui/swt/internal/gtk	line 45	Java Problem

Exporting the following in SWT's Manifest fixes the issue:
> org.eclipse.swt.internal.gtk,

I need to investigate further. If someone knows what's going please do say.
Comment 4 Christian Dietrich CLA 2017-04-26 16:55:16 EDT
@andrey loskutov.

do you have an idea what is so special on (our) RHEL KDE Setup.
I dont see this behaviour on other KDE Distos like Kubuntu or Fedora.
Comment 5 Andrey Loskutov CLA 2017-04-26 16:59:36 EDT
(In reply to Christian Dietrich from comment #4)
> @andrey loskutov.
> 
> do you have an idea what is so special on (our) RHEL KDE Setup.
> I dont see this behaviour on other KDE Distos like Kubuntu or Fedora.

The (custom GTK3) theme we are using has hard coded Eclipse tooltip background, which doesn't have dark mode.
Comment 6 Leo Ufimtsev CLA 2017-04-28 12:10:27 EDT
(In reply to Andrey Loskutov from comment #5)
> (In reply to Christian Dietrich from comment #4)
> > @andrey loskutov.
> > 
> > do you have an idea what is so special on (our) RHEL KDE Setup.
> > I dont see this behaviour on other KDE Distos like Kubuntu or Fedora.
> 
> The (custom GTK3) theme we are using has hard coded Eclipse tooltip
> background, which doesn't have dark mode.

Hmm, maybe we're discussing different problems here.

I found that in org.eclipse.e4.ui.swt.gtk, the project configuration was a bit off. I've submitted a separate patch to fix it, so that dark-theme activates on child eclipse:
Bug 515965 – org.eclipse.e4.ui.swt.gtk java Access restriction compile error due to OS.setDarkThemePreferred() 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=515965
Comment 7 Leo Ufimtsev CLA 2017-04-28 12:11:52 EDT
(In reply to Leo Ufimtsev from comment #6)
> (In reply to Andrey Loskutov from comment #5)
> > (In reply to Christian Dietrich from comment #4)
> > > @andrey loskutov.
> > > 
> > > do you have an idea what is so special on (our) RHEL KDE Setup.
> > > I dont see this behaviour on other KDE Distos like Kubuntu or Fedora.
> > 
> > The (custom GTK3) theme we are using has hard coded Eclipse tooltip
> > background, which doesn't have dark mode.
> 
> Hmm, maybe we're discussing different problems here.
> 
> I found that in org.eclipse.e4.ui.swt.gtk, the project configuration was a
> bit off. I've submitted a separate patch to fix it, so that dark-theme
> activates on child eclipse:
> Bug 515965 – org.eclipse.e4.ui.swt.gtk java Access restriction compile error
> due to OS.setDarkThemePreferred() 
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=515965

In general, it seems to me that on your system, the underlying darktheme isn't being turned on by OS.setDarkThemePreferred(..), or maybe you don't have a version of a dark gtk theme on your system.