diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2019-02-05 20:45:10 -0500 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2019-02-05 20:50:52 -0500 |
commit | 81531046e84d1159be0eebfd5fb18e7ea174495f (patch) | |
tree | a275abb5c8e02cb64aeb8c25d858e4396eab2668 /pkgs/development | |
parent | 7003a2891648b9e4c4002434e24f2ec37dd385a6 (diff) | |
download | nixpkgs-81531046e84d1159be0eebfd5fb18e7ea174495f.tar nixpkgs-81531046e84d1159be0eebfd5fb18e7ea174495f.tar.gz nixpkgs-81531046e84d1159be0eebfd5fb18e7ea174495f.tar.bz2 nixpkgs-81531046e84d1159be0eebfd5fb18e7ea174495f.tar.lz nixpkgs-81531046e84d1159be0eebfd5fb18e7ea174495f.tar.xz nixpkgs-81531046e84d1159be0eebfd5fb18e7ea174495f.tar.zst nixpkgs-81531046e84d1159be0eebfd5fb18e7ea174495f.zip |
qt511: add patch for macOS sdk
Unfortunately we don’t have access to NSWindowStyleMask. These patches should go away once we switch to a newer SDK.
Diffstat (limited to 'pkgs/development')
-rw-r--r-- | pkgs/development/libraries/qt-5/5.11/default.nix | 1 | ||||
-rw-r--r-- | pkgs/development/libraries/qt-5/5.11/qtbase-darwin-revert-69221.patch | 73 |
2 files changed, 74 insertions, 0 deletions
diff --git a/pkgs/development/libraries/qt-5/5.11/default.nix b/pkgs/development/libraries/qt-5/5.11/default.nix index c6cc393624e..59dab2beabd 100644 --- a/pkgs/development/libraries/qt-5/5.11/default.nix +++ b/pkgs/development/libraries/qt-5/5.11/default.nix @@ -56,6 +56,7 @@ let ./qtbase-fixguicmake.patch ] ++ optionals stdenv.isDarwin [ ./qtbase-darwin-nseventtype.patch + ./qtbase-darwin-revert-69221.patch ]; qtdeclarative = [ ./qtdeclarative.patch ]; qtscript = [ ./qtscript.patch ]; diff --git a/pkgs/development/libraries/qt-5/5.11/qtbase-darwin-revert-69221.patch b/pkgs/development/libraries/qt-5/5.11/qtbase-darwin-revert-69221.patch new file mode 100644 index 00000000000..73eea435f84 --- /dev/null +++ b/pkgs/development/libraries/qt-5/5.11/qtbase-darwin-revert-69221.patch @@ -0,0 +1,73 @@ +diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm +index 00c3f7c22c..94d35f59d6 100644 +--- a/src/plugins/platforms/cocoa/qcocoawindow.mm ++++ b/src/plugins/platforms/cocoa/qcocoawindow.mm +@@ -1355,15 +1355,6 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel) + { + QMacAutoReleasePool pool; + +- Qt::WindowType type = window()->type(); +- Qt::WindowFlags flags = window()->flags(); +- +- // Note: The macOS window manager has a bug, where if a screen is rotated, it will not allow +- // a window to be created within the area of the screen that has a Y coordinate (I quadrant) +- // higher than the height of the screen in its non-rotated state, unless the window is +- // created with the NSWindowStyleMaskBorderless style mask. +- NSWindowStyleMask styleMask = windowStyleMask(flags); +- + QRect rect = geometry(); + + QScreen *targetScreen = nullptr; +@@ -1375,22 +1366,26 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel) + } + + if (!targetScreen) { +- qCWarning(lcQpaCocoaWindow) << "Window position" << rect << "outside any known screen, using primary screen"; ++ qCWarning(lcQpaCocoaWindow) << "Window position outside any known screen, using primary screen"; + targetScreen = QGuiApplication::primaryScreen(); +- // AppKit will only reposition a window that's outside the target screen area if +- // the window has a title bar. If left out, the window ends up with no screen. +- // The style mask will be corrected to the original style mask in setWindowFlags. +- styleMask |= NSWindowStyleMaskTitled; + } + + rect.translate(-targetScreen->geometry().topLeft()); + QCocoaScreen *cocoaScreen = static_cast<QCocoaScreen *>(targetScreen->handle()); + NSRect frame = QCocoaScreen::mapToNative(rect, cocoaScreen); + ++ // Note: The macOS window manager has a bug, where if a screen is rotated, it will not allow ++ // a window to be created within the area of the screen that has a Y coordinate (I quadrant) ++ // higher than the height of the screen in its non-rotated state, unless the window is ++ // created with the NSWindowStyleMaskBorderless style mask. ++ ++ Qt::WindowType type = window()->type(); ++ Qt::WindowFlags flags = window()->flags(); ++ + // Create NSWindow + Class windowClass = shouldBePanel ? [QNSPanel class] : [QNSWindow class]; + QCocoaNSWindow *nsWindow = [[windowClass alloc] initWithContentRect:frame +- styleMask:styleMask ++ styleMask:windowStyleMask(flags) + // Deferring window creation breaks OpenGL (the GL context is + // set up before the window is shown and needs a proper window) + backing:NSBackingStoreBuffered defer:NO +@@ -1399,9 +1394,6 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel) + Q_ASSERT_X(nsWindow.screen == cocoaScreen->nativeScreen(), "QCocoaWindow", + "Resulting NSScreen should match the requested NSScreen"); + +- if (targetScreen != window()->screen()) +- QWindowSystemInterface::handleWindowScreenChanged(window(), targetScreen); +- + nsWindow.delegate = [[QNSWindowDelegate alloc] initWithQCocoaWindow:this]; + + // Prevent Cocoa from releasing the window on close. Qt +@@ -1421,6 +1413,9 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel) + }); + } + ++ if (targetScreen != window()->screen()) ++ QWindowSystemInterface::handleWindowScreenChanged(window(), targetScreen); ++ + nsWindow.restorable = NO; + nsWindow.level = windowLevel(flags); + |