diff options
Diffstat (limited to 'src/gui/embedded/qscreenlinuxfb_qws.cpp')
-rw-r--r-- | src/gui/embedded/qscreenlinuxfb_qws.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gui/embedded/qscreenlinuxfb_qws.cpp b/src/gui/embedded/qscreenlinuxfb_qws.cpp index fed7aad..48fe881 100644 --- a/src/gui/embedded/qscreenlinuxfb_qws.cpp +++ b/src/gui/embedded/qscreenlinuxfb_qws.cpp @@ -342,8 +342,18 @@ bool QLinuxFbScreen::connect(const QString &displaySpec) } dw=w; dh=h; - xoff += (vinfo.xres - w)/2; - yoff += (vinfo.yres - h)/2; + int xxoff, yyoff; + if (sscanf(qwssize, "%*dx%*d+%d+%d", &xxoff, &yyoff) == 2) { + if (xxoff < 0 || xxoff + w > vinfo.xres) + xxoff = vinfo.xres - w; + if (yyoff < 0 || yyoff + h > vinfo.yres) + yyoff = vinfo.yres - h; + xoff += xxoff; + yoff += yyoff; + } else { + xoff += (vinfo.xres - w)/2; + yoff += (vinfo.yres - h)/2; + } } else { dw=w=vinfo.xres; dh=h=vinfo.yres; |