Skip to content

Fix Window light theme detection being backwards#2378

Merged
xStrom merged 3 commits intolinebender:masterfrom
Insprill:fix/window-theme
May 5, 2023
Merged

Fix Window light theme detection being backwards#2378
xStrom merged 3 commits intolinebender:masterfrom
Insprill:fix/window-theme

Conversation

@Insprill
Copy link
Contributor

@Insprill Insprill commented May 4, 2023

In the Windows backend, when dark mode was enabled, should_use_light_theme would return true, and vice-versa. This caused the title bar's color to be the opposite of the system theme. This fixes that behavior so the title bar matches the system theme.

In the Windows backend, when dark mode was enabled, should_use_light_theme would return true, and vice-versa. This caused the title bar's color to be the opposite of the system theme. This fixes that behavior so the title bar matches the system theme.
@xStrom
Copy link
Member

xStrom commented May 4, 2023

This doesn't seem right to me. I'm using the dark theme and that registry value is 0 for me.

Are you claiming that if the AppsUseLightTheme property in registry is 0 then apps should use the light theme, and when it is 1 they should not use the light theme?

If so, does this match the registry value you see on your setup?

@Insprill
Copy link
Contributor Author

Insprill commented May 4, 2023

Apologies, after looking at it again, it's where the theme is set that's backward. DWMWA_USE_IMMERSIVE_DARK_MODE sets whether dark mode should be used, however, the value of the registry key was being passed in which states whether light mode should be used. I've renamed the function to should_use_dark_theme to match the change in return value.

Copy link
Member

@xStrom xStrom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, that does seem like a bug. I confirmed that this fixes the issue. 🎉

Thanks!

@xStrom xStrom added bug does not behave the way it is supposed to shell/win concerns the Windows backend port-to-glazier labels May 5, 2023
@xStrom xStrom merged commit af94bdd into linebender:master May 5, 2023
@Insprill Insprill deleted the fix/window-theme branch May 5, 2023 02:31
andrewhickman added a commit to andrewhickman/lanquetta that referenced this pull request Jun 9, 2023
@xStrom xStrom added this to the Release 0.9 milestone Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug does not behave the way it is supposed to port-to-glazier shell/win concerns the Windows backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants