Commit Graph

1890 Commits

Author SHA1 Message Date
Geoffrey McRae
dcde981a17 [client] opengl: fix cursor location when the source is downsampled 2023-11-10 06:28:05 +11:00
Geoffrey McRae
c54a09ca25 [client] opengl: fix row alignment parameter bug 2023-11-10 06:28:05 +11:00
Geoffrey McRae
3af2cf54d6 [client] egl: remove deprecated BGR members and logic 2023-11-10 06:28:05 +11:00
Geoffrey McRae
4aba15f31c [client] egl: only scale damage rects if it's packed BGR 2023-11-10 06:28:05 +11:00
Geoffrey McRae
ad13928c73 [client] egl: fix bgr filter re-init if DMA mode changes 2023-11-10 06:28:05 +11:00
Geoffrey McRae
139e98ac3b [client] OpenGL:fix RGB24 support for non 64-bit aligned pitches 2023-11-10 06:28:05 +11:00
Tudor Brindus
d02e3730b2 [client] EGL: implement damage-aware RGB24 copy 2023-11-10 06:28:05 +11:00
Tudor Brindus
1da50d220e [client] EGL: stop unpacking data across rows 2023-11-10 06:28:05 +11:00
Geoffrey McRae
c665044bfa [client] implement support for RGB24 packed data 2023-11-10 06:28:05 +11:00
Geoffrey McRae
6625cd733a [client] main: log if the frame format is using PQ or not 2023-10-27 01:16:08 +11:00
Geoffrey McRae
2f36aaff5c [client] egl: prepare for DXGI HDR10 support 2023-10-27 01:03:22 +11:00
Geoffrey McRae
eeea24ebfb [client] egl: invalidate the window when HDR settings are changed 2023-10-24 13:46:51 +11:00
Geoffrey McRae
e0bdd869d6 [all] fix client build on linux 2023-10-22 04:00:44 +11:00
Geoffrey McRae
2e515657dd [all] update/add license headers 2023-10-20 15:36:34 +11:00
Geoffrey McRae
df5c648377 [client] egl: remove unit qualifier from label 2023-10-20 15:30:36 +11:00
Geoffrey McRae
78df2073ff [client] egl: make it possible to configure HDR to SDR mapping 2023-10-20 15:26:27 +11:00
Geoffrey McRae
e658c2e0a2 [client] x11: change to a more visible "dot" cursor
This change alters the small square dot cursor to a more visible 16x16
cursor for X11. A new option `spice:largeDotCursor` can be set to use an
alternative 32x32 cursor for the vision impaired.
2023-09-13 21:54:31 +10:00
Geoffrey McRae
a3045e0b4a [client] main: don't request activation just because we re-connected 2023-09-13 14:08:18 +10:00
Geoffrey McRae
9cadb64942 [client] main: make activation requests optional 2023-09-13 14:07:42 +10:00
Geoffrey McRae
82607a7d6f [client] x11: read the i3 IPC response 2023-09-12 02:03:24 +10:00
Geoffrey McRae
24d4fce17c [client] x11: add support for i3 global full screen toggle
This commit adds an interface to the X11 display server code to support
various window manage specific features, such as in this case, the i3
global full screen toggle.

This feature specifically uses the i3 IPC to cause looking glass to go
full screen across all monitors if the new option `i3:globalFullScreen`
is enabled.
2023-09-12 01:19:06 +10:00
Geoffrey McRae
8dba4b6c0b [client] x11: fix cleanup if XIQueryVersion fails 2023-09-11 23:41:52 +10:00
Geoffrey McRae
193977895b [client] add new option input:captureOnFocus
This option allows the client to automatically enter capture mode if the
window is focused.

Closes #1088
2023-09-11 21:02:32 +10:00
Geoffrey McRae
ad43969c1a [client] egl: add support to map HDR to SDR 2023-04-26 16:26:54 +10:00
Geoffrey McRae
880d8042a4 [client] egl: fix support for deep color modes (30bpp) 2023-04-19 18:02:14 +10:00
Geoffrey McRae
a629d24dc3 [client] egl: fix fourcc for RGBA10 dmabuf 2023-04-19 17:30:40 +10:00
Geoffrey McRae
4f4cf2be7d [client] audio: provide option to prevent volume level sync 2023-04-16 19:10:35 +10:00
Geoffrey McRae
b7b302334c [client] main: remove debug true from if statement 2023-04-02 20:14:16 +10:00
Geoffrey McRae
28e74a73a4 [client] main: detect and warn on sub-optimal guest CPU configuration 2023-04-02 20:13:14 +10:00
Geoffrey McRae
996e1b2f7a [client] overlay: fix race on startup that caused a segfault
Fixes #1065
2023-03-30 14:59:37 +11:00
Geoffrey McRae
0ee5751b3a [client] egl: fix buffer overflow 2023-03-30 14:16:51 +11:00
Geoffrey McRae
b4b4a37b2b [client] egl: switch to using GL_TEXTURE_EXTERNAL_OES for DMABUF
According to Erik @ NVidia the open source NVidia driver will not
create a EGLImage from a DMABUF if the target is not
GL_TEXTURE_EXTERNAL_OES. This change set converts the dmabuf texture
from GL_TEXTURE_2D to GL_TEXTURE_EXTERNAL_OES and at runtime performs a
global search & replace on fragment shaders as needed to remain
compatible, replacing `sampler2D` with `samplerExternalOES`.

Ref: https://github.com/NVIDIA/open-gpu-kernel-modules/discussions/243#discussioncomment-3283415
2023-03-09 09:20:01 +11:00
Geoffrey McRae
bbc9204bfe [client] egl: ensure the preprocessed files have a null terminator 2023-03-09 09:15:39 +11:00
Geoffrey McRae
894b8b0c22 [client] x11: generate synthetic EnterNotify event on cursor leave
If the cursor was grabbed the window the cursor moves over when it is
ungrabbed will recieve an EnterNotify event with the mode of
NotifyUngrab, unfortunatly some window manages such as i3 will ignore
this message and as such focus follows mouse will not function
correctly. This patch injects a normal EnterNotify to work around this
issue.
2023-03-05 16:42:47 +11:00
Geoffrey McRae
91b0cba145 [client] egl: switch from mediump to highp
This fixes a rounding issue on certain hardware (NVidia) which actually
implement mediump as half precision (16-bit) float. It's safe to assume
`highp` is available as if the GPU does not support it, then the shader
compiler will try to find a lower precision that is supported by the GPU
2023-03-05 14:10:21 +11:00
Geoffrey McRae
2f48798db9 [client] wayland: check for failure of wl_display_connect 2023-02-28 23:38:44 +11:00
Geoffrey McRae
254b370bbf [client] audio/pipewire: fix compilation under clang 2023-01-24 13:46:22 +11:00
Geoffrey McRae
86efc47505 [client] audio/pipewire: PW_KEY_TARGET_OBJECT only exists as of 0.3.44 2023-01-24 13:43:17 +11:00
Geoffrey McRae
b559d6b9bc [client] audio/pipewire: add options to set the default out/rec devices 2023-01-24 13:35:25 +11:00
Geoffrey McRae
48cd0c3789 [client] audio: add missing earlyInit call for audio devs 2023-01-24 13:35:18 +11:00
Geoffrey McRae
6f8e6f9a19 [client] x11: catch and print details of X11 errors with a backtrace 2023-01-05 17:33:01 +11:00
Quantum
60ac03ebaf [client] wayland: implement window size setting for xdg-shell
This should allow win:autoResize to work on Wayland when the compositor
supports such an operation.
2022-12-08 21:08:33 +11:00
Geoffrey McRae
20b5957999 [client] update LGMP to fix buffer overflow bug 2022-11-07 21:57:10 +11:00
Geoffrey McRae
f0cb9d1167 [client] main: fix spice display fallback when waiting for LGMP upgrade 2022-11-07 19:16:52 +11:00
Ali Abdel-Qader
352cd2fafe [client] remove non-prototype function declarations
With -Wstrict-prototypes on non-protyped functions are deprecated and
functions must include a void parameter if they do not take parameters.
2022-11-01 08:03:15 +11:00
Chris Spencer
081a0a419d [client] audio: use actual device period if larger than expected maximum
This is rare and I'm not sure what causes it, but PipeWire sometimes uses a
larger period size than requested for no obvious reason (e.g., we could
request a period size of 512, but PipeWire uses 2048 anyway). This causes
us to stay in a permanent state of underrunning because the target latency
is too low.

With this change, we use the actual device period in the target latency
calculation if it is larger than the expected maximum. We may still get
some glitches at the beginning of playback (because the startup latency is
based upon the expected maximum period size), but it will recover after a
few seconds as it adjusts to the new target latency.
2022-11-01 08:02:37 +11:00
Geoffrey McRae
9d8bc46812 [client] keybind: fix typo 2022-11-01 08:00:37 +11:00
Quantum
646a725c0e [client] spice: wait 1 second before attempting to use spice video
This prevents the flash of spice display when it's not set to mirror
in the VM.
2022-09-19 14:59:59 +10:00
Quantum
bf8f4c17f0 [client] opengl: render cursor in spice mode 2022-09-19 14:58:47 +10:00
Quantum
d9ffb98c9b [client] wayland: fix attempt to confine when pointer is locked
This fixes the following crash when attempt to toggle capture at the
right after closing the overlay:

    zwp_pointer_constraints_v1@12: error 1: a pointer constraint with a wl_pointer of the same wl_seat is already on this surface
2022-09-19 14:58:27 +10:00
Quantum
0f261abb07 [client] egl: recalculate mouse position when toggling spice
Without this step, the cursor with be transformed for rendering the
spice cursor, not the IVSHMEM cursor.
2022-09-19 11:43:25 +10:00
Quantum
0c63a901be [client] main: add support for spice cursor channel 2022-09-19 11:13:53 +10:00
Quantum
1fd00ba26c [client] render_queue: support cursor operations 2022-09-19 11:13:53 +10:00
Quantum
f14d135266 [client] egl: support rendering cursors in spice display mode 2022-09-19 11:13:53 +10:00
Geoffrey McRae
5385853f3f [client] x11: set _NET_WM_PID
Fixes #1013
2022-09-18 10:10:13 +10:00
Geoffrey McRae
0149549251 [client] egl: fix usage `destRect, 0x0 is top left
This fixes the letterbox clip being incorrect when rounding is occuring
due to the inverted coordinate space.
2022-09-17 16:02:11 +10:00
Quantum
f5e68711d0 [client] wayland: handle wl_data_source.target action
There is no action to be taken by the Looking Glass client, but a
handler needs to exist as certain other Wayland clients chooses to
send this message for copy-paste operations despite the fact it's
supposed to be used for drag-and-drop negotiation.
2022-08-14 12:05:51 +10:00
Geoffrey McRae
d376dc4b5a [client] egl: fix the incorrect mask for dmabuf plane0 modifier 2022-07-30 22:08:47 +10:00
Geoffrey McRae
af51ea6d0b [client] egl: add support for EGL_EXT_image_dma_buf_import_modifiers 2022-07-30 15:55:20 +10:00
Quantum
eb1774f955 [client] keybind: add ScrollLock+C to cycle microphone defaults
This makes it possible to change the default action taken the next time
an application tries to open the microphone without restarting the
client.
2022-07-13 07:06:04 +10:00
Quantum
ae38db4915 [client] main: move micDefaultState into g_state 2022-07-13 07:06:04 +10:00
Quantum
9dee9ed7bb [client] main: better error when no display server is available
This commit makes it show a prettier error message when no display
server is available, including the display servers compiled. This
replaces the old assert.

Example output:

[E] 572277145932              main.c:1167 | lg_run                         | No display servers available, tried:
[E] 572277145934              main.c:1169 | lg_run                         | * Wayland
[E] 572277145935              main.c:1169 | lg_run                         | * X11
2022-07-13 07:05:07 +10:00
Quantum
0dabfdc432 [client] displayservers: add name field 2022-07-13 07:05:07 +10:00
Geoffrey McRae
9a9f9d433e [client] x11: add dependency on xkbcommon 2022-06-30 15:09:24 +10:00
Quantum
d24459b27f [client] wayland: correctly convert scan codes to numbers
Note that xkb scan code = linux scan code + 8.
2022-06-30 08:38:29 +10:00
Geoffrey McRae
da04a6dd54 [client] all: use the defined keyboard mapping for keybinds
Fixes #1007
2022-06-29 18:26:40 +10:00
Quantum
8b68a96ee1 [client] wayland: fix infinite resize loop
The intention has been to keep wlWm.needsResize true when skipping
resize, but I accidentally negated the value.
2022-06-01 22:41:20 -04:00
Geoffrey McRae
286e7622b8 [client] main: fix failure to startup when the guest VM has no UUID 2022-05-30 13:43:51 +10:00
Quantum
20d459d113 [client] wayland: deal getting scale before size
Certain window managers give us a scale before it gives us a size.
This commit makes the Wayland backend avoid passing a zero size to
wp_viewport_set_source, which is a protocol error.
2022-05-29 14:52:58 +10:00
Quantum
bf9023d6f8 [client] cmake: pass -Wstrict-prototypes for C files only
This avoids the following warning in C++ code:

    cc1plus: warning: command-line option ‘-Wstrict-prototypes’ is
    valid for C/ObjC but not for C++
2022-05-29 11:16:16 +10:00
Quantum
a8521b821e [all] cmake: standardize indentation to 2 spaces 2022-05-29 11:16:16 +10:00
Geoffrey McRae
0799910e70 [client] app: fix segfault when jitRender + spice display is in use 2022-05-28 00:52:03 +10:00
Quantum
8b8b580f63 [client] overlay/status: re-rasterize at high DPI when needed
When the window scale goes above the scale the SVGs were rasterized
at, we re-rasterize them at the necessary scale for a more crisp
appearance.
2022-05-27 18:19:18 +10:00
Quantum
712b1cbc46 [client] overlay/graphs: allow unregistering after shutdown
The Wayland display server has a graph for presentation times, but the
backend shuts down after the overlays, so calling
overlayGraph_unregister causes memory corruption. We can avoid this
problem by making unregister a noop after all graphs have been freed.

This is safe because updating the graph doesn't use the graph handle:
instead you update the ringbuffer which is owned by the user.
2022-05-27 18:18:15 +10:00
Geoffrey McRae
fba7c80b2f [client] interface: remove needsRender from renderers 2022-05-27 14:38:42 +10:00
Geoffrey McRae
a4f5bc7320 [client] render_queue: fix failure to show spice at startup 2022-05-27 14:02:00 +10:00
Geoffrey McRae
48735cd001 [client] main: don't start the overlay tick timer until init is done 2022-05-27 13:42:47 +10:00
Geoffrey McRae
123be552a4 [client] spice: fix duplicate keybind registration 2022-05-27 13:29:28 +10:00
Geoffrey McRae
aba8c5b499 [client] splash: added LG url, version and copyright strings 2022-05-27 12:39:08 +10:00
Geoffrey McRae
56ec98524c [client] egl: perform full damage if a post processing option is changed 2022-05-27 11:40:20 +10:00
Geoffrey McRae
9ccd93bfd8 [client] app: add option to disable dimming in overlay mode 2022-05-27 11:36:39 +10:00
Geoffrey McRae
f17dfdc9b3 [client] config: cosmetics 2022-05-27 11:30:24 +10:00
Geoffrey McRae
39c1f99446 [client] splash: add back support for win:quickSplash 2022-05-27 11:27:50 +10:00
Quantum
7e8849180d [client] audio: allow microphone recording to be toggled after dialog 2022-05-27 11:22:49 +10:00
Quantum
146d9a2a53 [client] main: remove micAlwaysAllow from g_params 2022-05-27 11:22:12 +10:00
Quantum
7cb6ccd6f5 [client] audio: switch to use config value audio:micDefault 2022-05-27 11:22:12 +10:00
Quantum
9b910eced1 [client] config: replace audio:micAlwaysAllow with audio:micDefault 2022-05-27 11:22:12 +10:00
Quantum
3e079e0489 [client] main: add micDefaultState to state and params 2022-05-27 11:22:12 +10:00
Geoffrey McRae
1e660fb7e1 [client] splash: pre-calculate & cache the radial gradient vectors 2022-05-27 10:23:10 +10:00
Geoffrey McRae
1770defea2 [client] spice: wait for the spice connection to finish at startup
A failure to connect to spice would cause LG to exit late, this adds a
startup condition that prevents the LG initialization to complete until
the spice connection has been established.
2022-05-27 09:22:10 +10:00
Geoffrey McRae
b94869249c [client] main: don't show the splash when transitioning to spice 2022-05-27 02:24:01 +10:00
Geoffrey McRae
a9e3ab9d18 [client] egl: remove no longer used drawing functions 2022-05-27 02:13:07 +10:00
Geoffrey McRae
fec45dfe9c [client] egl: remove unused splash shaders 2022-05-27 02:10:38 +10:00
Geoffrey McRae
5de175c1f3 [client] all: unify the LG splash screen into an overlay 2022-05-27 02:07:20 +10:00
Geoffrey McRae
8974ae4fb5 [client] add SVG loading support and use icons for status display
This brings nanosvg into the project for SVG loading and rendering.
Unfortunatly we can not at this time use a submodule for this project
until https://github.com/memononen/nanosvg/pull/214 is merged.
2022-05-26 04:11:31 +10:00
Geoffrey McRae
8aa36144dc overlay: move init/free to the context of the render thread
This is done to allow overlays to make use of the renderer during
init/free.
2022-05-26 00:46:13 +10:00
Geoffrey McRae
6384a8d006 [client] main: fix race condition on usage of events 2022-05-24 11:06:47 +10:00
Geoffrey McRae
d1e421f8a8 [client] spice: delay showing the spice display until spice is ready 2022-05-24 09:48:54 +10:00
Geoffrey McRae
6cbfa6e734 [client] egl: add spice display support 2022-05-24 06:57:33 +10:00
Geoffrey McRae
faae785c44 [client] spice: initialize new surfaces to black 2022-05-24 00:17:08 +10:00