mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-04-28 09:36:28 +00:00
[client] keybind: add keybind to set the guest resolution
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 / 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 / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
This commit is contained in:
parent
9593301511
commit
54d811e098
@ -192,7 +192,7 @@ bool core_warpPointer(int x, int y, bool exiting)
|
|||||||
|
|
||||||
void core_onWindowSizeChanged(unsigned width, unsigned height)
|
void core_onWindowSizeChanged(unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
if (!g_params.setGuestRes || !g_state.pointerQueue)
|
if (!g_state.pointerQueue)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (g_state.srcSize.x == width && g_state.srcSize.y == height)
|
if (g_state.srcSize.x == width && g_state.srcSize.y == height)
|
||||||
@ -214,7 +214,7 @@ void core_onWindowSizeChanged(unsigned width, unsigned height)
|
|||||||
|
|
||||||
void core_updatePositionInfo(void)
|
void core_updatePositionInfo(void)
|
||||||
{
|
{
|
||||||
if (g_state.kvmfrFeatures & KVMFR_FEATURE_WINDOWSIZE)
|
if (g_params.setGuestRes && g_state.kvmfrFeatures & KVMFR_FEATURE_WINDOWSIZE)
|
||||||
{
|
{
|
||||||
LGMsg msg =
|
LGMsg msg =
|
||||||
{
|
{
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "audio.h"
|
#include "audio.h"
|
||||||
#include "core.h"
|
#include "core.h"
|
||||||
#include "kb.h"
|
#include "kb.h"
|
||||||
|
#include "message.h"
|
||||||
|
|
||||||
#include <purespice.h>
|
#include <purespice.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -125,6 +126,26 @@ static void bind_toggleKey(int sc, void * opaque)
|
|||||||
purespice_keyUp((uintptr_t) opaque);
|
purespice_keyUp((uintptr_t) opaque);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void bind_setGuestRes(int sc, void * opaque)
|
||||||
|
{
|
||||||
|
if (!(g_state.kvmfrFeatures & KVMFR_FEATURE_WINDOWSIZE))
|
||||||
|
{
|
||||||
|
app_alert(LG_ALERT_INFO, "The guest doesn't support this feature");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LGMsg msg =
|
||||||
|
{
|
||||||
|
.type = LG_MSG_WINDOWSIZE,
|
||||||
|
.windowSize =
|
||||||
|
{
|
||||||
|
.width = g_state.windowW,
|
||||||
|
.height = g_state.windowH
|
||||||
|
}
|
||||||
|
};
|
||||||
|
lgMessage_post(&msg);
|
||||||
|
}
|
||||||
|
|
||||||
void keybind_commonRegister(void)
|
void keybind_commonRegister(void)
|
||||||
{
|
{
|
||||||
app_registerKeybind(0, 'F', bind_fullscreen , NULL,
|
app_registerKeybind(0, 'F', bind_fullscreen , NULL,
|
||||||
@ -137,6 +158,8 @@ void keybind_commonRegister(void)
|
|||||||
"Quit");
|
"Quit");
|
||||||
app_registerKeybind(0, 'O', bind_toggleOverlay, NULL,
|
app_registerKeybind(0, 'O', bind_toggleOverlay, NULL,
|
||||||
"Toggle overlay");
|
"Toggle overlay");
|
||||||
|
app_registerKeybind(0, '=', bind_setGuestRes, NULL,
|
||||||
|
"Set guest resolution to match window size");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_AUDIO
|
#if ENABLE_AUDIO
|
||||||
|
Loading…
x
Reference in New Issue
Block a user