Remove interface version checks

This commit is contained in:
emersion 2017-10-22 11:18:27 +02:00
parent 018cd98620
commit 4952a633ca
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
8 changed files with 8 additions and 46 deletions

View File

@ -53,12 +53,7 @@ static void wl_compositor_bind(struct wl_client *wl_client, void *_compositor,
uint32_t version, uint32_t id) { uint32_t version, uint32_t id) {
struct wlr_compositor *compositor = _compositor; struct wlr_compositor *compositor = _compositor;
assert(wl_client && compositor); assert(wl_client && compositor);
if (version > 4) {
wlr_log(L_ERROR, "Client requested unsupported wl_compositor version, "
"disconnecting");
wl_client_destroy(wl_client);
return;
}
struct wl_resource *wl_resource = struct wl_resource *wl_resource =
wl_resource_create(wl_client, &wl_compositor_interface, version, id); wl_resource_create(wl_client, &wl_compositor_interface, version, id);
wl_resource_set_implementation(wl_resource, &wl_compositor_impl, wl_resource_set_implementation(wl_resource, &wl_compositor_impl,

View File

@ -133,12 +133,7 @@ static void data_device_manager_bind(struct wl_client *client, void *data,
uint32_t version, uint32_t id) { uint32_t version, uint32_t id) {
struct wlr_data_device_manager *manager = data; struct wlr_data_device_manager *manager = data;
assert(client && manager); assert(client && manager);
if (version > 3) {
wlr_log(L_ERROR, "Client requested unsupported data_device_manager "
"version, disconnecting");
wl_client_destroy(client);
return;
}
struct wl_resource *resource = wl_resource_create( struct wl_resource *resource = wl_resource_create(
client, &wl_data_device_manager_interface, version, id); client, &wl_data_device_manager_interface, version, id);
if (!resource) { if (!resource) {

View File

@ -69,11 +69,7 @@ static void gamma_control_manager_bind(struct wl_client *wl_client,
void *_gamma_control_manager, uint32_t version, uint32_t id) { void *_gamma_control_manager, uint32_t version, uint32_t id) {
struct wlr_gamma_control_manager *gamma_control_manager = _gamma_control_manager; struct wlr_gamma_control_manager *gamma_control_manager = _gamma_control_manager;
assert(wl_client && gamma_control_manager); assert(wl_client && gamma_control_manager);
if (version > 1) {
wlr_log(L_ERROR, "Client requested unsupported gamma_control version, disconnecting");
wl_client_destroy(wl_client);
return;
}
struct wl_resource *wl_resource = wl_resource_create( struct wl_resource *wl_resource = wl_resource_create(
wl_client, &gamma_control_manager_interface, version, id); wl_client, &gamma_control_manager_interface, version, id);
wl_resource_set_implementation(wl_resource, &gamma_control_manager_impl, wl_resource_set_implementation(wl_resource, &gamma_control_manager_impl,

View File

@ -75,11 +75,7 @@ static void wl_output_bind(struct wl_client *wl_client, void *_wlr_output,
uint32_t version, uint32_t id) { uint32_t version, uint32_t id) {
struct wlr_output *wlr_output = _wlr_output; struct wlr_output *wlr_output = _wlr_output;
assert(wl_client && wlr_output); assert(wl_client && wlr_output);
if (version > 3) {
wlr_log(L_ERROR, "Client requested unsupported wl_output version, disconnecting");
wl_client_destroy(wl_client);
return;
}
struct wl_resource *wl_resource = wl_resource_create( struct wl_resource *wl_resource = wl_resource_create(
wl_client, &wl_output_interface, version, id); wl_client, &wl_output_interface, version, id);
wl_resource_set_implementation(wl_resource, &wl_output_impl, wl_resource_set_implementation(wl_resource, &wl_output_impl,

View File

@ -121,12 +121,7 @@ static void screenshooter_bind(struct wl_client *wl_client,
void *_screenshooter, uint32_t version, uint32_t id) { void *_screenshooter, uint32_t version, uint32_t id) {
struct wlr_screenshooter *screenshooter = _screenshooter; struct wlr_screenshooter *screenshooter = _screenshooter;
assert(wl_client && screenshooter); assert(wl_client && screenshooter);
if (version > 1) {
wlr_log(L_ERROR, "Client requested unsupported screenshooter version,"
"disconnecting");
wl_client_destroy(wl_client);
return;
}
struct wl_resource *wl_resource = wl_resource_create(wl_client, struct wl_resource *wl_resource = wl_resource_create(wl_client,
&orbital_screenshooter_interface, version, id); &orbital_screenshooter_interface, version, id);
wl_resource_set_implementation(wl_resource, &screenshooter_impl, wl_resource_set_implementation(wl_resource, &screenshooter_impl,

View File

@ -175,12 +175,7 @@ static void wl_seat_bind(struct wl_client *wl_client, void *_wlr_seat,
uint32_t version, uint32_t id) { uint32_t version, uint32_t id) {
struct wlr_seat *wlr_seat = _wlr_seat; struct wlr_seat *wlr_seat = _wlr_seat;
assert(wl_client && wlr_seat); assert(wl_client && wlr_seat);
if (version > 6) {
wlr_log(L_ERROR,
"Client requested unsupported wl_seat version, disconnecting");
wl_client_destroy(wl_client);
return;
}
struct wlr_seat_handle *handle = calloc(1, sizeof(struct wlr_seat_handle)); struct wlr_seat_handle *handle = calloc(1, sizeof(struct wlr_seat_handle));
handle->wl_resource = wl_resource_create( handle->wl_resource = wl_resource_create(
wl_client, &wl_seat_interface, version, id); wl_client, &wl_seat_interface, version, id);

View File

@ -580,12 +580,7 @@ static void shell_bind(struct wl_client *wl_client, void *_wl_shell,
uint32_t version, uint32_t id) { uint32_t version, uint32_t id) {
struct wlr_wl_shell *wl_shell = _wl_shell; struct wlr_wl_shell *wl_shell = _wl_shell;
assert(wl_client && wl_shell); assert(wl_client && wl_shell);
if (version > 1) {
wlr_log(L_ERROR,
"Client requested unsupported wl_shell version, disconnecting");
wl_client_destroy(wl_client);
return;
}
struct wl_resource *wl_resource = wl_resource_create(wl_client, struct wl_resource *wl_resource = wl_resource_create(wl_client,
&wl_shell_interface, version, id); &wl_shell_interface, version, id);
wl_resource_set_implementation(wl_resource, &shell_impl, wl_shell, wl_resource_set_implementation(wl_resource, &shell_impl, wl_shell,

View File

@ -1201,12 +1201,7 @@ static void xdg_shell_bind(struct wl_client *wl_client, void *_xdg_shell,
uint32_t version, uint32_t id) { uint32_t version, uint32_t id) {
struct wlr_xdg_shell_v6 *xdg_shell = _xdg_shell; struct wlr_xdg_shell_v6 *xdg_shell = _xdg_shell;
assert(wl_client && xdg_shell); assert(wl_client && xdg_shell);
if (version > 1) {
wlr_log(L_ERROR,
"Client requested unsupported xdg_shell_v6 version, disconnecting");
wl_client_destroy(wl_client);
return;
}
struct wlr_xdg_client_v6 *client = struct wlr_xdg_client_v6 *client =
calloc(1, sizeof(struct wlr_xdg_client_v6)); calloc(1, sizeof(struct wlr_xdg_client_v6));
if (client == NULL) { if (client == NULL) {