Bug 151641 - Options screen "Color scheme" - AUTOMATIC colors in DARK mode stays LIGHT (Windows only)
Summary: Options screen "Color scheme" - AUTOMATIC colors in DARK mode stays LIGHT (Wi...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.4.1.2 release
Hardware: All Windows (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard: target:7.5.0 target:7.4.3
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-19 15:00 UTC by scorpiosoft
Modified: 2022-10-26 02:12 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
LIGHT automatic colors in DARK mode (104.83 KB, image/jpeg)
2022-10-19 15:01 UTC, scorpiosoft
Details

Note You need to log in before you can comment on or make changes to this bug.
Description scorpiosoft 2022-10-19 15:00:20 UTC
Description:
On Windows, in Tools->Options->LibreOffice->Application colors, some AUTOMATIC colors for UI element do NOT become dark on selected scheme "LibreOffice" and dark mode of Windows is ON ("Enable experimental features" turned ON).

Example: Document background, Font color, Application background, Unvisited links, Visited links.

Steps to Reproduce:
1. Select "Dark" color in Windows Settings, Themes and related settings, Colors
2. Open Tools->Options->LibreOffice->Application colors
2. Select scheme "LibreOffice"
3. Select "Automatic" color for Document background, Font color, Application background, Unvisited links, Visited links.

Actual Results:
Document background and Application background become light, Unvisited links, Visited links and Font color become dark

Expected Results:
Document background and Application background must become dark, Unvisited links, Visited links and Font color must become light


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.4.1.2 (x64) / LibreOffice Community
Build ID: 3c58a8f3a960df8bc8fd77b461821e42c061c5f0
CPU threads: 8; OS: Windows 10.0 Build 19041; UI render: Skia/Vulkan; VCL: win
Locale: bg-BG (bg_BG); UI: en-US
Calc: threaded
Comment 1 scorpiosoft 2022-10-19 15:01:42 UTC
Created attachment 183134 [details]
LIGHT automatic colors in DARK mode
Comment 2 V Stuart Foote 2022-10-19 18:00:53 UTC
Confirmed, but there is also the predefined "LibreOffice Dark" color scheme on Tools -> Options -> Application Colors

Note: current release build is 7.4.2.3

Although some additional refactoring here for handling Windows WDM provided theme, HighContrast mode behavior, and removal from Experimental, please retest with current nightly master against 7.5

https://dev-builds.libreoffice.org/daily/master/Win-x86_64@tb77-TDF/

But, even on the 2022-10-16 master, Windows "Dark" them is detected, but the theme parsed "automatic" colors do no pick up reasonable "dark mode" values for:

Document Background
Application Background
Font color
Unvisited links
Visited links

And, IIUC the issue remains that we can not fully parse UWP theme, and depend on what WDM passes, which includes the HC mode toggle that is fully parsed. Not clear we can do any more.

@Caolán, is that a valid statement that we still can not fully parse the Windows themes.
Comment 3 scorpiosoft 2022-10-19 18:53:07 UTC
>theme parsed "automatic" colors do no pick up reasonable "dark mode" values...

I am not aware of full complexity of Windows theme parsing, but isn't possible to use colors from "system metrics" of Windows (as backup method only, of course) ? It just a amateur proposition... :)
Comment 4 Caolán McNamara 2022-10-24 11:05:18 UTC
For "Application Background" which comes from Settings::WorkspaceBackground we can do on windows what we do on all the other platforms and set it to the same color as the "DialogColor" https://gerrit.libreoffice.org/c/core/+/141725 so the portion of the writer window (outside the document "paper" area) will be dark in dark mode. Right now on windows this is a hard coded color that doesn't come from any theme setting in any mode.

The other ones are more problematic. For Dark Mode under GNOME we are doing the same as you see in Windows right now wrt the Document background and Font color where "Automatic" remains as default WYSIWYG white paper with black ink. So that's not windows specific. I feel those should stay as they are (users's can override the default) but if there's disagreement then its a general separate multi-platform issue rather than a windows specific thing.

The visited/unvisited hyperlinks under windows don't come from any specific windows settings in any mode (the checkbox is off by default anyway so even if they did come from a setting they aren't applied by default). There is a COLOR_HOTLIGHT https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getsyscolor but there is no distinction between visited and unvisited there (or in any of the options I can see at https://learn.microsoft.com/en-us/windows/win32/controls/parts-and-states). For the special case of a11y High Contrast mode I think we should be forcing use of COLOR_HOTLIGHT for both visited and unvisited though, so I can make that change as an aside.
Comment 5 Commit Notification 2022-10-24 11:06:51 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/09dc6fbcd8c441cb7706857ed66d197db9f26254

Related: tdf#151641 set windows WorkspaceColor similiar to other platforms

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Caolán McNamara 2022-10-24 11:09:13 UTC
I think that's as good as it gets in trunk now. Backport of application background setting for 7-4 is in gerrit.
Comment 7 Commit Notification 2022-10-25 09:04:51 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/388af06dcd2d495bbda7f589b616764a5c073bc5

Related: tdf#151641 set windows WorkspaceColor similiar to other platforms

It will be available in 7.4.3.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 V Stuart Foote 2022-10-26 02:12:59 UTC
Verified. The Tools -> Options -> Application Color 'Application background' is following os/DE color theme "dark" or "light" with something useful.

Version: 7.5.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 20ebccd6b349a1d9d3e057de55933c2805ff5d1a
CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded