Compare commits

..

76 Commits

Author SHA1 Message Date
Geoffrey McRae
2adca4bc48 [idd] hdr: dont advertise non hdr formats as hdr 2026-07-16 05:26:06 +10:00
Geoffrey McRae
b241f76908 [client] wayland: fix broken initialization 2026-07-16 04:30:36 +10:00
Geoffrey McRae
e1375440e6 [client] wayland: fix color management errors 2026-07-16 04:10:16 +10:00
Geoffrey McRae
182970d431 [idd] fix the HDR16 to HDR10 post processor
`linear` is a HLSL keyword
2026-07-16 03:53:12 +10:00
Geoffrey McRae
aa0dc44a63 [idd] hdr: fix incorrect struct usage 2026-07-16 03:47:04 +10:00
Geoffrey McRae
e18b34a194 [gl-check] exclude local static functions which match 2026-07-16 03:45:54 +10:00
Geoffrey McRae
117b76d662 [idd] cleanup IDD version guards for HDR support 2026-07-16 03:45:46 +10:00
Geoffrey McRae
8734af2674 [idd] whitespace fixes 2026-07-16 00:30:28 +10:00
Geoffrey McRae
e2f6de77e7 [client] wayland: implement HDR support 2026-07-16 00:30:28 +10:00
Geoffrey McRae
92d0383fd7 [obs] implement HDR support 2026-07-16 00:30:28 +10:00
Geoffrey McRae
1b7a815cee [idd] add support to return HDR metadata to clients 2026-07-16 00:30:23 +10:00
Geoffrey McRae
11b3ac00a8 [client/obs] update LGMP to detect version missmatch since struct change
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
2026-07-15 17:25:52 +10:00
Quantum
bc96319b94 [idd] driver: report Windows 11 OS name correctly
Also refactored the versioning code to be more modular.

The old registry code was turned into a fallback and simplified, since
C++11 and newer guarantees the byte past the end of the std::string is
valid for null-terminator writes.
2026-07-15 17:22:58 +10:00
Quantum
c9845d3453 [client] wayland: improve fractional scale protocol compatibility
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
There is no reason to call a bunch of stuff before the xdg_surface is
configured, so let's not call them and cause early painting to happen
should the compositor decide to send the `preferred_scale` message early.
2026-07-04 14:00:07 +10:00
Quantum
1f3051e81a [host] d12: handle IDXGIAdapter::EnumOutputs errors
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
Before, the code treated any errors other than DXGI_ERROR_NOT_FOUND as if
they were successes, which is incorrect.
2026-06-17 21:43:19 +10:00
Quantum
4bb2c58fb6 [client] wayland: delete useless enum EGLSwapWithDamageState
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
2026-06-09 19:31:45 +10:00
Quantum
e203bca480 [client] wayland: set content type to game
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
2026-06-07 07:04:12 +10:00
Quantum
8d7b45e240 [client] wayland: generate content-type-v1 client protocol 2026-06-07 07:04:12 +10:00
Quantum
66d8a9691e [idd] helper: update notification icon to reflect GPU availability 2026-06-07 07:04:00 +10:00
Quantum
89ddab9d57 [idd] helper: use Resources.h for icon IDs 2026-06-07 07:04:00 +10:00
Quantum
ffffff0740 [resources] icon: add Looking Glass icon with GPU and no GPU superimposed
These will be used as indicators for the IDD helper notification icon to
indicate whether GPU acceleration is available.
2026-06-07 07:04:00 +10:00
Quantum
c8edf1eaf3 [client] wayland: use round half away from zero behaviour
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
In fractional-scale-v1, the scaling is defined as follows:

> For toplevel surfaces, the size is rounded halfway away from zero.

Previously, it is undefined. This commit makes waylandScaleMulInt follow
the round half away from zero behaviour.
2026-06-06 02:32:23 +10:00
Quantum
938a2a6c22 [client] wayland: get scale from wp-fractional-scale-v1 if possible 2026-06-06 02:32:23 +10:00
Quantum
e406b0fee8 [client] wayland: generate fractional-scale-v1 client protocol 2026-06-06 02:32:23 +10:00
Quantum
79784fa44d [repos] wayland-protocols: bump to latest version 2026-06-06 02:32:23 +10:00
Quantum
a164c02f9a [client] core: resize guest to actual surface size
This ensures that the guest renders with the actual screen size when the
client surface is scaled when using automatic scaling.
2026-06-06 02:31:44 +10:00
Quantum
3aa6492760 [idd] driver: implement reading in pipe server
Following the example of CPipeClient in the helper, this switches to using
overlapped I/O for easy interruption and cancellation that doesn't quite
work with CancelSynchronousIO.
2026-06-06 02:30:43 +10:00
Quantum
0664e510a2 [idd] helper: send message over pipe when settings changed 2026-06-06 02:30:43 +10:00
Quantum
e4e211f07a [doc] build: delete wayland-protocols mentions
We now include it as a submodule, so it's pointless to tell people to
install it separately as a dependency.
2026-06-06 02:29:52 +10:00
Quantum
bff890f635 [idd] helper: use per-monitor DPI awareness v2
This avoids weird issues when scaling menus and non-client areas
dynamically.
2026-06-06 02:29:33 +10:00
Quantum
2317801411 [idd] helper: update icon tip to reflect GPU state 2026-06-06 02:29:14 +10:00
Quantum
140de3199b [idd] helper: defer no GPU notification when needed
No GPU notifications are not possible before the notification icon is
created. Since the helper could start before explorer.exe (and often does
on reboot), the notification would fail.

This commit adds logic to refer the notification and we send it immediately
when successfully creating the notification icon.
2026-06-06 02:29:14 +10:00
Quantum
c8f4898815 [idd] helper: allow changing preferred mode 2026-06-06 02:28:26 +10:00
Geoffrey McRae
462f638c12 [idd] project: cleanup vcxproj.filters mess
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
2026-06-04 01:45:35 +10:00
Geoffrey McRae
37bb89f490 [idd] ipc/helper: notify the helper if a software renderer is in use 2026-06-04 01:45:35 +10:00
Geoffrey McRae
b3701992c1 Merge pull request #1277 from quantum5/idd-no-gpu-warn
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
[idd] helper: implement warning when there is no GPU
2026-06-03 21:39:00 +10:00
Geoffrey McRae
7b2c60b267 Merge branch 'master' into idd-no-gpu-warn 2026-06-03 21:35:08 +10:00
Quantum
708ed2cbae [idd] helper: add mode list reset button 2026-06-03 21:32:35 +10:00
Quantum
415a946e56 [idd] helper: avoid potential empty option deference 2026-06-03 21:32:35 +10:00
Geoffrey McRae
803aea0d21 [idd] ipc: implement reporting of GPU software status 2026-06-03 21:31:08 +10:00
Quantum
cb70643fa4 [idd] helper: load default mode list with default refresh rate
After 882d531792, the existing code in the
helper reads past the end of the array for refresh rate, which is broken.

This PR also refactors the default modes into a getDefaultModes method so
that it can be used for a reset feature later.
2026-06-03 17:03:50 +10:00
Quantum
e74f58afb4 [idd] helper: allow no GPU warning to be configured 2026-06-03 03:02:07 -04:00
Quantum
29d02ddbb9 [idd] helper: add checkbox widget 2026-06-03 03:01:47 -04:00
Quantum
fec805fbe2 [idd] helper: show notification when no GPU is detected 2026-06-03 03:01:47 -04:00
Quantum
ebeb9d028e [idd] helper/registry: load and store no GPU preference 2026-06-03 03:01:47 -04:00
Quantum
1a137f3c08 [idd] helper: detect if system has GPU 2026-06-03 03:01:47 -04:00
Quantum
3ef8344e9f [idd] helper: set config window minimum size
This improves aesthetics and prevents widgets from getting clipped when
the window is too small.
2026-06-03 17:00:31 +10:00
Quantum
976be95177 [idd] driver: add BOM to CEdid.* for non-English systems
It wouldn't compile otherwise.
2026-06-03 16:59:58 +10:00
Geoffrey McRae
1b7c00dc82 [idd] driver: implement postprocess filters
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
2026-06-03 08:59:48 +10:00
Geoffrey McRae
a59040f0be [idd] driver: add/expose CSettings read string/bool methods 2026-06-03 08:59:48 +10:00
Geoffrey McRae
929428c273 [idd] driver: implement dirty rect tracking 2026-06-03 08:59:48 +10:00
Geoffrey McRae
bd88a64a98 [idd] driver: cleanup magic numbers in CEdid 2026-06-03 08:59:48 +10:00
Geoffrey McRae
882d531792 [idd] driver: use the default resolution for default modes 2026-06-03 08:59:48 +10:00
Geoffrey McRae
3211bc1d93 [idd] driver: improve resolution switching performance 2026-06-03 08:59:48 +10:00
Geoffrey McRae
a10efc9e23 [idd] hdr: use iddcx 1.10 if possible and expose HDR support 2026-06-03 08:59:48 +10:00
Geoffrey McRae
dbb80ebd66 [client]: core: add timeout on pointerQueue wait loop
If the host has had a fault this loop can become infinite,
soft-locking the application. This adds a 200ms timeout to prevent this.
2026-06-03 08:59:48 +10:00
Geoffrey McRae
65005c0dc0 [idd] all: add default refresh rate setting support 2026-06-03 08:59:48 +10:00
Geoffrey McRae
c2add993ac [idd] CEdid: add new helper class to build the EDID block 2026-06-03 08:59:48 +10:00
Geoffrey McRae
83bebf4519 [idd] CSettings: fix registry string value handling
Rename the invalid default parameter and make registry string reads
more robust.

Validate the returned value type and byte count after querying the
value data, reject malformed UTF-16 sizes, and explicitly terminate
the string based on the number of bytes actually returned.

Sanity check the parsed mode values
2026-06-03 08:59:48 +10:00
Geoffrey McRae
19f75dc045 [idd] driver: CSettings minor refactor 2026-06-03 08:59:48 +10:00
Geoffrey McRae
fc6a728bb7 [client] message: fix window resize event message handling
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
2026-05-31 22:16:02 +10:00
Geoffrey McRae
69f44a003d [all] refresh copyright
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
2026-05-31 15:13:57 +10:00
Geoffrey McRae
0743d49abe [all] update refresh-copyright to handle UTF BOM markers 2026-05-31 15:13:32 +10:00
Geoffrey McRae
e9b7bdfea1 Revert "[all] refresh copyright"
Corrupted IDD sources due to lack of UTF-8 with BOM support in the
script.
2026-05-31 15:10:44 +10:00
Geoffrey McRae
98602fb95e [all] refresh copyright 2026-05-31 15:03:37 +10:00
Geoffrey McRae
3c8f4eec90 [doc] spelling: chosen != choosen 2026-05-31 13:49:52 +10:00
d.vorst
8318046a29 doc: clarify terminology of 'host'
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
2026-05-31 13:26:35 +10:00
Geoffrey McRae
01b8724cfe [client] wayland: improve fractional scaling
avoids the 24.8 quantisation without introducing floating-point
equality/rounding behaviour throughout the Wayland state.

Closes #1257
2026-05-31 13:15:42 +10:00
Nikko Renn
dba2d23eb2 [repo] update PureSpice submodule 2026-05-31 12:48:02 +10:00
Janrupf
7f31ecf5e5 [all] add Janrupf to 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 / 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
2026-01-17 12:43:10 +11:00
Janrupf
b181859c1b [client] wayland: fix discrete mouse scroll speed 2026-01-17 12:43:10 +11:00
Quantum
53bfb6547f [idd] config: hook up default refresh configuration
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-28 11:51:28 +11:00
Quantum
06c490ca72 [idd] helper/CEditWidget: support enable/disabling edit controls 2025-11-28 11:51:28 +11:00
Quantum
c8de7b27fd [idd] helper: implement registry storage for default refresh 2025-11-28 11:51:28 +11:00
Jérôme Poulin
0983e50f4d [doc] add GNOME Wayland keyboard shortcuts troubleshooting
Document the GNOME permission system for keyboard shortcuts inhibitor
protocol. GNOME stores permissions in flatpak's database even for
non-flatpak applications, which can silently block capture mode.
2025-11-28 10:57:48 +11:00
Quantum
3efe47ffb2 [idd] helper: fallback to default mode list
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
2025-11-10 17:12:40 +11:00
339 changed files with 5726 additions and 755 deletions

View File

@@ -74,3 +74,4 @@ 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)
Jannis Lübke <business.janrupf@gmail.com> (Janrupf)

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -13,6 +13,7 @@ find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner)
add_library(displayserver_Wayland STATIC
activation.c
clipboard.c
colormgmt.c
cursor.c
gl.c
idle.c

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -0,0 +1,110 @@
/**
* Looking Glass
* Copyright (C) 2017-2026 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 "wayland.h"
#include <stdbool.h>
#include <wayland-client.h>
#include "common/debug.h"
static void cmIntent(void * data, struct wp_color_manager_v1 * cm, uint32_t intent)
{
if (intent == WP_COLOR_MANAGER_V1_RENDER_INTENT_PERCEPTUAL)
wlWm.cmHasPerceptualIntent = true;
}
static void cmFeature(void * data, struct wp_color_manager_v1 * cm, uint32_t feature)
{
switch (feature)
{
case WP_COLOR_MANAGER_V1_FEATURE_PARAMETRIC:
wlWm.cmHasParametric = true;
break;
case WP_COLOR_MANAGER_V1_FEATURE_SET_LUMINANCES:
wlWm.cmHasLuminances = true;
break;
case WP_COLOR_MANAGER_V1_FEATURE_SET_MASTERING_DISPLAY_PRIMARIES:
wlWm.cmHasMasteringPrimaries = true;
break;
default:
break;
}
}
static void cmTFNamed(void * data, struct wp_color_manager_v1 * cm, uint32_t tf)
{
if (tf == WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_ST2084_PQ)
wlWm.cmHasTFSt2084PQ = true;
else if (tf == WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_EXT_LINEAR)
wlWm.cmHasTFExtLinear = true;
}
static void cmPrimariesNamed(void * data, struct wp_color_manager_v1 * cm,
uint32_t primaries)
{
if (primaries == WP_COLOR_MANAGER_V1_PRIMARIES_BT2020)
wlWm.cmHasPrimariesBT2020 = true;
else if (primaries == WP_COLOR_MANAGER_V1_PRIMARIES_SRGB)
wlWm.cmHasPrimariesSRGB = true;
}
static void cmDone(void * data, struct wp_color_manager_v1 * cm)
{
wlWm.cmFeaturesDone = true;
wlWm.cmCanDoHDR = wlWm.cmHasParametric &&
((wlWm.cmHasTFSt2084PQ && wlWm.cmHasPrimariesBT2020) ||
(wlWm.cmHasTFExtLinear && wlWm.cmHasPrimariesSRGB));
DEBUG_INFO("Color management features: parametric:%d luminances:%d "
"mastering_primaries:%d st2084_pq:%d ext_linear:%d bt2020:%d srgb:%d "
"can_do_hdr:%d",
wlWm.cmHasParametric, wlWm.cmHasLuminances,
wlWm.cmHasMasteringPrimaries,
wlWm.cmHasTFSt2084PQ, wlWm.cmHasTFExtLinear,
wlWm.cmHasPrimariesBT2020, wlWm.cmHasPrimariesSRGB,
wlWm.cmCanDoHDR);
}
static const struct wp_color_manager_v1_listener cmListener = {
.supported_intent = cmIntent,
.supported_feature = cmFeature,
.supported_tf_named = cmTFNamed,
.supported_primaries_named = cmPrimariesNamed,
.done = cmDone,
};
bool waylandColorMgmtInit(void)
{
if (!wlWm.colorManager)
return true;
wp_color_manager_v1_add_listener(wlWm.colorManager, &cmListener, NULL);
return true;
}
void waylandColorMgmtFree(void)
{
if (!wlWm.colorManager)
return;
wp_color_manager_v1_destroy(wlWm.colorManager);
wlWm.colorManager = NULL;
}

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -183,7 +183,7 @@ void waylandCursorFree(void)
void waylandCursorScaleChange(void)
{
int newScale = ceil(wl_fixed_to_double(wlWm.scale));
int newScale = waylandScaleCeil(wlWm.scale);
if (newScale == wlWm.cursorScale)
return;

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -263,6 +263,11 @@ void libdecor_pollWait(struct wl_display * display, int epollFd,
}
}
bool libdecor_configured(void)
{
return state.configured;
}
WL_DesktopOps WLD_libdecor =
{
.name = "libdecor",
@@ -277,5 +282,6 @@ WL_DesktopOps WLD_libdecor =
.getSize = libdecor_getSize,
.registryGlobalHandler = libdecor_registryGlobalHandler,
.pollInit = libdecor_pollInit,
.pollWait = libdecor_pollWait
.pollWait = libdecor_pollWait,
.configured = libdecor_configured
};

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -304,6 +304,11 @@ void xdg_pollWait(struct wl_display * display, int epollFd,
wl_display_cancel_read(display);
}
bool xdg_configured(void)
{
return state.configured;
}
WL_DesktopOps WLD_xdg =
{
.name = "xdg",
@@ -318,5 +323,6 @@ WL_DesktopOps WLD_xdg =
.getSize = xdg_getSize,
.registryGlobalHandler = xdg_registryGlobalHandler,
.pollInit = xdg_pollInit,
.pollWait = xdg_pollWait
.pollWait = xdg_pollWait,
.configured = xdg_configured
};

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -70,6 +70,52 @@ EGLDisplay waylandGetEGLDisplay(void)
return eglGetDisplay(native);
}
static void applyHDRPending(void)
{
if (wlWm.pendingHDRApply)
{
wlWm.pendingHDRApply = false;
atomic_thread_fence(memory_order_acquire);
waylandSetHDRImageDescription(
wlWm.pendingHDRDisplayPrimary, wlWm.pendingHDRWhitePoint,
wlWm.pendingHDRMaxDisplayLuminance,
wlWm.pendingHDRMinDisplayLuminance,
wlWm.pendingHDRMaxCLL,
wlWm.pendingHDRMaxFALL,
wlWm.pendingHDRPQ);
}
else if (wlWm.pendingHDRClear)
{
wlWm.pendingHDRClear = false;
waylandClearHDRImageDescription();
}
}
void waylandClearHDRImageDescription(void)
{
if (!wlWm.hdrActive)
return;
if (wlWm.hdrImageCreator)
{
wp_image_description_creator_params_v1_destroy(wlWm.hdrImageCreator);
wlWm.hdrImageCreator = NULL;
}
if (wlWm.hdrImageDesc)
{
wp_image_description_v1_destroy(wlWm.hdrImageDesc);
wlWm.hdrImageDesc = NULL;
}
if (wlWm.colorSurface)
{
wp_color_management_surface_v1_destroy(wlWm.colorSurface);
wlWm.colorSurface = NULL;
}
wlWm.hdrActive = false;
DEBUG_INFO("HDR image description cleared");
}
void waylandEGLSwapBuffers(EGLDisplay display, EGLSurface surface, const struct Rect * damage, int count)
{
if (!wlWm.swapWithDamage.init)
@@ -84,6 +130,7 @@ void waylandEGLSwapBuffers(EGLDisplay display, EGLSurface surface, const struct
}
waylandPresentationFrame();
applyHDRPending();
swapWithDamage(&wlWm.swapWithDamage, display, surface, damage, count);
if (wlWm.needsResize)
@@ -92,8 +139,8 @@ void waylandEGLSwapBuffers(EGLDisplay display, EGLSurface surface, const struct
int width, height;
wlWm.desktop->getSize(&width, &height);
wl_egl_window_resize(wlWm.eglWindow, wl_fixed_to_int(width * wlWm.scale),
wl_fixed_to_int(height * wlWm.scale), 0, 0);
wl_egl_window_resize(wlWm.eglWindow, waylandScaleMulInt(wlWm.scale, width),
waylandScaleMulInt(wlWm.scale, height), 0, 0);
if (width == 0 || height == 0)
skipResize = true;
@@ -123,7 +170,7 @@ void waylandEGLSwapBuffers(EGLDisplay display, EGLSurface surface, const struct
wp_viewport_destroy(wlWm.viewport);
wlWm.viewport = NULL;
}
wl_surface_set_buffer_scale(wlWm.surface, wl_fixed_to_int(wlWm.scale));
wl_surface_set_buffer_scale(wlWm.surface, waylandScaleFloor(wlWm.scale));
}
struct wl_region * region = wl_compositor_create_region(wlWm.compositor);
@@ -131,7 +178,7 @@ void waylandEGLSwapBuffers(EGLDisplay display, EGLSurface surface, const struct
wl_surface_set_opaque_region(wlWm.surface, region);
wl_region_destroy(region);
app_handleResizeEvent(width, height, wl_fixed_to_double(wlWm.scale),
app_handleResizeEvent(width, height, waylandScaleToDouble(wlWm.scale),
(struct Border) {0, 0, 0, 0});
app_invalidateWindow(true);
waylandStopWaitFrame();
@@ -149,23 +196,227 @@ EGLNativeWindowType waylandGetEGLNativeWindow(void)
}
#endif
#ifdef ENABLE_OPENGL
bool waylandOpenGLInit(void)
// HDR color management support
void waylandSetHDRImageDescription(const uint16_t displayPrimary[3][2],
const uint16_t whitePoint[2], uint32_t maxDisplayLuminance,
uint32_t minDisplayLuminance, uint32_t maxCLL, uint32_t maxFALL,
bool hdrPQ)
{
EGLint attr[] =
if (!wlWm.colorManager)
return;
if (!wlWm.cmFeaturesDone)
{
EGL_BUFFER_SIZE , 24,
DEBUG_WARN("Color management features not yet advertised, deferring HDR");
return;
}
if (!wlWm.cmHasParametric)
{
DEBUG_WARN("Compositor does not support parametric image descriptions");
return;
}
// Verify the compositor supports the transfer function we need
if (hdrPQ && !wlWm.cmHasTFSt2084PQ)
{
DEBUG_WARN("Compositor does not support ST2084_PQ transfer function");
return;
}
if (!hdrPQ && !wlWm.cmHasTFExtLinear)
{
DEBUG_WARN("Compositor does not support EXT_LINEAR transfer function");
return;
}
// Verify primaries support for the target color space
if (hdrPQ && !wlWm.cmHasPrimariesBT2020)
{
DEBUG_WARN("Compositor does not support BT.2020 primaries");
return;
}
if (!hdrPQ && !wlWm.cmHasPrimariesSRGB)
{
DEBUG_WARN("Compositor does not support sRGB primaries");
return;
}
// Clean up any previous description (allows re-application with updated metadata)
if (wlWm.hdrImageCreator)
{
wp_image_description_creator_params_v1_destroy(wlWm.hdrImageCreator);
wlWm.hdrImageCreator = NULL;
}
if (wlWm.hdrImageDesc)
{
wp_image_description_v1_destroy(wlWm.hdrImageDesc);
wlWm.hdrImageDesc = NULL;
}
if (wlWm.colorSurface)
{
wp_color_management_surface_v1_destroy(wlWm.colorSurface);
wlWm.colorSurface = NULL;
}
wlWm.hdrActive = false;
wlWm.hdrImageCreator =
wp_color_manager_v1_create_parametric_creator(wlWm.colorManager);
if (!wlWm.hdrImageCreator)
{
DEBUG_WARN("Failed to create parametric image description creator");
return;
}
// Set primaries: BT.2020 for PQ HDR10, sRGB for scRGB/FP16
wp_image_description_creator_params_v1_set_primaries_named(
wlWm.hdrImageCreator,
hdrPQ ? WP_COLOR_MANAGER_V1_PRIMARIES_BT2020
: WP_COLOR_MANAGER_V1_PRIMARIES_SRGB);
// Select transfer function: PQ for PQ-encoded content, linear for scRGB/FP16
wp_image_description_creator_params_v1_set_tf_named(
wlWm.hdrImageCreator,
hdrPQ ? WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_ST2084_PQ
: WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_EXT_LINEAR);
// Set luminance range from metadata (values already in 0.0001 cd/m² units)
if (wlWm.cmHasLuminances)
wp_image_description_creator_params_v1_set_luminances(
wlWm.hdrImageCreator,
minDisplayLuminance > 0 ? minDisplayLuminance : 50,
maxDisplayLuminance > 0 ? maxDisplayLuminance : 10000000,
hdrPQ ? 2030000 : 800000);
// Set mastering display primaries from frame HDR metadata.
// Always set when the compositor supports it, falling back to the
// primaries from the metadata (even if zero, in which case the
// compositor uses its own defaults).
if (wlWm.cmHasMasteringPrimaries)
wp_image_description_creator_params_v1_set_mastering_display_primaries(
wlWm.hdrImageCreator,
displayPrimary[0][0], displayPrimary[0][1],
displayPrimary[1][0], displayPrimary[1][1],
displayPrimary[2][0], displayPrimary[2][1],
whitePoint[0], whitePoint[1]);
if (maxCLL > 0)
wp_image_description_creator_params_v1_set_max_cll(wlWm.hdrImageCreator, maxCLL);
if (maxFALL > 0)
wp_image_description_creator_params_v1_set_max_fall(wlWm.hdrImageCreator, maxFALL);
wlWm.hdrImageDesc =
wp_image_description_creator_params_v1_create(wlWm.hdrImageCreator);
wlWm.hdrImageCreator = NULL; // consumed by create
if (!wlWm.hdrImageDesc)
{
DEBUG_WARN("Failed to create HDR image description");
return;
}
wlWm.colorSurface =
wp_color_manager_v1_get_surface(wlWm.colorManager, wlWm.surface);
if (!wlWm.colorSurface)
{
DEBUG_WARN("Failed to get color management surface");
wp_image_description_v1_destroy(wlWm.hdrImageDesc);
wlWm.hdrImageDesc = NULL;
return;
}
wp_color_management_surface_v1_set_image_description(
wlWm.colorSurface, wlWm.hdrImageDesc,
WP_COLOR_MANAGER_V1_RENDER_INTENT_PERCEPTUAL);
wlWm.hdrActive = true;
DEBUG_INFO("HDR image description set on surface (%s, %s, %u nits)",
hdrPQ ? "PQ" : "scRGB", hdrPQ ? "BT.2020" : "sRGB", maxDisplayLuminance);
}
bool waylandRequestHDR(const uint16_t displayPrimary[3][2],
const uint16_t whitePoint[2], uint32_t maxDisplayLuminance,
uint32_t minDisplayLuminance, uint32_t maxCLL, uint32_t maxFALL,
bool hdrPQ)
{
if (!wlWm.cmFeaturesDone || !wlWm.cmHasParametric)
return false;
if (hdrPQ && !wlWm.cmHasTFSt2084PQ)
return false;
if (!hdrPQ && !wlWm.cmHasTFExtLinear)
return false;
if (hdrPQ && !wlWm.cmHasPrimariesBT2020)
return false;
if (!hdrPQ && !wlWm.cmHasPrimariesSRGB)
return false;
wlWm.pendingHDRPQ = hdrPQ;
// Write all metadata before setting the apply flag to ensure the
// render thread sees the complete HDR metadata when it observes
// pendingHDRApply == true.
memcpy(wlWm.pendingHDRDisplayPrimary, displayPrimary,
sizeof(wlWm.pendingHDRDisplayPrimary));
memcpy(wlWm.pendingHDRWhitePoint, whitePoint,
sizeof(wlWm.pendingHDRWhitePoint));
wlWm.pendingHDRMaxDisplayLuminance = maxDisplayLuminance;
wlWm.pendingHDRMinDisplayLuminance = minDisplayLuminance;
wlWm.pendingHDRMaxCLL = maxCLL;
wlWm.pendingHDRMaxFALL = maxFALL;
wlWm.pendingHDRClear = false;
atomic_thread_fence(memory_order_release);
wlWm.pendingHDRApply = true;
return true;
}
void waylandRequestClearHDR(void)
{
wlWm.pendingHDRClear = true;
wlWm.pendingHDRApply = false;
}
#ifdef ENABLE_OPENGL
static const EGLint eglBaseAttrs[] =
{
EGL_CONFORMANT , EGL_OPENGL_BIT,
EGL_RENDERABLE_TYPE , EGL_OPENGL_BIT,
EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER,
EGL_RED_SIZE , 8,
EGL_GREEN_SIZE , 8,
EGL_BLUE_SIZE , 8,
EGL_SAMPLE_BUFFERS , 0,
EGL_SAMPLES , 0,
EGL_NONE
};
};
static bool eglChooseConfigWithDepth(EGLDisplay display, EGLint red,
EGLint green, EGLint blue, EGLint alpha, EGLint depth,
EGLConfig * config, const char ** desc)
{
// Build attr array with the base attrs plus color depth
EGLint attr[32];
int ai = 0;
attr[ai++] = EGL_RED_SIZE ; attr[ai++] = red;
attr[ai++] = EGL_GREEN_SIZE; attr[ai++] = green;
attr[ai++] = EGL_BLUE_SIZE ; attr[ai++] = blue;
attr[ai++] = EGL_ALPHA_SIZE; attr[ai++] = alpha;
attr[ai++] = EGL_BUFFER_SIZE; attr[ai++] = depth;
for (int i = 0; eglBaseAttrs[i] != EGL_NONE; ++i)
attr[ai++] = eglBaseAttrs[i];
attr[ai] = EGL_NONE;
EGLint num_config;
if (eglChooseConfig(display, attr, config, 1, &num_config) && num_config > 0)
{
if (desc)
*desc = red >= 16 ? "FP16 (RGBA16F)" :
red >= 10 ? "10-bit (RGBA10)" : "8-bit (RGBA8)";
return true;
}
return false;
}
bool waylandOpenGLInit(void)
{
wlWm.glDisplay = waylandGetEGLDisplay();
int maj, min;
@@ -181,13 +432,31 @@ bool waylandOpenGLInit(void)
return false;
}
EGLint num_config;
if (!eglChooseConfig(wlWm.glDisplay, attr, &wlWm.glConfig, 1, &num_config))
EGLConfig config;
const char * configDesc = NULL;
// Probe for best available color depth: FP16 → 10-bit → 8-bit
if (!eglChooseConfigWithDepth(wlWm.glDisplay,
16, 16, 16, 0, 48, &config, &configDesc) &&
!eglChooseConfigWithDepth(wlWm.glDisplay,
10, 10, 10, 2, 32, &config, &configDesc) &&
!eglChooseConfigWithDepth(wlWm.glDisplay,
8, 8, 8, 0, 24, &config, &configDesc))
{
DEBUG_ERROR("Failed to choose config (eglError: 0x%x)", eglGetError());
DEBUG_ERROR("Failed to choose any EGL config");
return false;
}
wlWm.glConfig = config;
DEBUG_INFO("EGL config: %s", configDesc);
// Also store the 8-bit fallback for SDR contexts
if (configDesc && strcmp(configDesc, "8-bit (RGBA8)") != 0)
eglChooseConfigWithDepth(wlWm.glDisplay,
8, 8, 8, 0, 24, &wlWm.glConfigSDR, NULL);
else
wlWm.glConfigSDR = wlWm.glConfig;
wlWm.glSurface = eglCreateWindowSurface(wlWm.glDisplay, wlWm.glConfig, wlWm.eglWindow, NULL);
if (wlWm.glSurface == EGL_NO_SURFACE)
{

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -32,6 +32,9 @@
#include "app.h"
#include "common/debug.h"
const double WL_SCROLL_STEP = 15.0;
const double WL_HALF_SCROLL_STEP = WL_SCROLL_STEP / 2.0;
// Mouse-handling listeners.
static void pointerMotionHandler(void * data, struct wl_pointer * pointer,
@@ -91,12 +94,25 @@ static void pointerAxisHandler(void * data, struct wl_pointer * pointer,
if (axis != WL_POINTER_AXIS_VERTICAL_SCROLL)
return;
int button = value > 0 ?
5 /* SPICE_MOUSE_BUTTON_DOWN */ :
4 /* SPICE_MOUSE_BUTTON_UP */;
app_handleButtonPress(button);
app_handleButtonRelease(button);
app_handleWheelMotion(wl_fixed_to_double(value) / 15.0);
double delta = wl_fixed_to_double(value);
wlWm.scrollState += delta;
while (wlWm.scrollState > WL_HALF_SCROLL_STEP)
{
app_handleButtonPress(5 /* SPICE_MOUSE_BUTTON_DOWN */);
app_handleButtonRelease(5 /* SPICE_MOUSE_BUTTON_DOWN */);
wlWm.scrollState -= WL_SCROLL_STEP;
}
while (wlWm.scrollState < -WL_HALF_SCROLL_STEP)
{
app_handleButtonPress(4 /* SPICE_MOUSE_BUTTON_UP */);
app_handleButtonRelease(4 /* SPICE_MOUSE_BUTTON_UP */);
wlWm.scrollState += WL_SCROLL_STEP;
}
app_handleWheelMotion(delta / WL_SCROLL_STEP);
}
static int mapWaylandToSpiceButton(uint32_t button)

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -58,6 +58,8 @@ typedef struct WL_DesktopOps
bool (*pollInit)(struct wl_display * display);
void (*pollWait)(struct wl_display * display, int epollFd, unsigned int time);
bool (*configured)(void);
}
WL_DesktopOps;

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -29,17 +29,17 @@
static void outputUpdateScale(struct WaylandOutput * node)
{
wl_fixed_t original = node->scale;
struct WaylandScale original = node->scale;
if (!wlWm.useFractionalScale || !wlWm.viewporter || !node->logicalWidth)
node->scale = wl_fixed_from_int(node->scaleInt);
node->scale = waylandScaleFromInt(node->scaleInt);
else
{
int32_t modeWidth = node->modeRotate ? node->modeHeight : node->modeWidth;
node->scale = wl_fixed_from_double(1.0 * modeWidth / node->logicalWidth);
node->scale = waylandScaleFromRatio(modeWidth, node->logicalWidth);
}
if (original != node->scale)
if (!waylandScaleEqual(original, node->scale))
waylandWindowUpdateScale();
}
@@ -167,7 +167,7 @@ void waylandOutputBind(uint32_t name, uint32_t version)
}
node->name = name;
node->scale = 0;
node->scale = waylandScaleFromInt(0);
node->version = version;
node->output = wl_registry_bind(wlWm.registry, name,
&wl_output_interface, version >= 3 ? 3 : 2);
@@ -209,12 +209,12 @@ void waylandOutputTryUnbind(uint32_t name)
}
}
wl_fixed_t waylandOutputGetScale(struct wl_output * output)
struct WaylandScale waylandOutputGetScale(struct wl_output * output)
{
struct WaylandOutput * node;
wl_list_for_each(node, &wlWm.outputs, link)
if (node->output == output)
return node->scale;
return 0;
return waylandScaleFromInt(0);
}

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -60,6 +60,15 @@ wayland_generate(
wayland_generate(
"${WAYLAND_PROTOCOLS_BASE}/staging/xdg-activation/xdg-activation-v1.xml"
"${CMAKE_BINARY_DIR}/wayland/wayland-xdg-activation-v1-client-protocol")
wayland_generate(
"${WAYLAND_PROTOCOLS_BASE}/staging/fractional-scale/fractional-scale-v1.xml"
"${CMAKE_BINARY_DIR}/wayland/wayland-fractional-scale-v1-client-protocol")
wayland_generate(
"${WAYLAND_PROTOCOLS_BASE}/staging/content-type/content-type-v1.xml"
"${CMAKE_BINARY_DIR}/wayland/wayland-content-type-v1-client-protocol")
wayland_generate(
"${WAYLAND_PROTOCOLS_BASE}/staging/color-management/color-management-v1.xml"
"${CMAKE_BINARY_DIR}/wayland/wayland-color-management-v1-client-protocol")
target_link_libraries(wayland_protocol
PkgConfig::WAYLAND

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -46,6 +46,9 @@ static void registryGlobalHandler(void * data, struct wl_registry * registry,
else if (!strcmp(interface, wp_viewporter_interface.name))
wlWm.viewporter = wl_registry_bind(wlWm.registry, name,
&wp_viewporter_interface, 1);
else if (!strcmp(interface, wp_fractional_scale_manager_v1_interface.name))
wlWm.fractionalScaleManager = wl_registry_bind(wlWm.registry, name,
&wp_fractional_scale_manager_v1_interface, 1);
else if (!strcmp(interface, zwp_relative_pointer_manager_v1_interface.name))
wlWm.relativePointerManager = wl_registry_bind(wlWm.registry, name,
&zwp_relative_pointer_manager_v1_interface, 1);
@@ -68,6 +71,12 @@ static void registryGlobalHandler(void * data, struct wl_registry * registry,
else if (!strcmp(interface, xdg_activation_v1_interface.name))
wlWm.xdgActivation = wl_registry_bind(wlWm.registry, name,
&xdg_activation_v1_interface, 1);
else if (!strcmp(interface, wp_content_type_manager_v1_interface.name))
wlWm.contentTypeManager = wl_registry_bind(wlWm.registry, name,
&wp_content_type_manager_v1_interface, 1);
else if (!strcmp(interface, wp_color_manager_v1_interface.name))
wlWm.colorManager = wl_registry_bind(wlWm.registry, name,
&wp_color_manager_v1_interface, 1);
else if (wlWm.desktop->registryGlobalHandler(
data, registry, name, interface, version))
return;

View File

@@ -0,0 +1,80 @@
/**
* Looking Glass
* Copyright © 2017-2026 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 <stdint.h>
struct WaylandScale
{
int32_t num;
int32_t den;
};
static inline struct WaylandScale waylandScaleFromInt(int32_t scale)
{
return (struct WaylandScale) { scale, 1 };
}
static inline struct WaylandScale waylandScaleFromRatio(int32_t num, int32_t den)
{
return (struct WaylandScale) { num, den };
}
static inline bool waylandScaleValid(struct WaylandScale scale)
{
return scale.num > 0 && scale.den > 0;
}
static inline bool waylandScaleEqual(struct WaylandScale a, struct WaylandScale b)
{
return (int64_t)a.num * b.den == (int64_t)b.num * a.den;
}
static inline int waylandScaleCmp(struct WaylandScale a, struct WaylandScale b)
{
int64_t lhs = (int64_t)a.num * b.den;
int64_t rhs = (int64_t)b.num * a.den;
return (lhs > rhs) - (lhs < rhs);
}
static inline bool waylandScaleIsFractional(struct WaylandScale scale)
{
return waylandScaleValid(scale) && scale.num % scale.den != 0;
}
static inline int waylandScaleFloor(struct WaylandScale scale)
{
return scale.num / scale.den;
}
static inline int waylandScaleCeil(struct WaylandScale scale)
{
return (scale.num + scale.den - 1) / scale.den;
}
static inline int waylandScaleMulInt(struct WaylandScale scale, int value)
{
return (int)(((int64_t)value * scale.num + scale.den / 2) / scale.den);
}
static inline double waylandScaleToDouble(struct WaylandScale scale)
{
return (double)scale.num / (double)scale.den;
}

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
#include "common/debug.h"
#include "common/option.h"
#include "interface/renderer.h"
#include "dynamic/wayland_desktops.h"
@@ -143,6 +144,9 @@ static bool waylandInit(const LG_DSInitParams params)
if (!waylandRegistryInit())
return false;
if (!waylandColorMgmtInit())
return false;
if (!waylandActivationInit())
return false;
@@ -189,6 +193,7 @@ static void waylandFree(void)
waylandPresentationFree();
waylandInputFree();
waylandOutputFree();
waylandColorMgmtFree();
waylandRegistryFree();
waylandCursorFree();
wl_display_disconnect(wlWm.display);
@@ -202,6 +207,12 @@ static bool waylandGetProp(LG_DSProperty prop, void * ret)
return true;
}
if (prop == LG_DS_NATIVE_HDR)
{
*(bool *)ret = wlWm.cmCanDoHDR;
return true;
}
return false;
}
@@ -227,6 +238,22 @@ static void waylandMinimize(void)
wlWm.desktop->minimize();
}
static bool waylandHDRCallback(const void * rendererFormat)
{
if (!wlWm.colorManager)
return false;
const LG_RendererFormat * format = (const LG_RendererFormat *)rendererFormat;
if (format->hdr)
return waylandRequestHDR(format->hdrDisplayPrimary, format->hdrWhitePoint,
format->hdrMaxDisplayLuminance, format->hdrMinDisplayLuminance,
format->hdrMaxContentLightLevel, format->hdrMaxFrameAverageLightLevel,
format->hdrPQ);
else
waylandRequestClearHDR();
return true;
}
struct LG_DisplayServerOps LGDS_Wayland =
{
.name = "Wayland",
@@ -276,6 +303,8 @@ struct LG_DisplayServerOps LGDS_Wayland =
.getFullscreen = waylandGetFullscreen,
.minimize = waylandMinimize,
.setHDRImageDescription = waylandHDRCallback,
.cbInit = waylandCBInit,
.cbNotice = waylandCBNotice,
.cbRelease = waylandCBRelease,

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -47,6 +47,11 @@
#include "wayland-idle-inhibit-unstable-v1-client-protocol.h"
#include "wayland-xdg-output-unstable-v1-client-protocol.h"
#include "wayland-xdg-activation-v1-client-protocol.h"
#include "wayland-fractional-scale-v1-client-protocol.h"
#include "wayland-content-type-v1-client-protocol.h"
#include "wayland-color-management-v1-client-protocol.h"
#include "scale.h"
typedef void (*WaylandPollCallback)(uint32_t events, void * opaque);
@@ -62,7 +67,7 @@ struct WaylandPoll
struct WaylandOutput
{
uint32_t name;
wl_fixed_t scale;
struct WaylandScale scale;
int32_t scaleInt;
int32_t logicalWidth;
int32_t logicalHeight;
@@ -81,13 +86,6 @@ struct SurfaceOutput
struct wl_list link;
};
enum EGLSwapWithDamageState {
SWAP_WITH_DAMAGE_UNKNOWN,
SWAP_WITH_DAMAGE_UNSUPPORTED,
SWAP_WITH_DAMAGE_KHR,
SWAP_WITH_DAMAGE_EXT,
};
struct xkb_context;
struct xkb_keymap;
struct xkb_state;
@@ -108,12 +106,13 @@ struct WaylandDSState
struct wl_shm * shm;
struct wl_compositor * compositor;
wl_fixed_t scale;
struct WaylandScale scale;
bool fractionalScale;
bool needsResize;
bool configured;
bool warpSupport;
double cursorX, cursorY;
double scrollState;
#if defined(ENABLE_EGL) || defined(ENABLE_OPENGL)
struct wl_egl_window * eglWindow;
@@ -122,7 +121,8 @@ struct WaylandDSState
#ifdef ENABLE_OPENGL
EGLDisplay glDisplay;
EGLConfig glConfig;
EGLConfig glConfig; // primary config (best bit depth probed)
EGLConfig glConfigSDR; // fallback 8-bit SDR config
EGLSurface glSurface;
#endif
@@ -172,11 +172,52 @@ struct WaylandDSState
struct wp_viewporter * viewporter;
struct wp_viewport * viewport;
struct wp_fractional_scale_manager_v1 * fractionalScaleManager;
struct wp_fractional_scale_v1 * fractionalScaleInterface;
struct zxdg_output_manager_v1 * xdgOutputManager;
struct wl_list outputs; // WaylandOutput::link
struct wl_list surfaceOutputs; // SurfaceOutput::link
bool useFractionalScale;
struct wp_content_type_manager_v1 * contentTypeManager;
struct wp_content_type_v1 * contentType;
// Color management (HDR)
struct wp_color_manager_v1 * colorManager;
struct wp_color_management_surface_v1 * colorSurface;
struct wp_image_description_v1 * hdrImageDesc;
struct wp_image_description_creator_params_v1 * hdrImageCreator;
// Set to true when an HDR image description is active on the surface
bool hdrActive;
// wp_color_manager_v1 feature advertisement tracking.
// Set to true after the done event for the color-manager has been received
// and all compositor capabilities have been recorded.
bool cmFeaturesDone;
bool cmHasParametric;
bool cmHasLuminances;
bool cmHasMasteringPrimaries;
bool cmHasTFSt2084PQ;
bool cmHasTFExtLinear;
bool cmHasPrimariesBT2020;
bool cmHasPrimariesSRGB;
bool cmHasPerceptualIntent;
bool cmCanDoHDR; // true if compositor supports features needed for HDR
// Pending HDR format to apply (set by frame thread, applied in swap buffers).
// pendingHDRApply and pendingHDRClear are accessed from multiple threads
// without a lock, so they must be atomic.
_Atomic(bool) pendingHDRApply;
_Atomic(bool) pendingHDRClear;
bool pendingHDRPQ;
uint16_t pendingHDRDisplayPrimary[3][2];
uint16_t pendingHDRWhitePoint[2];
uint32_t pendingHDRMaxDisplayLuminance;
uint32_t pendingHDRMinDisplayLuminance;
uint32_t pendingHDRMaxCLL;
uint32_t pendingHDRMaxFALL;
LGEvent * frameEvent;
struct wl_list poll; // WaylandPoll::link
@@ -259,6 +300,24 @@ void waylandGLSetSwapInterval(int interval);
void waylandGLSwapBuffers(void);
#endif
// HDR color management (Wayland color-management-v1)
bool waylandColorMgmtInit(void);
void waylandColorMgmtFree(void);
void waylandSetHDRImageDescription(const uint16_t displayPrimary[3][2],
const uint16_t whitePoint[2], uint32_t maxDisplayLuminance,
uint32_t minDisplayLuminance, uint32_t maxCLL, uint32_t maxFALL,
bool hdrPQ);
void waylandClearHDRImageDescription(void);
// Queue HDR change from any thread (applied in waylandEGLSwapBuffers).
// Returns true if the request was queued, false if HDR is not available
// (no color manager, missing features, or unsupported TF/primaries).
bool waylandRequestHDR(const uint16_t displayPrimary[3][2],
const uint16_t whitePoint[2], uint32_t maxDisplayLuminance,
uint32_t minDisplayLuminance, uint32_t maxCLL, uint32_t maxFALL,
bool hdrPQ);
void waylandRequestClearHDR(void);
// idle module
bool waylandIdleInit(void);
void waylandIdleFree(void);
@@ -284,7 +343,7 @@ bool waylandOutputInit(void);
void waylandOutputFree(void);
void waylandOutputBind(uint32_t name, uint32_t version);
void waylandOutputTryUnbind(uint32_t name);
wl_fixed_t waylandOutputGetScale(struct wl_output * output);
struct WaylandScale waylandOutputGetScale(struct wl_output * output);
// poll module
bool waylandPollInit(void);

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -31,29 +31,39 @@
// Surface-handling listeners.
void waylandWindowUpdateScale(void)
static void setScale(struct WaylandScale newScale)
{
wl_fixed_t maxScale = 0;
struct SurfaceOutput * node;
wl_list_for_each(node, &wlWm.surfaceOutputs, link)
{
wl_fixed_t scale = waylandOutputGetScale(node->output);
if (scale > maxScale)
maxScale = scale;
}
if (maxScale)
{
wlWm.scale = maxScale;
wlWm.fractionalScale = wl_fixed_from_int(wl_fixed_to_int(maxScale)) != maxScale;
wlWm.scale = newScale;
wlWm.fractionalScale = waylandScaleIsFractional(newScale);
wlWm.needsResize = true;
if (wlWm.desktop->configured())
{
waylandCursorScaleChange();
app_invalidateWindow(true);
waylandStopWaitFrame();
}
}
void waylandWindowUpdateScale(void)
{
if (wlWm.fractionalScaleInterface)
return;
struct WaylandScale maxScale = waylandScaleFromInt(0);
struct SurfaceOutput * node;
wl_list_for_each(node, &wlWm.surfaceOutputs, link)
{
struct WaylandScale scale = waylandOutputGetScale(node->output);
if (waylandScaleCmp(scale, maxScale) > 0)
maxScale = scale;
}
if (waylandScaleValid(maxScale))
setScale(maxScale);
}
static void wlSurfaceEnterHandler(void * data, struct wl_surface * surface, struct wl_output * output)
{
struct SurfaceOutput * node = malloc(sizeof(*node));
@@ -85,9 +95,19 @@ static const struct wl_surface_listener wlSurfaceListener = {
.leave = wlSurfaceLeaveHandler,
};
static void fractionalScalePreferredScale(void * data,
struct wp_fractional_scale_v1 * fractionalScale, uint32_t scale)
{
setScale(waylandScaleFromRatio(scale, 120));
}
static const struct wp_fractional_scale_v1_listener fractionalScaleListener = {
.preferred_scale = fractionalScalePreferredScale,
};
bool waylandWindowInit(const char * title, const char * appId, bool fullscreen, bool maximize, bool borderless, bool resizable)
{
wlWm.scale = wl_fixed_from_int(1);
wlWm.scale = waylandScaleFromInt(1);
wlWm.frameEvent = lgCreateEvent(true, 0);
if (!wlWm.frameEvent)
@@ -110,8 +130,23 @@ bool waylandWindowInit(const char * title, const char * appId, bool fullscreen,
return false;
}
if (wlWm.fractionalScaleManager)
{
wlWm.fractionalScaleInterface = wp_fractional_scale_manager_v1_get_fractional_scale(
wlWm.fractionalScaleManager, wlWm.surface);
wp_fractional_scale_v1_add_listener(wlWm.fractionalScaleInterface,
&fractionalScaleListener, NULL);
}
else
wl_surface_add_listener(wlWm.surface, &wlSurfaceListener, NULL);
if (wlWm.contentTypeManager)
{
wlWm.contentType = wp_content_type_manager_v1_get_surface_content_type(
wlWm.contentTypeManager, wlWm.surface);
wp_content_type_v1_set_content_type(wlWm.contentType, WP_CONTENT_TYPE_V1_TYPE_GAME);
}
if (!wlWm.desktop->shellInit(wlWm.display, wlWm.surface,
title, appId, fullscreen, maximize, borderless, resizable))
return false;
@@ -122,6 +157,10 @@ bool waylandWindowInit(const char * title, const char * appId, bool fullscreen,
void waylandWindowFree(void)
{
if (wlWm.fractionalScaleInterface)
wp_fractional_scale_v1_destroy(wlWm.fractionalScaleInterface);
if (wlWm.contentType)
wp_content_type_v1_destroy(wlWm.contentType);
wl_surface_destroy(wlWm.surface);
lgFreeEvent(wlWm.frameEvent);
}

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -72,6 +72,13 @@ void app_setFullscreen(bool fs);
bool app_getFullscreen(void);
bool app_getProp(LG_DSProperty prop, void * ret);
/**
* Returns true if the last call to setHDRImageDescription() failed.
* When this returns true, the renderer should fall back to software
* tone-mapping even on a compositor that reports LG_DS_NATIVE_HDR.
*/
bool app_getHDRDescFailed(void);
#ifdef ENABLE_EGL
EGLDisplay app_getEGLDisplay(void);
EGLNativeWindowType app_getEGLNativeWindow(void);

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -53,6 +53,14 @@ typedef enum LG_DSProperty
* return data type: bool
*/
LG_DS_WARP_SUPPORT,
/**
* returns true if the display server supports native HDR via
* setHDRImageDescription (i.e., the compositor actually has the
* required color-management features to process HDR content).
* return data type: bool
*/
LG_DS_NATIVE_HDR,
}
LG_DSProperty;
@@ -213,6 +221,13 @@ struct LG_DisplayServerOps
void (*setFullscreen)(bool fs);
void (*minimize)(void);
/* HDR color management - set display image description.
* Optional, if not supported set to NULL.
* Returns true on success, false if the description could not be applied
* (e.g., compositor doesn't support the required transfer function or
* primaries, or the image description creation failed). */
bool (*setHDRImageDescription)(const void * rendererFormat);
/* clipboard support, optional, if not supported set to NULL */
bool (*cbInit)(void);
void (*cbNotice)(LG_ClipboardData type);

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -84,6 +84,14 @@ typedef struct LG_RendererFormat
unsigned int pitch; // scanline bytes (or compressed size)
unsigned int bpp; // bits per pixel (zero if compressed)
LG_RendererRotate rotate; // guest rotation
// HDR static metadata (from KVMFRFrame, valid when hdr is true)
uint16_t hdrDisplayPrimary[3][2];
uint16_t hdrWhitePoint[2];
uint32_t hdrMaxDisplayLuminance;
uint32_t hdrMinDisplayLuminance;
uint32_t hdrMaxContentLightLevel;
uint32_t hdrMaxFrameAverageLightLevel;
}
LG_RendererFormat;

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -91,6 +91,7 @@ struct EGL_Desktop
// map HDR content to SDR
bool mapHDRtoSDR;
bool nativeHDR;
int peakLuminance;
int maxCLL;
@@ -548,7 +549,7 @@ bool egl_desktopRender(EGL_Desktop * desktop, unsigned int outputWidth,
{
.type = EGL_UNIFORM_TYPE_1I,
.location = shader->uCBMode,
.f = { desktop->cbMode }
.i = { desktop->cbMode }
},
{
.type = EGL_UNIFORM_TYPE_1I,
@@ -558,7 +559,7 @@ bool egl_desktopRender(EGL_Desktop * desktop, unsigned int outputWidth,
{
.type = EGL_UNIFORM_TYPE_1I,
.location = shader->uMapHDRtoSDR,
.i = { desktop->mapHDRtoSDR }
.i = { desktop->mapHDRtoSDR && !desktop->nativeHDR }
},
{
.type = EGL_UNIFORM_TYPE_1F,
@@ -568,7 +569,7 @@ bool egl_desktopRender(EGL_Desktop * desktop, unsigned int outputWidth,
{
.type = EGL_UNIFORM_TYPE_1I,
.location = shader->uMapHDRPQ,
.f = { desktop->hdrPQ }
.i = { desktop->hdrPQ }
}
};
@@ -579,6 +580,11 @@ bool egl_desktopRender(EGL_Desktop * desktop, unsigned int outputWidth,
return true;
}
void egl_desktopSetNativeHDR(EGL_Desktop * desktop, bool nativeHDR)
{
desktop->nativeHDR = nativeHDR;
}
void egl_desktopSpiceConfigure(EGL_Desktop * desktop, int width, int height)
{
if (!desktop->spiceTexture)

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -42,6 +42,7 @@ bool egl_desktopInit(EGL * egl, EGL_Desktop ** desktop, EGLDisplay * display,
void egl_desktopFree(EGL_Desktop ** desktop);
void egl_desktopConfigUI(EGL_Desktop * desktop);
void egl_desktopSetNativeHDR(EGL_Desktop * desktop, bool nativeHDR);
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);

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -121,6 +121,9 @@ struct Inst
bool showSpice;
int spiceWidth, spiceHeight;
bool configSupportsHDR; // true if we probed FP16 or 10-bit EGL config
bool hdr; // true if current frame format is HDR
};
static struct Option egl_options[] =
@@ -607,6 +610,26 @@ static bool egl_onFrameFormat(LG_Renderer * renderer, const LG_RendererFormat fo
egl_cursorSetScale(this->cursor, scale);
}
// Track HDR state and warn if HDR frames arrive without any HDR path
this->hdr = format.hdr;
if (format.hdr)
{
bool nativeHDR = false;
app_getProp(LG_DS_NATIVE_HDR, &nativeHDR);
if (!this->configSupportsHDR && !nativeHDR)
DEBUG_WARN("HDR frames being displayed on an 8-bit EGL surface "
"without a color-managed compositor; tones may be incorrect");
}
// If the display server supports native HDR (via setHDRImageDescription),
// disable software tone-mapping to avoid double tone-mapping.
// However, if the last call to setHDRImageDescription actually failed
// (e.g., compositor missing required primaries), keep tone-mapping on.
bool nativeHDR = false;
app_getProp(LG_DS_NATIVE_HDR, &nativeHDR);
egl_desktopSetNativeHDR(this->desktop,
format.hdr && nativeHDR && !app_getHDRDescFailed());
egl_update_scale_type(this);
egl_damageSetup(this->damage, format.frameWidth, format.frameHeight);
@@ -774,22 +797,51 @@ static bool egl_renderStartup(LG_Renderer * renderer, bool useDMA)
}
}
// Probe for best available color depth: FP16 → 10-bit → 8-bit
static const struct { EGLint r, g, b, a, depth; const char * desc; } configs[] =
{
{ 16, 16, 16, 0, 48, "FP16 (RGBA16F)" },
{ 10, 10, 10, 2, 32, "10-bit (RGBA10)" },
{ 8, 8, 8, 0, 24, "8-bit (RGBA8)" },
};
EGLint num_config;
const char * configDesc = NULL;
int chosen = -1;
for (int i = 0; i < (int)(sizeof(configs) / sizeof(configs[0])); ++i)
{
EGLint attr[] =
{
EGL_BUFFER_SIZE , 30,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
EGL_RED_SIZE , configs[i].r,
EGL_GREEN_SIZE , configs[i].g,
EGL_BLUE_SIZE , configs[i].b,
EGL_ALPHA_SIZE , configs[i].a,
EGL_BUFFER_SIZE , configs[i].depth,
EGL_RENDERABLE_TYPE , EGL_OPENGL_ES2_BIT,
EGL_SAMPLE_BUFFERS , maxSamples > 0 ? 1 : 0,
EGL_SAMPLES , maxSamples,
EGL_NONE
};
EGLint num_config;
if (!eglChooseConfig(this->display, attr, &this->configs, 1, &num_config))
if (eglChooseConfig(this->display, attr, &this->configs, 1, &num_config) &&
num_config > 0)
{
DEBUG_ERROR("Failed to choose config (eglError: 0x%x)", eglGetError());
configDesc = configs[i].desc;
chosen = i;
break;
}
}
if (chosen < 0)
{
DEBUG_ERROR("Failed to choose any EGL config");
return false;
}
this->configSupportsHDR = chosen <= 1; // FP16 or 10-bit
DEBUG_INFO("EGL config: %s%s", configDesc,
this->configSupportsHDR ? " (HDR capable)" : "");
const EGLint surfattr[] =
{
EGL_RENDER_BUFFER, this->opt.doubleBuffer ? EGL_BACK_BUFFER : EGL_SINGLE_BUFFER,

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -618,6 +618,11 @@ bool app_getProp(LG_DSProperty prop, void * ret)
return g_state.ds->getProp(prop, ret);
}
bool app_getHDRDescFailed(void)
{
return atomic_load(&g_state.hdrDescFailed);
}
#ifdef ENABLE_EGL
EGLDisplay app_getEGLDisplay(void)
{

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -782,7 +782,7 @@ static void doLicense(void)
// BEGIN LICENSE BLOCK
"\n"
"Looking Glass\n"
"Copyright © 2017-2025 The Looking Glass Authors\n"
"Copyright © 2017-2026 The Looking Glass Authors\n"
"https://looking-glass.io\n"
"\n"
"This program is free software; you can redistribute it and/or modify it under\n"

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it
@@ -221,8 +221,8 @@ void core_updatePositionInfo(void)
.type = LG_MSG_WINDOWSIZE,
.windowSize =
{
.width = g_state.windowW,
.height = g_state.windowH
.width = round(g_state.windowW * g_state.windowScale),
.height = round(g_state.windowH * g_state.windowScale)
}
};
lgMessage_post(&msg);
@@ -554,6 +554,7 @@ void core_handleMouseNormal(double ex, double ey)
{
/* wait for the move request to be processed */
g_cursor.realigning = true;
unsigned timeout = 200;
do
{
LG_LOCK(g_state.pointerQueueLock);
@@ -577,6 +578,14 @@ void core_handleMouseNormal(double ex, double ey)
if (hostSerial >= setPosSerial)
break;
if (--timeout == 0)
{
DEBUG_ERROR(
"pointerQueue serial not updating, expected %u but stuck at %u",
setPosSerial, hostSerial);
break;
}
g_state.ds->wait(1);
}
while(app_isRunning());

View File

@@ -1,6 +1,6 @@
/**
* Looking Glass
* Copyright © 2017-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 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-2025 The Looking Glass Authors
* Copyright © 2017-2026 The Looking Glass Authors
* https://looking-glass.io
*
* This program is free software; you can redistribute it and/or modify it

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