Make Settings a NavigationSplitView window#267
Merged
Conversation
danirod
added a commit
that referenced
this pull request
Aug 31, 2025
This PR will ask the Microsoft Windows compositor to enable a system backdrop when running Cartero on Windows 11. This is known as acrylic mode, Microsoft Fluent 2 or just Mica. Any Win32 application running on Windows 11 Build 22621 or greater can [request a DwmAttribute](https://learn.microsoft.com/en-us/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute) called `DWMWA_SYSTEMBACKDROP_TYPE` to set [one of the four supported Mica values](https://learn.microsoft.com/en-us/windows/win32/api/dwmapi/ne-dwmapi-dwm_systembackdrop_type). The way this seems to work is that the backdrop is handled by the compositor. In other words, the application will paint on top of the backdrop. If the application supports alpha channels (which GTK does) and decides to render the background transparent or partially transparent, it can blend with the backdrop. And this is what I'm doing right now. If I detect that the system supports Mica, I request the backdrop from the compositor, and add a CSS class called `mica` to the window. The style.css file has new rules that mark some elements such as the top bar or the NavigationSplit sidebar as transparent when the window has the `mica` class. The backdrop will render because the header bar does not have a solid background color: <img width="897" height="243" alt="imagen" src="https://github.com/user-attachments/assets/d7bbf023-873f-417c-a285-2dc21585f93b" /> For the welcome pane I'm setting a background with alpha channel. Therefore, the backdrop appears lighter: <img width="897" height="756" alt="imagen" src="https://github.com/user-attachments/assets/1b9f662d-c968-4d78-a175-734d4de297bb" /> Dark mode is supported too, for that matter. <img width="851" height="697" alt="imagen" src="https://github.com/user-attachments/assets/014ba136-baaf-4d29-90cb-36149b8b11cd" /> Indirectally, this commit also fixes the following two side bugs: * Cartero was not reacting to the "high contrast mode has changed" event in order to update the dark mode style. There is an edge case where this can cause the application text to become unreadable then the high contrast mode is enabled or disabled, as the Adwaita theme switches to High Contrast (borders everywhere) but the text color is kept white over light or black over dark. * The new settings page added in #267 did not request the title bar color to switch on Windows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The settings window used to be an AdwPreferenceDialog; now it's a standard AdwWindow that presents a NavigationSplitView.
Reasons: