Compare commits

..

1 Commits

Author SHA1 Message Date
Quantum
41678e856f [idd] helper: fallback to default mode list 2025-11-10 00:51:13 -05:00
11 changed files with 6 additions and 112 deletions

View File

@@ -74,4 +74,3 @@ rs189 <35667100+rs189@users.noreply.github.com> (rs189)
Jérôme Poulin <jeromepoulin@gmail.com> (ticpu) Jérôme Poulin <jeromepoulin@gmail.com> (ticpu)
Marco Rodolfi <marco.rodolfi@tuta.io> (RodoMa92) Marco Rodolfi <marco.rodolfi@tuta.io> (RodoMa92)
Stewart Borle <stewi1014@gmail.com> (stewi1014) Stewart Borle <stewi1014@gmail.com> (stewi1014)
Jannis Lübke <business.janrupf@gmail.com> (Janrupf)

View File

@@ -32,9 +32,6 @@
#include "app.h" #include "app.h"
#include "common/debug.h" #include "common/debug.h"
const double WL_SCROLL_STEP = 15.0;
const double WL_HALF_SCROLL_STEP = WL_SCROLL_STEP / 2.0;
// Mouse-handling listeners. // Mouse-handling listeners.
static void pointerMotionHandler(void * data, struct wl_pointer * pointer, static void pointerMotionHandler(void * data, struct wl_pointer * pointer,
@@ -94,25 +91,12 @@ static void pointerAxisHandler(void * data, struct wl_pointer * pointer,
if (axis != WL_POINTER_AXIS_VERTICAL_SCROLL) if (axis != WL_POINTER_AXIS_VERTICAL_SCROLL)
return; return;
double delta = wl_fixed_to_double(value); int button = value > 0 ?
5 /* SPICE_MOUSE_BUTTON_DOWN */ :
wlWm.scrollState += delta; 4 /* SPICE_MOUSE_BUTTON_UP */;
app_handleButtonPress(button);
while (wlWm.scrollState > WL_HALF_SCROLL_STEP) app_handleButtonRelease(button);
{ app_handleWheelMotion(wl_fixed_to_double(value) / 15.0);
app_handleButtonPress(5 /* SPICE_MOUSE_BUTTON_DOWN */);
app_handleButtonRelease(5 /* SPICE_MOUSE_BUTTON_DOWN */);
wlWm.scrollState -= WL_SCROLL_STEP;
}
while (wlWm.scrollState < -WL_HALF_SCROLL_STEP)
{
app_handleButtonPress(4 /* SPICE_MOUSE_BUTTON_UP */);
app_handleButtonRelease(4 /* SPICE_MOUSE_BUTTON_UP */);
wlWm.scrollState += WL_SCROLL_STEP;
}
app_handleWheelMotion(delta / WL_SCROLL_STEP);
} }
static int mapWaylandToSpiceButton(uint32_t button) static int mapWaylandToSpiceButton(uint32_t button)

View File

@@ -114,7 +114,6 @@ struct WaylandDSState
bool configured; bool configured;
bool warpSupport; bool warpSupport;
double cursorX, cursorY; double cursorX, cursorY;
double scrollState;
#if defined(ENABLE_EGL) || defined(ENABLE_OPENGL) #if defined(ENABLE_EGL) || defined(ENABLE_OPENGL)
struct wl_egl_window * eglWindow; struct wl_egl_window * eglWindow;

View File

@@ -42,30 +42,3 @@ The clipboard is not working
- The Spice VDAgent is available in both Spice Guest Tools, and - The Spice VDAgent is available in both Spice Guest Tools, and
standalone as a separate installer. Check your installed programs standalone as a separate installer. Check your installed programs
and uninstall the VDAgent if it's installed separately. and uninstall the VDAgent if it's installed separately.
.. _keyboard_shortcuts_not_captured_on_gnome_wayland:
Keyboard shortcuts are not captured on GNOME Wayland
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Capture mode may fail to capture compositor shortcuts like
ALT+Tab or ALT+Middle Mouse - they go to GNOME instead of the guest VM.
When Looking Glass first requests to inhibit shortcuts, GNOME shows a
dialog asking for permission. If you clicked "Deny" (or dismissed the dialog),
GNOME permanently blocks the application and never shows the dialog again.
Use the ``flatpak`` command to view or grant the permission, this works even
if LookingGlass is not a Flatpak application, as GNOME stores these permissions
in Flatpak's database:
.. code:: bash
flatpak permission-set gnome shortcuts-inhibitor looking-glass-client.desktop GRANTED
To verify the permission was set:
.. code:: bash
flatpak permissions gnome shortcuts-inhibitor

View File

@@ -21,7 +21,6 @@ downsampling
downscaler downscaler
downscaling downscaling
evdev evdev
Flatpak
framebuffer framebuffer
fullscreen fullscreen
gcc gcc

View File

@@ -28,10 +28,7 @@ CConfigWindow::CConfigWindow() : m_scale(1)
if (error != ERROR_SUCCESS) if (error != ERROR_SUCCESS)
DEBUG_ERROR_HR(error, "Failed to load settings"); DEBUG_ERROR_HR(error, "Failed to load settings");
else else
{
m_modes = m_settings.getModes(); m_modes = m_settings.getModes();
m_defaultRefresh = m_settings.getDefaultRefresh();
}
if (!CreateWindowEx(0, MAKEINTATOM(s_atom), L"Looking Glass IDD Configuration", if (!CreateWindowEx(0, MAKEINTATOM(s_atom), L"Looking Glass IDD Configuration",
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 500, 400, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 500, 400,
@@ -128,11 +125,6 @@ LRESULT CConfigWindow::onCreate()
m_defRefresh.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | ES_LEFT | ES_NUMBER | WS_TABSTOP, m_hwnd)); m_defRefresh.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | ES_LEFT | ES_NUMBER | WS_TABSTOP, m_hwnd));
m_defRefreshHz.reset(new CStaticWidget(L"Hz", WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, m_hwnd)); m_defRefreshHz.reset(new CStaticWidget(L"Hz", WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, m_hwnd));
if (m_defaultRefresh)
m_defRefresh->setNumericValue(*m_defaultRefresh);
else
m_defRefresh->disable();
RECT client = { 0, 0, (LONG)(436 * m_scale), (LONG)(300 * m_scale) }; RECT client = { 0, 0, (LONG)(436 * m_scale), (LONG)(300 * m_scale) };
AdjustWindowRect(&client, WS_OVERLAPPEDWINDOW, FALSE); AdjustWindowRect(&client, WS_OVERLAPPEDWINDOW, FALSE);
SetWindowPos(m_hwnd, NULL, 0, 0, client.right - client.left, client.bottom - client.top, SWP_NOMOVE | SWP_NOZORDER); SetWindowPos(m_hwnd, NULL, 0, 0, client.right - client.left, client.bottom - client.top, SWP_NOMOVE | SWP_NOZORDER);
@@ -247,22 +239,5 @@ LRESULT CConfigWindow::onCommand(WORD id, WORD code, HWND hwnd)
updateModeList(); updateModeList();
onModeListSelectChange(); onModeListSelectChange();
} }
else if (hwnd == *m_defRefresh && code == EN_CHANGE && m_defaultRefresh)
{
int value;
try
{
value = m_defRefresh->getNumericValue();
}
catch (std::logic_error &)
{
return 0;
}
m_defaultRefresh = value;
LRESULT result = m_settings.setDefaultRefresh(value);
if (result != ERROR_SUCCESS)
DEBUG_ERROR_HR((HRESULT)result, "Failed to default refresh");
}
return 0; return 0;
} }

View File

@@ -42,7 +42,6 @@ class CConfigWindow : public CWindow
Microsoft::WRL::Wrappers::HandleT<FontTraits> m_font; Microsoft::WRL::Wrappers::HandleT<FontTraits> m_font;
CRegistrySettings m_settings; CRegistrySettings m_settings;
std::optional<std::vector<DisplayMode>> m_modes; std::optional<std::vector<DisplayMode>> m_modes;
std::optional<DWORD> m_defaultRefresh;
void updateFont(); void updateFont();
void updateModeList(); void updateModeList();

View File

@@ -24,11 +24,6 @@ int CEditWidget::getNumericValue()
return std::stoi(getValue()); return std::stoi(getValue());
} }
bool CEditWidget::enable(bool enabled)
{
return Edit_Enable(m_hwnd, enabled);
}
void CEditWidget::setValue(const std::wstring &value) void CEditWidget::setValue(const std::wstring &value)
{ {
if (!Edit_SetText(m_hwnd, value.c_str())) if (!Edit_SetText(m_hwnd, value.c_str()))

View File

@@ -9,8 +9,6 @@ public:
std::wstring getValue(); std::wstring getValue();
int getNumericValue(); int getNumericValue();
bool enable(bool enabled = true);
bool disable() { return enable(false); }
void setValue(const std::wstring &value); void setValue(const std::wstring &value);
void setNumericValue(int value); void setNumericValue(int value);
}; };

View File

@@ -8,8 +8,6 @@
#define LGIDD_REGKEY L"SOFTWARE\\LookingGlass\\IDD" #define LGIDD_REGKEY L"SOFTWARE\\LookingGlass\\IDD"
const DWORD DEFAULT_REFRESH = 120;
CRegistrySettings::CRegistrySettings() : hKey(nullptr) {} CRegistrySettings::CRegistrySettings() : hKey(nullptr) {}
CRegistrySettings::~CRegistrySettings() CRegistrySettings::~CRegistrySettings()
@@ -138,25 +136,3 @@ std::wstring DisplayMode::toString()
serialized.push_back('*'); serialized.push_back('*');
return serialized; return serialized;
} }
std::optional<DWORD> CRegistrySettings::getDefaultRefresh()
{
DWORD result, cbData = sizeof result;
LSTATUS status = RegGetValue(hKey, nullptr, L"DefaultRefresh", RRF_RT_REG_DWORD, nullptr, &result, &cbData);
switch (status)
{
case ERROR_SUCCESS:
return result;
case ERROR_FILE_NOT_FOUND:
return DEFAULT_REFRESH;
default:
DEBUG_ERROR_HR(status, "RegGetValue(Modes) length computation");
return {};
}
}
LSTATUS CRegistrySettings::setDefaultRefresh(DWORD refresh)
{
return RegSetValueEx(hKey, L"DefaultRefresh", 0, REG_DWORD, (LPBYTE) &refresh, sizeof(DWORD));
}

View File

@@ -26,7 +26,4 @@ public:
std::optional<std::vector<DisplayMode>> getModes(); std::optional<std::vector<DisplayMode>> getModes();
LSTATUS setModes(const std::vector<DisplayMode> &modes); LSTATUS setModes(const std::vector<DisplayMode> &modes);
std::optional<DWORD> getDefaultRefresh();
LSTATUS setDefaultRefresh(DWORD refresh);
}; };