gdk/x11: don't select RANDR events if the extension is missing
Prevents an Xlib warning on Xnest, or Xorg with xinerama, or other
non-RANDR-capable xserver. Reintroduce a have_randr12 field in
GdkDisplayX11 to avoid having to call XRRQuery{Extension,Version} twice,
and don't select randr 1.2 events if that's false.
https://bugzilla.gnome.org/show_bug.cgi?id=634711
Signed-off-by: Julien Cristau <jcristau@debian.org>
This commit is contained in:
committed by
Matthias Clasen
parent
317f8baf60
commit
d211c8af6b
@ -1220,6 +1220,7 @@ _gdk_x11_display_open (const gchar *display_name)
|
||||
_gdk_x11_precache_atoms (display, precache_atoms, G_N_ELEMENTS (precache_atoms));
|
||||
|
||||
/* RandR must be initialized before we initialize the screens */
|
||||
display_x11->have_randr12 = FALSE;
|
||||
display_x11->have_randr13 = FALSE;
|
||||
#ifdef HAVE_RANDR
|
||||
if (XRRQueryExtension (display_x11->xdisplay,
|
||||
@ -1229,8 +1230,11 @@ _gdk_x11_display_open (const gchar *display_name)
|
||||
|
||||
XRRQueryVersion (display_x11->xdisplay, &major, &minor);
|
||||
|
||||
if ((major == 1 && minor >= 3) || major > 1)
|
||||
display_x11->have_randr13 = TRUE;
|
||||
if ((major == 1 && minor >= 2) || major > 1) {
|
||||
display_x11->have_randr12 = TRUE;
|
||||
if (minor >= 3 || major > 1)
|
||||
display_x11->have_randr13 = TRUE;
|
||||
}
|
||||
|
||||
gdk_x11_register_standard_event_type (display, display_x11->xrandr_event_base, RRNumberEvents);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user