wayland: Return the largest scale when output cannot be found
When follow mode != none dunst cannot detect what output is being used to display the notification (yet). With this commit dunst falls back to using the largest scale from any ouput. The compositor should scale the buffer down again if the scale of the output is smaller that the used scale.
This commit is contained in:
		
							parent
							
								
									e69adcefea
								
							
						
					
					
						commit
						ea531ca9ae
					
				| @ -898,10 +898,19 @@ bool wl_have_fullscreen_window(void) { | ||||
| } | ||||
| 
 | ||||
| int wl_get_scale(void) { | ||||
|         int scale = 0; | ||||
|         struct dunst_output *output = get_configured_output(); | ||||
|         if (output) | ||||
|                 return output->scale; | ||||
|         else | ||||
|                 return 1; | ||||
|         if (output) { | ||||
|                 scale = output->scale; | ||||
|         } else { | ||||
|                 // return the largest scale
 | ||||
|                 struct dunst_output *output; | ||||
|                 wl_list_for_each(output, &ctx.outputs, link) { | ||||
|                         scale = MAX(output->scale, scale); | ||||
|                 } | ||||
|         } | ||||
|         if (scale <= 0) | ||||
|                 scale = 1; | ||||
|         return scale; | ||||
| } | ||||
| /* vim: set ft=c tabstop=8 shiftwidth=8 expandtab textwidth=0: */ | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 fwsmit
						fwsmit