Skip to content

Commit 77c43c0

Browse files
committed
Display (Linux): prefer resolutions reported by randr mode info
1 parent 31ae7a6 commit 77c43c0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/detection/displayserver/linux/xcb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ static bool xcbRandrHandleOutput(XcbRandrData* data, xcb_randr_output_t output,
215215

216216
FFDisplayResult* item = ffdsAppendDisplay(
217217
data->result,
218-
(uint32_t) crtcInfoReply->width,
219-
(uint32_t) crtcInfoReply->height,
218+
(uint32_t) (currentMode ? currentMode->width : crtcInfoReply->width),
219+
(uint32_t) (currentMode ? currentMode->height : crtcInfoReply->height),
220220
currentMode ? (double) currentMode->dot_clock / (double) ((uint32_t) currentMode->htotal * currentMode->vtotal) : 0,
221221
(uint32_t) (crtcInfoReply->width / scaleFactor + .5),
222222
(uint32_t) (crtcInfoReply->height / scaleFactor + .5),
@@ -230,7 +230,7 @@ static bool xcbRandrHandleOutput(XcbRandrData* data, xcb_randr_output_t output,
230230
0,
231231
(uint32_t) outputInfoReply->mm_width,
232232
(uint32_t) outputInfoReply->mm_height,
233-
"xcb-randr-crtc"
233+
currentMode ? "xcb-randr-mode" : "xcb-randr-crtc"
234234
);
235235
if (item && edidLength)
236236
{

src/detection/displayserver/linux/xlib.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ static bool xrandrHandleCrtc(XrandrData* data, XRROutputInfo* output, FFstrbuf*
134134

135135
FFDisplayResult* item = ffdsAppendDisplay(
136136
data->result,
137-
(uint32_t) crtcInfo->width,
138-
(uint32_t) crtcInfo->height,
137+
(uint32_t) (currentMode ? currentMode->width : crtcInfo->width),
138+
(uint32_t) (currentMode ? currentMode->height : crtcInfo->height),
139139
currentMode ? (double) currentMode->dotClock / (double) ((uint32_t) currentMode->hTotal * currentMode->vTotal) : 0,
140140
(uint32_t) (crtcInfo->width / scaleFactor + .5),
141141
(uint32_t) (crtcInfo->height / scaleFactor + .5),
@@ -149,7 +149,7 @@ static bool xrandrHandleCrtc(XrandrData* data, XRROutputInfo* output, FFstrbuf*
149149
0,
150150
(uint32_t) output->mm_width,
151151
(uint32_t) output->mm_height,
152-
"xlib-randr-crtc"
152+
currentMode ? "xlib-randr-mode" : "xlib-randr-crtc"
153153
);
154154

155155
if (item)

0 commit comments

Comments
 (0)