From 024322c8d101b5bb9223eff6ca05d387bf1bbce8 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Mon, 21 Dec 2015 10:03:42 +0100 Subject: [PATCH] Fixed full-screen widgets all being moved to primary screen on OSX (due to commit 9adc899). Fullscreening should now work as expected in OSX 10.9 and 10.10, with one or multiple monitors. --- src/frameworks/UBPlatformUtils_mac.mm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/frameworks/UBPlatformUtils_mac.mm b/src/frameworks/UBPlatformUtils_mac.mm index 36bfca8a..1ec487aa 100644 --- a/src/frameworks/UBPlatformUtils_mac.mm +++ b/src/frameworks/UBPlatformUtils_mac.mm @@ -598,14 +598,14 @@ void UBPlatformUtils::showFullScreen(QWidget *pWidget) pWidget->showMaximized(); - /* Hack. On OS X 10.10, showMaximize() resizes the widget to full screen; - but on 10.9, it is placed in the "available" screen area (i.e the screen area minus - the menu bar and dock area). So we have to manually resize it to the total screen height, - and move it up to the top of the screen (0,0 position) */ + /* Bit of a hack. On OS X 10.10, showMaximized() resizes the widget to full screen (if the dock and + * menu bar are hidden); but on 10.9, it is placed in the "available" screen area (i.e the + * screen area minus the menu bar and dock area). So we have to manually resize it to the + * total screen height, and move it up to the top of the screen (y=0 position). */ QDesktopWidget * desktop = QApplication::desktop(); pWidget->resize(pWidget->width(), desktop->screenGeometry().height()); - pWidget->move(0, 0); + pWidget->move(pWidget->pos().x(), 0); }