diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2012-05-04 16:31:52 +0200 |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2012-05-09 14:32:00 +0200 |
commit | e14b1548b7d1211201b138bc077353cdbc0d0bed (patch) | |
tree | 7b7d56cc22789967089f20ffcbe75818d2a67a74 /src/plugins/platforms/wayland/qwaylanddisplay.cpp | |
parent | 7f71672e27a2cbb7fb19333b77d7b3e4d4a068b9 (diff) |
Implemented refresh rate support.
Implements QWaylandScreen::refreshRate() based on the wl_output mode
information we get from the compositor.
In the compositor, adds API to override the refresh rate, with the
default set to whatever QScreen reports on the compositor-side.
Change-Id: I5f5175f2498940875c6ec68d29d25cf5993a1e65
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Diffstat (limited to 'src/plugins/platforms/wayland/qwaylanddisplay.cpp')
-rw-r--r-- | src/plugins/platforms/wayland/qwaylanddisplay.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.cpp b/src/plugins/platforms/wayland/qwaylanddisplay.cpp index be8a09678..d0ae002fe 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay.cpp +++ b/src/plugins/platforms/wayland/qwaylanddisplay.cpp @@ -234,18 +234,19 @@ void QWaylandDisplay::outputHandleGeometry(void *data, } void QWaylandDisplay::mode(void *data, - struct wl_output *wl_output, + struct wl_output *output, uint32_t flags, int width, int height, int refresh) { - Q_UNUSED(data); - Q_UNUSED(wl_output); - Q_UNUSED(flags); - Q_UNUSED(width); - Q_UNUSED(height); - Q_UNUSED(refresh); + QWaylandDisplay *waylandDisplay = static_cast<QWaylandDisplay *>(data); + + if (flags & WL_OUTPUT_MODE_CURRENT) { + QWaylandScreen *screen = waylandDisplay->screenForOutput(output); + if (screen) + screen->handleMode(QSize(width, height), refresh); + } } const struct wl_output_listener QWaylandDisplay::outputListener = { |