Remove 'else', fix formatting.

This commit is contained in:
Brandon Wright 2018-10-15 14:18:21 -05:00
parent e7f4bd63fa
commit 62f3761aa6
1 changed files with 7 additions and 4 deletions

View File

@ -1622,14 +1622,16 @@ Snes9xWindow::get_refresh_rate (void)
double refresh_rate = 0.0;
GdkDisplay *display = gtk_widget_get_display (window);
GdkWindow *gdk_window = gtk_widget_get_window (window);
#ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_DISPLAY (display))
{
Window xid = GDK_COMPAT_WINDOW_XID (gtk_widget_get_window (window));
Display *dpy = gdk_x11_display_get_xdisplay (gtk_widget_get_display (window));
refresh_rate = XRRGetExactRefreshRate (dpy, xid);
} else
Window xid = GDK_COMPAT_WINDOW_XID (gtk_widget_get_window (window));
Display *dpy = gdk_x11_display_get_xdisplay (gtk_widget_get_display (window));
refresh_rate = XRRGetExactRefreshRate (dpy, xid);
}
#endif
#ifdef GDK_WINDOWING_WAYLAND
if (GDK_IS_WAYLAND_DISPLAY (display))
{
@ -1637,6 +1639,7 @@ Snes9xWindow::get_refresh_rate (void)
refresh_rate = (double) gdk_monitor_get_refresh_rate(monitor) / 1000.0;
}
#endif
if (refresh_rate < 10.0)
{
printf ("Warning: Couldn't read refresh rate.\n");