-
Notifications
You must be signed in to change notification settings - Fork 267
Fix bug, fix more warnings (See commit description) #1576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
} | ||
default: { | ||
// FIXME: See if MultiSelection / ExtendedSelection need to be handled | ||
if (selectionType != QAbstractItemView::NoSelection) | ||
qWarning() << "Unhandled QAbstractItemView selection type!"; | ||
break; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about just breaking on ones that we know we should ignore instead of using an if statement to exclude them from the default case?
} | |
default: { | |
// FIXME: See if MultiSelection / ExtendedSelection need to be handled | |
if (selectionType != QAbstractItemView::NoSelection) | |
qWarning() << "Unhandled QAbstractItemView selection type!"; | |
break; | |
} | |
} | |
case QAbstractItemView::NoSelection: | |
break; | |
default: { | |
// FIXME: See if MultiSelection / ExtendedSelection need to be handled | |
qWarning() << "Unhandled QAbstractItemView selection type:" << selectionType; | |
break; | |
} |
launcher/ui/WinDarkmode.cpp
Outdated
if (IsWindows8_0_Only()) | ||
WinSyscall<NtUserSetWindowCompositionAttribute_NT6_2>(hWnd, &data); | ||
if (IsWindows8_1_Only()) | ||
WinSyscall<NtUserSetWindowCompositionAttribute_NT6_3>(hWnd, &data); | ||
if (IsWindows10_Only() || IsWindows11()) | ||
{ | ||
((fnSetWindowCompositionAttribute)(PVOID)GetProcAddress(GetModuleHandleW(L"user32.dll"), "SetWindowCompositionAttribute")) | ||
(hWnd, &data); | ||
// Verified this ordinal is the same through Win11 22H2 (5/8/2023) | ||
((fnSetPreferredAppMode)(PVOID)GetProcAddress(GetModuleHandleW(L"uxtheme.dll"), MAKEINTRESOURCEA(135))) | ||
(AppMode_AllowDark); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these are mutually exclusive wouldn't it make more sense to use else if
instead of if
for the subsequent checks
This ends my series of patches fixing warnings throughout the codebase. Now, there are NO warnings except for unused parameters, tested on GCC 13.1.1 and Clang 16.0.2 with -Wall -Wextra. Fixed dark mode crashing on Windows 8.1, 8 and 7, and removed a need for an export by moving in the function. Any people looking at the Windows code and asking why I didn't use official version querying API's, those typically have some sort of unwanted behavior, plus checking exports to determine versions is shorter.
This ends my series of patches fixing warnings throughout the codebase. Now, there are NO warnings except for unused parameters, tested on GCC 13.1.1 and Clang 16.0.2 with -Wall -Wextra.
Fixed dark mode crashing on Windows 8.1, 8 and 7, and removed a need for an export by moving in the function.
Any people looking at the Windows code and asking why I didn't use official version querying API's, those typically have some sort of unwanted funny behavior (compatibility manifests, other ought-to-be nonsense), plus checking exports to determine versions is shorter.