mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	Schedule frame callback in the redraw handler
This commit is contained in:
		
							parent
							
								
									7c221d278a
								
							
						
					
					
						commit
						5c4056e049
					
				
					 1 changed files with 7 additions and 5 deletions
				
			
		| 
						 | 
					@ -25,6 +25,7 @@
 | 
				
			||||||
#include <stdlib.h>
 | 
					#include <stdlib.h>
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
#include <cairo.h>
 | 
					#include <cairo.h>
 | 
				
			||||||
 | 
					#include <math.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "wayland-util.h"
 | 
					#include "wayland-util.h"
 | 
				
			||||||
#include "wayland-client.h"
 | 
					#include "wayland-client.h"
 | 
				
			||||||
| 
						 | 
					@ -73,6 +74,11 @@ resizor_draw(struct resizor *resizor)
 | 
				
			||||||
	cairo_surface_destroy(surface);
 | 
						cairo_surface_destroy(surface);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	window_flush(resizor->window);
 | 
						window_flush(resizor->window);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (fabs(resizor->height.previous - resizor->height.target) < 0.1) {
 | 
				
			||||||
 | 
							wl_display_frame_callback(display_get_display(resizor->display),
 | 
				
			||||||
 | 
										  frame_callback, resizor);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					static void
 | 
				
			||||||
| 
						 | 
					@ -120,11 +126,7 @@ frame_callback(void *data, uint32_t time)
 | 
				
			||||||
	window_set_child_size(resizor->window,
 | 
						window_set_child_size(resizor->window,
 | 
				
			||||||
			      &resizor->child_allocation);
 | 
								      &resizor->child_allocation);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ((int) (height + 0.5) != resizor->height.target) {
 | 
					 | 
				
			||||||
	window_schedule_redraw(resizor->window);
 | 
						window_schedule_redraw(resizor->window);
 | 
				
			||||||
		wl_display_frame_callback(display_get_display(resizor->display),
 | 
					 | 
				
			||||||
					  frame_callback, resizor);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					static void
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue