summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_win.cpp
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-06-26 08:29:27 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-06-26 08:29:27 (GMT)
commite9e2baccfcfc48926414b0f18885140312470cae (patch)
tree289fd7825c7d4efc67fabfbee1a4b6d363c544b8 /src/gui/kernel/qapplication_win.cpp
parent7484a16ffeaf2c7640fc35b424a66cdd8695841c (diff)
parent7278c142089d46946d1ad2558eae949220dfe0c4 (diff)
downloadQt-e9e2baccfcfc48926414b0f18885140312470cae.zip
Qt-e9e2baccfcfc48926414b0f18885140312470cae.tar.gz
Qt-e9e2baccfcfc48926414b0f18885140312470cae.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/gui/kernel/qapplication_win.cpp')
-rw-r--r--src/gui/kernel/qapplication_win.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 0daabde..bb7d931 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -752,7 +752,11 @@ void QApplicationPrivate::initializeWidgetPaletteHash()
typedef BOOL (WINAPI *PtrUpdateLayeredWindow)(HWND hwnd, HDC hdcDst, const POINT *pptDst,
const SIZE *psize, HDC hdcSrc, const POINT *pptSrc, COLORREF crKey,
const Q_BLENDFUNCTION *pblend, DWORD dwflags);
+
+typedef BOOL (WINAPI *PtrSetProcessDPIAware) (VOID);
+
static PtrUpdateLayeredWindow ptrUpdateLayeredWindow = 0;
+static PtrSetProcessDPIAware ptrSetProcessDPIAware = 0;
static BOOL WINAPI qt_updateLayeredWindowIndirect(HWND hwnd, const Q_UPDATELAYEREDWINDOWINFO *info)
{
@@ -878,6 +882,11 @@ void qt_init(QApplicationPrivate *priv, int)
if (ptrUpdateLayeredWindow && !ptrUpdateLayeredWindowIndirect)
ptrUpdateLayeredWindowIndirect = qt_updateLayeredWindowIndirect;
+
+ // Notify Vista and Windows 7 that we support highter DPI settings
+ if (ptrSetProcessDPIAware = (PtrSetProcessDPIAware)
+ QLibrary::resolve(QLatin1String("user32"), "SetProcessDPIAware"))
+ ptrSetProcessDPIAware();
#endif
}
@@ -1940,10 +1949,14 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
// don't show resize-cursors for fixed-size widgets
QRect fs = widget->frameStrut();
if (!widget->isMinimized()) {
+ if (widget->minimumHeight() == widget->maximumHeight()) {
+ if (pos.y() < -(fs.top() - fs.left()))
+ return HTCAPTION;
+ if (pos.y() >= widget->height())
+ return HTBORDER;
+ }
if (widget->minimumWidth() == widget->maximumWidth() && (pos.x() < 0 || pos.x() >= widget->width()))
- break;
- if (widget->minimumHeight() == widget->maximumHeight() && (pos.y() < -(fs.top() - fs.left()) || pos.y() >= widget->height()))
- break;
+ return HTBORDER;
}
}