summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qnswindow.h
Commit message (Collapse)AuthorAgeFilesLines
* macOS: Set up platform window reference before initializing QNSWindow/PanelTor Arne Vestbø2019-02-181-0/+3
| | | | | | | | | Initializing the window will end up in [NSWindow _commonAwake], which calls many of the getters. We need to set up the platform window reference first, so we can properly reflect the window's state during initialization. Change-Id: I5349273b1930ee8a57dc518db74be90d2426f61c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Implement QNSWindow/QNSPanel mixin using preprocessor includesTor Arne Vestbø2019-02-181-8/+0
| | | | | | | | | | | | | | We want to share the implementation between the two classes, but Objective-C doesn't natively have a mixin-feature. Instead of using dynamic super-calls at runtime (which worked fine, but added complexity), we now do the mixin at compile time using the preprocessor. The dynamic-super feature is left in, in case we need it in other areas in the future. Change-Id: I95dfa7f18cba86cc518e963dd018944ef113ac06 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Modernize worksWhenModal handlingTor Arne Vestbø2019-02-181-0/+1
| | | | | | | The code in QCocoaEventDispatcher was dead and could be removed. Change-Id: I0c57e64791045d65033376c096220983059028ba Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Make sure QNSPanel also gets a debug descriptionTor Arne Vestbø2018-06-051-0/+1
| | | | | Change-Id: I5de08c3493b02a8e98ba3c4fe3922f5f9fd6e2c2 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10Tor Arne Vestbø2018-01-161-0/+7
| | | | Change-Id: I896b0cf54f317c4336cc3d3db319a0b89e421728
* macOS: Determine opaqueness and backgroundColor of NSWindow declarativelyTor Arne Vestbø2017-08-301-0/+2
| | | | | | | | | Instead of imperatively trying to keep the logic consistent in many different call sites. Task-number: QTBUG-61909 Change-Id: I8d647690c47656f34673555a8a8aa3ec6ffc73d1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Deduplicate QNSWindow/QNSPanel codeTor Arne Vestbø2017-08-241-43/+7
| | | | | | | | | | | | | | | | | | | | | | By sharing the implementations of the methods between QNSWindow and QNSPanel we don't need a helper, and can remove duplicated code. This duplication would expand in the future, as for each method added to the QNSWindowProtocol, we would have to add forwarding functions in both QNSWindow and QNSPanel, forwarding to QNSWindowHelper, and then two more functions in QNSWindow and QNSPanel in case we wanted to call super from the helper, similar to [QNSWindow superSendEvent]. The only snag is that calls to super are hard-coded to a specific superclass during complication, so we provide our wrapper for objc_msgSendSuper that resolves the superclass at runtime. The helper class QSendSuperHelper provides compile time implicit instantiation of the right template without having to provide the return type as a template argument, via operator T and a fallback for the case of no return type via the destructor. Change-Id: Iaf13f27675d90f884470f5005270ea0d9d0316f3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* macOS: Remove workaround for crash when closing window from title barTor Arne Vestbø2017-06-291-1/+0
| | | | | | | | | The platform window is now protected by a QPointer, so we don't need to juggle the NSWindow retain count. Task-number: QTBUG-37287 Change-Id: Id55ea311f0793370e248aa58cc8e383b574fbb40 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Remove unneeded Objective-C instance variable declarationsTor Arne Vestbø2017-06-291-7/+0
| | | | | | | | And their corresponding synthesizations. The compiler will take care of it for us. Change-Id: Ifa42e0732059008af6f3f65151bf203a1a19079d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Remove workaround for grabbing child NSWindowsTor Arne Vestbø2017-06-281-4/+0
| | | | | | | | The code was introduced in 28c9c2ea50, but child NSWindows are no longer supported, so we can simplify the code by removing it. Change-Id: Ic98b8b0e0a84d5f2adba1840bd8318de2be031b6 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Make QCocoaNSWindow header file slightly more readableTor Arne Vestbø2017-06-271-18/+14
| | | | | Change-Id: I09ac42af476feb1d561a77f68999a2754a2e252e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Move QNSWindow implementation into separate fileTor Arne Vestbø2017-06-211-0/+124
Change-Id: Ie75419c7ffb7a8fdf78d53e1ea14afee63ef1656 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>