Implement xwayland idle fix differently
This commit is contained in:
		
							parent
							
								
									af10f6f8cd
								
							
						
					
					
						commit
						5a20d463b5
					
				| @ -5,17 +5,11 @@ | |||||||
| #include "x11/screen.h" | #include "x11/screen.h" | ||||||
| #include "wayland/wl.h" | #include "wayland/wl.h" | ||||||
| 
 | 
 | ||||||
| bool running_xwayland; |  | ||||||
| 
 |  | ||||||
| const bool is_running_wayland(void) { | const bool is_running_wayland(void) { | ||||||
|         char* wayland_display = getenv("WAYLAND_DISPLAY"); |         char* wayland_display = getenv("WAYLAND_DISPLAY"); | ||||||
|         return !(wayland_display == NULL); |         return !(wayland_display == NULL); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| const bool is_running_xwayland(void) { |  | ||||||
|         return running_xwayland; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| const struct output output_x11 = { | const struct output output_x11 = { | ||||||
|         x_setup, |         x_setup, | ||||||
|         x_free, |         x_free, | ||||||
| @ -58,7 +52,6 @@ const struct output output_wl = { | |||||||
| 
 | 
 | ||||||
| const struct output* output_create(bool force_xwayland) | const struct output* output_create(bool force_xwayland) | ||||||
| { | { | ||||||
|         running_xwayland = force_xwayland; |  | ||||||
|         if (!force_xwayland && is_running_wayland()) { |         if (!force_xwayland && is_running_wayland()) { | ||||||
|                 LOG_I("Using Wayland output"); |                 LOG_I("Using Wayland output"); | ||||||
|                 return &output_wl; |                 return &output_wl; | ||||||
|  | |||||||
| @ -143,10 +143,6 @@ static bool queues_notification_is_finished(struct notification *n, struct dunst | |||||||
| 
 | 
 | ||||||
|         bool is_idle = status.fullscreen ? false : status.idle; |         bool is_idle = status.fullscreen ? false : status.idle; | ||||||
| 
 | 
 | ||||||
|         /* There is no way to detect if the user is idle
 |  | ||||||
|          * on xwayland, so assume they aren't */ |  | ||||||
|         if (is_running_xwayland()) is_idle = false; |  | ||||||
| 
 |  | ||||||
|         /* don't timeout when user is idle */ |         /* don't timeout when user is idle */ | ||||||
|         if (is_idle && !n->transient) { |         if (is_idle && !n->transient) { | ||||||
|                 n->start = time_monotonic_now(); |                 n->start = time_monotonic_now(); | ||||||
|  | |||||||
| @ -215,6 +215,12 @@ void load_settings(char *cmdline_config_path) | |||||||
|                 "Don't timeout notifications if user is longer idle than threshold" |                 "Don't timeout notifications if user is longer idle than threshold" | ||||||
|         ); |         ); | ||||||
| 
 | 
 | ||||||
|  |         if (settings.force_xwayland) { | ||||||
|  |                 /* There is no way to detect if the user is idle
 | ||||||
|  |                  * on xwayland, so turn this feature off */ | ||||||
|  |                 settings.idle_threshold = 0; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         settings.monitor = option_get_int( |         settings.monitor = option_get_int( | ||||||
|                 "global", |                 "global", | ||||||
|                 "monitor", "-mon/-monitor", defaults.monitor, |                 "monitor", "-mon/-monitor", defaults.monitor, | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 fwsmit
						fwsmit