Skip to content
This repository has been archived by the owner on Dec 2, 2021. It is now read-only.

Commit

Permalink
Use correct versions when binding globals
Browse files Browse the repository at this point in the history
Changes to protocols aren't forward-compatible. It's not possible to use
version n+1 when a client has been designed to work with version n. For
instance in wlr-screencopy v5 a new event has been added. Binding to
version 5 without upgrading the client leads to libwayland errors
because libwayland doesn't know how to handle the event.

The client needs to maintain its own version requirements.

Closes: https://github.com/cyclopsian/wdisplays/issues/18
  • Loading branch information
emersion committed Jul 27, 2020
1 parent dd7e1e2 commit 5198a9c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/outputs.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,20 +534,20 @@ static void registry_handle_global(void *data, struct wl_registry *registry,

if (strcmp(interface, zwlr_output_manager_v1_interface.name) == 0) {
state->output_manager = wl_registry_bind(registry, name,
&zwlr_output_manager_v1_interface, version);
&zwlr_output_manager_v1_interface, 1);
zwlr_output_manager_v1_add_listener(state->output_manager,
&output_manager_listener, state);
} else if (strcmp(interface, zxdg_output_manager_v1_interface.name) == 0) {
state->xdg_output_manager = wl_registry_bind(registry, name,
&zxdg_output_manager_v1_interface, version);
&zxdg_output_manager_v1_interface, 2);
} else if(strcmp(interface, zwlr_screencopy_manager_v1_interface.name) == 0) {
state->copy_manager = wl_registry_bind(registry, name,
&zwlr_screencopy_manager_v1_interface, version);
&zwlr_screencopy_manager_v1_interface, 1);
} else if(strcmp(interface, zwlr_layer_shell_v1_interface.name) == 0) {
state->layer_shell = wl_registry_bind(registry, name,
&zwlr_layer_shell_v1_interface, version);
&zwlr_layer_shell_v1_interface, 1);
} else if(strcmp(interface, wl_shm_interface.name) == 0) {
state->shm = wl_registry_bind(registry, name, &wl_shm_interface, version);
state->shm = wl_registry_bind(registry, name, &wl_shm_interface, 1);
}
}

Expand Down

0 comments on commit 5198a9c

Please sign in to comment.