summaryrefslogtreecommitdiffstats
path: root/video/out/x11_common.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-16 21:43:13 +0200
committerwm4 <wm4@nowhere>2014-08-16 21:56:22 +0200
commitfe782a6e957c1f2d472a91eceef01ca5fd6f5cb7 (patch)
tree2007e80bdf53da8aab97be0bd4e0479fbd202695 /video/out/x11_common.h
parent925c431ff7f68a7ea8b1fc0cd260edcf8b88fdc1 (diff)
downloadmpv-fe782a6e957c1f2d472a91eceef01ca5fd6f5cb7.tar.bz2
mpv-fe782a6e957c1f2d472a91eceef01ca5fd6f5cb7.tar.xz
x11: use xrandr to retrieve display refresh rate
Drop use of the ancient XF86VM, and use the slightly less ancient Xrandr extension to retrieve the refresh rate. Xrandr has the advantage that it supports multiple monitors (at least the modern version of it). For now, we don't attempt any dynamic reconfiguration. We don't request and listen to Xrandr events, and we don't notify the VO code of changes in the refresh rate. (The later works by assuming that X coordinates map directly to Xrandr coordinates, which probably is wrong with compositing window manager, at least if these use complicated transformations. But I know of no API to handle this.) It would be nice to drop use of the Xinerama extension too, but unfortunately, at least one EWMH feature uses Xinerama screen numbers, and I don't know how that maps to Xrandr outputs.
Diffstat (limited to 'video/out/x11_common.h')
-rw-r--r--video/out/x11_common.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/video/out/x11_common.h b/video/out/x11_common.h
index 72386543de..d1ccdd7223 100644
--- a/video/out/x11_common.h
+++ b/video/out/x11_common.h
@@ -29,6 +29,13 @@
struct vo;
struct mp_log;
+#define MAX_DISPLAYS 32 // ought to be enough for everyone
+
+struct xrandr_display {
+ struct mp_rect rc;
+ double fps;
+};
+
struct vo_x11_state {
struct mp_log *log;
Display *display;
@@ -40,6 +47,9 @@ struct vo_x11_state {
int ws_height;
struct mp_rect screenrc;
+ struct xrandr_display displays[MAX_DISPLAYS];
+ int num_displays;
+
bool screensaver_enabled;
bool dpms_touched;
double screensaver_time_last;
@@ -61,6 +71,7 @@ struct vo_x11_state {
// Current actual window position (updated on window move/resize events).
struct mp_rect winrc;
+ double current_display_fps;
int pending_vo_events;