Lagrange [work/v1.15]

Windows: Enable dark mode in all regular windows

=> b552ed70ee2abb01a67c7e0c43bda298000db865

diff --git a/src/ui/window.c b/src/ui/window.c
index 9793dfdb..2d20c0e3 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -586,6 +586,11 @@ void init_Window(iWindow *d, enum iWindowType type, iRect rect, uint32_t flags)
                info.name,
                info.flags & SDL_RENDERER_ACCELERATED ? " (accelerated)" : "");
     }
+#endif
+#if defined (iPlatformMsys)
+    if (type == extra_WindowType) {
+        enableDarkMode_SDLWindow(d->win);
+    }
 #endif
     drawBlank_Window_(d);
     d->pixelRatio   = pixelRatio_Window_(d); /* point/pixel conversion */
@@ -689,7 +694,7 @@ void init_MainWindow(iMainWindow *d, iRect rect) {
         }
 #endif
     }
-#if defined(iPlatformMsys)
+#if defined (iPlatformMsys)
     SDL_SetWindowMinimumSize(d->base.win, minSize.x * d->base.displayScale, minSize.y * d->base.displayScale);
     useExecutableIconResource_SDLWindow(d->base.win);
     enableDarkMode_SDLWindow(d->base.win);
diff --git a/src/win32.c b/src/win32.c
index 287c11e9..a442d7d1 100644
--- a/src/win32.c
+++ b/src/win32.c
@@ -1,4 +1,4 @@
-/* Copyright 2020 Jaakko Keränen 
+/* Copyright 2020 Jaakko Keränen 

 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
@@ -280,13 +280,15 @@ void enableDarkMode_SDLWindow(SDL_Window *win) {
 
 void handleCommand_Win32(const char *cmd) {
     if (equal_Command(cmd, "theme.changed")) {        
-        iConstForEach(PtrArray, iter, mainWindows_App()) {
-            iMainWindow *mw = iter.ptr;
-            SDL_Window *win = mw->base.win;
+        iConstForEach(PtrArray, iter, regularWindows_App()) {

+            iWindow *w = iter.ptr;

+            SDL_Window *win = w->win;

             if (refreshTitleBarThemeColor_(windowHandle_(win)) &&
-                !isFullscreen_MainWindow(mw) &&
+                (type_Window(w) != main_WindowType || 

+                 !isFullscreen_MainWindow(as_MainWindow(w))) &&

                 !argLabel_Command(cmd, "auto")) {
-                /* Silly hack, but this will ensure that the non-client area is repainted. */
+                /* Silly hack, but this will ensure that the non-client

+                   area is repainted. */

                 SDL_MinimizeWindow(win);
                 SDL_RestoreWindow(win);
             }
Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/work%2Fv1.15/cdiff/b552ed70ee2abb01a67c7e0c43bda298000db865
Status Code
Success (20)
Meta
text/gemini; charset=utf-8
Capsule Response Time
54.852528 milliseconds
Gemini-to-HTML Time
0.166179 milliseconds

This content has been proxied by September (ba2dc).