Compare commits

...

385 Commits

Author SHA1 Message Date
Quantum
4882a3fbd6 [idd] helper: remove compiler warnings 2025-11-09 21:51:28 -05:00
Quantum
3ed08ba56c [idd] helper: require numeric input for modes 2025-11-10 12:01:13 +11:00
Quantum
70da98c1a1 [idd] helper: implement UI for default refresh rate
The UI is not yet hooked up to anything.
2025-11-10 11:58:52 +11:00
Quantum
ed1602fc74 [idd] helper: fix notification icon creation on explorer start 2025-11-10 11:44:47 +11:00
Quantum
f9ecddab98 [idd] helper: implement mode deletion
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
2025-11-09 03:36:19 +11:00
Quantum
fad7af7740 [idd] helper: fix crash when saving invalid values 2025-11-09 03:34:24 +11:00
Quantum
6c70e36cb1 [idd] helper: allow scrolling when mode list is long 2025-11-09 03:30:07 +11:00
Quantum
dca54a79fd [idd] helper: implement adding new modes
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
2025-11-07 00:28:20 +11:00
Quantum
113199b6dd [idd] helper: prevent saving when no mode is selected 2025-11-07 00:28:20 +11:00
Quantum
7d33b93a50 [idd] helper: save mode changes into registry and update listview 2025-11-07 00:28:20 +11:00
Quantum
bf77128053 [idd] helper: add mode save button 2025-11-07 00:28:20 +11:00
Quantum
124b4742e0 [idd] helper: add mode edit controls 2025-11-07 00:28:20 +11:00
Quantum
569619384c [idd] helper: add mode edit labels 2025-11-07 00:28:20 +11:00
Quantum
1d7cb35de8 [idd] helper: detect mode listbox selection change 2025-11-07 00:28:20 +11:00
Quantum
e082acbe44 [idd] helper: use common control v6 with styles 2025-11-07 00:28:20 +11:00
Quantum
ab6e2c89d5 [idd] helper: add basic group box around mode config 2025-11-07 00:28:20 +11:00
Quantum
7a3833782c [idd] helper: display configured modes in listbox 2025-11-07 00:28:20 +11:00
Quantum
96367e83f1 [idd] helper: add CListBox widget 2025-11-07 00:28:20 +11:00
Quantum
c99f516b29 [idd] helper/resize: move logic to .cpp and add error checking 2025-11-07 00:28:20 +11:00
Quantum
2647678b0f [idd] helper: add parser for mode settings in registry 2025-11-07 00:28:20 +11:00
Quantum
40d606890b [repos] wayland-protocols: switch to a mirror on GitHub
anongit.freedesktop.org has unfortunately been very flaky in our CI
pipelines and causing builds to fail. I am running my own mirror which
syncs from the official FreeDesktop GitLab instance to GitHub, which
should allow CI pipelines to continue working on the last available
release should the GitLab sync fail.
2025-11-07 00:22:24 +11:00
Quantum
fddcb7f2d4 [idd] helper: define WIN32_LEAN_AND_MEAN globally
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
It doesn't really help that much, but since we are defining it in
some headers, we might as well do it everywhere so it actually has
some effect in case the headers were included in a different order.
2025-09-23 02:07:18 +10:00
Quantum
48ab317fa0 [idd] helper/notify: delete icon when exiting 2025-09-23 02:03:06 +10:00
Quantum
08e54fd1b1 [idd] installer: fix ivshmem driver installation 2025-09-17 21:03:27 +10:00
Quantum
b504627145 [idd] helper/notify: correctly handle menu dismissal 2025-09-17 20:47:52 +10:00
Quantum
4585362f54 [idd] helper/config: implement window positioning, fonts, and high DPI support 2025-09-17 18:05:00 +10:00
Quantum
e123e02e15 [idd] helper/CWindow: use sane value for hbrBackground 2025-09-17 18:05:00 +10:00
Quantum
85e728b59e [idd] helper: add simple static widget implementation 2025-09-17 18:05:00 +10:00
Quantum
042450a708 [idd] helper: implement basic config class 2025-09-17 18:05:00 +10:00
Quantum
9009217366 [idd] helper: stop using MsgWaitForMultipleObjects
`MsgWaitForMultipleObjects` doesn't handle inner message loops,
which may happen during `TrackPopupMenu`, causing exits to fail.
2025-09-15 09:22:27 +10:00
Quantum
d006dbb547 [idd] helper/CWindow: add onClose and onDestroy hooks 2025-09-15 09:22:27 +10:00
Quantum
c4f3936d98 [idd] helper: split CWindow into base class and CNotifyWindow 2025-09-15 09:22:27 +10:00
Geoffrey McRae
118e300f2f [repos] wayland-protocols: swith to anongit.freedesktop.org
gitlab.freedesktop.org has become unreliable over the last year,
to prevent the ci pipeline from failing, fall back to the more stable
and trusted anongit.
2025-09-15 02:03:34 +10:00
Quantum
19989ce9fb [idd] helper: add icon context menu with log directory open 2025-09-15 01:38:13 +10:00
Quantum
e1a2fa790d [idd] debug: use better log path determination algorithm 2025-09-14 06:23:13 -04:00
Quantum
daa78bcf47 [idd] debug: full Unicode handling and log as UTF-8
This commit makes `CDebug` use Unicode internally instead of whatever
random code page is in use. It also gets rid of the horrible character
counting and replaces that with `vasprintf` and `vaswprintf` helpers
(partially inspired by Linux) which allocates a buffer.

For HRESULT logging, the error code in both hex and decimal are included.

The output is now guaranteed to be UTF-8.
2025-09-14 20:00:25 +10:00
Quantum
e2bc1856b6 [idd] install: add missing io.h include 2025-09-14 19:44:50 +10:00
Quantum
30869c1c9c [idd] debug: log to C:\ProgramData\Looking Glass (IDD) 2025-09-14 17:18:44 +10:00
Quantum
9e8cb2f919 [idd] install: allow unicode errors 2025-09-14 17:18:10 +10:00
Quantum
70e0c356fc [idd] common/debug: add UTC timestamp and raw error code to logs 2025-09-14 17:17:56 +10:00
Quantum
8c3a2d01bc [idd] helper/PipeClient: use event and async I/O to interrupt read
An event, `m_signal`, is created and signalled when either `m_running` or
`m_connected` is changed by another thread, so that the pipe thread knows
to interrupt the read.

The pipe is now opened as async to allow interruption, and the I/O
operations now use overlapped I/O.

Other changes include:
* Changing `m_pipe` to `HandleT<HANDLETraits>` since `CreateFile` returns
  `INVALID_HANDLE_VALUE` instead of `NULL` on error.
* Remove the call to `WaitNamedPipeA` because it's useless and returns
  immediately without waiting if the pipe doesn't exist.
2025-09-14 17:17:21 +10:00
Quantum
eff8555f9b [idd] helper: wait on parent process directly 2025-09-14 17:16:23 +10:00
Quantum
c873aa4c4e [idd] helper: use separate log for child process 2025-09-14 17:16:23 +10:00
Quantum
5c1d604a22 [idd] helper: correctly pump message and destroy window 2025-09-14 17:16:23 +10:00
Quantum
67e1574d20 [idd] helper: add notification icon 2025-09-14 09:49:39 +10:00
Quantum
94550e09b4 [idd] helper: use CWindow helper to avoid global state 2025-09-14 09:49:39 +10:00
Quantum
9d48e70983 [idd] helper: switch to fully Unicode to avoid encoding issues 2025-09-14 09:49:39 +10:00
Quantum
48dc7a90f9 [idd] installer: use icon embedded in LGIddHelper.exe 2025-09-14 09:49:39 +10:00
Quantum
4ff5ce02d7 [idd] helper: add icon to resource 2025-09-14 09:49:39 +10:00
Geoffrey McRae
b7e3ef6824 [client] nanosvg: disable warning for release builds 2025-09-14 01:12:16 +10:00
Geoffrey McRae
870eb8c670 [repos] lgmp: update to fix queue empty state bug 2025-09-14 00:14:37 +10:00
Geoffrey McRae
d02d46283c [obs] dmabuf: fix repeated re-creation of dmabuf texture 2025-09-14 00:14:37 +10:00
Quantum
d5ee54e23e [idd] install: use CreateWellKnownSid 2025-09-13 19:49:39 +10:00
Quantum
41d3e7a981 [idd] install: rework error handling for ensureKeyWithAce
Also avoid weird allocators like LocalAlloc in favour of malloc.
2025-09-13 19:33:53 +10:00
Quantum
e75c7cff46 [idd] install: call ensureKeyWithAce once and fail properly 2025-09-13 19:10:57 +10:00
Quantum
e81462176a [idd] installer: update help text
Also rename /driver to /ivshmem since this is a driver package.
2025-09-13 14:53:22 +10:00
Geoffrey McRae
d00f12875c [idd] installer: dont make the reg key owned by USER MODE DRIVERS
Windows 11 does not allow the key to be owned by USER MODE DRIVERS
granting the user control via the ACL should resolve this
2025-09-13 14:34:04 +10:00
Geoffrey McRae
b6ceb72855 [idd] driver: cleanup duplicated string constant 2025-09-13 14:08:33 +10:00
Geoffrey McRae
13ae3441cf [idd] driver: move the ExtraMode registry key now permissions are correct
This resolves the problem of this setting being essentially lost
between driver upgrades.
2025-09-13 14:08:33 +10:00
Geoffrey McRae
b83d70a068 [idd] installer: create the IDD registry key for the driver
The driver runs under the account `NT AUTHORITY\USER MODE DRIVERS`
and as a result requires the key to be owned by this user so that
it is able to write to it.
2025-09-13 14:08:33 +10:00
Geoffrey McRae
2d28d27e90 Revert idd reg changes due to missing nsis support 2025-09-13 11:21:48 +10:00
Geoffrey McRae
e6b3b7fa76 [idd] nsis: add missed includes 2025-09-13 11:13:21 +10:00
Geoffrey McRae
9220c85e85 [idd] nsis: fix syntax error in if statements 2025-09-13 11:09:58 +10:00
Geoffrey McRae
2c370847e7 [idd] nsis: create a registry key the driver can write to 2025-09-13 11:06:01 +10:00
Quantum
e1170f8e01 [idd] installer: fix copy pasta from host installer 2025-09-13 10:39:55 +10:00
Quantum
41d2210624 [idd] installer: add option to disable old host application 2025-09-13 10:39:39 +10:00
Quantum
037a61a1c7 [host] ci/windows: use explicit windows-2025
This allows forks for whom windows-latest doesn't point to windows-2025
to build successfully.
2025-09-13 10:39:26 +10:00
Quantum
c6eda7e3a0 [idd] ci: build installer 2025-09-13 10:39:11 +10:00
Quantum
ff8650829c [idd] install: create NSIS installer script 2025-09-13 00:32:00 +10:00
Geoffrey McRae
df6d22455e [idd] install: copy executable to staging directory 2025-09-12 22:53:14 +10:00
Quantum
52849bc1d7 [idd] all: delete ARM and ARM64 targets 2025-09-12 22:36:10 +10:00
Quantum
155540a8f7 [idd] install: create new driver installer/uninstaller 2025-09-12 18:54:33 +10:00
Quantum
6e00dedc2b [idd] helper: enable per-monitor DPI awareness 2025-09-11 18:45:43 +10:00
Quantum
3da40f046d [ci] idd: add job 2025-09-11 17:05:38 +10:00
Quantum
e816847fb1 [idd] all: use UTF-8 source code 2025-09-11 17:00:35 +10:00
Geoffrey McRae
eec9aa3ae3 [client] egl: fix uninitialized use of variables 2025-09-08 11:00:06 +10:00
Geoffrey McRae
f07dd827ae [client] egl: fix null pointer dereference crash 2025-09-08 10:57:08 +10:00
Geoffrey McRae
08064efb7f [idd] driver: fix failure to track last pointer ID
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
2025-09-07 20:28:55 +00:00
Geoffrey McRae
01cae959d8 [client] core: workaround windows mouse information problem
Under windows there is no cursor enabled at all until it has been moved
for the fist time by the user. If our cursor information is invalid we
assume that this has occured and induce a wiggle to force windows to
create the cursor.
2025-09-07 20:24:17 +10:00
Geoffrey McRae
da154a5591 [github] ci: install NSIS (take 6)
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
2025-09-07 13:56:42 +10:00
Geoffrey McRae
a85b666238 [github] ci: install NSIS (take 6) 2025-09-07 13:49:13 +10:00
Geoffrey McRae
eff1e4d7ea [github] ci: install NSIS (take 4) 2025-09-07 13:42:26 +10:00
Geoffrey McRae
4affd03c2d [github] ci: install NSIS (take 3) 2025-09-07 13:37:36 +10:00
Geoffrey McRae
a1cc58c9f2 [github] ci: install NSIS (take 2) 2025-09-07 13:35:42 +10:00
Geoffrey McRae
9a6e03114e [github] ci: install nsis for windows native builds
As of the Windows Server 2025 image github provides, nsis is no longer
included, as such we must install it ourself.
2025-09-07 13:25:53 +10:00
Geoffrey McRae
0feaa716c5 [idd] helper: implement enable/disable priv
Implements `EnablePriv` and `DisablePriv` so the helper can now
interact with the desktop. Fixes issues with setting cursor position
2025-09-07 13:07:15 +00:00
Geoffrey McRae
5f9649b4a2 [client] egl: set the dmabuf sampler state at creation
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
2025-09-02 13:12:03 +10:00
Geoffrey McRae
e40610ea77 [client] egl: sync on fence without force glFlush in non-dmabuf path 2025-09-02 13:09:39 +10:00
Geoffrey McRae
d5839c7efd [client] egl: improve dmabuf import hot path performance
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
* Removes the vector in favour of a two element array
* Removes iteration on the vector
* Create and track a per-image fence
* bind the EGLImage to the texture at creation, avoiding re-binding
* sync on GL_SYNC_FLUSH_COMMANDS_BIT and remove glFlush
2025-08-31 13:48:08 +10:00
Geoffrey McRae
2a2250b9bd [idd] driver: added files missed in the last commit 2025-08-30 18:08:53 +00:00
Geoffrey McRae
16a283717a [idd] driver; support custom resolution and refresh rate list
Custom modes can now be configured via the registry under

HKEY_LOCAL_MACHINE\SOFTWARE\LookingGlass\IDD

Create the value "Modes" as a REG_MULTI_SZ with the value as
a list of modes, for example:

1024x768@60
1920x1080@60
1920x1080@120*

The '*' denotes the preferred mode to default to if one has not
been selected by the user.
2025-08-30 18:02:55 +00:00
Geoffrey McRae
5a4a2529af [idd] driver: remove static EDID
We do not need this as we are configuring the avialable modes directly
2025-08-30 14:13:53 +00:00
Geoffrey McRae
403bf87d6d [idd] driver: ignore failure due to normal operation
If the screen is blanked or removed through a user action
`IddCxMonitorQueryHardwareCursor` will return with a failure. This
is normal and we should not log this as an error.
2025-08-30 13:05:28 +00:00
Geoffrey McRae
e1a585ad6f [idd] driver: relocate the HW cursor thread into CSwapChainProcessor
It is invalid to call `IddCxMonitorSetupHardwareCursor` before
`IddCxSwapChainSetDevice`. This fixes this by moving the thread into
CSwapChainProcessor and starting it after `IddCxSwapChainSetDevice`
has succeeded.
2025-08-30 11:56:30 +00:00
Geoffrey McRae
7c2e0ec4e9 [repo] lgmp: update to fix packing to align with MSVC properly 2025-08-30 05:14:07 +10:00
Geoffrey McRae
33600682cf [repos] lgmp: fix msvc build (take 5) 2025-08-30 03:57:02 +10:00
Geoffrey McRae
60bda2befc [repos] lgmp: fix msvc build (take 4) 2025-08-30 03:00:25 +10:00
Geoffrey McRae
04a55e1419 [repos] lgmp: fix MSVC build (take 3) 2025-08-30 02:35:55 +10:00
Geoffrey McRae
ca98b5b1fd [repos] lgmp: fix client build under MSVC 2025-08-30 01:30:27 +10:00
Geoffrey McRae
c156044423 [repos] lgmp: update to fix MSVC build 2025-08-30 01:26:18 +10:00
Geoffrey McRae
85ceae91bf [repos] lgmp: update to latest version
The queue size for the cursor needed to be increased to a power of two
with the new design for messages queues in LGMP.
2025-08-30 01:16:26 +10:00
Geoffrey McRae
f8f05c36b8 [client] egl: remove invalid call to glTexImage2D for dmabuf
GL_TEXTURE_EXTERNAL_OES is not a valid target for glTexImage2D and there
is no need to "create" the textures as this is done during import by
eglCreateImage
2025-08-29 19:25:39 +10:00
Geoffrey McRae
05bf816b45 [ci] woodpecker: restrict the entire pipeline 2025-08-29 18:56:05 +10:00
Jonathan Rubenstein
3f35b0b0af [client] wayland: xdg handles resizable
Added missing resizable functionality to xdg_shellInit
when win:allowResize is set to true
2025-08-29 18:15:58 +10:00
Jonathan Rubenstein
f7e0b9746a [client] wayland: libdecor handles borderless
Added missing borderless functionality to libdecor_shellInit
when win:borderless is set to true
This works properly when going full screen as well
2025-08-29 18:15:58 +10:00
Jacob McNamee
b7d044de5d [client] opengl: initialize scale to 1.0
Fixes SPICE cursor rendering unconditionally at (0, 0) prior to KVMFR
frame format configuration
2025-08-29 18:15:28 +10:00
Netboy3
28b653b112 [all] Update to new issue template workflow 2025-08-29 18:14:33 +10:00
Netboy3
26848ba70a [client] pipewire: Stop loading properties from client-rt.conf
Pipewire now automatically moves non-rt clients into non-rt
threads so client-rt.conf is obsolete. Stop loading it during
context initialization for Pipewire 1.3.81 and newer.
See: 24bcacc619
2025-08-29 18:14:17 +10:00
Netboy3
482f66ab9b [doc] kvmfr: Update udev rule example
Starting with version 258, "systemd-udevd ignores OWNER=/GROUP=
settings with a non-system user/group specified in udev rules files".
Change the example udev rule to remove the explicit user assignment and
instead use the "uaccess" tag to auto-assign the logged-in user
permissions. As "uaccess" tags are processed using the 73-seat-late
udev rule, the KVMFR rule file name must precede it (i.e. should use
a lower ordinal value), so change the file name in the example to reflect that.
Credit goes to Discord user "w1kl4s" for bringing this systemd change
to our attention and assisting in testing.
2025-08-29 18:12:58 +10:00
Jonathan Rubenstein
8d9806bb0e [doc] words: Add ie and evdev 2025-08-29 17:58:35 +10:00
Jonathan Rubenstein
fa661aed64 [doc] usage: Update command-line options 2025-08-29 17:58:35 +10:00
Jonathan Rubenstein
2c648b99ad [client] config: Correct spelling in win:setGuestRes
Misspelled word "resoution" corrected to "resolution"
2025-08-29 17:58:35 +10:00
Geoffrey McRae
6a6cfadbf2 [ci] woodpecker: only build pushes to gnif/LookingGlass master 2025-08-29 17:54:30 +10:00
Geoffrey McRae
11c86273d2 [idd] driver: correct reported stride 2025-08-29 15:53:42 +10:00
Stewart Borle
60d7c84972 [client] egl: make int highp in fragment shaders
https://gitlab.freedesktop.org/mesa/mesa/-/issues/12990#note_3038479
2025-08-29 15:33:52 +10:00
Marco Rodolfi
cb304115f6 Update AUTHORS
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
2025-06-30 14:25:08 +10:00
Marco Rodolfi
c349f704d6 [doc] client: add documentation for disableWaitingMessage option 2025-06-30 14:25:08 +10:00
Marco Rodolfi
add45347b5 [client] app: add option to disable waiting for host message 2025-06-30 14:25:08 +10:00
Geoffrey McRae
f15d72cdfe [host] ivshmem: fix missing bounds check on device vector
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
2025-05-10 11:12:57 +10:00
Geoffrey McRae
54d811e098 [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
2025-04-04 10:23:00 +11:00
Geoffrey McRae
9593301511 [client] config: add option to disable auto client resolution switching 2025-04-04 10:13:19 +11:00
Geoffrey McRae
c2a19f5e76 [client] message: free any pending messages on deinit 2025-04-04 10:13:09 +11:00
Geoffrey McRae
d8baa62c6a [client] core: check if the resolution already matches the window
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
2025-04-02 14:03:48 +11:00
Geoffrey McRae
81162b460e [client] message: fix compile failure 2025-04-02 13:52:45 +11:00
Geoffrey McRae
852eb6bf69 [client] core: new message event system to debounce window size events 2025-04-02 13:46:55 +11:00
Geoffrey McRae
4b11743f18 [common] ll: make ll_push report success/failure 2025-04-02 13:46:07 +11:00
Geoffrey McRae
656d01a694 [idd] driver: add additional logging to CIVSHMEM
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
2025-03-31 00:25:54 +11:00
Geoffrey McRae
a4406ac867 [idd] driver: fix free copy queue search method 2025-03-30 23:28:04 +00:00
Geoffrey McRae
57a2f68931 [idd] driver: reduce CopyQueue contention 2025-03-30 23:18:14 +00:00
Geoffrey McRae
f4df3f0ec7 [idd] driver: pre-calculae addresses of structs and offsets 2025-03-30 22:58:12 +00:00
Geoffrey McRae
4e951184f1 [idd] driver: fix hardcoded pitch values
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
2025-03-30 21:40:10 +00:00
Geoffrey McRae
be4782b062 [idd] driver: fix header 2025-03-30 19:04:04 +11:00
Geoffrey McRae
b17c66d6bb [idd] driver: fix failure to intiialize command queue pending 2025-03-30 18:59:42 +11:00
Geoffrey McRae
94fbbad21c [idd] driver: handle command queue failures gracefully 2025-03-30 18:58:03 +11:00
Geoffrey McRae
63a9365377 [idd] driver: fix failure to report completion when an error occurs 2025-03-30 18:21:34 +00:00
Geoffrey McRae
cadcfe4b39 [idd] driver: fix deadlock caused by command queue completion callback
The callback runs in a random thread, we can't call directx methods
safely from it, so move reset so it's called automatically when a free
copy list is obtained.
2025-03-30 16:52:58 +00:00
Geoffrey McRae
3b883bf9fe [idd] driver: use a timeout instead of an event wait.
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
Waiting on the events is dangerous as there is a race here where
we may end up stuck as the events need to be auto-reset
2025-03-30 04:28:49 +00:00
Geoffrey McRae
b58171c3e1 [idd] driver: very experimental change to syncronization
This may get reverted, at this point it's an experiment for the
testers to trial.
2025-03-30 02:47:40 +00:00
Geoffrey McRae
7afb9b93eb [idd] driver: improve display mode support and resolution switch 2025-03-29 22:42:49 +00:00
Geoffrey McRae
6396ff1e9c [repos] lgmp: update for the new wdk version 2025-03-29 22:42:49 +00:00
Geoffrey McRae
db1dda00c8 [idd] all: update to sdk 10.0.26100 and iddcx 1.10 2025-03-29 22:42:48 +00:00
Geoffrey McRae
5b07286c65 [idd] driver: report we are finished with the frame earlier
`IddCxSwapChainFinishedProcessingFrame` must be called after every
frame, but we should do it as early as possible once all commands
are queued that use the frame.
2025-03-29 22:29:47 +00:00
Geoffrey McRae
6dad0de8b8 [idd] driver: reset cursor thread events on reinit 2025-03-29 22:27:55 +00:00
Geoffrey McRae
35c975d334 [idd] driver: fix loss of mouse cursor on guest wakeup
Some checks are pending
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / module (push) Waiting to run
build / host-linux (push) Waiting to run
build / host-windows-cross (push) Waiting to run
build / host-windows-native (push) Waiting to run
build / obs (clang) (push) Waiting to run
build / obs (gcc) (push) Waiting to run
build / docs (push) Waiting to run
2025-03-29 01:16:53 +00:00
Geoffrey McRae
530e83e7bf [idd] driver: cosmetics 2025-03-29 00:56:54 +00:00
Geoffrey McRae
40a4debfda [idd] driver: fix debug messages 2025-03-29 00:56:39 +00:00
Geoffrey McRae
75f07cb28c [idd] driver: improve reInit logic on failure 2025-03-29 00:56:16 +00:00
Geoffrey McRae
f26fa17bc1 [idd] driver: make m_indirectCopy static so it persists on retry 2025-03-28 23:50:54 +00:00
Geoffrey McRae
648fca7caa [idd] driver: re-plug the monitor if the heap test failed 2025-03-28 23:47:31 +00:00
Geoffrey McRae
868504d22d [client] core: fix dynamic res switch race issue 2025-03-28 23:18:41 +11:00
Geoffrey McRae
cb423730e4 [idd] driver: implement dynamic mode switch support 2025-03-28 23:17:31 +00:00
Geoffrey McRae
86de1c9ac6 [idd] common: still print the message if FormatMsg failed 2025-03-28 21:38:36 +00:00
Geoffrey McRae
d839a45d0b [client] kvmfr: report the local window size to the VM
Some checks are pending
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / module (push) Waiting to run
build / host-linux (push) Waiting to run
build / host-windows-cross (push) Waiting to run
build / host-windows-native (push) Waiting to run
build / obs (clang) (push) Waiting to run
build / obs (gcc) (push) Waiting to run
build / docs (push) Waiting to run
2025-03-28 16:38:02 +11:00
Geoffrey McRae
9ffb800e93 [idd] driver: use the frameSize instead of the resource size
As the resource size can be larger then the actual frame data, we
need to track this seperately so that we don't waste cycles copying
data the client will never use.
2025-03-28 14:35:19 +00:00
Geoffrey McRae
91e8440c9d [idd] vs: remove dynamically generated VersionInfo.h from the repo 2025-03-28 14:13:34 +00:00
Geoffrey McRae
15eff234ec [idd] driver: make indirectCopy functional 2025-03-28 14:11:48 +00:00
Geoffrey McRae
6a4edfc6b6 [idd] helper: added new helper service
Some checks are pending
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / module (push) Waiting to run
build / host-linux (push) Waiting to run
build / host-windows-cross (push) Waiting to run
build / host-windows-native (push) Waiting to run
build / obs (clang) (push) Waiting to run
build / obs (gcc) (push) Waiting to run
build / docs (push) Waiting to run
As the IDD itself runs in a WUMDF sandbox, it doesn't have enough
access to perform interactive operations such as moving the cursor.

This helper service communicates with the IDD over a named pipe,
so that we can perform these things, as well as in the future provide
a configuration GUI.
2025-03-28 12:05:02 +00:00
Geoffrey McRae
bf59e45118 [idd] cosmetic: it's a device, not a driver!
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
2025-03-24 16:46:52 +00:00
Geoffrey McRae
9cc99e7db9 [idd] ci: fetch the tags so the version info is correct 2025-03-24 16:15:36 +00:00
Geoffrey McRae
af5a48deca [idd] ci: fix build take 3
Revert "[idd] ci: fix build take 2"
Issue was with the docker container account

This reverts commit b1b6da32ce.
2025-03-24 15:58:59 +00:00
Geoffrey McRae
b1b6da32ce [idd] ci: fix build take 2 2025-03-24 15:54:07 +00:00
Geoffrey McRae
17b24cc8ff [idd] ci: fix compilation 2025-03-24 15:48:26 +00:00
Geoffrey McRae
7248b666ea [idd] nuget: added missing packages.config to the repo 2025-03-24 15:40:47 +00:00
Geoffrey McRae
2084a9fee3 [idd] all: generate versioning information 2025-03-24 15:37:17 +00:00
Geoffrey McRae
a2a771f94e [idd] cosmetic: single change just to trigger the ci workflow
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
2025-03-23 03:43:28 +00:00
Geoffrey McRae
b526eb3da0 [idd] ci: added woodpecker CI configuration for the IDD
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
As the IDD requires being built in MSVC2022 with the WDK and then
signed to create a usable driver, this must be done on the LG build
server instead of github directly. This workflow will trigger this on
each commit
2025-03-20 16:46:23 +11:00
Geoffrey McRae
7a88a49f1c [idd] handle frame re-send for when a new client connects
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
2025-03-16 19:37:03 +00:00
Geoffrey McRae
ce23cff12e [idd] remove deprecated locking defines 2025-03-16 19:28:07 +00:00
Geoffrey McRae
09df8c41aa [idd] debug: add debug defines and make use of them 2025-03-16 16:31:44 +00:00
Geoffrey McRae
0db9d3a27b [idd] CDebug: implement new debug print class and write to a file 2025-03-16 16:11:21 +00:00
Geoffrey McRae
4f2eb984d3 [idd] remove unconditional debug enablement for DirectX11
Some checks are pending
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / module (push) Waiting to run
build / host-linux (push) Waiting to run
build / host-windows-cross (push) Waiting to run
build / host-windows-native (push) Waiting to run
build / obs (clang) (push) Waiting to run
build / obs (gcc) (push) Waiting to run
build / docs (push) Waiting to run
2025-03-16 12:35:59 +00:00
Geoffrey McRae
8b198091ce [idd] rewrite to support DirectX12 copy 2025-03-16 12:32:52 +00:00
Geoffrey McRae
62c075cfb5 [idd] make the dirver functional again 2025-03-11 10:27:46 +00:00
Geoffrey McRae
bea198735a [repos] LGMP: update to the latest version
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
2025-03-09 02:57:38 +11:00
Geoffrey McRae
a421329d9a [all] general: fix possible memory leaks with realloc usage 2025-03-09 02:56:20 +11:00
Geoffrey McRae
5382a94945 [client] evdev: implement mouse support
Some checks are pending
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / module (push) Waiting to run
build / host-linux (push) Waiting to run
build / host-windows-cross (push) Waiting to run
build / host-windows-native (push) Waiting to run
build / obs (clang) (push) Waiting to run
build / obs (gcc) (push) Waiting to run
build / docs (push) Waiting to run
2025-03-08 19:14:46 +11:00
Geoffrey McRae
4278a10fe1 [client] evdev: read up to 256 events at a time 2025-03-08 18:19:10 +11:00
Geoffrey McRae
35e6a6e81a [client] evdev: handle device removal and hot-plug 2025-03-08 13:28:31 +11:00
Geoffrey McRae
afbd844be8 [client] evdev: add new exclusive evdev while captured option
Some checks are pending
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / module (push) Waiting to run
build / host-linux (push) Waiting to run
build / host-windows-cross (push) Waiting to run
build / host-windows-native (push) Waiting to run
build / obs (clang) (push) Waiting to run
build / obs (gcc) (push) Waiting to run
build / docs (push) Waiting to run
2025-03-07 13:47:01 +11:00
Geoffrey McRae
7c285a45fb [app] core: place the local cursor inside the window on capture 2025-03-07 12:21:20 +11:00
Geoffrey McRae
968fd42d46 [all] common: set the backtrace define for the entire project 2025-03-07 11:32:24 +11:00
Geoffrey McRae
66ac453c98 [client] input: add support for evdev keyboard capture mode
Some checks are pending
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / module (push) Waiting to run
build / host-linux (push) Waiting to run
build / host-windows-cross (push) Waiting to run
build / host-windows-native (push) Waiting to run
build / obs (clang) (push) Waiting to run
build / obs (gcc) (push) Waiting to run
build / docs (push) Waiting to run
The new configuration option `input:evdev` accepts a comma separated
list of `/dev/input/` keyboard devices to use for input when in capture
mode. This makes it possible to capture only a specific keyboard instead
of all keyboards.
2025-03-07 02:36:00 +11:00
Geoffrey McRae
27fe47cbe2 [obs] dmabuf: enable dmabuf by default
Some checks are pending
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / module (push) Waiting to run
build / host-linux (push) Waiting to run
build / host-windows-cross (push) Waiting to run
build / host-windows-native (push) Waiting to run
build / obs (clang) (push) Waiting to run
build / obs (gcc) (push) Waiting to run
build / docs (push) Waiting to run
2025-03-06 14:39:51 +11:00
Geoffrey McRae
aefbebff9c [obs] cosmetics: adhere to 80 column rule 2025-03-06 14:39:31 +11:00
Geoffrey McRae
9174b1ae0f [host] d12: perform full re-initialization if the heapTest fails
Some checks are pending
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / module (push) Waiting to run
build / host-linux (push) Waiting to run
build / host-windows-cross (push) Waiting to run
build / host-windows-native (push) Waiting to run
build / obs (clang) (push) Waiting to run
build / obs (gcc) (push) Waiting to run
build / docs (push) Waiting to run
2025-03-05 16:44:29 +11:00
Geoffrey McRae
f6b7ea11c8 [host] app: fix complation on windows with mingw 2025-03-05 16:34:07 +11:00
Geoffrey McRae
2c50ce4dbd [github] build: add libfontconfig-dev dependency 2025-03-05 16:25:01 +11:00
Geoffrey McRae
f6b0752e45 [github] build: use native packages now ubuntu 24.04 is available 2025-03-05 16:22:00 +11:00
Geoffrey McRae
50fee59b29 [client] app: fix broken keyboard input after imgui update 2025-03-05 16:07:06 +11:00
Geoffrey McRae
554f5bf75d [client] overlay: use graph address as imgui id 2025-03-05 15:25:34 +11:00
Geoffrey McRae
b43f572af0 Revert "[client] overlay/status: don't return damage rect if nothing was drawn"
This reverts commit 7e9e38faa5 as it
causes screen corruption when moving imgui overlay dialogs around.
2025-03-05 15:18:29 +11:00
Geoffrey McRae
d9f2df361d [client] cimgui: update to 1.91.8 2025-03-05 15:16:31 +11:00
Geoffrey McRae
6dcf178879 [github] linux-host: add missing dependency for xcb/shm 2025-03-05 13:32:33 +11:00
Geoffrey McRae
ea00b623ed [github] linux-host: add missing dependency for gio/gio-unix 2025-03-05 13:27:43 +11:00
Geoffrey McRae
711c932380 [all] common: fix compilation on clang 2025-03-05 12:48:20 +11:00
Geoffrey McRae
be52a86a9a [all] repos: update LGMP and PureSpice submodules 2025-03-05 12:44:58 +11:00
Geoffrey McRae
420eaebb71 [cmake] all: update cmake_minimum_required version to 3.10 2025-03-05 12:27:23 +11:00
Geoffrey McRae
551298ed5b [doc] all: update copyright year 2025-03-05 12:24:38 +11:00
Mark Stosberg
41008add12 [client] linux: Install .desktop file and icon
SVGs have had a great support for Linux for about a decade, so only
install that for simplicity.
2025-03-05 11:12:42 +11:00
Jonathan Rubenstein
32d1b8063e [doc] requirements: Modify language of DMABUF for iGPUS 2025-03-05 11:11:54 +11:00
Jonathan Rubenstein
b0227a8ff8 [doc] Add hypervisor and framebuffer to words.txt
Used `python ./sort_words.py -s -a framebuffer -a hypervisor`
This also properly sorted the list
2025-03-05 11:11:54 +11:00
Jonathan Rubenstein
a1c713556d [doc] install_libvirt: Link to iGPUs should use DMABUF 2025-03-05 11:11:54 +11:00
Jonathan Rubenstein
a0cf34df73 [doc] requirements: Add section encouraging DMABUF use for iGPUs 2025-03-05 11:11:54 +11:00
Jonathan Rubenstein
fbb489b9b6 [github] pr-check: Automatically add review requesting changes when PR author is not found in AUTHORS 2025-03-05 11:02:45 +11:00
Chris Spencer
03ca20d3e4 [client] overlay/msg: fix race condition in render
Some checks are pending
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / module (push) Waiting to run
build / host-linux (push) Waiting to run
build / host-windows-cross (push) Waiting to run
build / host-windows-native (push) Waiting to run
build / obs (clang) (push) Waiting to run
build / obs (gcc) (push) Waiting to run
build / docs (push) Waiting to run
If an overlay is closed with overlayMsg_close, the message can be freed
while it is still being used by msg_render, resulting in a segfault. Lock
the message list for the duration of msg_render to fix this.
2025-03-05 10:59:05 +11:00
Chris Spencer
7e9e38faa5 [client] overlay/status: don't return damage rect if nothing was drawn
The renderer contains an optimization to skip ImGui if there is nothing to
show, but the status overlay always returns a damage rect, even if it
didn't draw anything, so the optimization can never take effect.
2025-03-05 10:58:10 +11:00
Chris Spencer
0fd6f59bbb [client] egl: fix desktop render dimensions check
Code now matches the error message.
2025-03-05 10:57:20 +11:00
Justin Gatzen
661efd107e [host] app: fix app state race in lgmpTimer thread
While resuming from hibernation lgmpTimer may transition app.state to
APP_STATE_REINIT_LGMP. Sometimes the transition is lost if the app_main
processing loop also changes app.state simultaneously. This seems to
occur frequently with the hibernation use case.

Separate lgmp timer state into its own enum. Move resulting app.state
transitions to the app_main loop so they are serialized.
2025-03-05 10:56:39 +11:00
Jérôme Poulin
f6094de919 [module] MODULE_IMPORT_NS now requires a string literal in 6.13
Fixes: #1155
References: 33def8498fdde180023444b08e12b72a9efed41d
Co-authored-by: HikariKnightt <2557889+HikariKnight@users.noreply.github.com>
Co-authored-by: zeule <zeule@users.noreply.github.com>
Reviewed-by: netboy3 <1472804+netboy3@users.noreply.github.com>
2025-03-05 10:52:31 +11:00
Geoffrey McRae
77f6054f0a d12: implement indirectCopy fallback for compatibillity
When the heapTest fails for DMA copies to shared memory, fallback to
conventional CPU copy via mapped resources. While this is less optimal,
it is still faster then the older DXGI capture backend.
2025-02-19 16:30:27 +11:00
Geoffrey McRae
c169d4ab23 [obs] dmabuf: fix failure to display frames in both buffers 2025-02-14 19:24:36 +11:00
rs189
e25492a3a3 [client] x11/wayland: add application id
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
2024-10-15 11:52:10 +11:00
Geoffrey McRae
4e8201da07 [common] ivshmem: default to /dev/kvmfr0 if it's found
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
2024-09-05 14:01:28 +10:00
Geoffrey McRae
6a0a635781 [common] rect: fix avx unaligned bytes copy
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
Thanks @D0ot for debugging and finding this this, the LG community are
very appreciate for a fix for this long outstanding bug.

Fixes #1129
Closes #1136
2024-08-30 09:12:19 +10:00
Geoffrey McRae
3ea37b86e3 [module] check vmf->pgoff before using it
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
As reported by @Crispy-fried-chicken in issue #1133 there is a potential
XXE vulnerability here. This fixes this problem by verifying the value
of `vmf->pgff` does not exceed the bounds of the memory mapping.

Fixes: #1133
2024-08-26 14:37:21 +10:00
Geoffrey McRae
d060e375ea [client] fix typo
Fixes #1122 - Thanks @MadelineRitchie
2024-06-07 19:04:03 +10:00
Geoffrey McRae
7305ce36af [module] fix build on linux 6.10
Fixes #1124 - Thanks @pongo1231
2024-06-07 19:02:23 +10:00
vmfortress
c04f84b85c [client] pipewire: Add pipewire application name 2024-06-07 18:59:14 +10:00
majcosta
d21bdebc52 [doc] kvmfr/libvirt: change double quotes to single quotes
virt-manager (or libvirt itself) tends to preserve outer quotation marks but explode inner double-quotes into '&quot' which is annoying.

this looks nicer when pasted into the XML editor and applied

Also used double-quotes for the QEMU <6.2 example for consistency

PS: added myself to AUTHORS since this is my first contribution
2024-06-02 12:42:13 +10:00
Jacob McNamee
695cbc2d61 [all] update authors 2024-05-20 19:42:21 +10:00
Jacob McNamee
2067b21d47 [client] egl: fix line copy size computation in texBufferStreamUpdate 2024-05-20 19:42:21 +10:00
Jacob McNamee
9bc82ab1b4 [client] egl: fix misuse of stride vs. pitch in texBufferStreamUpdate 2024-05-20 19:42:21 +10:00
Jacob McNamee
82c9df54c5 [client] egl: fix unintended vertical clipping in spiceDrawFill 2024-05-20 19:42:21 +10:00
Jacob McNamee
c48bd35b3a [client] opengl: fix unintended vertical clipping in spiceDrawFill 2024-05-20 19:42:21 +10:00
Geoffrey McRae
ecd3692e1e [host] dxgi: fix crash during init due to out of order accesses 2024-04-04 22:44:49 +11:00
Geoffrey McRae
23b773ad80 [client] wayland: fix failure to select libdecor
Fixes #1116 - Thanks @blu3bird
2024-03-27 01:57:01 +11:00
kamplom
a626a1142d [client] wayland: Let viewporter use full wl_buffer 2024-03-22 03:56:26 +11:00
Netboy3
e70718600c [doc] Update module libvirt setup 2024-03-21 13:00:05 +11:00
Geoffrey McRae
0990c59eff [obs] fix compilation for older versions of OBS 2024-03-18 17:42:40 +11:00
Geoffrey McRae
fb1d96e147 [obs] tell OBS if we are operating in HDR 2024-03-18 17:35:25 +11:00
Geoffrey McRae
7f515c54b3 [client] x11/i3: fix fullscreen at launch via parameter/config 2024-03-14 12:56:39 +11:00
Geoffrey McRae
20972cfd9b [client] cmake: move X11 config directives to displayservers 2024-03-13 11:17:25 +11:00
Geoffrey McRae
dc9065b62f [client] egl: do not use DMA when using the spice display 2024-03-12 13:57:23 +11:00
Geoffrey McRae
13b9756e80 [client] egl: fix desktop spice toggle race 2024-03-12 11:58:16 +11:00
Geoffrey McRae
d902afa3dc [host] d12: fix error output string format 2024-03-11 20:32:34 +11:00
Geoffrey McRae
6e37305765 [host] d12: check if the device was removed during init 2024-03-11 20:27:36 +11:00
Geoffrey McRae
dd6c79594b [host] d12: check for failure to obtain d3d12 functions 2024-03-11 20:16:00 +11:00
Geoffrey McRae
ce9ed5da5d [host] d12: add additional debug tracing 2024-03-11 20:12:41 +11:00
Geoffrey McRae
fdad5daff8 [host/common] d12: add debug tracing 2024-03-11 19:14:54 +11:00
Geoffrey McRae
8d25469d27 [host] d12: limit the dx11 interop level to one version 2024-03-11 18:44:26 +11:00
Geoffrey McRae
8c5d1d47ee [host] nvfbc: mark NvFBC as deprecated 2024-03-11 14:16:12 +11:00
Geoffrey McRae
90398bc04f [host] app: do not try to use deprecated interfaces automatically 2024-03-11 14:16:12 +11:00
Geoffrey McRae
989fe2bb0b [host] d12: test if creating resources in the heap works at init
AMD GPUs and older NVidia GPUs can initialize fine but fail when we
start to create resources in the shared memory heap, we must test it
early to detect this so we can fallback to a working capture method.
2024-03-11 14:16:12 +11:00
Geoffrey McRae
7a41169104 [doc] consistency fix in example output 2024-03-11 00:59:46 +11:00
Geoffrey McRae
0b4322d921 [doc] remove NvFBC tuning recommendation now D12 is faster 2024-03-09 23:06:37 +11:00
Geoffrey McRae
b251b22a64 [doc] fix ivshmem_kvmfr tree structure 2024-03-09 13:36:22 +11:00
Geoffrey McRae
90b27ae1f7 [host] d12: revert ivshmem heap order change
Moving this prevented the RX580 crash early in init, but later
presents during the capture. As we want to ensure fallback to DXGI
if this happens we need to catch this fault during init. This moves
the order back so that we fail back into a working state.
2024-03-09 12:11:54 +11:00
Geoffrey McRae
4d388d6b9b [host] d12: move ivshmem heap creation to later in init
This has been moved to try to isolate a failure with RX580 startup
2024-03-09 11:56:14 +11:00
Geoffrey McRae
a88783e5b7 [doc] fix lack of consistency of Recommended 2024-03-09 11:35:52 +11:00
Geoffrey McRae
da820769e8 [host] windows: fix crash on failure to init a capture interface 2024-03-09 11:30:35 +11:00
Geoffrey McRae
d5b32225f4 [host] d12: don't attempt to use realtime priority
Some GPUs such as the RX580 seem to completely crash when attempting
to use `D3D12_COMMAND_QUEUE_PRIORITY_GLOBAL_REALTIME`.
2024-03-09 11:00:44 +11:00
Geoffrey McRae
778c21070c [doc] ammend ivshmem_kvmfr to make cgroups and permissions clearer 2024-03-08 23:31:32 +11:00
Geoffrey McRae
cae410d4de [doc] the nvidia open drivers now support DMABUF 2024-03-08 22:57:22 +11:00
Geoffrey McRae
064a605208 [doc] fix broken reference 2024-03-08 22:55:09 +11:00
Geoffrey McRae
279357e205 [doc] remove the module page as it's now part of installation 2024-03-08 22:53:43 +11:00
Geoffrey McRae
98aade2ec9 [doc] update host usage documentation 2024-03-08 22:41:32 +11:00
Geoffrey McRae
4acea9fa25 [doc] fix document reference 2024-03-08 18:37:40 +11:00
Geoffrey McRae
01efbc62c4 [doc] fix typos (again) 2024-03-08 18:34:22 +11:00
Geoffrey McRae
ed512f5943 [doc] fix typos 2024-03-08 18:32:38 +11:00
Geoffrey McRae
4a4f72ba38 [doc] update and restructure installation documentation 2024-03-08 18:22:07 +11:00
Geoffrey McRae
eb31815b46 [host] windows: add OutputDebugString capture for diagnostics 2024-03-07 11:34:46 +11:00
Geoffrey McRae
545e736389 [host] windows: handle graceful shutdown on user switch 2024-03-06 15:02:37 +11:00
Geoffrey McRae
6a72633674 [host] windows: move the service log to the temp directory
Often this log is provided instead of the actual host log, as this
log is largely useless for debugging this moves it to the temp
directory out of view of the user.
2024-03-06 13:11:48 +11:00
Geoffrey McRae
9123984ecc [host] windows: rotate the host log out keeping at most 3 prior versions 2024-03-06 12:59:15 +11:00
Geoffrey McRae
d81395b672 [common] option: send all output to stderr 2024-03-04 21:21:46 +11:00
Geoffrey McRae
bfadf0a427 [host] app: print list of valid capture interfaces 2024-03-04 21:09:39 +11:00
Geoffrey McRae
03662f45a7 [host] nvfbc: add warning to encourage migration to D12 2024-03-04 16:34:47 +11:00
Geoffrey McRae
a4e761bedc [host] win: make D12 the default copy backend 2024-03-04 16:31:14 +11:00
Geoffrey McRae
beb8de922d [host] dxgi: remove the deprecated and broken d3d12 copyBackend
This backend has been deprecated and has been replaced by the new D12 capture
interface.
2024-03-04 16:29:43 +11:00
Geoffrey McRae
e247f1fc7b [host] d12: enlarge downsampler damage rects 2024-02-28 20:34:09 +11:00
Geoffrey McRae
4463ca15f6 [host] d12: added downsampler 2024-02-28 20:21:47 +11:00
Geoffrey McRae
97d91a32c8 [host] d12: make effects fully self-contained 2024-02-28 16:05:56 +11:00
Geoffrey McRae
2d41cda640 [host] d12: fix target for wait fence when effects are active 2024-02-28 12:31:56 +11:00
Geoffrey McRae
a894348530 [host] d12: correct the pitch when HDR16 is in use 2024-02-28 12:23:41 +11:00
Geoffrey McRae
ad7ac6540f [host] d12: implement hdr16 to hdr10 conversion 2024-02-28 11:59:58 +11:00
Geoffrey McRae
0184ddeedd [host] d12: properly handle format changes by effects 2024-02-28 09:40:35 +11:00
Geoffrey McRae
b87d8d2f33 [host] d12: disable RGB24 if the capture is HDR 2024-02-28 07:46:47 +11:00
Geoffrey McRae
5c4540ed8b [host] d12: pass frame information in a description structure 2024-02-28 07:30:39 +11:00
Geoffrey McRae
c7f1aadb9e [host] d12: pass back rotation metadata to the client 2024-02-28 05:54:40 +11:00
Geoffrey McRae
57ac020c8c [host] linux: update to build again 2024-02-27 19:14:58 +11:00
Geoffrey McRae
71b826458d [host] fix host-windows-cross github compilation 2024-02-27 19:14:58 +11:00
Geoffrey McRae
4408359597 [host] d12: fix damage tracking with RGB24 enabled 2024-02-24 09:04:59 +11:00
Geoffrey McRae
2f3ca443cf [host] d12: Use the gpu reported pitch instead of assuming w * 4 2024-02-24 07:57:50 +11:00
Geoffrey McRae
66049cf763 [host] d12: fix, send the current dirtyRects, not the old 2024-02-23 17:38:45 +11:00
Geoffrey McRae
a6dc8a9db3 [host] d12: fix damage tracking on re-init 2024-02-23 17:28:09 +11:00
Geoffrey McRae
dc4d93f50a [host] d12: remove extra copies in damage tracking 2024-02-23 17:24:25 +11:00
Geoffrey McRae
3b43dcb80d [host] d12: fix type of function argument 2024-02-23 11:00:18 +11:00
Geoffrey McRae
9de047d9cb [host] d12: implement damage aware copy 2024-02-23 10:54:08 +11:00
Geoffrey McRae
1098b7e6bd [host] d12: cosmetics 2024-02-23 08:38:32 +11:00
Geoffrey McRae
055d5527ef [host] d12: allow specifying adapter and output to capture 2024-02-23 08:14:24 +11:00
Geoffrey McRae
b1313980fb [host] d12: make RGB24 optional, disabled by default 2024-02-05 05:17:55 +11:00
Geoffrey McRae
319241b597 [host] d12: use a GPU side fence instead of CPU side 2024-02-05 04:27:04 +11:00
Geoffrey McRae
b0b851dd4b [host] d12: fix incorrect format presented to extra clients 2024-02-05 04:20:38 +11:00
Geoffrey McRae
60b01566e1 [host] d12: implement initial RGB24 support 2024-02-05 02:49:08 +11:00
Geoffrey McRae
4076377820 [host] win: add comRef helpers for leak identification and tracking 2024-02-05 02:49:08 +11:00
Geoffrey McRae
0b210a280d [all] update the copyright to 2024 2024-02-01 17:16:31 +11:00
Geoffrey McRae
a4fede01f3 [host] d12: general cleanups 2024-02-01 17:13:18 +11:00
Geoffrey McRae
071e4323fa [host] windows: make DXGI the default capture interface, D12 is not ready 2024-02-01 14:48:44 +11:00
Geoffrey McRae
be82b7e578 [host] d12: add wrappers for backend functions 2024-01-31 10:18:56 +11:00
Geoffrey McRae
c07b72883a [host] d12: adjust backend API to allow multiple instances 2024-01-31 09:43:01 +11:00
Geoffrey McRae
462d8187b6 [host] d12: handle error when windows switches to the secure desktop 2024-01-31 05:42:30 +11:00
Geoffrey McRae
4523b9ba00 [host] d12: fix failure to send mouse shape updates 2024-01-31 05:28:03 +11:00
Geoffrey McRae
cae4b2f4f9 [host] windows: fix compilation under gcc 2024-01-31 01:33:43 +11:00
Geoffrey McRae
72b25b99bc [host] add new D12 capture interface
Note, this capture interface is not yet feature complete but does seem
to be stable.
2024-01-31 00:29:55 +11:00
Geoffrey McRae
e376e6fb53 [host] app: revert unintended change from last commit 2024-01-27 23:19:42 +11:00
Geoffrey McRae
34e8a2255e [host] dxgi: d3d12 now writes direclty into ivshmem
This is still incomplete as d3d12 doesn't have any proper sync with the
captured frame and as such is still not suggested for general usage. This
change though is monumental for this project as it removes a full memory
copy reducing bandwidth consumption enormously.
2024-01-27 22:57:13 +11:00
Geoffrey McRae
adaf40e2bf [host] dxgi: Fix d3d12 32-bit output
Fixes #1100
2024-01-27 20:07:52 +11:00
Geoffrey McRae
84dd68dd2b [host] dxgi: correct 24-bit packed output height calculation bug 2024-01-27 11:14:04 +11:00
Geoffrey McRae
738a04d0bc [host] dxgi: fix packed texture height calculation 2024-01-27 10:56:23 +11:00
Geoffrey McRae
2316a5e64d [host] dxgi: ensure 24-bit packed output is properly aligned 2024-01-27 10:11:01 +11:00
Geoffrey McRae
47ad93f48d [host] common: fix compilation on clang 2024-01-27 10:10:48 +11:00
Geoffrey McRae
c5cbb8aa46 [host] dxgi: enable 24-bit mode by default
General community feedback with this enabled has been positive and we
can now transition to enabling by default.
2024-01-27 02:28:09 +11:00
Geoffrey McRae
ad00aaacd0 [obs] fix non-dmabuf 24-bit imports
OBS `GS_RGBA` maps to the sRGB color space which breaks our mapping
kludge, as such we need to use the UNORM variants to avoid this
2024-01-27 02:14:05 +11:00
Geoffrey McRae
1b75ae0762 [obs] fix 24-bit import support with dmabuf 2024-01-27 00:44:38 +11:00
Geoffrey McRae
5b3cc4cd48 [cmake] MakeObject: ensure embedded objects are null terminated 2024-01-27 00:44:38 +11:00
Geoffrey McRae
7247fadad8 [client] egl: fix post processing failure when converting pixel formats 2024-01-25 17:51:06 +11:00
Geoffrey McRae
c2237f29ae [client] x11: fix typo
Closes #1105
2024-01-02 08:51:13 +11:00
Tudor Brindus
e5a9c0242f [client] wayland: libdecor maximize request should maximize, not minimize 2023-12-24 15:30:19 +11:00
Quantum
537218d6ae [client] wayland: honour fullscreen and maximize in libdecor
We never added the functionality when the parameters were passed to
libdecor_shellInit.
2023-12-22 14:08:48 +11:00
Geoffrey McRae
f05151c9a6 [host] nvfbc: fix compilation with new debug code 2023-12-07 16:33:54 +11:00
Geoffrey McRae
b776b00a67 [common] host: fix compliation on windows 2023-12-07 16:11:28 +11:00
Geoffrey McRae
4b4e07875d [common] debug: fix compilation on windows 2023-12-07 15:46:31 +11:00
Geoffrey McRae
6104956a27 [common] reformat the debug output to be more useful 2023-12-07 15:37:54 +11:00
Geoffrey McRae
3668040892 [client] pipewire: correct pipewire_latency as per the docs
see: https://docs.pipewire.org/structpw__time.html
2023-12-06 22:26:20 +11:00
Geoffrey McRae
8cd002f1b2 [client] x11: fix incorrect pointer reference, fixes clipboard
Thanks to @JJRcop for bisecting to discover the fault
2023-12-01 09:12:38 +11:00
Geoffrey McRae
22d949c411 [client] egl: fix rgb24 regression
We need the alpha channel for this data type
2023-11-21 12:20:46 +11:00
Geoffrey McRae
43a3fb0db3 [client] egl: RGB24 improvements
This patch performs several changes.

* Alters the fourcc codes to types that ignore the alpha channel where
  possible to allow the gpu to internally use 24-bit formats.
* Attempts to use DRM_FORMAT_RGB888 first as some GPUs may support this
* If DMABUF is not in use the data is now imported directly as RGB24
  without the post-processing shader
2023-11-21 12:01:45 +11:00
Geoffrey McRae
8d27d9e2e2 [common] rect: fix avx alignment issue take 2 2023-11-19 18:01:34 +11:00
Geoffrey McRae
660b4b8ec8 [common] rects: fix avx implementation for unaligned accesses 2023-11-19 17:16:22 +11:00
Geoffrey McRae
4911e129f8 [common] time: improve flow with compiler hints 2023-11-19 16:31:45 +11:00
Geoffrey McRae
d3ee5bddde [common] rect/framebuffer: improve avx implementations 2023-11-19 15:45:15 +11:00
Geoffrey McRae
0ce4c34c37 [client] egl: fix non-dma RGB24 import path 2023-11-19 09:42:37 +11:00
Geoffrey McRae
584de4133f [common] fix compilation on clang 2023-11-19 03:20:34 +11:00
Geoffrey McRae
3330f83af6 [common] add runtime detection and selection of AVX/AVX2 support 2023-11-19 02:52:11 +11:00
Geoffrey McRae
5d4c1d348c [all] refactor cpuInfo function names 2023-11-19 01:22:09 +11:00
Geoffrey McRae
750cab83a3 Revert "[common] add AVX/AVX2 memory copy implementations"
This reverts commit e61678ef1b.
GCC only supports multi-versioning in C++
2023-11-19 00:18:48 +11:00
Geoffrey McRae
e61678ef1b [common] add AVX/AVX2 memory copy implementations 2023-11-19 00:09:42 +11:00
Geoffrey McRae
6357df1a7a [client] egl: fix non-dma texture stride issue 2023-11-15 17:40:57 +11:00
Geoffrey McRae
1f4395570c [obs] fix timeout when unsupported frame type is provided 2023-11-15 17:39:09 +11:00
Geoffrey McRae
accf300c6c [host] dxgi: fix failure to reset texture state on fast restarts 2023-11-15 17:31:37 +11:00
Geoffrey McRae
a0fd03d328 [repo] update LGMP submodule 2023-11-13 14:03:19 +11:00
Geoffrey McRae
929e88b9d3 [all] provide conditional path optimization hints to the compiler 2023-11-12 18:26:08 +11:00
Geoffrey McRae
7bea919352 [common] time: prevent possible div by zero on windows 2023-11-12 06:56:37 +11:00
Geoffrey McRae
96b5892c31 [host] app: prevent possible null deref and resource leak 2023-11-12 06:44:20 +11:00
Geoffrey McRae
b14aad7118 [host] dxgi: remove uneeded variable + minor cosmetic changes 2023-11-12 06:36:04 +11:00
Geoffrey McRae
7321ca6768 [host] windows: fix stdout/stderr resource leak 2023-11-12 06:20:29 +11:00
Geoffrey McRae
cd6485f2ed [host] downsample: fix resource leak on failure 2023-11-12 05:59:47 +11:00
Geoffrey McRae
7bcad37568 [host] platform: Close the exitEvent when done 2023-11-12 05:59:14 +11:00
Geoffrey McRae
ba8075a9fd [host] app: fix unchecked return value 2023-11-11 20:50:42 +11:00
Geoffrey McRae
3bad3837b4 [host] fix copy-paste error 2023-11-11 20:47:36 +11:00
Geoffrey McRae
084ebe5035 [host] dxgi: fix potential buffer out of bounds access 2023-11-11 20:41:10 +11:00
Geoffrey McRae
d480b674ca [host] dxgi: fix invalid array access via wrong variable 2023-11-11 20:37:58 +11:00
Geoffrey McRae
10e30eec57 [host] dxgi: fix possible null dereference 2023-11-11 20:36:53 +11:00
Geoffrey McRae
38b6b0ac40 [common] windows/event: fix control flow issue 2023-11-11 20:34:30 +11:00
Geoffrey McRae
503efdd0d8 [host] dxgi: fix failure to call FreeLibrary for d3d12 2023-11-11 20:31:53 +11:00
Geoffrey McRae
75e10688d4 [repo] update PureSpice submodule 2023-11-11 15:51:37 +11:00
Geoffrey McRae
ec88a52fe2 [common] ivshmem: fix possible resource leak 2023-11-11 14:04:54 +11:00
Geoffrey McRae
a28deae569 [client] util: fix invalid pointer arithmatic 2023-11-11 14:03:40 +11:00
Geoffrey McRae
cf51503a54 [client] X11/i3: write directly into sun_path to avoid strncpy 2023-11-11 13:48:41 +11:00
Geoffrey McRae
aa42751743 [client] common: fix time of check/time of use issue 2023-11-11 13:48:41 +11:00
Geoffrey McRae
9a53880b9b [common] ivshmem: fix failure to check ioctl for error result 2023-11-11 13:48:41 +11:00
Geoffrey McRae
a3b51220ed [common] option: remove const qualifier from shortopt 2023-11-11 13:48:41 +11:00
Geoffrey McRae
17fce1cf78 [client] util: fix failure to check result of ftell for error 2023-11-11 13:48:41 +11:00
Geoffrey McRae
9f3f8cc5bd [client] splash: remove 0 array specifier from func prototype 2023-11-11 13:48:41 +11:00
Geoffrey McRae
0524980cb4 [client] msg: make it clear we ignore the return for ll_shift 2023-11-11 13:48:41 +11:00
Geoffrey McRae
a0f5907cb6 [client] overlay: prevent possible divide by zero 2023-11-11 13:48:41 +11:00
Geoffrey McRae
0a9784d09d [client] main: fix possible dereference of null g_state.ds 2023-11-11 13:48:41 +11:00
Geoffrey McRae
120e063a10 [client] main: prevent possible null pointer dereference 2023-11-11 13:48:41 +11:00
Geoffrey McRae
f59ef4422a [client] app: prevent possible out of bounds array access 2023-11-11 13:48:41 +11:00
Geoffrey McRae
417c9cf092 [client] opengl: act on glBufferSubData failure 2023-11-11 13:48:41 +11:00
Geoffrey McRae
852825a97e [client] util: fix failure to dereference pointer 2023-11-11 13:48:41 +11:00
Geoffrey McRae
cce12508cc [egl] shader: fix reliance on null terminated strings
Compiled in resources often will not contain a null terminator, as such
we must not use functions that rely on it. This implements a memsearch
function that performs like strstr on a buffer instead of a null
terminated string.
2023-11-11 13:48:41 +11:00
Geoffrey McRae
43f9a4c0e1 [client] egl: fix potential integer underflow 2023-11-11 13:48:41 +11:00
Geoffrey McRae
ee5c02f72a [client] egl: fix potential resource leak 2023-11-11 13:48:41 +11:00
Geoffrey McRae
55fa5cc851 [client] egl: fix integer division into float 2023-11-11 13:48:41 +11:00
Geoffrey McRae
b70811dcb9 [client] x11: pass large struct by reference 2023-11-11 13:48:41 +11:00
Geoffrey McRae
3c1405719c [client] wayland: fix use after free bugs 2023-11-11 13:48:41 +11:00
Geoffrey McRae
f6befb4567 [client] wayland: formatting 2023-11-11 13:48:41 +11:00
Jonathan Rubenstein
62aef5a240 [doc] build: Move NvFBC note into don't build warning
Also:
   - Add link to warning (#dont-build-the-host)
2023-11-11 10:32:15 +11:00
Jonathan Rubenstein
4f508d320a [doc] words: Sort using sort_words.py 2023-11-11 10:31:51 +11:00
Jonathan Rubenstein
29f1434270 [doc] sort_words: Create sort_words.py to make words.txt easier to maintain
sort_words.py outputs a diff that if applied will sort words.txt

It has a few options:
    - '--add-word': Add a word before sorting (usable multiple times)
    - '--save': Save changes to file instead of only outputting a diff
    - '--quiet': Don't output a diff
2023-11-11 10:31:51 +11:00
Geoffrey McRae
27f3af8221 [host] nvfbc: cosmetics 2023-11-11 09:08:56 +11:00
Geoffrey McRae
cb849b287c [hosts] nvfbc: exit loop early if ystart is > then dataHeight 2023-11-11 09:08:08 +11:00
Geoffrey McRae
8630fd20ad [common] rects: simplify unaligned copy function 2023-11-11 09:07:00 +11:00
Geoffrey McRae
0057cf5377 [host] nvfbc: add additional debug output 2023-11-10 08:01:03 +11:00
392 changed files with 34250 additions and 12003 deletions

View File

@@ -1,3 +1,9 @@
---
name: Bug report
about: Report bugs in Looking Glass (only confirmed bugs and feature requests please)
---
### Issues are for Bug Reports and Feature Requests Only!
If you are looking for help or support please use one of the following methods
@@ -64,3 +70,4 @@ https://www.youtube.com/watch?v=EqxxJK9Yo64
```
PASTE FULL BACKTRACE HERE
```

9
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,9 @@
blank_issues_enabled: false
contact_links:
- name: Looking Glass on Level1Tech's Forum
url: https://forum.level1techs.com/c/software/lookingGlass/142
about: Ask for help by creating a New Topic on the Level1Tech's forum
- name: Looking Glass Discord Server
url: https://discord.gg/52SMupxkvt
about: Ask for help in the Looking Glass discord server

View File

@@ -2,7 +2,7 @@ name: build
on: [push, pull_request]
jobs:
client:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
@@ -15,12 +15,6 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install libdecor PPA
run: sudo add-apt-repository ppa:christianrauch/libdecoration
if: ${{ matrix.wayland_shell == 'libdecor' }}
- name: Install PipeWire repository
run: |
echo 'deb [trusted=yes] https://pipewire-ubuntu.quantum5.workers.dev ./' | sudo tee /etc/apt/sources.list.d/pipewire.list
- name: Update apt
run: |
sudo apt-get update
@@ -32,6 +26,7 @@ jobs:
libgl-dev libgles-dev \
libx11-dev libxss-dev libxi-dev libxinerama-dev libxcursor-dev libxpresent-dev \
libwayland-dev libxkbcommon-dev \
libfontconfig-dev \
libsamplerate0-dev libpipewire-0.3-dev libpulse-dev \
$([ '${{ matrix.wayland_shell }}' = libdecor ] && echo 'libdecor-0-dev libdbus-1-dev') \
$([ '${{ matrix.compiler.cc }}' = clang ] && echo 'clang-tools')
@@ -76,16 +71,13 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install PipeWire repository
run: |
echo 'deb [trusted=yes] https://pipewire-ubuntu.quantum5.workers.dev ./' | sudo tee /etc/apt/sources.list.d/pipewire.list
- name: Update apt
run: |
sudo apt-get update
- name: Install Linux host dependencies
run: |
sudo apt-get install binutils-dev libxcb-xfixes0-dev \
libpipewire-0.3-dev
sudo apt-get install binutils-dev libglib2.0-dev libxcb-xfixes0-dev \
libpipewire-0.3-dev libxcb-shm0-dev
- name: Configure Linux host
run: |
mkdir host/build
@@ -128,11 +120,33 @@ jobs:
makensis -DIVSHMEM platform/Windows/installer.nsi
host-windows-native:
runs-on: windows-latest
runs-on: windows-2025
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install NSIS
shell: powershell
run: |
winget install -e --id NSIS.NSIS --silent --accept-source-agreements --accept-package-agreements
$paths = @(
(Join-Path ${env:ProgramFiles} 'NSIS\Bin'),
(Join-Path ${env:ProgramFiles(x86)} 'NSIS\Bin')
) | Where-Object { Test-Path $_ }
if ($paths.Count -eq 0) {
Write-Error "NSIS 'Bin' folder not found after install."
exit 1
}
$paths | ForEach-Object {
Add-Content -Path $env:GITHUB_PATH -Value $_
}
Write-Host "makensis location(s): $($paths -join ', ')"
- name: Test NSIS
run: |
makensis /VERSION
- name: Configure Windows host for native MinGW-w64
run: |
mkdir host\build
@@ -147,6 +161,36 @@ jobs:
cd host\build
makensis -DBUILD_32BIT platform\Windows\installer.nsi
idd:
runs-on: windows-2022
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64
- name: Install NuGet packages
run: |
cd idd
nuget restore LGIdd.sln
- name: Build IDD
run: |
cd idd
msbuild.exe LGIdd.sln /t:Build /p:Configuration=Release /p:Platform=x64
- name: Build NSIS Installer
run: |
cd idd\x64\Release\LGIdd
makensis -DBUILD_32BIT installer.nsi
- name: Build NSIS installer with IVSHMEM drivers
run: |
cd idd\x64\Release
Invoke-WebRequest https://dl.quantum2.xyz/ivshmem.tar.gz -OutFile ivshmem.tar.gz
tar -xzvf ivshmem.tar.gz
cd LGIdd
makensis -DBUILD_32BIT -DIVSHMEM installer.nsi
obs:
runs-on: ubuntu-latest
strategy:

View File

@@ -3,16 +3,36 @@ on: pull_request
jobs:
authors:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v1
- name: Check AUTHORS file
id: check-authors
run: |
user="$(curl -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' -s https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }} | jq -r .user.login)"
echo "user=$user" >> "$GITHUB_OUTPUT"
echo "Checking if GitHub user $user is in AUTHORS file..."
if grep -q -E '> \('"$user"'\)' AUTHORS; then
echo "$user found in AUTHORS file, all good!"
else
echo "$user not found in AUTHORS file."
echo "Please add yourself to the AUTHORS file and try again."
exit 1
echo "not-found=yes" >> "$GITHUB_OUTPUT"
fi
- name: 'Not found: Create review requesting changes'
if: ${{ steps.check-authors.outputs.not-found }}
uses: actions/github-script@v7
with:
script: |
github.rest.pulls.createReview({
owner: context.issue.owner,
repo: context.issue.repo,
pull_number: context.issue.number,
event: "REQUEST_CHANGES",
body: "@${{ steps.check-authors.outputs.user }} not found in AUTHORS file.\n" +
"Please add yourself to the AUTHORS file and try again."
});
- name: 'Not found: Fail job'
if: ${{ steps.check-authors.outputs.not-found }}
run: exit 1

8
.gitignore vendored
View File

@@ -11,7 +11,11 @@ module/modules.order
__pycache__
*.py[co]
*/.vs
*.user
idd/Debug
idd/x64
idd/LGIdd/x64
idd/LGIdd/Debug
idd/*/x64
idd/*/Debug
idd/*/VersionInfo.h
idd/*/VERSION
idd/packages

2
.gitmodules vendored
View File

@@ -9,7 +9,7 @@
url = https://github.com/cimgui/cimgui.git
[submodule "repos/wayland-protocols"]
path = repos/wayland-protocols
url = https://gitlab.freedesktop.org/wayland/wayland-protocols.git
url = https://github.com/quantum5/wayland-protocols.git
[submodule "repos/nanosvg"]
path = repos/nanosvg
url = https://github.com/memononen/nanosvg.git

34
.woodpecker/idd.yaml Normal file
View File

@@ -0,0 +1,34 @@
---
labels:
platform: windows/amd64
matrix:
BUILD_TYPE:
- Debug
- Release
when:
- event: push
branch: master
repo: gnif/LookingGlass
clone:
- name: clone
image: woodpeckerci/plugin-git
pull: false
settings:
tags: true
steps:
- name: idd
image: lg-vs2022:latest
pull: true
environment:
VS_PATH: "\"C:\\\\Program Files (x86)\\\\Microsoft Visual Studio\\\\2022\\\\\""
entrypoint:
- cmd
- /C
- >
%VS_PATH%\BuildTools\Common7\Tools\VsDevCmd.bat -arch=amd64 &&
msbuild /restore idd\LGIdd.sln /p:Configuration=${BUILD_TYPE} /p:RestorePackagesConfig=true /p:Platform=x64 /p:SignMode=Off /m &&
IF EXIST C:\artifacts\build.cmd (cmd /C C:\artifacts\build.cmd)

View File

@@ -67,3 +67,10 @@ Daniel Cordero <looking-glass@0xdc.io> (0xdc)
esi <git@esibun.net> (esibun)
MakiseKurisu <saberconer@gmail.com> (MakiseKurisu)
Zenithal <i@zenithal.me> (ZenithalHourlyRate)
Kamplom <6284968128@protonmail.ch> (kamplom)
Jacob McNamee <jacob@jacobmcnamee.com> (jacobmcnamee)
Marco Antonio J. Costa <marco.antonio.costa@gmail.com> (majcosta)
rs189 <35667100+rs189@users.noreply.github.com> (rs189)
Jérôme Poulin <jeromepoulin@gmail.com> (ticpu)
Marco Rodolfi <marco.rodolfi@tuta.io> (RodoMa92)
Stewart Borle <stewi1014@gmail.com> (stewi1014)

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)
project(looking-glass-client C CXX)
get_filename_component(PROJECT_TOP "${PROJECT_SOURCE_DIR}/.." ABSOLUTE)
@@ -42,19 +42,12 @@ add_feature_info(ENABLE_ASAN ENABLE_ASAN "AddressSanitizer support.")
option(ENABLE_UBSAN "Build with UndefinedBehaviorSanitizer" OFF)
add_feature_info(ENABLE_UBSAN ENABLE_UBSAN "UndefinedBehaviorSanitizer support.")
option(ENABLE_X11 "Build with X11 support" ON)
add_feature_info(ENABLE_X11 ENABLE_X11 "X11 support.")
option(ENABLE_PIPEWIRE "Build with PipeWire audio output support" ON)
add_feature_info(ENABLE_PIPEWIRE ENABLE_PIPEWIRE "PipeWire audio support.")
option(ENABLE_PULSEAUDIO "Build with PulseAudio audio output support" ON)
add_feature_info(ENABLE_PULSEAUDIO ENABLE_PULSEAUDIO "PulseAudio audio support.")
if (NOT ENABLE_X11 AND NOT ENABLE_WAYLAND)
message(FATAL_ERROR "Either ENABLE_X11 or ENABLE_WAYLAND must be on")
endif()
add_compile_options(
"-Wall"
"-Wextra"
@@ -120,6 +113,7 @@ set(SOURCES
src/main.c
src/core.c
src/app.c
src/message.c
src/audio.c
src/config.c
src/keybind.c
@@ -131,6 +125,7 @@ set(SOURCES
src/eglutil.c
src/overlay_utils.c
src/render_queue.c
src/evdev.c
src/overlay/splash.c
src/overlay/alert.c
@@ -144,6 +139,8 @@ set(SOURCES
# Force cimgui to build as a static library.
set(IMGUI_STATIC "yes" CACHE STRING "Build as a static library")
add_definitions("-DCIMGUI_USE_OPENGL2=1")
add_definitions("-DCIMGUI_USE_OPENGL3=1")
add_subdirectory("${PROJECT_TOP}/resources" "${CMAKE_BINARY_DIR}/resources")
add_subdirectory("${PROJECT_TOP}/common" "${CMAKE_BINARY_DIR}/common" )
@@ -154,6 +151,7 @@ add_subdirectory("${PROJECT_TOP}/repos/cimgui" "${CMAKE_BINARY_DIR}/cimgui" E
add_subdirectory(displayservers)
add_subdirectory(renderers)
configure_file("${PROJECT_TOP}/resources/looking-glass-client.desktop.in" "${CMAKE_BINARY_DIR}/resources/looking-glass-client.desktop" @ONLY)
add_executable(looking-glass-client ${SOURCES})
target_compile_definitions(looking-glass-client PRIVATE CIMGUI_DEFINE_ENUMS_AND_STRUCTS=1)
@@ -184,4 +182,10 @@ install(TARGETS looking-glass-client
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT binary)
install(FILES "${CMAKE_BINARY_DIR}/resources/looking-glass-client.desktop"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
install(FILES "${PROJECT_TOP}/resources/lg-logo.svg"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps"
RENAME "looking-glass.svg")
feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES)

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)
project(audiodevs LANGUAGES C)
set(AUDIODEV_H "${CMAKE_BINARY_DIR}/include/dynamic/audiodev.h")

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)
project(audiodev_PipeWire LANGUAGES C)
find_package(PkgConfig)

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -48,6 +48,7 @@ struct PipeWire
{
struct pw_stream * stream;
struct spa_io_rate_match * rateMatch;
struct pw_time time;
int channels;
int sampleRate;
@@ -91,6 +92,14 @@ static void pipewire_onPlaybackProcess(void * userdata)
{
struct pw_buffer * pbuf;
#if PW_CHECK_VERSION(0, 3, 50)
if (pw_stream_get_time_n(pw.playback.stream, &pw.playback.time,
sizeof(pw.playback.time)) < 0)
#else
if (pw_stream_get_time(pw.playback.stream, &pw.playback.time) < 0)
#endif
DEBUG_ERROR("pw_stream_get_time failed");
if (!(pbuf = pw_stream_dequeue_buffer(pw.playback.stream)))
{
DEBUG_WARN("out of buffers");
@@ -115,6 +124,7 @@ static void pipewire_onPlaybackProcess(void * userdata)
return;
}
pbuf->size = frames;
sbuf->datas[0].chunk->offset = 0;
sbuf->datas[0].chunk->stride = pw.playback.stride;
sbuf->datas[0].chunk->size = frames * pw.playback.stride;
@@ -158,6 +168,12 @@ static bool pipewire_init(void)
pw_init(NULL, NULL);
pw.loop = pw_loop_new(NULL);
#if PW_CHECK_VERSION(1, 3, 81)
pw.context = pw_context_new(
pw.loop,
NULL,
0);
#else
pw.context = pw_context_new(
pw.loop,
pw_properties_new(
@@ -166,6 +182,7 @@ static bool pipewire_init(void)
NULL
),
0);
#endif
if (!pw.context)
{
DEBUG_ERROR("Failed to create a context");
@@ -248,6 +265,7 @@ static void pipewire_playbackSetup(int channels, int sampleRate,
struct pw_properties * props =
pw_properties_new(
PW_KEY_APP_NAME , "Looking Glass",
PW_KEY_NODE_NAME , "Looking Glass",
PW_KEY_MEDIA_TYPE , "Audio",
PW_KEY_MEDIA_CATEGORY, "Playback",
@@ -401,20 +419,32 @@ static void pipewire_playbackMute(bool mute)
pw_thread_loop_unlock(pw.thread);
}
static size_t pipewire_playbackLatency(void)
static uint64_t pipewire_playbackLatency(void)
{
struct pw_time time = { 0 };
pw_thread_loop_lock(pw.thread);
#if PW_CHECK_VERSION(0, 3, 50)
if (pw_stream_get_time_n(pw.playback.stream, &time, sizeof(time)) < 0)
#else
if (pw_stream_get_time(pw.playback.stream, &time) < 0)
#endif
DEBUG_ERROR("pw_stream_get_time failed");
pw_thread_loop_unlock(pw.thread);
if (pw.playback.time.rate.num == 0)
return 0;
return time.delay + time.queued / pw.playback.stride;
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
// diff in ns
int64_t diff = SPA_TIMESPEC_TO_NSEC(&ts) - pw.playback.time.now;
// elapsed frames
int64_t elapsed =
(pw.playback.time.rate.denom * diff) /
(pw.playback.time.rate.num * SPA_NSEC_PER_SEC);
const int64_t buffered = pw.playback.time.buffered + pw.playback.time.queued;
int64_t latency = (buffered * 1000 / pw.playback.sampleRate) +
((pw.playback.time.delay - elapsed) * 1000 *
pw.playback.time.rate.num / pw.playback.time.rate.denom);
return max(0, -latency);
#else
return pw.playback.time.delay + pw.playback.time.queued / pw.playback.stride;
#endif
}
static void pipewire_recordStopStream(void)

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)
project(audiodev_PulseAudio LANGUAGES C)
find_package(PkgConfig)

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)
project(displayservers LANGUAGES C)
set(DISPLAYSERVER_H "${CMAKE_BINARY_DIR}/include/dynamic/displayservers.h")
@@ -18,9 +18,16 @@ function(add_displayserver name)
add_subdirectory(${name})
endfunction()
option(ENABLE_X11 "Build with X11 support" ON)
add_feature_info(ENABLE_X11 ENABLE_X11 "X11 support.")
option(ENABLE_WAYLAND "Build with Wayland support" ON)
add_feature_info(ENABLE_WAYLAND ENABLE_WAYLAND "Wayland support.")
if (NOT ENABLE_X11 AND NOT ENABLE_WAYLAND)
message(FATAL_ERROR "Either ENABLE_X11 or ENABLE_WAYLAND must be on")
endif()
# Add/remove displayservers here!
if (ENABLE_WAYLAND)
add_displayserver(Wayland)

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)
project(displayserver_Wayland LANGUAGES C)
find_package(PkgConfig)

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -376,7 +376,7 @@ static void clipboardReadCancel(struct ClipboardRead * data)
static void clipboardReadCallback(uint32_t events, void * opaque)
{
struct ClipboardRead * data = opaque;
if (events & EPOLLERR)
if (events & EPOLLERR)
{
clipboardReadCancel(data);
return;
@@ -475,6 +475,7 @@ void waylandCBRequest(LG_ClipboardData type)
close(data->fd);
free(data->buf);
free(data);
return;
}
wlCb.currentRead = data;

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)
project(wayland_desktops LANGUAGES C)
set(DESKTOP_H "${CMAKE_BINARY_DIR}/include/dynamic/wayland_desktops.h")

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)
project(wayland_desktop_libdecor LANGUAGES C)
add_library(wayland_desktop_libdecor STATIC

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -46,6 +46,7 @@ typedef struct LibDecorState
int32_t width, height;
bool needsResize;
bool fullscreen;
bool borderless;
uint32_t resizeSerial;
}
LibDecorState;
@@ -130,17 +131,27 @@ static void libdecorCallback(uint32_t events, void * opaque)
static bool libdecor_shellInit(
struct wl_display * display, struct wl_surface * surface,
const char * title, bool fullscreen,
const char * title, const char * appId, bool fullscreen,
bool maximize, bool borderless, bool resizable)
{
state.libdecor = libdecor_new(display, &libdecorListener);
state.libdecorFrame = libdecor_decorate(state.libdecor, surface,
&libdecorFrameListener, NULL);
libdecor_frame_set_app_id(state.libdecorFrame, "looking-glass-client");
libdecor_frame_set_app_id(state.libdecorFrame, appId);
libdecor_frame_set_title(state.libdecorFrame, title);
libdecor_frame_map(state.libdecorFrame);
if (fullscreen)
libdecor_frame_set_fullscreen(state.libdecorFrame, NULL);
if (maximize)
libdecor_frame_set_maximized(state.libdecorFrame);
if (borderless)
libdecor_frame_set_visibility(state.libdecorFrame, false);
state.borderless = borderless;
if (resizable)
libdecor_frame_set_capabilities(state.libdecorFrame,
LIBDECOR_ACTION_RESIZE);
@@ -177,7 +188,8 @@ static void libdecor_setFullscreen(bool fs)
else
libdecor_frame_unset_fullscreen(state.libdecorFrame);
libdecor_frame_set_visibility(state.libdecorFrame, !fs);
if (!state.borderless)
libdecor_frame_set_visibility(state.libdecorFrame, !fs);
}
static bool libdecor_getFullscreen(void)

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)
project(wayland_desktop_xdg LANGUAGES C)
add_library(wayland_desktop_xdg STATIC

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -49,6 +49,7 @@ typedef struct XDGState
uint32_t resizeSerial;
bool fullscreen;
bool floating;
bool resizable;
int displayFd;
}
XDGState;
@@ -130,7 +131,7 @@ static const struct xdg_toplevel_listener xdgToplevelListener = {
};
bool xdg_shellInit(struct wl_display * display, struct wl_surface * surface,
const char * title, bool fullscreen, bool maximize, bool borderless,
const char * title, const char * appId, bool fullscreen, bool maximize, bool borderless,
bool resizable)
{
if (!state.wmBase)
@@ -147,7 +148,7 @@ bool xdg_shellInit(struct wl_display * display, struct wl_surface * surface,
state.toplevel = xdg_surface_get_toplevel(state.surface);
xdg_toplevel_add_listener(state.toplevel, &xdgToplevelListener, NULL);
xdg_toplevel_set_title(state.toplevel, title);
xdg_toplevel_set_app_id(state.toplevel, "looking-glass-client");
xdg_toplevel_set_app_id(state.toplevel, appId);
if (fullscreen)
xdg_toplevel_set_fullscreen(state.toplevel, NULL);
@@ -155,6 +156,13 @@ bool xdg_shellInit(struct wl_display * display, struct wl_surface * surface,
if (maximize)
xdg_toplevel_set_maximized(state.toplevel);
if (!resizable)
{
xdg_toplevel_set_min_size(state.toplevel, state.width, state.height);
xdg_toplevel_set_max_size(state.toplevel, state.width, state.height);
}
state.resizable = resizable;
if (state.decorationManager)
{
state.toplevelDecoration = zxdg_decoration_manager_v1_get_toplevel_decoration(
@@ -200,7 +208,7 @@ static void xdg_minimize(void)
static void xdg_shellResize(int w, int h)
{
if (!state.floating)
if (!state.floating || !state.resizable)
return;
state.width = w;

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -102,7 +102,11 @@ void waylandEGLSwapBuffers(EGLDisplay display, EGLSurface surface, const struct
wl_surface_set_buffer_scale(wlWm.surface, 1);
if (!wlWm.viewport)
wlWm.viewport = wp_viewporter_get_viewport(wlWm.viewporter, wlWm.surface);
wp_viewport_set_source(wlWm.viewport, 0, 0, width * wlWm.scale, height * wlWm.scale);
wp_viewport_set_source(
wlWm.viewport,
wl_fixed_from_int(-1), wl_fixed_from_int(-1),
wl_fixed_from_int(-1), wl_fixed_from_int(-1)
);
wp_viewport_set_destination(wlWm.viewport, width, height);
}
else

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -209,7 +209,7 @@ done:
close(fd);
}
static int getCharcode(uint32_t key)
int waylandGetCharCode(int key)
{
key += 8; // xkb scancode is evdev scancode + 8
xkb_keysym_t sym = xkb_state_key_get_one_sym(wlWm.xkbState, key);
@@ -232,7 +232,7 @@ static void keyboardEnterHandler(void * data, struct wl_keyboard * keyboard,
uint32_t * key;
wl_array_for_each(key, keys)
app_handleKeyPress(*key, getCharcode(*key));
app_handleKeyPress(*key);
}
static void keyboardLeaveHandler(void * data, struct wl_keyboard * keyboard,
@@ -253,9 +253,9 @@ static void keyboardKeyHandler(void * data, struct wl_keyboard * keyboard,
return;
if (state == WL_KEYBOARD_KEY_STATE_PRESSED)
app_handleKeyPress(key, getCharcode(key));
app_handleKeyPress(key);
else
app_handleKeyRelease(key, getCharcode(key));
app_handleKeyRelease(key);
if (!wlWm.xkbState || !app_isOverlayMode() || state != WL_KEYBOARD_KEY_STATE_PRESSED)
return;

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -34,7 +34,7 @@ typedef struct WL_DesktopOps
bool (*shellInit)(
struct wl_display * display, struct wl_surface * surface,
const char * title, bool fullscreen, bool maximize,
const char * title, const char * appId, bool fullscreen, bool maximize,
bool borderless, bool resizable);
void (*shellAckConfigureIfNeeded)(void);

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -109,10 +109,17 @@ void waylandPresentationFrame(void)
return;
struct FrameData * data = malloc(sizeof(*data));
if (!data)
{
DEBUG_ERROR("out of memory");
return;
}
if (clock_gettime(wlWm.clkId, &data->sent))
{
DEBUG_ERROR("clock_gettime failed: %s\n", strerror(errno));
free(data);
return;
}
struct wp_presentation_feedback * feedback = wp_presentation_feedback(wlWm.presentation, wlWm.surface);

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)
project(wayland_protocol LANGUAGES C)
find_package(PkgConfig)

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -121,7 +121,7 @@ static bool waylandInit(const LG_DSInitParams params)
for(int i = 0; i < WL_DESKTOP_COUNT; ++i)
if (strcmp(WL_Desktops[i]->compositor, compositor) == 0)
{
wlWm.desktop = WL_Desktops[0];
wlWm.desktop = WL_Desktops[i];
break;
}
}
@@ -159,7 +159,7 @@ static bool waylandInit(const LG_DSInitParams params)
return false;
wlWm.desktop->setSize(params.w, params.h);
if (!waylandWindowInit(params.title, params.fullscreen, params.maximize,
if (!waylandWindowInit(params.title, params.appId, params.fullscreen, params.maximize,
params.borderless, params.resizable))
return false;
@@ -263,6 +263,7 @@ struct LG_DisplayServerOps LGDS_Wayland =
.uncapturePointer = waylandUncapturePointer,
.grabKeyboard = waylandGrabKeyboard,
.ungrabKeyboard = waylandUngrabKeyboard,
.getCharCode = waylandGetCharCode,
.warpPointer = waylandWarpPointer,
.realignPointer = waylandRealignPointer,
.isValidPointerPos = waylandIsValidPointerPos,

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -277,6 +277,7 @@ void waylandUncapturePointer(void);
void waylandRealignPointer(void);
void waylandWarpPointer(int x, int y, bool exiting);
void waylandGuestPointerUpdated(double x, double y, double localX, double localY);
int waylandGetCharCode(int key);
// output module
bool waylandOutputInit(void);
@@ -301,7 +302,7 @@ bool waylandRegistryInit(void);
void waylandRegistryFree(void);
// window module
bool waylandWindowInit(const char * title, bool fullscreen, bool maximize, bool borderless, bool resizable);
bool waylandWindowInit(const char * title, const char * appId, bool fullscreen, bool maximize, bool borderless, bool resizable);
void waylandWindowFree(void);
void waylandWindowUpdateScale(void);
void waylandSetWindowSize(int x, int y);

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -85,7 +85,7 @@ static const struct wl_surface_listener wlSurfaceListener = {
.leave = wlSurfaceLeaveHandler,
};
bool waylandWindowInit(const char * title, bool fullscreen, bool maximize, bool borderless, bool resizable)
bool waylandWindowInit(const char * title, const char * appId, bool fullscreen, bool maximize, bool borderless, bool resizable)
{
wlWm.scale = wl_fixed_from_int(1);
@@ -113,7 +113,7 @@ bool waylandWindowInit(const char * title, bool fullscreen, bool maximize, bool
wl_surface_add_listener(wlWm.surface, &wlSurfaceListener, NULL);
if (!wlWm.desktop->shellInit(wlWm.display, wlWm.surface,
title, fullscreen, maximize, borderless, resizable))
title, appId, fullscreen, maximize, borderless, resizable))
return false;
wl_surface_commit(wlWm.surface);

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)
project(displayserver_X11 LANGUAGES C)
find_package(PkgConfig)

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -60,40 +60,40 @@ static void x11CBSelectionIncr(const XPropertyEvent e);
static void x11CBSelectionNotify(const XSelectionEvent e);
static void x11CBXFixesSelectionNotify(const XFixesSelectionNotifyEvent e);
bool x11CBEventThread(const XEvent xe)
bool x11CBEventThread(const XEvent * xe)
{
switch(xe.type)
switch(xe->type)
{
case SelectionRequest:
x11CBSelectionRequest(xe.xselectionrequest);
x11CBSelectionRequest(xe->xselectionrequest);
return true;
case SelectionClear:
x11CBSelectionClear(xe.xselectionclear);
x11CBSelectionClear(xe->xselectionclear);
return true;
case SelectionNotify:
x11CBSelectionNotify(xe.xselection);
x11CBSelectionNotify(xe->xselection);
return true;
case PropertyNotify:
if (xe.xproperty.state != PropertyNewValue)
if (xe->xproperty.state != PropertyNewValue)
break;
if (xe.xproperty.atom == x11atoms.SEL_DATA)
if (xe->xproperty.atom == x11atoms.SEL_DATA)
{
if (x11cb.lowerBound == 0)
return true;
x11CBSelectionIncr(xe.xproperty);
x11CBSelectionIncr(xe->xproperty);
return true;
}
break;
default:
if (xe.type == x11.eventBase + XFixesSelectionNotify)
if (xe->type == x11.eventBase + XFixesSelectionNotify)
{
XFixesSelectionNotifyEvent * sne = (XFixesSelectionNotifyEvent *)&xe;
XFixesSelectionNotifyEvent * sne = (XFixesSelectionNotifyEvent *)xe;
x11CBXFixesSelectionNotify(*sne);
return true;
}

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#include "interface/displayserver.h"
bool x11CBEventThread(const XEvent xe);
bool x11CBEventThread(const XEvent * xe);
bool x11CBInit(void);
void x11CBNotice(LG_ClipboardData type);

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -71,9 +71,9 @@ static bool wm_i3_init(void)
return false;
struct sockaddr_un addr = { .sun_family = AF_UNIX };
char path[sizeof(addr.sun_path)];
char * path = (char *)&addr.sun_path;
int pathLen;
if ((pathLen = fread(path, 1, sizeof(path), fd)) <= 0)
if ((pathLen = fread(path, 1, sizeof(addr.sun_path), fd)) <= 0)
{
pclose(fd);
return false;
@@ -91,7 +91,6 @@ static bool wm_i3_init(void)
return false;
}
strncpy(addr.sun_path, path, sizeof(addr.sun_path));
if (connect(i3.sock, (struct sockaddr *)&addr, sizeof(addr)) < 0)
{
DEBUG_ERROR("Failed to connect to the i3 IPC socket");

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -229,7 +229,7 @@ static void x11CheckEWMHSupport(void)
x11.ewmhHasFocusEvent = true;
}
DEBUG_INFO("EWMH-complient window manager detected: %s", wmName);
DEBUG_INFO("EWMH-compliant window manager detected: %s", wmName);
x11.ewmhSupport = true;
if (strcmp(wmName, "i3") == 0)
@@ -343,7 +343,7 @@ static bool x11Init(const LG_DSInitParams params)
XClassHint hint =
{
.res_name = strdup(params.title),
.res_class = strdup("looking-glass-client")
.res_class = strdup(params.appId)
};
XSetClassHint(x11.display, x11.window, &hint);
free(hint.res_name);
@@ -699,7 +699,7 @@ static bool x11Init(const LG_DSInitParams params)
XMoveWindow(x11.display, x11.window, params.x, params.y);
if (params.fullscreen)
x11SetFullscreen(true);
x11.doFullscreenOnExpose = true;
XSetLocaleModifiers(""); // Load XMODIFIERS
x11.xim = XOpenIM(x11.display, 0, 0, 0);
@@ -897,7 +897,7 @@ static int x11EventThread(void * unused)
XNextEvent(x11.display, &xe);
// call the clipboard handling code
if (x11CBEventThread(xe))
if (x11CBEventThread(&xe))
continue;
switch(xe.type)
@@ -946,6 +946,11 @@ static int x11EventThread(void * unused)
{
atomic_store(&x11.lastWMEvent, microtime());
x11.invalidateAll = true;
if (x11.doFullscreenOnExpose)
{
x11SetFullscreen(true);
x11.doFullscreenOnExpose = false;
}
break;
}
@@ -1082,8 +1087,9 @@ static void setFocus(bool focused, double x, double y)
app_handleFocusEvent(focused);
}
static int getCharcode(int detail)
static int x11GetCharCode(int detail)
{
detail += x11.minKeycode;
if (detail < x11.minKeycode || detail > x11.maxKeycode)
return 0;
@@ -1224,8 +1230,7 @@ static void x11XInputEvent(XGenericEventCookie *cookie)
return;
XIDeviceEvent *device = cookie->data;
app_handleKeyPress(device->detail - x11.minKeycode,
getCharcode(device->detail));
app_handleKeyPress(device->detail - x11.minKeycode);
if (!x11.xic || !app_isOverlayMode())
return;
@@ -1275,8 +1280,7 @@ static void x11XInputEvent(XGenericEventCookie *cookie)
return;
XIDeviceEvent *device = cookie->data;
app_handleKeyRelease(device->detail - x11.minKeycode,
getCharcode(device->detail));
app_handleKeyRelease(device->detail - x11.minKeycode);
if (!x11.xic || !app_isOverlayMode())
return;
@@ -1305,8 +1309,7 @@ static void x11XInputEvent(XGenericEventCookie *cookie)
return;
XIRawEvent *raw = cookie->data;
app_handleKeyPress(raw->detail - x11.minKeycode,
getCharcode(raw->detail));
app_handleKeyPress(raw->detail - x11.minKeycode);
return;
}
@@ -1316,8 +1319,7 @@ static void x11XInputEvent(XGenericEventCookie *cookie)
return;
XIRawEvent *raw = cookie->data;
app_handleKeyRelease(raw->detail - x11.minKeycode,
getCharcode(raw->detail));
app_handleKeyRelease(raw->detail - x11.minKeycode);
return;
}
@@ -2012,6 +2014,7 @@ struct LG_DisplayServerOps LGDS_X11 =
.ungrabPointer = x11UngrabPointer,
.capturePointer = x11CapturePointer,
.uncapturePointer = x11UncapturePointer,
.getCharCode = x11GetCharCode,
.grabKeyboard = x11GrabKeyboard,
.ungrabKeyboard = x11UngrabKeyboard,
.warpPointer = x11WarpPointer,

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -71,6 +71,7 @@ struct X11DSState
_Atomic(uint64_t) lastWMEvent;
bool invalidateAll;
bool doFullscreenOnExpose;
int xpresentOp;
bool jitRender;

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -59,8 +59,8 @@ void app_handleButtonPress(int button);
void app_handleButtonRelease(int button);
void app_handleWheelMotion(double motion);
void app_handleKeyboardTyped(const char * typed);
void app_handleKeyPress(int scancode, int charcode);
void app_handleKeyRelease(int scancode, int charcode);
void app_handleKeyPress(int scancode);
void app_handleKeyRelease(int scancode);
void app_handleKeyboardModifiers(bool ctrl, bool shift, bool alt, bool super);
void app_handleKeyboardLEDs(bool numLock, bool capsLock, bool scrollLock);
void app_handleEnterEvent(bool entered);

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

51
client/include/evdev.h Normal file
View File

@@ -0,0 +1,51 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., 59
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdbool.h>
/**
* initialize configuration options
*/
void evdev_earlyInit(void);
/**
* start the evdev layer
*/
bool evdev_start(void);
/**
* stop the evdev layer
*/
void evdev_stop(void);
/**
* grab the keyboard for exclusive access
*/
void evdev_grabKeyboard(void);
/**
* ungrab the keyboard
*/
void evdev_ungrabKeyboard(void);
/**
* returns true if input should only be processed by evdev
*/
bool evdev_isExclusive(void);

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -84,6 +84,7 @@ LG_DSPointer;
typedef struct LG_DSInitParams
{
const char * title;
const char * appId;
int x, y, w, h;
bool center;
bool fullscreen;
@@ -182,6 +183,9 @@ struct LG_DisplayServerOps
void (*capturePointer)(void);
void (*uncapturePointer)(void);
/* get the character code for the provided scancode */
int (*getCharCode)(int sc);
/* exiting = true if the warp is to leave the window */
void (*warpPointer)(int x, int y, bool exiting);
@@ -252,6 +256,7 @@ struct LG_DisplayServerOps
DEBUG_ASSERT((x)->ungrabPointer ); \
DEBUG_ASSERT((x)->capturePointer ); \
DEBUG_ASSERT((x)->uncapturePointer ); \
DEBUG_ASSERT((x)->getCharCode ); \
DEBUG_ASSERT((x)->warpPointer ); \
DEBUG_ASSERT((x)->realignPointer ); \
DEBUG_ASSERT((x)->isValidPointerPos ); \

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)
project(renderers LANGUAGES C)
set(RENDERER_H "${CMAKE_BINARY_DIR}/include/dynamic/renderers.h")

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)
project(renderer_EGL LANGUAGES C CXX)
find_package(PkgConfig)

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -346,11 +346,6 @@ bool egl_desktopSetup(EGL_Desktop * desktop, const LG_RendererFormat format)
case FRAME_TYPE_RGB_24:
pixFmt = EGL_PF_RGB_24;
// the data width is correct per the format, but we are going to use a
// 32-bit texture to load the data, so we need to alter the width for the
// different bpp
desktop->format.dataWidth =
desktop->format.pitch / 4;
break;
default:
@@ -382,9 +377,9 @@ bool egl_desktopSetup(EGL_Desktop * desktop, const LG_RendererFormat format)
bool egl_desktopUpdate(EGL_Desktop * desktop, const FrameBuffer * frame, int dmaFd,
const FrameDamageRect * damageRects, int damageRectsCount)
{
if (desktop->useDMA && dmaFd >= 0)
if (likely(desktop->useDMA && dmaFd >= 0))
{
if (egl_textureUpdateFromDMA(desktop->texture, frame, dmaFd))
if (likely(egl_textureUpdateFromDMA(desktop->texture, frame, dmaFd)))
{
atomic_store(&desktop->processFrame, true);
return true;
@@ -420,8 +415,8 @@ bool egl_desktopUpdate(EGL_Desktop * desktop, const FrameBuffer * frame, int dma
return false;
}
if (egl_textureUpdateFromFrame(desktop->texture, frame,
damageRects, damageRectsCount))
if (likely(egl_textureUpdateFromFrame(desktop->texture, frame,
damageRects, damageRectsCount)))
{
atomic_store(&desktop->processFrame, true);
return true;
@@ -442,25 +437,28 @@ bool egl_desktopRender(EGL_Desktop * desktop, unsigned int outputWidth,
{
EGL_Texture * tex;
int width, height;
bool dma;
if (desktop->useSpice)
if (unlikely(desktop->useSpice))
{
tex = desktop->spiceTexture;
width = desktop->spiceWidth;
height = desktop->spiceHeight;
dma = false;
}
else
{
tex = desktop->texture;
width = desktop->width;
height = desktop->height;
dma = desktop->useDMA;
}
if (outputWidth == 0 && outputHeight == 0)
if (unlikely(outputWidth == 0 || outputHeight == 0))
DEBUG_FATAL("outputWidth || outputHeight == 0");
enum EGL_TexStatus status;
if ((status = egl_textureProcess(tex)) != EGL_TEX_STATUS_OK)
if (unlikely((status = egl_textureProcess(tex)) != EGL_TEX_STATUS_OK))
{
if (status != EGL_TEX_STATUS_NOTREADY)
DEBUG_ERROR("Failed to process the desktop texture");
@@ -475,12 +473,19 @@ bool egl_desktopRender(EGL_Desktop * desktop, unsigned int outputWidth,
if (atomic_exchange(&desktop->processFrame, false) ||
egl_postProcessConfigModified(desktop->pp))
egl_postProcessRun(desktop->pp, tex, desktop->mesh,
width, height, outputWidth, outputHeight, desktop->useDMA);
width, height, outputWidth, outputHeight, dma);
unsigned int finalSizeX, finalSizeY;
EGL_Texture * texture = egl_postProcessGetOutput(desktop->pp,
&finalSizeX, &finalSizeY);
if (unlikely(!texture))
{
texture = tex;
finalSizeX = width;
finalSizeY = height;
}
glBindFramebuffer(GL_FRAMEBUFFER, 0);
egl_resetViewport(desktop->egl);
@@ -515,7 +520,7 @@ bool egl_desktopRender(EGL_Desktop * desktop, unsigned int outputWidth,
&desktop->dmaShader : &desktop->shader;
const float mapHDRGain =
desktop->maxCLL / desktop->peakLuminance;
(float)desktop->maxCLL / desktop->peakLuminance;
EGL_Uniform uniforms[] =
{
@@ -611,9 +616,9 @@ void egl_desktopSpiceDrawFill(EGL_Desktop * desktop, int x, int y, int width,
for(int x = 0; x < width; ++x)
line[x] = color;
for(; y < height; ++y)
for(int dy = 0; dy < height; ++dy)
egl_textureUpdateRect(desktop->spiceTexture,
x, y, width, 1, width, sizeof(line), (uint8_t *)line, false);
x, y + dy, width, 1, width, sizeof(line), (uint8_t *)line, false);
atomic_store(&desktop->processFrame, true);
}
@@ -629,4 +634,5 @@ void egl_desktopSpiceDrawBitmap(EGL_Desktop * desktop, int x, int y, int width,
void egl_desktopSpiceShow(EGL_Desktop * desktop, bool show)
{
desktop->useSpice = show;
atomic_store(&desktop->processFrame, true);
}

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -296,7 +296,7 @@ bool egl_screenToDesktop(struct FrameDamageRect * output, const double matrix[6]
void egl_desktopRectsRender(EGL_DesktopRects * rects)
{
if (!rects->count)
if (unlikely(!rects->count))
return;
glBindVertexArray(rects->vao);

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -20,6 +20,7 @@
#include "interface/renderer.h"
#include "common/util.h"
#include "common/debug.h"
#include "common/KVMFR.h"
#include "common/option.h"
@@ -580,7 +581,7 @@ static bool egl_onFrameFormat(LG_Renderer * renderer, const LG_RendererFormat fo
this->formatValid = true;
/* this event runs in a second thread so we need to init it here */
if (!this->frameContext)
if (unlikely(!this->frameContext))
{
static EGLint attrs[] = {
EGL_CONTEXT_CLIENT_VERSION, 2,
@@ -600,7 +601,7 @@ static bool egl_onFrameFormat(LG_Renderer * renderer, const LG_RendererFormat fo
}
}
if (this->scalePointer)
if (likely(this->scalePointer))
{
float scale = max(1.0f, (float)format.screenWidth / this->width);
egl_cursorSetScale(this->cursor, scale);
@@ -623,7 +624,8 @@ static bool egl_onFrame(LG_Renderer * renderer, const FrameBuffer * frame, int d
struct Inst * this = UPCAST(struct Inst, renderer);
uint64_t start = nanotime();
if (!egl_desktopUpdate(this->desktop, frame, dmaFd, damageRects, damageRectsCount))
if (unlikely(!egl_desktopUpdate(
this->desktop, frame, dmaFd, damageRects, damageRectsCount)))
{
DEBUG_INFO("Failed to to update the desktop");
return false;
@@ -632,12 +634,17 @@ static bool egl_onFrame(LG_Renderer * renderer, const FrameBuffer * frame, int d
INTERLOCKED_SECTION(this->desktopDamageLock, {
struct DesktopDamage * damage = this->desktopDamage + this->desktopDamageIdx;
if (damage->count == -1 || damageRectsCount == 0 ||
damage->count + damageRectsCount >= KVMFR_MAX_DAMAGE_RECTS)
if (unlikely(
damage->count == -1 ||
damageRectsCount == 0 ||
damage->count + damageRectsCount >= KVMFR_MAX_DAMAGE_RECTS))
{
damage->count = -1;
}
else
{
memcpy(damage->rects + damage->count, damageRects, damageRectsCount * sizeof(FrameDamageRect));
memcpy(damage->rects + damage->count, damageRects,
damageRectsCount * sizeof(FrameDamageRect));
damage->count += damageRectsCount;
}
});
@@ -1056,14 +1063,14 @@ static bool egl_render(LG_Renderer * renderer, LG_RendererRotate rotate,
accumulated->count = 0;
INTERLOCKED_SECTION(this->desktopDamageLock, {
if (!renderAll)
if (likely(!renderAll))
{
for (int i = 0; i < bufferAge; ++i)
{
struct DesktopDamage * damage = this->desktopDamage +
IDX_AGO(this->desktopDamageIdx, i, DESKTOP_DAMAGE_COUNT);
if (damage->count < 0)
if (unlikely(damage->count < 0))
{
renderAll = true;
break;
@@ -1087,7 +1094,7 @@ static bool egl_render(LG_Renderer * renderer, LG_RendererRotate rotate,
this->desktopDamage[this->desktopDamageIdx].count = 0;
});
if (!renderAll)
if (likely(!renderAll))
{
double matrix[6];
egl_screenToDesktopMatrix(matrix,
@@ -1101,7 +1108,7 @@ static bool egl_render(LG_Renderer * renderer, LG_RendererRotate rotate,
int count = this->overlayHistoryCount[idx];
struct Rect * damage = this->overlayHistory[idx];
if (count < 0)
if (unlikely(count < 0))
{
renderAll = true;
break;
@@ -1114,11 +1121,12 @@ static bool egl_render(LG_Renderer * renderer, LG_RendererRotate rotate,
);
}
accumulated->count = rectsMergeOverlapping(accumulated->rects, accumulated->count);
accumulated->count = rectsMergeOverlapping(accumulated->rects,
accumulated->count);
}
++this->overlayHistoryIdx;
if (this->destRect.w > 0 && this->destRect.h > 0)
if (likely(this->destRect.w > 0 && this->destRect.h > 0))
{
if (egl_desktopRender(this->desktop,
this->destRect.w, this->destRect.h,
@@ -1136,41 +1144,39 @@ static bool egl_render(LG_Renderer * renderer, LG_RendererRotate rotate,
renderLetterBox(this);
hasOverlay |= egl_damageRender(this->damage, rotate, newFrame ? desktopDamage : NULL);
hasOverlay |= invalidateWindow;
hasOverlay |=
egl_damageRender(this->damage, rotate, newFrame ? desktopDamage : NULL) |
invalidateWindow;
struct Rect damage[KVMFR_MAX_DAMAGE_RECTS + MAX_OVERLAY_RECTS + 2];
int damageIdx = app_renderOverlay(damage, MAX_OVERLAY_RECTS);
switch (damageIdx)
if (unlikely(damageIdx != 0))
{
case 0: // no overlay
break;
case -1: // full damage
if (damageIdx == -1)
hasOverlay = true;
// fallthrough
default:
ImGui_ImplOpenGL3_NewFrame();
ImGui_ImplOpenGL3_RenderDrawData(igGetDrawData());
for (int i = 0; i < damageIdx; ++i)
damage[i].y = this->height - damage[i].y - damage[i].h;
ImGui_ImplOpenGL3_NewFrame();
ImGui_ImplOpenGL3_RenderDrawData(igGetDrawData());
for (int i = 0; i < damageIdx; ++i)
damage[i].y = this->height - damage[i].y - damage[i].h;
}
if (damageIdx >= 0 && cursorState.visible)
if (likely(damageIdx >= 0 && cursorState.visible))
damage[damageIdx++] = cursorState.rect;
int overlayHistoryIdx = this->overlayHistoryIdx % DESKTOP_DAMAGE_COUNT;
if (hasOverlay)
if (unlikely(hasOverlay))
this->overlayHistoryCount[overlayHistoryIdx] = -1;
else
{
if (damageIdx > 0)
memcpy(this->overlayHistory[overlayHistoryIdx], damage, damageIdx * sizeof(struct Rect));
if (unlikely(damageIdx > 0))
memcpy(this->overlayHistory[overlayHistoryIdx],
damage, damageIdx * sizeof(struct Rect));
this->overlayHistoryCount[overlayHistoryIdx] = damageIdx;
}
if (!hasOverlay && !this->hadOverlay)
if (unlikely(!hasOverlay && !this->hadOverlay))
{
if (this->cursorLast.visible)
damage[damageIdx++] = this->cursorLast.rect;
@@ -1197,7 +1203,9 @@ static bool egl_render(LG_Renderer * renderer, LG_RendererRotate rotate,
this->cursorLast = cursorState;
preSwap(udata);
app_eglSwapBuffers(this->display, this->surface, damage, this->noSwapDamage ? 0 : damageIdx);
app_eglSwapBuffers(this->display, this->surface, damage,
this->noSwapDamage ? 0 : damageIdx);
return true;
}

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -39,7 +39,8 @@ typedef enum EGL_PixelFormat
EGL_PF_RGBA10,
EGL_PF_RGBA16F,
EGL_PF_BGR_32,
EGL_PF_RGB_24
EGL_PF_RGB_24,
EGL_PF_RGB_24_32
}
EGL_PixelFormat;

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -80,9 +80,9 @@ typedef struct EGL_FilterOps
void (*setOutputResHint)(EGL_Filter * filter,
unsigned int x, unsigned int y);
/* returns the output resolution of the filter */
/* returns the output resolution and pixel format of the filter */
void (*getOutputRes)(EGL_Filter * filter,
unsigned int *x, unsigned int *y);
unsigned int *x, unsigned int *y, enum EGL_PixelFormat *pixFmt);
/* prepare the shader for use
* A filter can return false to bypass it */
@@ -162,9 +162,9 @@ static inline void egl_filterSetOutputResHint(EGL_Filter * filter,
}
static inline void egl_filterGetOutputRes(EGL_Filter * filter,
unsigned int *x, unsigned int *y)
unsigned int *x, unsigned int *y, enum EGL_PixelFormat *pixFmt)
{
return filter->ops.getOutputRes(filter, x, y);
return filter->ops.getOutputRes(filter, x, y, pixFmt);
}
static inline bool egl_filterPrepare(EGL_Filter * filter)

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -112,7 +112,7 @@ static bool egl_filter24bitSetup(EGL_Filter * filter,
{
EGL_Filter24bit * this = UPCAST(EGL_Filter24bit, filter);
if (pixFmt != EGL_PF_BGR_32 && pixFmt != EGL_PF_RGB_24)
if (pixFmt != EGL_PF_BGR_32 && pixFmt != EGL_PF_RGB_24_32)
return false;
if (this->useDMA != useDMA || this->format != pixFmt)
@@ -148,7 +148,7 @@ static bool egl_filter24bitSetup(EGL_Filter * filter,
this->desktopHeight == desktopHeight)
return true;
if (!egl_framebufferSetup(this->fb, pixFmt, desktopWidth, desktopHeight))
if (!egl_framebufferSetup(this->fb, EGL_PF_BGRA, desktopWidth, desktopHeight))
return false;
this->format = pixFmt;
@@ -162,11 +162,12 @@ static bool egl_filter24bitSetup(EGL_Filter * filter,
}
static void egl_filter24bitGetOutputRes(EGL_Filter * filter,
unsigned int *width, unsigned int *height)
unsigned int *width, unsigned int *height, enum EGL_PixelFormat *pixFmt)
{
EGL_Filter24bit * this = UPCAST(EGL_Filter24bit, filter);
*width = this->desktopWidth;
*height = this->desktopHeight;
*pixFmt = EGL_PF_BGRA;
}
static bool egl_filter24bitPrepare(EGL_Filter * filter)

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -370,11 +370,12 @@ static bool egl_filterDownscaleSetup(EGL_Filter * filter,
}
static void egl_filterDownscaleGetOutputRes(EGL_Filter * filter,
unsigned int *width, unsigned int *height)
unsigned int *width, unsigned int *height, enum EGL_PixelFormat *pixFmt)
{
EGL_FilterDownscale * this = UPCAST(EGL_FilterDownscale, filter);
*width = this->width;
*height = this->height;
*pixFmt = this->pixFmt;
}
static bool egl_filterDownscalePrepare(EGL_Filter * filter)

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -254,11 +254,12 @@ static bool egl_filterFFXCASSetup(EGL_Filter * filter,
}
static void egl_filterFFXCASGetOutputRes(EGL_Filter * filter,
unsigned int *width, unsigned int *height)
unsigned int *width, unsigned int *height, enum EGL_PixelFormat *pixFmt)
{
EGL_FilterFFXCAS * this = UPCAST(EGL_FilterFFXCAS, filter);
*width = this->width;
*height = this->height;
*pixFmt = this->pixFmt;
}
static bool egl_filterFFXCASPrepare(EGL_Filter * filter)

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -383,11 +383,12 @@ static bool egl_filterFFXFSR1Setup(EGL_Filter * filter,
}
static void egl_filterFFXFSR1GetOutputRes(EGL_Filter * filter,
unsigned int *width, unsigned int *height)
unsigned int *width, unsigned int *height, enum EGL_PixelFormat *pixFmt)
{
EGL_FilterFFXFSR1 * this = UPCAST(EGL_FilterFFXFSR1, filter);
*width = this->width;
*height = this->height;
*pixFmt = this->pixFmt;
}
static bool egl_filterFFXFSR1Prepare(EGL_Filter * filter)

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -43,6 +43,7 @@ bool egl_framebufferInit(EGL_Framebuffer ** fb)
if (!egl_textureInit(&this->tex, NULL, EGL_TEXTYPE_BUFFER))
{
DEBUG_ERROR("Failed to initialize the texture");
free(this);
return false;
}
@@ -71,7 +72,7 @@ bool egl_framebufferSetup(EGL_Framebuffer * this, enum EGL_PixelFormat pixFmt,
}
GLuint tex;
egl_textureGet(this->tex, &tex, NULL, NULL);
egl_textureGet(this->tex, &tex, NULL, NULL, NULL);
glBindTexture(GL_TEXTURE_2D, tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -642,7 +642,9 @@ bool egl_postProcessRun(EGL_PostProcess * this, EGL_Texture * tex,
//TODO: clean this up
GLuint _unused;
if (egl_textureGet(tex, &_unused, &sizeX, &sizeY) != EGL_TEX_STATUS_OK)
EGL_PixelFormat pixFmt;
if (egl_textureGet(tex, &_unused,
&sizeX, &sizeY, &pixFmt) != EGL_TEX_STATUS_OK)
return false;
if (atomic_exchange(&this->modified, false))
@@ -677,13 +679,13 @@ bool egl_postProcessRun(EGL_PostProcess * this, EGL_Texture * tex,
{
egl_filterSetOutputResHint(filter, targetX, targetY);
if (!egl_filterSetup(filter, tex->format.pixFmt, sizeX, sizeY,
if (!egl_filterSetup(filter, pixFmt, sizeX, sizeY,
desktopWidth, desktopHeight, useDMA) ||
!egl_filterPrepare(filter))
continue;
texture = egl_filterRun(filter, &filterRects, texture);
egl_filterGetOutputRes(filter, &sizeX, &sizeY);
egl_filterGetOutputRes(filter, &sizeX, &sizeY, &pixFmt);
if (lastFilter)
egl_filterRelease(lastFilter);

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -20,6 +20,7 @@
#include "shader.h"
#include "common/debug.h"
#include "common/stringutils.h"
#include "util.h"
#include <stdlib.h>
@@ -219,18 +220,22 @@ bool egl_shaderCompile(EGL_Shader * this, const char * vertex_code,
if (useDMA)
{
const char * search = "sampler2D";
const char * replace = "samplerExternalOES";
const char search[] = "sampler2D";
const char replace[] = "samplerExternalOES";
const char * src = fragment_code;
const char * offset = NULL;
int instances = 0;
while((src = strstr(src, search)))
while((offset = memsearch(
fragment_code, fragment_size,
search , sizeof(search)-1,
offset)))
{
++instances;
src += strlen(search);
offset += sizeof(search)-1;
}
const int diff = (strlen(replace) - strlen(search)) * instances;
const int diff = (sizeof(replace) - sizeof(search)) * instances;
const int newLen = fragment_size + diff;
newCode = malloc(newLen + 1);
if (!newCode)
@@ -239,7 +244,7 @@ bool egl_shaderCompile(EGL_Shader * this, const char * vertex_code,
goto exit;
}
src = fragment_code;
const char * src = fragment_code;
char * dst = newCode;
for(int i = 0; i < instances; ++i)
{
@@ -248,10 +253,10 @@ bool egl_shaderCompile(EGL_Shader * this, const char * vertex_code,
memcpy(dst, src, offset);
dst += offset;
src = pos + strlen(search);
src = pos + sizeof(search)-1;
memcpy(dst, replace, strlen(replace));
dst += strlen(replace);
memcpy(dst, replace, sizeof(replace)-1);
dst += sizeof(replace)-1;
}
const int final = fragment_size - (src - fragment_code);
@@ -303,7 +308,9 @@ bool egl_shaderCompile(EGL_Shader * this, const char * vertex_code,
if (!newLine)
{
insertPos = i - 1;
insertPos = i;
if (insertPos > 0)
--insertPos;
break;
}
}

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2023 The Looking Glass Authors
* Copyright © 2017-2025 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -2,6 +2,7 @@
#extension GL_OES_EGL_image_external_essl3 : enable
precision highp float;
precision highp int;
in vec2 fragCoord;
out vec4 fragColor;

View File

@@ -1,5 +1,6 @@
#version 300 es
precision highp float;
precision highp int;
in vec2 uv;
out vec4 color;

View File

@@ -1,5 +1,6 @@
#version 300 es
precision highp float;
precision highp int;
#include "color_blind.h"

View File

@@ -1,5 +1,6 @@
#version 300 es
precision highp float;
precision highp int;
out vec4 color;

View File

@@ -2,6 +2,7 @@
#extension GL_OES_EGL_image_external_essl3 : enable
precision highp float;
precision highp int;
#define EGL_SCALE_AUTO 0
#define EGL_SCALE_NEAREST 1

View File

@@ -2,6 +2,7 @@
#extension GL_OES_EGL_image_external_essl3 : enable
precision highp float;
precision highp int;
in vec2 fragCoord;
out vec4 fragColor;

View File

@@ -2,6 +2,7 @@
#extension GL_OES_EGL_image_external_essl3 : enable
precision highp float;
precision highp int;
#define PI 3.141592653589793

Some files were not shown because too many files have changed in this diff Show More