wayland: Don't apply display orientation on Sailfish
Some checks are pending
Build (All) / Create test plan (push) Waiting to run
Build (All) / level1 (push) Blocked by required conditions
Build (All) / level2 (push) Blocked by required conditions

This commit is contained in:
Frank Praznik 2026-02-23 11:04:11 -05:00
parent 5f25ce9282
commit 79de30a345

View file

@ -562,6 +562,11 @@ static void display_handle_done(void *data,
SDL_VideoData *video = driverdata->videodata;
SDL_DisplayMode native_mode, desktop_mode;
SDL_VideoDisplay *dpy;
#ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
const SDL_bool has_qt_touch = video->touch != NULL;
#else
const SDL_bool has_qt_touch = SDL_FALSE;
#endif
const SDL_bool mode_emulation_enabled = SDL_GetHintBoolean(SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION, SDL_TRUE);
/*
@ -602,8 +607,10 @@ static void display_handle_done(void *data,
driverdata->height /= driverdata->scale_factor;
}
/* xdg-output dimensions are already transformed, so no need to rotate. */
if (driverdata->has_logical_size || !(driverdata->transform & WL_OUTPUT_TRANSFORM_90)) {
/* xdg-output dimensions are already transformed, so no need to rotate, and Qt touch indicates Sailfish,
* and shouldn't be rotated.
*/
if (driverdata->has_logical_size || !(driverdata->transform & WL_OUTPUT_TRANSFORM_90) || has_qt_touch) {
desktop_mode.w = driverdata->width;
desktop_mode.h = driverdata->height;
} else {
@ -625,7 +632,7 @@ static void display_handle_done(void *data,
}
/* Calculate the display DPI */
if (driverdata->transform & WL_OUTPUT_TRANSFORM_90) {
if ((driverdata->transform & WL_OUTPUT_TRANSFORM_90) && !has_qt_touch) {
driverdata->hdpi = driverdata->physical_height ? (((float)driverdata->native_height) * 25.4f / driverdata->physical_height) : 0.0f;
driverdata->vdpi = driverdata->physical_width ? (((float)driverdata->native_width) * 25.4f / driverdata->physical_width) : 0.0f;
driverdata->ddpi = SDL_ComputeDiagonalDPI(driverdata->native_height,