[client] wayland: gracefully degrade when protocols are unsupported

zwp_relative_pointer_manager_v1 and zwp_pointer_constraints_v1 are
supported by GNOME/KDE/sway (and most other compositors), but they are
not a required part of the protocol.

Some users also run software in one-off nested compositors like cage[0]
for an extra layer of isolation; cage, at least, does not support
pointer captures.

This commit makes Looking Glass warn when an optional protocol is
unsupported, and fail if a required one is missing. Pointer grab paths
have a new guard against the aforementioned protocols being missing.

[0]: https://github.com/Hjdskes/cage
This commit is contained in:
Tudor Brindus
2021-01-16 13:01:30 -05:00
committed by Geoffrey McRae
parent 2a69a19dbd
commit 56c80a15e6
4 changed files with 28 additions and 8 deletions

View File

@@ -81,7 +81,7 @@ static void x11CBSelectionIncr(const XPropertyEvent e);
static void x11CBSelectionNotify(const XSelectionEvent e);
static void x11CBXFixesSelectionNotify(const XFixesSelectionNotifyEvent e);
static void x11Init(SDL_SysWMinfo * info)
static bool x11Init(SDL_SysWMinfo * info)
{
memset(&x11, 0, sizeof(x11));
x11.display = info->info.x11.display;
@@ -110,6 +110,8 @@ static void x11Init(SDL_SysWMinfo * info)
(unsigned char *)&value,
1
);
return true;
}
static void x11Startup(void)