mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 13:41:07 +00:00
Merge branch 'trap-bad-rr-errors' into 'main'
x11: Trap XRandr errors when getting outputs during init and update See merge request GNOME/gtk!6046
This commit is contained in:
commit
c8c895d160
@ -685,8 +685,13 @@ init_randr13 (GdkX11Screen *x11_screen)
|
||||
for (i = 0; i < resources->noutput; ++i)
|
||||
{
|
||||
RROutput output = resources->outputs[i];
|
||||
XRROutputInfo *output_info =
|
||||
XRRGetOutputInfo (x11_screen->xdisplay, resources, output);
|
||||
XRROutputInfo *output_info;
|
||||
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
output_info = XRRGetOutputInfo (x11_screen->xdisplay, resources, output);
|
||||
|
||||
if (gdk_x11_display_error_trap_pop (display))
|
||||
continue;
|
||||
|
||||
if (output_info->connection == RR_Disconnected)
|
||||
{
|
||||
@ -697,13 +702,22 @@ init_randr13 (GdkX11Screen *x11_screen)
|
||||
if (output_info->crtc)
|
||||
{
|
||||
GdkX11Monitor *monitor;
|
||||
XRRCrtcInfo *crtc = XRRGetCrtcInfo (x11_screen->xdisplay, resources, output_info->crtc);
|
||||
XRRCrtcInfo *crtc;
|
||||
char *name;
|
||||
GdkRectangle geometry;
|
||||
GdkRectangle newgeo;
|
||||
int j;
|
||||
int refresh_rate = 0;
|
||||
|
||||
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];
|
||||
@ -775,8 +789,10 @@ init_randr13 (GdkX11Screen *x11_screen)
|
||||
}
|
||||
|
||||
x11_display->primary_monitor = 0;
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
primary_output = XRRGetOutputPrimary (x11_screen->xdisplay,
|
||||
x11_screen->xroot_window);
|
||||
gdk_x11_display_error_trap_pop_ignored (display);
|
||||
|
||||
for (i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (x11_display->monitors)); i++)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user