mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-12-02 22:28:14 +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:
17
idd/LGCommon/DefaultDisplayModes.h
Normal file
17
idd/LGCommon/DefaultDisplayModes.h
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
static const DWORD DefaultDisplayModes[][3] =
|
||||||
|
{
|
||||||
|
{7680, 4800, 120}, {7680, 4320, 120}, {6016, 3384, 120}, {5760, 3600, 120},
|
||||||
|
{5760, 3240, 120}, {5120, 2800, 120}, {4096, 2560, 120}, {4096, 2304, 120},
|
||||||
|
{3840, 2400, 120}, {3840, 2160, 120}, {3200, 2400, 120}, {3200, 1800, 120},
|
||||||
|
{3008, 1692, 120}, {2880, 1800, 120}, {2880, 1620, 120}, {2560, 1600, 120},
|
||||||
|
{2560, 1440, 120}, {1920, 1440, 120}, {1920, 1200, 120}, {1920, 1080, 120},
|
||||||
|
{1600, 1200, 120}, {1600, 1024, 120}, {1600, 1050, 120}, {1600, 900 , 120},
|
||||||
|
{1440, 900 , 120}, {1400, 1050, 120}, {1366, 768 , 120}, {1360, 768 , 120},
|
||||||
|
{1280, 1024, 120}, {1280, 960 , 120}, {1280, 800 , 120}, {1280, 768 , 120},
|
||||||
|
{1280, 720 , 120}, {1280, 600 , 120}, {1152, 864 , 120}, {1024, 768 , 120},
|
||||||
|
{800 , 600 , 120}, {640 , 480 , 120}
|
||||||
|
};
|
||||||
|
|
||||||
|
static const DWORD DefaultPreferredDisplayMode = 19;
|
||||||
@@ -17,6 +17,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "LGCommon", "LGCommon", "{AC
|
|||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
LGCommon\CDebug.cpp = LGCommon\CDebug.cpp
|
LGCommon\CDebug.cpp = LGCommon\CDebug.cpp
|
||||||
LGCommon\CDebug.h = LGCommon\CDebug.h
|
LGCommon\CDebug.h = LGCommon\CDebug.h
|
||||||
|
LGCommon\DefaultDisplayModes.h = LGCommon\DefaultDisplayModes.h
|
||||||
LGCommon\PipeMsg.h = LGCommon\PipeMsg.h
|
LGCommon\PipeMsg.h = LGCommon\PipeMsg.h
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include "CSettings.h"
|
#include "CSettings.h"
|
||||||
#include "CDebug.h"
|
#include "CDebug.h"
|
||||||
|
#include "DefaultDisplayModes.h"
|
||||||
|
|
||||||
#include <wdf.h>
|
#include <wdf.h>
|
||||||
|
|
||||||
@@ -7,22 +8,6 @@ CSettings g_settings;
|
|||||||
|
|
||||||
#define LGIDD_REGKEY L"SOFTWARE\\LookingGlass\\IDD"
|
#define LGIDD_REGKEY L"SOFTWARE\\LookingGlass\\IDD"
|
||||||
|
|
||||||
static const DWORD DefaultDisplayModes[][3] =
|
|
||||||
{
|
|
||||||
{7680, 4800, 120}, {7680, 4320, 120}, {6016, 3384, 120}, {5760, 3600, 120},
|
|
||||||
{5760, 3240, 120}, {5120, 2800, 120}, {4096, 2560, 120}, {4096, 2304, 120},
|
|
||||||
{3840, 2400, 120}, {3840, 2160, 120}, {3200, 2400, 120}, {3200, 1800, 120},
|
|
||||||
{3008, 1692, 120}, {2880, 1800, 120}, {2880, 1620, 120}, {2560, 1600, 120},
|
|
||||||
{2560, 1440, 120}, {1920, 1440, 120}, {1920, 1200, 120}, {1920, 1080, 120},
|
|
||||||
{1600, 1200, 120}, {1600, 1024, 120}, {1600, 1050, 120}, {1600, 900 , 120},
|
|
||||||
{1440, 900 , 120}, {1400, 1050, 120}, {1366, 768 , 120}, {1360, 768 , 120},
|
|
||||||
{1280, 1024, 120}, {1280, 960 , 120}, {1280, 800 , 120}, {1280, 768 , 120},
|
|
||||||
{1280, 720 , 120}, {1280, 600 , 120}, {1152, 864 , 120}, {1024, 768 , 120},
|
|
||||||
{800 , 600 , 120}, {640 , 480 , 120}
|
|
||||||
};
|
|
||||||
|
|
||||||
static const DWORD DefaultPreferredDisplayMode = 19;
|
|
||||||
|
|
||||||
CSettings::CSettings()
|
CSettings::CSettings()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
#include <regex>
|
#include <regex>
|
||||||
#include <CDebug.h>
|
#include <CDebug.h>
|
||||||
|
|
||||||
|
#include "DefaultDisplayModes.h"
|
||||||
|
|
||||||
#define LGIDD_REGKEY L"SOFTWARE\\LookingGlass\\IDD"
|
#define LGIDD_REGKEY L"SOFTWARE\\LookingGlass\\IDD"
|
||||||
|
|
||||||
CRegistrySettings::CRegistrySettings() : hKey(nullptr) {}
|
CRegistrySettings::CRegistrySettings() : hKey(nullptr) {}
|
||||||
@@ -60,8 +62,25 @@ std::optional<std::vector<DisplayMode>> CRegistrySettings::getModes()
|
|||||||
|
|
||||||
DWORD type = 0, cb = 0;
|
DWORD type = 0, cb = 0;
|
||||||
status = RegGetValue(hKey, nullptr, L"Modes", RRF_RT_REG_MULTI_SZ, &type, nullptr, &cb);
|
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");
|
DEBUG_ERROR_HR(status, "RegGetValue(Modes) length computation");
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user