summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-142-48/+29
|\ | | | | | | Change-Id: I129dd579f92cb2592a38ca043472b45cb926ae12
| * Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-132-48/+29
| |\ | | | | | | | | | Change-Id: I9953c1ca16862184c2373027e946c482ce8e6f0e
| | * macOS: Optionally flush sub-layers via sub-image copies of the backingstoreTor Arne Vestbø2019-10-111-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we're flushing the backingstore to sub-views with their own layers we don't want to pay the cost of uploading the whole backingstore to the GPU in the case where we're dealing with a discrete GPU. To work around this we make a copy of the appropriate part of the surfcace. This results in additional copies of the data, and will need further investigation to limit these. Task-number: QTBUG-77447 Change-Id: I318ae80e433dd7b0a55fd5a598b19f114d8bd28e Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | * macOS: Don't override event handler for kAEQuitApplicationTor Arne Vestbø2019-10-111-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation of the default handler, [NSApp _handleAEQuit], does a lot more than just terminating the application, including sending NSWorkspaceWillPowerOffNotification if appropriate, and deals appropriately with state restoration. Change-Id: If725838fc0f40d09a0b8885eb3e7239499d8fea0 Fixes: QTBUG-18624 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | * macOS: Simplify reflection delegate handling in QCocoaApplicationDelegateTor Arne Vestbø2019-10-111-25/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sending a message to a nil object returns nil, so there's no reason to check the delegate before calling respondsToSelector, and we can use the implicit _cmd argument to pass along the selector for the method we're in. For applicationShouldTerminate, if there's a reflection delegate but it doesn't answer to applicationShouldTerminate it makes no sense to skip our own logic. Change-Id: Iafcd883a5c8cec1b35d2f95238de55eff060d71f Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-101-3/+3
|\| | | | | | | | | | | Change-Id: Iab9b3a7d004a2e4b4de816f4a2d7ed2fb936d3ae
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-091-3/+3
| |\| | | | | | | | | | Change-Id: I03d82c5bc47908a97e7a908d7e67a7301b28d8cb
| | * macOS: Pass required parameters to NSOpenSavePanelDelegate callbacksTor Arne Vestbø2019-10-081-3/+3
| | | | | | | | | | | | | | | | | | Change-Id: I0e0322734a077e4ee948128f3ba6c074514ccbb9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-061-8/+5
|\| | | | | | | | | | | Change-Id: Ife31dad3c8dc43c5ff4d266e6d646230c5d20a50
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-051-8/+5
| |\| | | | | | | | | | Change-Id: I554a2762890391b3b6013c8b82211a8386a4ced8
| | * Modernize QWindowSystemInterface::handleCloseEventTor Arne Vestbø2019-10-041-8/+5
| | | | | | | | | | | | | | | | | | | | | The base WindowSystemEvent has had an eventAccepted flag since 2014. Change-Id: Ia0aa795083cd98ece83a4c1cc010d3a25e2489fd Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-022-60/+147
|\| | | | | | | | | | | Change-Id: Ideaa64d583746f1ce8265997131fb1ce3a9acbcf
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-012-60/+147
| |\| | | | | | | | | | Change-Id: I77ba01f09b3dbcaf13cb265a70d9da661c32a61f
| | * macOS: Avoid automatic resizing of layers by fixing them to top-leftTor Arne Vestbø2019-09-281-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a layer is resized, e.g. during a window resize, the contents of the layer may lag behind if the client doesn't fill the layer in response to the window resize and corresponding expose event. The default behavior is for Core Animation to stretch the content to fill the layer, but this results in the content "jumping" back and forth when the content then picks up the new size and fills the layer. Instead we tell Core Animation to fix the content to the top left corner. If a layer is sized up without a corresponding layer contents update this will result in missing/transparent pixels in the bottom or right part of the layer, explicitly showing what the result of the missing paint is. During debugging we also highlight this area by adding a magenta background color to the layer. Conversely, if the layer is sized down we don't need to resize it, we can just keep the fixed top left position, and the content will stay in place during the resize. This allows for optimizations during window resizing, where we don't need to allocate new buffers if the old buffer is larger than the new one. Change-Id: I265b57e3a0ddff8bbcda3af5d670cd8c3b00b181 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| | * macOS: Resolve layer contents scale based on DPRTor Arne Vestbø2019-09-281-2/+30
| | | | | | | | | | | | | | | Change-Id: I32de4610a2aebbc7e0adcad9bb3440683cae5906 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | * macOS: Improve layer delegate setupTor Arne Vestbø2019-09-281-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | We should detect the cases where there's already a delegate, and setting up the delegate before the layer is added makes sense. Change-Id: I67896cbc96d11ce9a3826fd8aa0e5e104a83a21c Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | * macOS: Flesh out and clarify layer setupTor Arne Vestbø2019-09-281-18/+50
| | | | | | | | | | | | | | | Change-Id: I10d972254c02de8789e64c8503861d51764a1633 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | * macOS: Propagate drawRect: dirty bounding rect as fallbackTor Arne Vestbø2019-09-281-3/+4
| | | | | | | | | | | | | | | Change-Id: I333e2bfe4a25bfbfebef7b2ec30a600fd441c9a9 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | * macOS: Gather QNSView draw callbacks togetherTor Arne Vestbø2019-09-281-39/+51
| | | | | | | | | | | | | | | | | | Change-Id: I29881b379481287b4938e47fc06405c918aa39a3 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| | * Replace use of deprecated API in macOS event dispatchersTor Arne Vestbø2019-09-281-1/+1
| | | | | | | | | | | | | | | | | | Change-Id: I077ba12b406f662ba22b2f2cddf0171963335739 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-09-243-35/+8
|\| | | | | | | | | | | Change-Id: Ic0dbddfa711905bc8e01aa6cbbdabf056a19587f
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-09-243-35/+8
| |\| | | | | | | | | | Change-Id: I9ec6345a38ada55219f3cdfb6bd0d6e9169fe880
| | * macOS: Don't update Metal layer's drawableSize automaticallyTor Arne Vestbø2019-09-231-21/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like our other rendering code paths, the Metal path should allow the user to resize their surface when they see fit. This is the case today with e.g QBackingStore::resize() and QOpenGLPaintDevice::setSize(). [ChangeLog][macOS] The drawableSize of Metal layers is no longer updated automatically on window resize or screen change. Update the size manually in response to resizeEvent(), or at the start of each frame, as needed. Change-Id: I9ed6d4326d0e0a3f4e3c63984d3b193e8bb77cae Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | * macOS: Handle backing property changes in a single placeTor Arne Vestbø2019-09-233-20/+12
| | | | | | | | | | | | | | | Change-Id: I70d57632a1756f74249f64d4d4c405cb3120a179 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2019-09-173-5/+10
|\| | | | | | | | | | | Change-Id: Ic1fd51143f903b7e9086fc19ca960dfd9654ee00
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-09-163-5/+10
| |\| | | | | | | | | | Change-Id: Ie24be82ee70bf103c2664de1a42741979262b10c
| | * macOS: Keep default NSWindow background unless window is framelessTor Arne Vestbø2019-09-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic was changed in ee82f8661 to only draw a window background when the window was textured, and otherwise ask for a clear window background. This has an unfortunate side-effect on macOS 10.15 that the window's title bar will be partially transparent and reflect the content under the window, with a blur effect. It also inadvertently broke the use-case of setting the NSWindow background color explicitly. With this patch we're back to the behavior before ee82f8661, and users who still want to have a non-borderless window with a clear background can still do this by setting the background color to the clear color manually. Task-number: QTBUG-77637 Change-Id: I8a11bc46e6393b29a37f002ea123a987048106b9 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | * Merge "Merge remote-tracking branch 'origin/5.13' into 5.14"Qt Forward Merge Bot2019-09-131-2/+3
| | |\
| | | * Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-09-131-2/+3
| | | |\ | | | | | | | | | | | | | | | Change-Id: Idcf8fc1d79bcd84b494d7f43308e6fe82d60e1a4
| | | | * Cocoa: Set the accepted action to be the one from the responseAndy Shaw2019-09-121-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By setting the accepted action to be the one from the response it will enable the user to set the drop action in their code and this will be reflected at the platform level. Change-Id: I7b9459b228c00ef01d91649b3405316729713164 Fixes: QTBUG-77427 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | * | | macOS dark mode: set the link colorShawn Rutledge2019-09-121-1/+5
| | |/ / | | | | | | | | | | | | | | | | | | | | Fixes: QTBUG-71740 Change-Id: I49f49338c7f3a28845de63c2a6bf2dc8495dd108 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-09-0611-57/+115
|\| | | | | | | | | | | | | | | Change-Id: Ib6649a412e131bf679aab97c4c384520af348b4f
| * | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-09-0510-54/+110
| |\| | | | | | | | | | | | | | Change-Id: I065e212f0dc115efa1ffcb14cf9f679259da6b79
| | * | Merge remote-tracking branch 'origin/5.13' into 5.14Liang Qi2019-09-049-53/+108
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/codecs/qicucodec.cpp src/dbus/qdbusserver.cpp src/gui/painting/qbezier.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp src/plugins/printsupport/cups/qppdprintdevice.cpp Change-Id: I2703128bb64baf5580fbc2c2061b55b0f0611d2a
| | | * Merge remote-tracking branch 'origin/5.12' into 5.13Allan Sandfeld Jensen2019-08-272-15/+31
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/painting/qdrawhelper.cpp src/gui/painting/qdrawhelper_p.h src/gui/painting/qdrawhelper_sse2.cpp src/gui/painting/qdrawhelper_x86_p.h Change-Id: I83256bb38ab3a705776e353bc0629315b6c59a0f
| | | | * macOS: Choose appropriate NSWindow depth based on surface formatTor Arne Vestbø2019-08-242-15/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I67e63412096ca11a8f056f5755525311756906ef Reviewed-by: Andy Nichols <andy.nichols@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-08-248-32/+65
| | | |\| | | | | | | | | | | | | | | | Change-Id: I60bb714ef11bced075d94addb74d23c3a3975519
| | | | * Fix build with -no-feature-printer on macOSAndré Klitzing2019-08-223-17/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: QTBUG-62675 Change-Id: I3bfcd6d78c3124769ff8662941472333c795fdbe Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
| | | | * macOS: Invalidate backingstore and trigger expose on color space changesTor Arne Vestbø2019-08-224-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: QTBUG-77749 Change-Id: I677a71152e4a218c08d8863d4f886d158a79e809 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | | | * macOS: Don't ask for a NSWindow background unless we need oneTor Arne Vestbø2019-08-222-15/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allow halfway transparent windows, even with a border, which is a bit of a weird use-case, but matches what we do on other platforms. We don't need the explicit call to NSDrawWindowBackground in the QNSWindowBackingStore implementation, as the NSThemeFrame will draw this background on our behalf. Fixes: QTBUG-77637 Change-Id: I012d845fa957c40aa713adaecbb1601a848e3534 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-08-221-1/+3
| | | |\| | | | | | | | | | | | | | | | Change-Id: Ia4bcd81eff948e56a5eda9519cdbee59b7da54d9
| | | | * macOS: Bail out early in case a popup is closed by a mouseDownTimur Pocheptsov2019-08-191-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It can happen that AppKit calls -mouseDown: on a popup's view, but we consider the click to be outside of popup's area (happens on the 1-pixel edge of a 'geometry', QRect::contains() returns false). If we send close event to essentially 'self', m_platformWindow is becoming nullptr. So we bail out early, no further processing is needed. Fixes: QTBUG-77348 Change-Id: I224943e6bcf4ae052412ef7dc7b23a94f999aa19 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| | | * | Merge remote-tracking branch 'qt/5.12' into 5.13Paul Olav Tvete2019-08-201-5/+9
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/configure.json src/gui/util/qtexturefilereader.cpp src/gui/util/util.pri tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp Change-Id: I2bc4f84705b66099e97330cda68e0b816aceb9cc
| | | | * Fix macOS build with -no-feature-accessibilityAndré Klitzing2019-08-161-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Id16b102feb7b57efcf1a36385a009774cb023f41 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
| * | | | QSystemTrayIcon on macOS: support the timeout hint in showMessageVolker Hilsheimer2019-08-302-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If set, schedule a call to remove the notification (NSTimeInterval is specified in seconds). The system might hide the notification balloon earlier, but the notification will still be removed from the message center after the specified interval. Task-number: QTBUG-77150 Change-Id: I510e412beb16e9de271290798f3e66310f44df4f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | | | QSystemTrayIcon: on macOS, hide messages when the user clicks themVolker Hilsheimer2019-08-301-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is default behavior on macOS, and also the behavior on Windows. [ChangeLog][QtWidgets][QSystemTrayIcon] On macOS, clicking on the message will remove the notification. Change-Id: Ie30f7dacf478af76ccb53d16aea8f122869072c8 Fixes: QTBUG-77150 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | | | Close popups on windowWillMiniaturize notificationTimur Pocheptsov2019-08-294-10/+23
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We do this on windowDidMove/windowWillClose, but we don't on a 'will miniaturize' notification. This can leave an application with an orphan popup window, such as context menu which looks really weird. I err on a safe side though - I don't close all popups - the application's logic can be such that it has several windows and one of them gets minimized (we can do this via QWidget's interface, for example) - would be strange if all popups close. So I only close popups that have the miniaturized window as a transient parent. Task-number: QTBUG-77833 Change-Id: Ib655a27c0ce8661f9e7156e6035f7fffaff901b1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | | Update Dpi and scale factor computationMorten Johan Sørvig2019-08-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove pixelScale() in favor of logicalBaseDpi(). Compute scale factor based on logical DPI and logical base DPI, or optionally based on the physical DPI. Add policies for running the scale factor and adjusting the logical DPI reported to the application. The policies are set via environment variables: QT_SCALE_FACTOR_ROUNDING_POLICY=Round|Ceil|Floor|RoundPreferFloor|PassThrough QT_DPI_ADJUSTMENT_POLICY=AdjustDpi|DontAdjustDpi|AdjustUpOnly QT_USE_PHYSICAL_DPI=0|1 Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io> Task-number: QTBUG-53022 Change-Id: I4846f223186df665eb0a9c827eaef0a96d1f458f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | | Rename QWidgetBackingStore to QWidgetRepaintManagerTor Arne Vestbø2019-08-201-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Quoting a blog from 2009, "this class is responsible for figuring out which parts of the window surface needs to be updated prior to showing it to screen, so it's really a repaint manager." https://blog.qt.io/blog/2009/12/16/qt-graphics-and-performance-an-overview/ What better time to do the rename than 10 years later! Change-Id: Ibf3c3bc8c7df64ac03d72e1f71d296b62d832fee Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-08-135-42/+75
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/win32-clang-msvc/qmake.conf src/corelib/tools/qlist.h src/gui/painting/qcompositionfunctions.cpp src/gui/painting/qtriangulator_p.h src/gui/text/qfontengine_p.h src/network/kernel/qhostinfo_p.h src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io> Change-Id: Ib8a0308cf77224c4fbdcf56778fdac4a43e37798