This commit is contained in:
Nishi 2026-01-27 18:50:03 +09:00
commit 626294c95f
Signed by: nishi
GPG key ID: 27EF69B208EB9343
2 changed files with 19 additions and 19 deletions

View file

@ -8,7 +8,7 @@ typedef struct userdata {
int max_set; int max_set;
} userdata_t; } userdata_t;
static void detect_darktheme(MwLL handle){ static void detect_darktheme(MwLL handle) {
DWORD dw; DWORD dw;
DWORD sz = sizeof(dw); DWORD sz = sizeof(dw);
int err, t; int err, t;
@ -20,7 +20,7 @@ static void detect_darktheme(MwLL handle){
err = RegQueryValueEx(hkey, "AppsUseLightTheme", NULL, &type, (PBYTE)&dw, &sz); err = RegQueryValueEx(hkey, "AppsUseLightTheme", NULL, &type, (PBYTE)&dw, &sz);
RegCloseKey(hkey); RegCloseKey(hkey);
if(err != ERROR_SUCCESS || type != REG_DWORD){ if(err != ERROR_SUCCESS || type != REG_DWORD) {
return; return;
} }
@ -226,11 +226,11 @@ static LRESULT CALLBACK wndproc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) {
} else if(msg == WM_USER) { } else if(msg == WM_USER) {
InvalidateRect(hWnd, NULL, FALSE); InvalidateRect(hWnd, NULL, FALSE);
UpdateWindow(hWnd); UpdateWindow(hWnd);
} else if(msg == WM_WININICHANGE){ } else if(msg == WM_WININICHANGE) {
char* s = (char*)lp; char* s = (char*)lp;
LPARAM style = GetWindowLongPtr(hWnd, GWL_STYLE); LPARAM style = GetWindowLongPtr(hWnd, GWL_STYLE);
if(!(style & WS_CHILD)){ if(!(style & WS_CHILD)) {
if(s != NULL && strcmp(s, "ImmersiveColorSet") == 0) detect_darktheme(u->ll); if(s != NULL && strcmp(s, "ImmersiveColorSet") == 0) detect_darktheme(u->ll);
} }
} else { } else {
@ -440,7 +440,7 @@ static void MwLLNextEventImpl(MwLL handle) {
handle->gdi.get_clipboard = 0; handle->gdi.get_clipboard = 0;
} }
if(handle->gdi.get_darktheme){ if(handle->gdi.get_darktheme) {
detect_darktheme(handle); detect_darktheme(handle);
handle->gdi.get_darktheme = 0; handle->gdi.get_darktheme = 0;

View file

@ -127,7 +127,7 @@ static void llclipboardhandler(MwLL handle, void* data) {
*/ */
#define IsFirstVisible(handle) ((handle)->widget_class != NULL && ((handle)->parent == NULL || (handle)->parent->widget_class == NULL)) #define IsFirstVisible(handle) ((handle)->widget_class != NULL && ((handle)->parent == NULL || (handle)->parent->widget_class == NULL))
static void lldarkthemehandler(MwLL handle, void* data){ static void lldarkthemehandler(MwLL handle, void* data) {
MwWidget h = (MwWidget)handle->common.user; MwWidget h = (MwWidget)handle->common.user;
int* ptr = data; int* ptr = data;