Commit Graph

1602 Commits

Author SHA1 Message Date
Quantum
22920acc88 [host] windows: define exit codes for future use
The host process will be changed to return these codes, from which the
service process could decide whether to exit or restart the process and log.

Note that on Windows, return values are 32-bit unlike POSIX which is only 8.
2021-01-15 11:27:02 +11:00
Quantum
65009dcedc [host] windows: avoid leaking process and thread handles
The handles in PROCESS_INFORMATION must be closed if not used, or they
will leak.
2021-01-15 09:49:42 +11:00
Geoffrey McRae
25d6d88adb [client] minor nit: compare double to double const 2021-01-15 08:50:27 +11:00
Quantum
8217d5efa5 [obs] build pull requests and master with GitHub Actions 2021-01-15 08:49:30 +11:00
Quantum
d670913fd2 [host] windows: build pull requests and master with GitHub Actions 2021-01-15 08:49:30 +11:00
Quantum
afa277f8ee [common] ivshmem/linux: add stubs for ivshmemInit and ivshmemFree
These two functions were added in 9ff1859dc1
for Windows, but were never used on Linux.

Adding stubs will allow the host to compile on Linux.
These should be fixed later.
2021-01-15 08:49:30 +11:00
Quantum
a55b5e4b06 [host] linux: link with libX11 and libGL 2021-01-15 08:49:30 +11:00
Quantum
e467db64d8 [host] linux: include missing headers
- <pwd.h> for getpwuid
- <unistd.h> for getuid
- "common/stringutils.h" for alloc_sprintf
2021-01-15 08:49:30 +11:00
Quantum
dd2d69fa37 [host] xcb: remove undefined getPointer member from Capture_XCB 2021-01-15 08:49:30 +11:00
Quantum
ed9e3d253b [host] xcb: fix xcb_create signature error
Should have two arguments instead of zero.
2021-01-15 08:49:30 +11:00
Quantum
2723b4b7c0 [host] xcb: fix xcb_getFrame compile error
The argument should have been a pointer.
2021-01-15 08:49:30 +11:00
Quantum
69a4dffddc [host] linux: build pull requests and master with GitHub Actions 2021-01-15 08:49:30 +11:00
Quantum
ec69ae261f [module] build pull requests and master with GitHub Actions 2021-01-15 08:49:30 +11:00
Quantum
b8178b3e7d [client] build pull requests and master with GitHub Actions 2021-01-15 08:49:30 +11:00
Geoffrey McRae
bfc7b43758 [all] updated LGMP and PureSpice submodules 2021-01-15 08:49:05 +11:00
Quantum
78cb65a6a4 [client] spice: correctly use fabs for floating point
The prototype for abs is int abs (int n), which implicitly casts floating
point values to integers. The correct function is fabs.

This commit allows the client to compile under clang.
2021-01-15 08:48:15 +11:00
Quantum
369c49cdcf [client] render/opengl: remove braces so fallthrough comment is recognized
gcc -Wimplicit-fallthrough only detects comments if they are immediately
preceded before the next label. Braces stops it from recognizing the
fallthrough comment.
2021-01-15 08:06:56 +11:00
Quantum
5f20ee46a8 [client] spice: remove suprious const on function return type
const in the return type does nothing and triggers -Wignored-qualifiers.
2021-01-15 08:06:56 +11:00
Quantum
0495f5de26 [client] enable useful extra warnings
-Wno-sign-compare is used to suppress warnings related to comparing signed
values with unsigned ones. It's too pedantic.

-Wunused-parameter is also too pedantic, especially since all parameters
have to be named in C.

Otherwise, -Wextra lets us catch bugs, such as x < 0 for unsigned x.

On gcc, we pass -Wimplicit-fallthrough=2 so it will recognize our fall
through comment.
2021-01-15 08:06:56 +11:00
Tudor Brindus
5538a31f6b [client] add support for compiling with UndefinedBehaviorSanitizer 2021-01-14 17:48:28 +11:00
Tudor Brindus
a46a3a2668 [all] use explicit void parameter lists
This makes it a compile-time error to call a function that semantically
takes no parameters with a nonzero number of arguments.

Previously, such code would still compile, but risk blowing up the stack
if a compiler chose to use something other than caller-cleanup calling
conventions.
2021-01-14 17:29:37 +11:00
Tudor Brindus
dc17492750 [client] clipboard/wayland: make DnD a no-op
Wayland requires us to set all listeners, even for events we don't care
about. Not doing so caused Looking Glass to abort when used as a drop
target.
2021-01-14 17:09:54 +11:00
Quantum
17691f889b [client] clipboard/wayland: avoid writing back to guest clipboard
Copying rich text from the guest would be turned into plaintext on the client.
Prior to this change, this would be sent back to the guest, overwriting its
clipboard. This made it impossible to copy rich text inside the guest.

This commit detects such self-copies by checking if the receiver is the
current process, and rejecting it.
2021-01-14 10:41:32 +11:00
Quantum
02421ef269 [client] clipboard/wayland: fix null mimetype receive error
This prevents looking-glass-client from failing with an error message like:

error marshalling arguments for receive (signature sh): null value passed for arg 0
Error marshalling request: Invalid argument
2021-01-14 10:41:08 +11:00
Quantum
50c934db5a [client] wm/wayland: correctly handle double keyboard grab
When input:grabKeyboardOnFocus is set (default), entering capture mode grabs
the keyboard a second time. This commit makes the second grab a no-op on
Wayland to avoid a crash.
2021-01-13 15:53:02 +11:00
Geoffrey McRae
c650690bcc [client] wm: fix duplicate declaration of static struct 2021-01-13 14:00:25 +11:00
Tudor Brindus
fd009c6392 [client] wm/wayland: bypass SDL loop for pointer events 2021-01-13 13:59:00 +11:00
Tudor Brindus
96c10c2c2d [client] clipboard/wayland: make use of boilerplate from wm.c 2021-01-13 13:39:32 +11:00
Tudor Brindus
2aa2ec31ef [client] clipboard/wayland: address style nits 2021-01-13 13:39:32 +11:00
Tudor Brindus
bf223158d0 [client] clipboard: try each clipboard until one initializes
Previously, main.c would segfault at runtime if clipboards were disabled
via cmake flags, as the clipboards array would be empty but still
indexed during initialization.

Co-authored-by: Quantum <quantum2048@gmail.com>
2021-01-13 13:39:32 +11:00
Tudor Brindus
2627381021 [client] clipboard/wayland: ignore SIGPIPE from clients that hang up
Otherwise, a badly-behaving client causes Looking Glass to receive a
SIGPIPE during Wayland copy operations. Handle EPIPE at call-sites
instead.

Co-authored-by: Quantum <quantum2048@gmail.com>
2021-01-13 13:39:32 +11:00
Tudor Brindus
48941cb9c4 [client] clipboard/wayland: implement better text mimetype heuristic
This roughly matches the heuristic that wl-copy uses to detect text.
2021-01-13 13:39:32 +11:00
Tudor Brindus
fb7ee16f7b [client] clipboard/wayland: support keyboard capability hotplug 2021-01-13 13:39:32 +11:00
Tudor Brindus
c73d50f56a [client] clipboard/wayland: implement host-to-VM transfers
Co-authored-by: Quantum <quantum2048@gmail.com>
2021-01-13 13:39:32 +11:00
Tudor Brindus
2bfd066833 [client] clipboard/wayland: implement VM-to-host image copy
Co-authored-by: Quantum <quantum2048@gmail.com>
2021-01-13 13:39:32 +11:00
Tudor Brindus
c58f33f5ab [client] clipboard/wayland: implement VM-to-host text copy
Co-authored-by: Quantum <quantum2048@gmail.com>
2021-01-13 13:39:32 +11:00
Tudor Brindus
a205515d91 [client] clipboard/wayland: implement a no-op Wayland clipboard
Build scaffolding only; implementation in later commits.

Co-authored-by: Quantum <quantum2048@gmail.com>
2021-01-13 13:39:32 +11:00
Quantum
8f4e0f6b50 [client] spice/wayland: ignore mouse moves when dpiScale is unknown
This prevents division by zero and sending invalid information to spice.
2021-01-13 13:39:10 +11:00
Quantum
95205ca967 [client] spice/wayland: use correct coordinate space
This will now correctly respect the cursor hotspot.
2021-01-13 13:39:10 +11:00
Quantum
ab96f77d9e [client] wm/wayland: generate protocol files into the build dir
This avoids polluting the source tree.
2021-01-12 16:00:12 +11:00
Quantum
1f01eec3a2 [client] spice/wayland: correctly update guest cursor location 2021-01-12 15:59:49 +11:00
Quantum
24a4de6d65 [client] wm/wayload: implement keyboard grabbing 2021-01-12 15:26:42 +11:00
Geoffrey McRae
b58176fcdb [client] removed last remnents of the decoders & parsers 2021-01-12 12:42:06 +11:00
Tudor Brindus
c21f502414 [client] wm/wayland: implement grab mode for capture 2021-01-12 12:36:21 +11:00
Tudor Brindus
1040a7c168 [client] wm/wayland: don't grab keyboard
This is unimplemented for Wayland, and only has the effect of confining
the mouse.
2021-01-12 12:36:21 +11:00
Tudor Brindus
a97332025c [cmake] add option to build Wayland headers 2021-01-12 12:36:21 +11:00
Geoffrey McRae
3a29d1cf03 [client] spice: zero the error accumulators when switching grab modes 2021-01-12 11:49:27 +11:00
Geoffrey McRae
8365419262 [client] spice: use modf in cursorToInt for fractional tracking 2021-01-12 11:48:29 +11:00
Quantum
78bd41716a [client] spice: use simple custom Wayland mouse logic
The normal logic does not work due to Wayland not supporting mouse warp.
We use a simple logic that works for the desktop with 1:1 mouse patch and
require capture mode for all other cases.
2021-01-11 20:57:13 +11:00
Quantum
790c2b39ad [client] spice: set absolute position and focus state on Wayland 2021-01-11 20:57:13 +11:00