mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-12-26 19:39:49 +01:00
Merge pull request #313 from emersion/remove-interface-version-checks
Remove interface version checks
This commit is contained in:
commit
799f8b95b7
8 changed files with 8 additions and 46 deletions
|
@ -53,12 +53,7 @@ static void wl_compositor_bind(struct wl_client *wl_client, void *_compositor,
|
|||
uint32_t version, uint32_t id) {
|
||||
struct wlr_compositor *compositor = _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 =
|
||||
wl_resource_create(wl_client, &wl_compositor_interface, version, id);
|
||||
wl_resource_set_implementation(wl_resource, &wl_compositor_impl,
|
||||
|
|
|
@ -133,12 +133,7 @@ static void data_device_manager_bind(struct wl_client *client, void *data,
|
|||
uint32_t version, uint32_t id) {
|
||||
struct wlr_data_device_manager *manager = data;
|
||||
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(
|
||||
client, &wl_data_device_manager_interface, version, id);
|
||||
if (!resource) {
|
||||
|
|
|
@ -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) {
|
||||
struct wlr_gamma_control_manager *gamma_control_manager = _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(
|
||||
wl_client, &gamma_control_manager_interface, version, id);
|
||||
wl_resource_set_implementation(wl_resource, &gamma_control_manager_impl,
|
||||
|
|
|
@ -75,11 +75,7 @@ static void wl_output_bind(struct wl_client *wl_client, void *_wlr_output,
|
|||
uint32_t version, uint32_t id) {
|
||||
struct wlr_output *wlr_output = _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(
|
||||
wl_client, &wl_output_interface, version, id);
|
||||
wl_resource_set_implementation(wl_resource, &wl_output_impl,
|
||||
|
|
|
@ -121,12 +121,7 @@ static void screenshooter_bind(struct wl_client *wl_client,
|
|||
void *_screenshooter, uint32_t version, uint32_t id) {
|
||||
struct wlr_screenshooter *screenshooter = _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,
|
||||
&orbital_screenshooter_interface, version, id);
|
||||
wl_resource_set_implementation(wl_resource, &screenshooter_impl,
|
||||
|
|
|
@ -175,12 +175,7 @@ static void wl_seat_bind(struct wl_client *wl_client, void *_wlr_seat,
|
|||
uint32_t version, uint32_t id) {
|
||||
struct wlr_seat *wlr_seat = _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));
|
||||
handle->wl_resource = wl_resource_create(
|
||||
wl_client, &wl_seat_interface, version, id);
|
||||
|
|
|
@ -580,12 +580,7 @@ static void shell_bind(struct wl_client *wl_client, void *_wl_shell,
|
|||
uint32_t version, uint32_t id) {
|
||||
struct wlr_wl_shell *wl_shell = _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,
|
||||
&wl_shell_interface, version, id);
|
||||
wl_resource_set_implementation(wl_resource, &shell_impl, wl_shell,
|
||||
|
|
|
@ -1201,12 +1201,7 @@ static void xdg_shell_bind(struct wl_client *wl_client, void *_xdg_shell,
|
|||
uint32_t version, uint32_t id) {
|
||||
struct wlr_xdg_shell_v6 *xdg_shell = _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 =
|
||||
calloc(1, sizeof(struct wlr_xdg_client_v6));
|
||||
if (client == NULL) {
|
||||
|
|
Loading…
Reference in a new issue