diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/xfwm-common.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/common/xfwm-common.c b/common/xfwm-common.c index ce4b30b40..d61c0ec28 100644 --- a/common/xfwm-common.c +++ b/common/xfwm-common.c @@ -22,7 +22,7 @@ #include <gdk/gdkx.h> #include "xfwm-common.h" - +#define DEFAULT_REFRESH_RATE 30 void @@ -140,11 +140,19 @@ xfwm_get_primary_refresh_rate (GdkScreen *screen) { GdkDisplay *display; GdkMonitor *monitor; + int refresh_rate; display = gdk_screen_get_display (screen); monitor = gdk_display_get_primary_monitor (display); + refresh_rate = 0; + + if (monitor) + refresh_rate = gdk_monitor_get_refresh_rate (monitor) / 1000; + + if (refresh_rate) + return refresh_rate; - return gdk_monitor_get_refresh_rate (monitor) / 1000; + return DEFAULT_REFRESH_RATE; } |