mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05: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) {
 | 
							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,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue