mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-11-17 23:42:20 +00:00
[idd] helper: fallback to default mode list
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
#include <regex>
|
||||
#include <CDebug.h>
|
||||
|
||||
#include "DefaultDisplayModes.h"
|
||||
|
||||
#define LGIDD_REGKEY L"SOFTWARE\\LookingGlass\\IDD"
|
||||
|
||||
CRegistrySettings::CRegistrySettings() : hKey(nullptr) {}
|
||||
@@ -60,8 +62,25 @@ std::optional<std::vector<DisplayMode>> CRegistrySettings::getModes()
|
||||
|
||||
DWORD type = 0, cb = 0;
|
||||
status = RegGetValue(hKey, nullptr, L"Modes", RRF_RT_REG_MULTI_SZ, &type, nullptr, &cb);
|
||||
if (status != ERROR_SUCCESS)
|
||||
switch (status)
|
||||
{
|
||||
case ERROR_SUCCESS:
|
||||
break;
|
||||
case ERROR_FILE_NOT_FOUND:
|
||||
{
|
||||
std::vector<DisplayMode> result;
|
||||
for (int i = 0; i < ARRAYSIZE(DefaultDisplayModes); ++i)
|
||||
{
|
||||
DisplayMode mode;
|
||||
mode.width = DefaultDisplayModes[i][0];
|
||||
mode.height = DefaultDisplayModes[i][1];
|
||||
mode.refresh = DefaultDisplayModes[i][2];
|
||||
mode.preferred = i == DefaultPreferredDisplayMode;
|
||||
result.emplace_back(mode);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
default:
|
||||
DEBUG_ERROR_HR(status, "RegGetValue(Modes) length computation");
|
||||
return {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user