mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-05 01:48:02 +02:00
xwayland/output: properly return the current emulated mode when queried
This fixes an issue with GLFW-based games failing to set the resolution
when the user request to switch back to the native display mode.
Signed-off-by: Minh Phan <phanquangminh217@gmail.com>
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
(cherry picked from commit 511d1686a6)
This commit is contained in:
parent
7d039914ff
commit
6c2c2a2437
2 changed files with 17 additions and 0 deletions
|
|
@ -266,6 +266,7 @@ xwl_output_add_emulated_mode_for_client(struct xwl_output *xwl_output,
|
|||
emulated_mode->server_output_id = xwl_output->server_output_id;
|
||||
emulated_mode->width = mode->mode.width;
|
||||
emulated_mode->height = mode->mode.height;
|
||||
emulated_mode->id = mode->mode.id;
|
||||
emulated_mode->from_vidmode = from_vidmode;
|
||||
}
|
||||
|
||||
|
|
@ -902,6 +903,20 @@ xwl_randr_crtc_set(ScreenPtr pScreen,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
xwl_randr_crtc_get(ScreenPtr pScreen,
|
||||
RRCrtcPtr crtc,
|
||||
xRRGetCrtcInfoReply *rep)
|
||||
{
|
||||
struct xwl_output *xwl_output = crtc->devPrivate;
|
||||
|
||||
struct xwl_emulated_mode *mode = xwl_output_get_emulated_mode_for_client(
|
||||
xwl_output, GetCurrentClient());
|
||||
|
||||
if (mode)
|
||||
rep->mode = mode->id;
|
||||
}
|
||||
|
||||
static Bool
|
||||
xwl_randr_crtc_set_gamma(ScreenPtr pScreen, RRCrtcPtr crtc)
|
||||
{
|
||||
|
|
@ -962,6 +977,7 @@ xwl_screen_init_output(struct xwl_screen *xwl_screen)
|
|||
#if RANDR_12_INTERFACE
|
||||
rp->rrScreenSetSize = xwl_randr_screen_set_size;
|
||||
rp->rrCrtcSet = xwl_randr_crtc_set;
|
||||
rp->rrCrtcGet = xwl_randr_crtc_get;
|
||||
rp->rrCrtcSetGamma = xwl_randr_crtc_set_gamma;
|
||||
rp->rrCrtcGetGamma = xwl_randr_crtc_get_gamma;
|
||||
rp->rrOutputSetProperty = xwl_randr_output_set_property;
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ struct xwl_emulated_mode {
|
|||
uint32_t server_output_id;
|
||||
int32_t width;
|
||||
int32_t height;
|
||||
RRMode id;
|
||||
Bool from_vidmode;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue