Merge branch 'wip/fix-randr-race-3-24' into 'gtk-3-24'

x11: Trap error when getting CRTC info [3.24]

See merge request GNOME/gtk!4168
This commit is contained in:
Emmanuele Bassi 2021-11-24 16:48:39 +00:00
commit 34038aaf7d

View File

@ -568,9 +568,18 @@ init_randr15 (GdkScreen *screen, gboolean *changed)
if (output_info->crtc)
{
XRRCrtcInfo *crtc = XRRGetCrtcInfo (x11_screen->xdisplay, resources, output_info->crtc);
XRRCrtcInfo *crtc;
int j;
gdk_x11_display_error_trap_push (display);
crtc = XRRGetCrtcInfo (x11_screen->xdisplay, resources,
output_info->crtc);
if (gdk_x11_display_error_trap_pop (display))
{
XRRFreeOutputInfo (output_info);
continue;
}
for (j = 0; j < resources->nmode; j++)
{
XRRModeInfo *xmode = &resources->modes[j];