Merge pull request #176 from acrisci/bug/init-desktop-before-input
rootston: create desktop before input
This commit is contained in:
		
						commit
						edf5e6211d
					
				| 
						 | 
					@ -78,11 +78,6 @@ struct roots_desktop *desktop_create(struct roots_server *server,
 | 
				
			||||||
	desktop->compositor = wlr_compositor_create(
 | 
						desktop->compositor = wlr_compositor_create(
 | 
				
			||||||
			server->wl_display, server->renderer);
 | 
								server->wl_display, server->renderer);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	wlr_cursor_attach_output_layout(server->input->cursor, desktop->layout);
 | 
					 | 
				
			||||||
	wlr_cursor_map_to_region(server->input->cursor, config->cursor.mapped_box);
 | 
					 | 
				
			||||||
	cursor_load_config(config, server->input->cursor,
 | 
					 | 
				
			||||||
			server->input, desktop);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	desktop->xdg_shell_v6 = wlr_xdg_shell_v6_create(server->wl_display);
 | 
						desktop->xdg_shell_v6 = wlr_xdg_shell_v6_create(server->wl_display);
 | 
				
			||||||
	wl_signal_add(&desktop->xdg_shell_v6->events.new_surface,
 | 
						wl_signal_add(&desktop->xdg_shell_v6->events.new_surface,
 | 
				
			||||||
		&desktop->xdg_shell_v6_surface);
 | 
							&desktop->xdg_shell_v6_surface);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -71,6 +71,8 @@ static void input_remove_notify(struct wl_listener *listener, void *data) {
 | 
				
			||||||
struct roots_input *input_create(struct roots_server *server,
 | 
					struct roots_input *input_create(struct roots_server *server,
 | 
				
			||||||
		struct roots_config *config) {
 | 
							struct roots_config *config) {
 | 
				
			||||||
	wlr_log(L_DEBUG, "Initializing roots input");
 | 
						wlr_log(L_DEBUG, "Initializing roots input");
 | 
				
			||||||
 | 
						assert(server->desktop);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct roots_input *input = calloc(1, sizeof(struct roots_input));
 | 
						struct roots_input *input = calloc(1, sizeof(struct roots_input));
 | 
				
			||||||
	assert(input);
 | 
						assert(input);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -104,6 +106,11 @@ struct roots_input *input_create(struct roots_server *server,
 | 
				
			||||||
	cursor_initialize(input);
 | 
						cursor_initialize(input);
 | 
				
			||||||
	wlr_cursor_set_xcursor(input->cursor, input->xcursor);
 | 
						wlr_cursor_set_xcursor(input->cursor, input->xcursor);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						wlr_cursor_attach_output_layout(input->cursor, server->desktop->layout);
 | 
				
			||||||
 | 
						wlr_cursor_map_to_region(input->cursor, config->cursor.mapped_box);
 | 
				
			||||||
 | 
						cursor_load_config(config, input->cursor,
 | 
				
			||||||
 | 
							input, server->desktop);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return input;
 | 
						return input;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -20,8 +20,8 @@ int main(int argc, char **argv) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	assert(server.renderer = wlr_gles2_renderer_create(server.backend));
 | 
						assert(server.renderer = wlr_gles2_renderer_create(server.backend));
 | 
				
			||||||
	wl_display_init_shm(server.wl_display);
 | 
						wl_display_init_shm(server.wl_display);
 | 
				
			||||||
	server.input = input_create(&server, server.config);
 | 
					 | 
				
			||||||
	server.desktop = desktop_create(&server, server.config);
 | 
						server.desktop = desktop_create(&server, server.config);
 | 
				
			||||||
 | 
						server.input = input_create(&server, server.config);
 | 
				
			||||||
	server.data_device_manager = wlr_data_device_manager_create(
 | 
						server.data_device_manager = wlr_data_device_manager_create(
 | 
				
			||||||
			server.wl_display);
 | 
								server.wl_display);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue