summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKimmo Ollila <kimmo.ollila@qt.io>2018-10-16 12:34:36 +0300
committerKimmo Ollila <kimmo.ollila@qt.io>2018-12-11 13:54:47 +0000
commit88041986f448c14871fac76ee01280736af3f382 (patch)
tree57803faa92e9dc6c51ecdf5ed1deacb098742ac0
parent42b135077e653126afef66fb08254f258f49c57e (diff)
Fix scaling if wrong attached window size is returned
Some drivers may return wrong size from wl_egl_window_get_attached_size and can therefore ignore wl_egl_window_resize calls. This patch introduces a new env variable QT_WAYLAND_DISABLE_RESIZECHECK to skip the size check and to force resizing of egl window on create and resize events. Task-number: QTBUG-70079 Change-Id: I9be97480088c63ae0a6dc3d1d1e026b0683a627e Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
index f10a7469..24dadff4 100644
--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
@@ -126,8 +126,12 @@ void QWaylandEglWindow::updateSurface(bool create)
} else {
if (m_waylandEglWindow) {
int current_width, current_height;
- wl_egl_window_get_attached_size(m_waylandEglWindow,&current_width,&current_height);
- if (current_width != sizeWithMargins.width() || current_height != sizeWithMargins.height()) {
+ static bool disableResizeCheck = qgetenv("QT_WAYLAND_DISABLE_RESIZECHECK").toInt();
+
+ if (!disableResizeCheck) {
+ wl_egl_window_get_attached_size(m_waylandEglWindow, &current_width, &current_height);
+ }
+ if (disableResizeCheck || (current_width != sizeWithMargins.width() || current_height != sizeWithMargins.height())) {
wl_egl_window_resize(m_waylandEglWindow, sizeWithMargins.width(), sizeWithMargins.height(), mOffset.x(), mOffset.y());
mOffset = QPoint();