forked from pool/libqt5-qtbase
3b1f949c32
- Added xcb-dont-crash-in-mapToNativemapFromNative-if-the-screen-is-null.patch and xcb-fix-yet-another-crash-when-screens-are-disconnected.patch (kde#341497, qtbug#47385) - Added QDate_QTime-fix-SiC-introduced-by-adding-new-non-explicit-ctors.patch - When in SLE12, use the internal Harfbuzz version instead of the system one (which is too old for Qt's requirements) - Fix-compile-error-on-big-endian.patch: Fix compile error on big endian OBS-URL: https://build.opensuse.org/request/show/338269 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libqt5-qtbase?expand=0&rev=47
58 lines
2.0 KiB
Diff
58 lines
2.0 KiB
Diff
From c2dd0bb2c7a0468abefb9556dead85456daa851f Mon Sep 17 00:00:00 2001
|
|
From: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
|
|
Date: Fri, 4 Sep 2015 14:25:15 +0200
|
|
Subject: [PATCH] xcb: don't crash in mapToNative/mapFromNative if the screen
|
|
is null
|
|
|
|
The results will be wrong, but it only happens in rare cases anyway.
|
|
|
|
Task-number: QTBUG-42985
|
|
Task-number: QTBUG-47385
|
|
Change-Id: I6438f219f175af2b118e6b3af16b5b626136defa
|
|
---
|
|
src/plugins/platforms/xcb/qxcbwindow.cpp | 8 ++++++++
|
|
1 file changed, 8 insertions(+)
|
|
|
|
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
|
|
index 4fdebe1..3b589d2 100644
|
|
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
|
|
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
|
|
@@ -179,6 +179,8 @@ QXcbScreen *QXcbWindow::parentScreen()
|
|
|
|
QPoint QXcbWindow::mapToNative(const QPoint &pos, const QXcbScreen *screen) const
|
|
{
|
|
+ if (!screen)
|
|
+ return pos;
|
|
if (parent())
|
|
return pos * int(screen->devicePixelRatio());
|
|
else
|
|
@@ -186,6 +188,8 @@ QPoint QXcbWindow::mapToNative(const QPoint &pos, const QXcbScreen *screen) cons
|
|
}
|
|
QPoint QXcbWindow::mapFromNative(const QPoint &pos, const QXcbScreen *screen) const
|
|
{
|
|
+ if (!screen)
|
|
+ return pos;
|
|
if (parent())
|
|
return pos / int(screen->devicePixelRatio());
|
|
else
|
|
@@ -193,6 +197,8 @@ QPoint QXcbWindow::mapFromNative(const QPoint &pos, const QXcbScreen *screen) co
|
|
}
|
|
QRect QXcbWindow::mapToNative(const QRect &rect, const QXcbScreen *screen) const
|
|
{
|
|
+ if (!screen)
|
|
+ return rect;
|
|
if (parent())
|
|
return mapLocalGeometryToNative(rect, int(screen->devicePixelRatio()));
|
|
else
|
|
@@ -200,6 +206,8 @@ QRect QXcbWindow::mapToNative(const QRect &rect, const QXcbScreen *screen) const
|
|
}
|
|
QRect QXcbWindow::mapFromNative(const QRect &rect, const QXcbScreen *screen) const
|
|
{
|
|
+ if (!screen)
|
|
+ return rect;
|
|
if (parent())
|
|
return mapLocalGeometryFromNative(rect, int(screen->devicePixelRatio()));
|
|
else
|
|
--
|
|
2.3.5
|