@@ -153,13 +153,13 @@ static bool xcbRandrHandleOutput(XcbRandrData* data, xcb_randr_output_t output,
153153 ffEdidGetName (edidData , name );
154154 }
155155
156- uint8_t randrEmulation = 0 ;
156+ bool randrEmulation = false ;
157157 FF_AUTO_FREE xcb_randr_get_output_property_reply_t * randrEmulationReply = xcbRandrGetProperty (data , output , "RANDR Emulation" );
158158 if (randrEmulationReply )
159159 {
160160 int len = data -> ffxcb_randr_get_output_property_data_length (randrEmulationReply );
161161 if (len >= 1 )
162- randrEmulation = data -> ffxcb_randr_get_output_property_data (randrEmulationReply )[0 ];
162+ randrEmulation = !! data -> ffxcb_randr_get_output_property_data (randrEmulationReply )[0 ];
163163 }
164164
165165 xcb_randr_get_crtc_info_cookie_t crtcInfoCookie = data -> ffxcb_randr_get_crtc_info (data -> connection , outputInfoReply -> crtc , XCB_CURRENT_TIME );
@@ -227,11 +227,21 @@ static bool xcbRandrHandleOutput(XcbRandrData* data, xcb_randr_output_t output,
227227 : (currentMode ? "xcb-randr-mode" : "xcb-randr-crtc" )
228228
229229 );
230- if (item && edidData && edidLength >= 128 )
230+ if (item )
231231 {
232- item -> hdrStatus = ffEdidGetHdrCompatible (edidData , (uint32_t ) edidLength ) ? FF_DISPLAY_HDR_STATUS_SUPPORTED : FF_DISPLAY_HDR_STATUS_UNSUPPORTED ;
233- ffEdidGetSerialAndManufactureDate (edidData , & item -> serial , & item -> manufactureYear , & item -> manufactureWeek );
232+ if (edidData && edidLength >= 128 )
233+ {
234+ item -> hdrStatus = ffEdidGetHdrCompatible (edidData , (uint32_t ) edidLength ) ? FF_DISPLAY_HDR_STATUS_SUPPORTED : FF_DISPLAY_HDR_STATUS_UNSUPPORTED ;
235+ ffEdidGetSerialAndManufactureDate (edidData , & item -> serial , & item -> manufactureYear , & item -> manufactureWeek );
236+ }
234237 item -> bitDepth = bitDepth ;
238+ if ((rotation == 90 || rotation == 180 ) && !randrEmulation )
239+ {
240+ // In XWayland mode, width / height has been swapped out of box
241+ uint32_t tmp = item -> width ;
242+ item -> width = item -> height ;
243+ item -> height = tmp ;
244+ }
235245 }
236246
237247 return !!item ;
0 commit comments