mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-09 20:24:14 +00:00
[client] wayland: fail gracefully when interfaces are too old
Before, we just attempt to bind, causing an obscure Wayland error. This commit checks the interface versions and print better error messages.
This commit is contained in:
@@ -77,12 +77,18 @@ void waylandOutputFree(void)
|
||||
}
|
||||
}
|
||||
|
||||
void waylandOutputBind(uint32_t name)
|
||||
void waylandOutputBind(uint32_t name, uint32_t version)
|
||||
{
|
||||
struct WaylandOutput * node = malloc(sizeof(struct WaylandOutput));
|
||||
if (!node)
|
||||
return;
|
||||
|
||||
if (version < 3)
|
||||
{
|
||||
DEBUG_WARN("wl_output version too old: expected 3, got %d", version);
|
||||
return;
|
||||
}
|
||||
|
||||
node->name = name;
|
||||
node->scale = 0;
|
||||
node->output = wl_registry_bind(wlWm.registry, name,
|
||||
|
Reference in New Issue
Block a user