mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Fix usage of sway_assert
This commit is contained in:
		
							parent
							
								
									820a8c9c2d
								
							
						
					
					
						commit
						6e6b0decd9
					
				
					 1 changed files with 7 additions and 3 deletions
				
			
		| 
						 | 
					@ -167,7 +167,9 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec,
 | 
				
			||||||
			// If pointed container is in nested containers which are
 | 
								// If pointed container is in nested containers which are
 | 
				
			||||||
			// inside tabbed/stacked layout we should skip them
 | 
								// inside tabbed/stacked layout we should skip them
 | 
				
			||||||
			bool do_mouse_focus = true;
 | 
								bool do_mouse_focus = true;
 | 
				
			||||||
			sway_assert(c->type == C_VIEW, "pointed container is not a view");
 | 
								if(!sway_assert(c->type == C_VIEW, "pointed container is not a view")) {
 | 
				
			||||||
 | 
									return;
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
			bool is_visible = view_is_visible(c->sway_view);
 | 
								bool is_visible = view_is_visible(c->sway_view);
 | 
				
			||||||
			struct sway_container *p = c->parent;
 | 
								struct sway_container *p = c->parent;
 | 
				
			||||||
			while (p) {
 | 
								while (p) {
 | 
				
			||||||
| 
						 | 
					@ -181,8 +183,10 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec,
 | 
				
			||||||
			if (!do_mouse_focus) {
 | 
								if (!do_mouse_focus) {
 | 
				
			||||||
				struct sway_container *next_focus = seat_get_focus_inactive(
 | 
									struct sway_container *next_focus = seat_get_focus_inactive(
 | 
				
			||||||
						cursor->seat, p);
 | 
											cursor->seat, p);
 | 
				
			||||||
				sway_assert(next_focus->type == C_VIEW,
 | 
									if(!sway_assert(next_focus->type == C_VIEW,
 | 
				
			||||||
							"focus inactive container is not a view");
 | 
												"focus inactive container is not a view")) {
 | 
				
			||||||
 | 
										return;
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
				if (next_focus && view_is_visible(next_focus->sway_view)) {
 | 
									if (next_focus && view_is_visible(next_focus->sway_view)) {
 | 
				
			||||||
					seat_set_focus_warp(cursor->seat, next_focus, false);
 | 
										seat_set_focus_warp(cursor->seat, next_focus, false);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue