Fixed UBPlatformUtils::showFullScreen not maximizing to full screen on OS X 10.9

preferencesAboutTextFull
Craig Watson 9 years ago
parent 665945f590
commit 9adc8991cd
  1. 20
      src/frameworks/UBPlatformUtils_mac.mm

@ -588,12 +588,24 @@ void UBPlatformUtils::setFrontProcess()
*/ */
void UBPlatformUtils::showFullScreen(QWidget *pWidget) void UBPlatformUtils::showFullScreen(QWidget *pWidget)
{ {
pWidget->showMaximized(); /* OpenBoard is designed to be run in "kiosk mode", i.e full screen.
* On OS X, we want to maximize the application while hiding the dock and menu bar,
/* On OS X, we want to hide the Dock and menu bar (aka "kiosk mode"). Qt's default behaviour * rather than use OS X's native full screen mode (which places the window on a new desktop).
* when full-screening a QWidget is to set the dock and menu bar to auto-hide. * However, Qt's default behaviour when full-screening a QWidget is to set the dock and menu bar to auto-hide.
* Since it is impossible to later set different presentation options (i.e Hide dock & menu bar) * Since it is impossible to later set different presentation options (i.e Hide dock & menu bar)
* to NSApplication, we have to avoid calling QWidget::showFullScreen on OSX. * to NSApplication, we have to avoid calling QWidget::showFullScreen on OSX.
*/ */
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) */
QDesktopWidget * desktop = QApplication::desktop();
pWidget->resize(pWidget->width(), desktop->screenGeometry().height());
pWidget->move(0, 0);
} }

Loading…
Cancel
Save