mirror of https://github.com/snes9xgit/snes9x.git
wayland: make xrandr query conditional
This commit is contained in:
parent
62f3761aa6
commit
549e98e5e7
|
@ -1589,33 +1589,23 @@ S9xQueryDrivers (void)
|
||||||
|
|
||||||
gui_config->allow_xrandr = 0;
|
gui_config->allow_xrandr = 0;
|
||||||
|
|
||||||
int error_base_p, event_base_p;
|
#ifdef GDK_WINDOWING_X11
|
||||||
int major_version, minor_version;
|
GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (top_level->get_window()));
|
||||||
Display *dpy = gdk_x11_display_get_xdisplay (gtk_widget_get_display (GTK_WIDGET (top_level->get_window())));
|
if (GDK_IS_X11_DISPLAY (display))
|
||||||
Window xid = GDK_COMPAT_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (top_level->get_window())));
|
{
|
||||||
|
int error_base_p, event_base_p;
|
||||||
|
int major_version, minor_version;
|
||||||
|
Display *dpy = gdk_x11_display_get_xdisplay (gtk_widget_get_display (GTK_WIDGET (top_level->get_window())));
|
||||||
|
Window xid = gdk_x11_window_get_xid (gtk_widget_get_window (GTK_WIDGET (top_level->get_window())));
|
||||||
|
|
||||||
if (!XRRQueryExtension (dpy, &event_base_p, &error_base_p))
|
gui_config->allow_xrandr = 1;
|
||||||
{
|
gui_config->xrr_screen_resources = XRRGetScreenResourcesCurrent (dpy, xid);
|
||||||
gui_config->change_display_resolution = FALSE;
|
gui_config->xrr_crtc_info = XRRGetCrtcInfo (dpy,
|
||||||
return;
|
gui_config->xrr_screen_resources,
|
||||||
}
|
gui_config->xrr_screen_resources->crtcs[0]);
|
||||||
if (!XRRQueryVersion (dpy, &major_version, &minor_version))
|
|
||||||
{
|
|
||||||
gui_config->change_display_resolution = FALSE;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (minor_version < 3)
|
|
||||||
{
|
|
||||||
gui_config->change_display_resolution = FALSE;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gui_config->allow_xrandr = 1;
|
#endif
|
||||||
gui_config->xrr_screen_resources = XRRGetScreenResourcesCurrent (dpy, xid);
|
|
||||||
gui_config->xrr_crtc_info = XRRGetCrtcInfo (dpy,
|
|
||||||
gui_config->xrr_screen_resources,
|
|
||||||
gui_config->xrr_screen_resources->crtcs[0]);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue