mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	Remove input.last_active_view
This commit is contained in:
		
							parent
							
								
									4bee96bd30
								
							
						
					
					
						commit
						315c01ba0f
					
				
					 4 changed files with 5 additions and 7 deletions
				
			
		| 
						 | 
					@ -95,7 +95,7 @@ struct roots_input {
 | 
				
			||||||
	struct wl_client *cursor_client;
 | 
						struct wl_client *cursor_client;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	enum roots_cursor_mode mode;
 | 
						enum roots_cursor_mode mode;
 | 
				
			||||||
	struct roots_view *active_view, *last_active_view;
 | 
						struct roots_view *active_view;
 | 
				
			||||||
	int offs_x, offs_y;
 | 
						int offs_x, offs_y;
 | 
				
			||||||
	int view_x, view_y, view_width, view_height;
 | 
						int view_x, view_y, view_width, view_height;
 | 
				
			||||||
	float view_rotation;
 | 
						float view_rotation;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -172,7 +172,6 @@ void set_view_focus(struct roots_input *input, struct roots_desktop *desktop,
 | 
				
			||||||
	if (!view) {
 | 
						if (!view) {
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	input->last_active_view = view;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	size_t index = 0;
 | 
						size_t index = 0;
 | 
				
			||||||
	for (size_t i = 0; i < desktop->views->length; ++i) {
 | 
						for (size_t i = 0; i < desktop->views->length; ++i) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -24,9 +24,6 @@ void view_destroy(struct roots_view *view) {
 | 
				
			||||||
		input->active_view = NULL;
 | 
							input->active_view = NULL;
 | 
				
			||||||
		input->mode = ROOTS_CURSOR_PASSTHROUGH;
 | 
							input->mode = ROOTS_CURSOR_PASSTHROUGH;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (input->last_active_view == view) {
 | 
					 | 
				
			||||||
		input->last_active_view = NULL;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for (size_t i = 0; i < desktop->views->length; ++i) {
 | 
						for (size_t i = 0; i < desktop->views->length; ++i) {
 | 
				
			||||||
		struct roots_view *_view = desktop->views->items[i];
 | 
							struct roots_view *_view = desktop->views->items[i];
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -29,8 +29,10 @@ static void keyboard_binding_execute(struct roots_keyboard *keyboard,
 | 
				
			||||||
	if (strcmp(command, "exit") == 0) {
 | 
						if (strcmp(command, "exit") == 0) {
 | 
				
			||||||
		wl_display_terminate(server->wl_display);
 | 
							wl_display_terminate(server->wl_display);
 | 
				
			||||||
	} else if (strcmp(command, "close") == 0) {
 | 
						} else if (strcmp(command, "close") == 0) {
 | 
				
			||||||
		if (keyboard->input->last_active_view != NULL) {
 | 
							if (server->desktop->views->length > 0) {
 | 
				
			||||||
			view_close(keyboard->input->last_active_view);
 | 
								struct roots_view *view =
 | 
				
			||||||
 | 
									server->desktop->views->items[server->desktop->views->length-1];
 | 
				
			||||||
 | 
								view_close(view);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} else if (strcmp(command, "next_window") == 0) {
 | 
						} else if (strcmp(command, "next_window") == 0) {
 | 
				
			||||||
		if (server->desktop->views->length > 0) {
 | 
							if (server->desktop->views->length > 0) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue