mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 07:13:23 +01:00
qt511.qtbase: fix darwin build
Qt 5.11.1 replaced one occurrence of NSMouseMoved with NSEventTypeMouseMoved:
da32360ffc
.
It is not available in AppKit from macOS 10.10, therefore this change restores
NSMouseMoved: https://developer.apple.com/documentation/appkit/nsmousemoved
Closes #43258
This commit is contained in:
parent
2f4f631b6a
commit
bbca5042ac
2 changed files with 15 additions and 0 deletions
|
@ -41,6 +41,8 @@ let
|
|||
./qtbase.patch
|
||||
./qtbase-darwin.patch
|
||||
./qtbase-revert-no-macos10.10.patch
|
||||
] ++ optionals stdenv.isDarwin [
|
||||
./qtbase-darwin-nseventtype.patch
|
||||
];
|
||||
qtdeclarative = [ ./qtdeclarative.patch ];
|
||||
qtscript = [ ./qtscript.patch ];
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
|
||||
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
|
||||
@@ -404,8 +404,8 @@ void QCocoaWindow::setVisible(bool visible)
|
||||
removeMonitor();
|
||||
monitor = [NSEvent addGlobalMonitorForEventsMatchingMask:NSLeftMouseDownMask|NSRightMouseDownMask|NSOtherMouseDownMask|NSMouseMovedMask handler:^(NSEvent *e) {
|
||||
QPointF localPoint = QCocoaScreen::mapFromNative([NSEvent mouseLocation]);
|
||||
- const auto button = e.type == NSEventTypeMouseMoved ? Qt::NoButton : cocoaButton2QtButton([e buttonNumber]);
|
||||
- const auto eventType = e.type == NSEventTypeMouseMoved ? QEvent::MouseMove : QEvent::MouseButtonPress;
|
||||
+ const auto button = e.type == NSMouseMoved ? Qt::NoButton : cocoaButton2QtButton([e buttonNumber]);
|
||||
+ const auto eventType = e.type == NSMouseMoved ? QEvent::MouseMove : QEvent::MouseButtonPress;
|
||||
QWindowSystemInterface::handleMouseEvent(window(), window()->mapFromGlobal(localPoint.toPoint()), localPoint,
|
||||
Qt::MouseButtons(uint(NSEvent.pressedMouseButtons & 0xFFFF)), button, eventType);
|
||||
}];
|
Loading…
Reference in a new issue