mirror of
				https://github.com/swaywm/sway.git
				synced 2025-10-29 05:40:18 -04:00 
			
		
		
		
	input: Move get_current_time_msec in from util
get_current_time_msec is only used in cursor.c, so we can move it in and make it static. This is primarily intended to avoid a symbol collision with wlroots, which we unfortunately do not have a good solution for yet.
This commit is contained in:
		
							parent
							
								
									f81dc1ecc0
								
							
						
					
					
						commit
						80315217f7
					
				
					 3 changed files with 7 additions and 12 deletions
				
			
		|  | @ -10,12 +10,6 @@ | ||||||
| #include "log.h" | #include "log.h" | ||||||
| #include "util.h" | #include "util.h" | ||||||
| 
 | 
 | ||||||
| uint32_t get_current_time_msec(void) { |  | ||||||
| 	struct timespec now; |  | ||||||
| 	clock_gettime(CLOCK_MONOTONIC, &now); |  | ||||||
| 	return now.tv_sec * 1000 + now.tv_nsec / 1000000; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| int wrap(int i, int max) { | int wrap(int i, int max) { | ||||||
| 	return ((i % max) + max) % max; | 	return ((i % max) + max) % max; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -29,12 +29,6 @@ enum movement_unit parse_movement_unit(const char *unit); | ||||||
| int parse_movement_amount(int argc, char **argv, | int parse_movement_amount(int argc, char **argv, | ||||||
| 		struct movement_amount *amount); | 		struct movement_amount *amount); | ||||||
| 
 | 
 | ||||||
| /**
 |  | ||||||
|  * Get the current time, in milliseconds. |  | ||||||
|  */ |  | ||||||
| 
 |  | ||||||
| uint32_t get_current_time_msec(void); |  | ||||||
| 
 |  | ||||||
| /**
 | /**
 | ||||||
|  * Wrap i into the range [0, max] |  * Wrap i into the range [0, max] | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
|  | @ -4,6 +4,7 @@ | ||||||
| #include <libevdev/libevdev.h> | #include <libevdev/libevdev.h> | ||||||
| #include <linux/input-event-codes.h> | #include <linux/input-event-codes.h> | ||||||
| #include <errno.h> | #include <errno.h> | ||||||
|  | #include <time.h> | ||||||
| #include <strings.h> | #include <strings.h> | ||||||
| #include <wlr/types/wlr_box.h> | #include <wlr/types/wlr_box.h> | ||||||
| #include <wlr/types/wlr_cursor.h> | #include <wlr/types/wlr_cursor.h> | ||||||
|  | @ -31,6 +32,12 @@ | ||||||
| #include "sway/tree/workspace.h" | #include "sway/tree/workspace.h" | ||||||
| #include "wlr-layer-shell-unstable-v1-protocol.h" | #include "wlr-layer-shell-unstable-v1-protocol.h" | ||||||
| 
 | 
 | ||||||
|  | static uint32_t get_current_time_msec(void) { | ||||||
|  | 	struct timespec now; | ||||||
|  | 	clock_gettime(CLOCK_MONOTONIC, &now); | ||||||
|  | 	return now.tv_sec * 1000 + now.tv_nsec / 1000000; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| static struct wlr_surface *layer_surface_at(struct sway_output *output, | static struct wlr_surface *layer_surface_at(struct sway_output *output, | ||||||
| 		struct wl_list *layer, double ox, double oy, double *sx, double *sy) { | 		struct wl_list *layer, double ox, double oy, double *sx, double *sy) { | ||||||
| 	struct sway_layer_surface *sway_layer; | 	struct sway_layer_surface *sway_layer; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Kenny Levinsen
						Kenny Levinsen