randr: Add "RANDR Emulation" property
When RANDR is emulated as with Xwayland, the actual output configuration does not change as RANDR is emulated using viewports. As a result, changes to the CRTC may be skipped, resulting in the configuration being (wrongly) assumed to be unchanged. Add a new output property "RANDR Emulation" that the DDX can set to force RRCrtcSet() to reconfigure the CRTC regardless of the change. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
		
							parent
							
								
									972603845e
								
							
						
					
					
						commit
						0904421f57
					
				|  | @ -709,6 +709,25 @@ rrCheckPixmapBounding(ScreenPtr pScreen, | ||||||
|     return TRUE; |     return TRUE; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | #define XRANDR_EMULATION_PROP "RANDR Emulation" | ||||||
|  | static Bool | ||||||
|  | rrCheckEmulated(RROutputPtr output) | ||||||
|  | { | ||||||
|  |     const char *emulStr = XRANDR_EMULATION_PROP; | ||||||
|  |     Atom emulProp; | ||||||
|  |     RRPropertyValuePtr val; | ||||||
|  | 
 | ||||||
|  |     emulProp = MakeAtom(emulStr, strlen(emulStr), FALSE); | ||||||
|  |     if (emulProp == None) | ||||||
|  |         return FALSE; | ||||||
|  | 
 | ||||||
|  |     val = RRGetOutputProperty(output, emulProp, TRUE); | ||||||
|  |     if (val && val->data) | ||||||
|  |         return !!val->data; | ||||||
|  | 
 | ||||||
|  |     return FALSE; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| /*
 | /*
 | ||||||
|  * Request that the Crtc be reconfigured |  * Request that the Crtc be reconfigured | ||||||
|  */ |  */ | ||||||
|  | @ -728,9 +747,11 @@ RRCrtcSet(RRCrtcPtr crtc, | ||||||
| 
 | 
 | ||||||
|     crtcChanged = FALSE; |     crtcChanged = FALSE; | ||||||
|     for (o = 0; o < numOutputs; o++) { |     for (o = 0; o < numOutputs; o++) { | ||||||
|         if (outputs[o] && outputs[o]->crtc != crtc) { |         if (outputs[o]) { | ||||||
|             crtcChanged = TRUE; |             if (rrCheckEmulated(outputs[o]) || (outputs[o]->crtc != crtc)) { | ||||||
|             break; |                 crtcChanged = TRUE; | ||||||
|  |                 break; | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue