summaryrefslogtreecommitdiffstats
path: root/src/compositor/wayland_wrapper/wloutput.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2012-05-04 16:31:52 +0200
committerSamuel Rødal <samuel.rodal@nokia.com>2012-05-09 14:32:00 +0200
commite14b1548b7d1211201b138bc077353cdbc0d0bed (patch)
tree7b7d56cc22789967089f20ffcbe75818d2a67a74 /src/compositor/wayland_wrapper/wloutput.cpp
parent7f71672e27a2cbb7fb19333b77d7b3e4d4a068b9 (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/compositor/wayland_wrapper/wloutput.cpp')
-rw-r--r--src/compositor/wayland_wrapper/wloutput.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/compositor/wayland_wrapper/wloutput.cpp b/src/compositor/wayland_wrapper/wloutput.cpp
index c1c91edc7..e00d8b8d9 100644
--- a/src/compositor/wayland_wrapper/wloutput.cpp
+++ b/src/compositor/wayland_wrapper/wloutput.cpp
@@ -52,6 +52,7 @@ OutputGlobal::OutputGlobal()
{
QScreen *screen = QGuiApplication::primaryScreen();
m_geometry = QRect(QPoint(0, 0), screen->availableGeometry().size());
+ m_refreshRate = qRound(screen->refreshRate());
}
OutputGlobal::~OutputGlobal()
@@ -64,6 +65,11 @@ void OutputGlobal::setGeometry(const QRect &geometry)
m_geometry = geometry;
}
+void OutputGlobal::setRefreshRate(int rate)
+{
+ m_refreshRate = rate;
+}
+
Output *OutputGlobal::outputForClient(wl_client *client) const
{
return static_cast<Output *>(resourceForClient(client)->data);
@@ -92,7 +98,7 @@ Output::Output(OutputGlobal *outputGlobal, wl_client *client, uint32_t version,
m_output_global->size().width(), m_output_global->size().height(),0,"","");
wl_output_send_mode(m_output_resource, WL_OUTPUT_MODE_CURRENT|WL_OUTPUT_MODE_PREFERRED,
- m_output_global->size().width(),m_output_global->size().height(), 60);
+ m_output_global->size().width(), m_output_global->size().height(), m_output_global->refreshRate());
}