| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| | |
Change-Id: Ia082e20e2eb4b76afd4c1a1584ff4e5514655d7a
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Set the devicePixelRatio to 1 on the scaled down pixmap.
A scaled down version of the high DPI pixmap is added to the NSCursor in
addition to the high DPI one, but the devicePixelRatio must be set
correctly on the smaller of the two for macOS to pick the right image
to use on a high resolution display (retina).
This change also fixes the problem that only a high DPI custom cursor
with a hotspot in the upper left quadrant is applied by macOS. I suspect
that the NSCursor was discarded by macOS, because the hotspot was
outside the device independent bounds of the smaller scaled image.
Task-number: QTBUG-52211
Change-Id: I7e552e8f62f5255dd3786da44b2f619f6790c37a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
And move some logic into detectMenuRole(), where it belongs.
This refactoring will enable fixes for the issues below.
Change-Id: Id03bb5c26d7dd0bb3b94f01e69935e1f3321bb95
Task-number: QTBUG-17291
Task-number: QTBUG-30812
Task-number: QTBUG-38705
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In this edition:
* Use Objective-C properties where appropriate.
* Use recently introduced qt_objc_cast().
* Remove uses of foreach.
* Update copyright headers.
Change-Id: I2a07a7b6cab27b833e4deaeedf9563463ff55914
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
|
|\|
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
src/plugins/platforms/cocoa/qcocoawindow.mm
Change-Id: Ideea96d1b43d47b1d9b34e11c9986a88e240aa71
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Some of our examples, and perhaps also some applications,
call requestUpdate() immediately after producing a
frame. This can cause Cocoa to immediately start
(trying to) draw a new frame without processing e.g.
input events.
This should (and will) be handled by rate limiting
updates with CVDisplayLink. In the mean time fall back
to using the base class QPlatformWindow implementation,
which is implemented using a timer, which will allow
for input event processing.
Change-Id: Ic2541f344b2f4018d785404a06274959a7bad2df
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
According to Apple's documentation, there's no delegate
in NSFontManager. We set its target instead. The action
is changeFont: by default.
Change-Id: I8c01bfa97c78dd8097f38c27353748d13f51489f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
qtbase/src/plugins/platforms/cocoa/qcocoawindow.mm:408:53: warning:
'handleMouseEvent<QWindowSystemInterface::DefaultDelivery>' is deprecated [-Wdeprecated-declarations]
QWindowSystemInterface::handleMouseEvent(window(), window()->mapFromGlobal(localPoint.toPoint()), localPoint,
Change-Id: Ifbf8c46e31a1de2089ce0e16cec087fdd9adb64e
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
| |
| |
| |
| |
| |
| | |
Change-Id: Ia0d1f019622d20ad70b5fd8c4122b719c0286738
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
Just tidying code a bit.
Change-Id: I492535094533ee307d757bfbbcb41376291f8878
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
'QPrint::Color' should be returned in case 'ColorModel'
is NOT set to 'Gray'. However, the logic was inverted
before, since 'qstrcmp()' returns 0 if the two strings
match.
Also, eliminate a redundant condition:
The left-hand side of the '||' already makes sure that
'colorModel' is non-null, so there's no need to check again.
(Corresponding cppcheck warning: "Redundant condition: colorModel.
'!A || (A && B)' is equivalent to '!A || B'")
Change-Id: I965c29e8c020bc9c47a53678e23d94f05be3fd53
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
|
|\ \
| | |
| | |
| | | |
refs/staging/dev
|
| |\|
| | |
| | |
| | | |
Change-Id: I0bea38585382b5d9c8d7a013bf6bcb3a6008d159
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It use to be yellowish in the past, but modern versions
of macOS show it light gray.
Change-Id: I8cca5cbb37c73a6dfc79e633a746b9a7d7bced05
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The idea was probably to ignore it since macOS already provides
accessibility for a menu item in its native system menu. However, a Qt
Quick Controls2 Menu will instead show a non-native menu, which should
not be ignored.
Task-number: QTBUG-63522
Change-Id: Ib5ae16ad991ebd7a18fa73b8f576f20b1c14d4c8
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This generalizes what qnsview_cast() does to any Objective-C class.
Notice that this is a loose cast, using isKindOfClass: instead
of isMemberOfClass:.
Change-Id: I745f548e474f2f9eef89f370d7d45496f0c51434
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
We use nil for Objective-C null pointers and nullptr everywhere
else, including CoreFoundation and similar opaque types.
Change-Id: Id75c59413dec54bf4d8e83cf7ed0ff7f3d8bb480
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We extend QCocoaNSMenuItem with separator items capabilities
and use it as any other custom item in the app menu.
Addition and removal of items in the app menu remains very
basic because that menu doesn't exist as such. Instead, it's
hinted through the QAction's menu role.
Change-Id: Ia13bfcc008c75e49fd21705d2528da5a85ed1c73
Task-number: QTBUG-63756
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is in accordance with the macOS HIG which state that, "in general,
a Preferences menu item should be the first app-specific menu item." See
https://developer.apple.com/macos/human-interface-guidelines/menus/menu-bar-menus/
Change-Id: Ie2b6ce274995a7d0b0e934c6a68241500a39f7aa
Task-number: QTBUG-63756
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We start by setting the menu item target to nil.
Then, -[qt_itemFired:] action is now in QNSView, which itself is
naturally inserted in the responder chain. This removes the need
to track and change the menu item's target/action when we're
displaying a native dialog. Part of this is possible because we
now derive our own QCocoaNSMenuItem class from NSMenuItem.
We use -[respondsToSelector:] to decide whether the QNSView in
the responder chain should respond to cut:, copy:, etc. And we
only return YES when the view is first responder. The invocation
to these action is forwarded to the same views' -[qt_itemFired:].
Message forwarding is done via forwardInvocation:, but experiments
have shown that it can be done by the sole means of respondsToSelector:
and direct invocation from cut:, copy:, etc. See the usage of the
macro QT_COCOA_DYNAMIC_MENU_ITEM_ACTION.
Menu validation also happens in QNSView and looks for modal windows.
Therefore, -[worksWhenModal] is no longer necessary. Also, since the
target is no longer set, the logic as documented in NSMenuItem.target
won't work anymore.
Most items from QCocoaMenuLoader also become QCocoaNSMenuItem and
get the same target/action, which removes a bit of duplicated (and
outdated) code. A particular case is the Quit item, which gets the
terminate: action set until an actual menu item is added.
Tested with texedit and standard dialogs examples together with
menus, menurama and bigmenucreator manual tests.
We also renamed some functions and variables to reflect common
naming practices.
Change-Id: I9b51d3be3467a666d8c3dcf8585edbc821e0282e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
And add CoreServices as framework dependency.
The standard pixmaps depend on CoreServices, or LaunchServices
to be accurate.
Change-Id: Ib97e521f3e950586a352bf9b30f827ce3fda8efd
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
So that platform plugins don't need to dive into QWindowPrivate.
Change-Id: Ia2d94b3e9236e4a68857e6afe7af063f1b0d0aeb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I2144e39c69fe79c0a31d5fb708abe4b20169d27a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Make sure the layer is updated on window resize and
screen change.
Add a support test and print a warning if we try to
create a Metal layer without Metal system support.
This test should ideally be done earlier, before
configuring the QWindow to use Metal.
Link against the Metal framework: The minimum deployment
target is already 10.11 so this does not add additional
deployment requirements.
Change-Id: I0a38e824d0b6042bb52520dfaf0958ce21bb40b8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It seems that's the only place we were doing any check.
We can remove it since it's not supposed to happen, and
it would have crashed already if it had.
Change-Id: Ic2034d2d278899f30a7d07284057e63a12e8eb10
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
This is always NO and no longer needed.
Change-Id: I32a3dca6cc427cb074ee3d58bf2202f57af4c623
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
|
|\|
| |
| |
| | |
Change-Id: I954bd6418bc862a04691240c0f1766f6ce033640
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
QWindows with transparent pixels (of which QMacNativeWidget
is an example) must be composited, even if they are
content views.
This will display the NSWindow background instead
of solid black for the areas where the Qt backingstore
has transparent pixels.
Change-Id: Ibee1327e11bc64975900b4c5d632dd5f103da4c8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Having deliverUpdateRequest in QWindowPrivate was a bit awkward and
asymmetric to the QPlatformWindow::requestUpdate() API. Keeping
them together follows the existing pattern of plumbing things
through the platform window, and also allows us to move away
from platform plugins relying on QWindowPrivate implementation
details.
Change-Id: Ib131ccdd1c2bdd6ff1c8d95facbc3f6f88a1abcf
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|\|
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/plugins/platforms/cocoa/qnsview.mm
src/plugins/platforms/cocoa/qnsview_mouse.mm
src/testlib/testlib.pro
Change-Id: Ia0ce4243418fe6a485b0f290c67bd433b3b04ff2
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When performing gestures such as Exposé or Mission Control with the
mouse button down, the position of the mouse release event is
returned with NaN values. This causes
QGuiApplicationPrivate::processMouseEvent to be called recursively
and ultimately crash.
Task-number: QTBUG-67194
Change-Id: If1536bc4dc2075c498cdd6c5afe57c86bdaac13b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This should be tied to the CustomizeWindowHint flag:
if that flag is set we start out without NSResizableWindowMask
and possibly add it later on if WindowMaximizeButtonHint
is set.
Change-Id: I7e826d4bd357a8a17c60cfef948af25d61b66ebf
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This prevents delivering queued activation events
to windows that have been hidden or destroyed.
Task-number: QTBUG-66536
Change-Id: I4edf86b6c8592751130f836876725c786452933c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Implement QCocoaWindow::isEmbedded() which detects this
property based on parent view and window type. This avoids
having to use a setter function to set the state.
The detection can’t handle all cases, but should be
sufficient for our use case.
Change-Id: I12a5b90b4e4a7e10714f7275ae001e99c9361e2c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: Ib5dc8178293d13542a54d51484181debd57580f5
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I144bd33a2c122d53ea1435a53483a3d8b46fd093
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: Ia253edf84bc0c890f291499ed2635d8287b18327
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The updateLayer function is only called when the layer is a
_NSViewBackingLayer instance, which is what the default
implementation of [NSView makeBackingLayer] returns.
Once we move to optionally returning a CAMetalLayer, we need
to use the more generic displayLayer: API, so we do that now
as a first step.
This matches the way we draw and send expose events on iOS.
Change-Id: I49721ff005ca9dfddebff645705f96b5ab46abb4
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: Iaeaa5c57368445a1fd67d110823c919aa7173a7a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add null-pointer checks to QCocoaEventDispatcher::
currentModalSession():
- window->handle() may return nullptr if the window
has been destroyed.
- We call beginModalSessionForWindow, which processes
events. This can potentially destroy or delete the
current window; pointers to it must be checked again.
This also has the effect that currentModalSessionCached
is not set to a session that does not have a window,
also prevents clearing the cleanupModalSessionsNeeded
flag for such sessions.
Task-number: QTBUG-66536
Change-Id: Ie055933c872a8ede3c938882fb2d4f7cf8ff3c81
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Makes it easier to get an overview of the code, work on separate
sections/areas in isolation, and highlights which part of the APIs
we are using from outside of QNSView, and internally between the
different parts of QNSView.
Change-Id: Ia2c5ab9a68bf75feddba853ac20d3bb397f7564b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We've never had the policy to declare every function that we override,
so to clean up the headers and for consistency we remove any declaration
that's not part of the public interface.
Change-Id: Ie71dc062b9d2252872e1434ca19f8f537cdd6f96
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Format selectors consistently
- Use proper style for init methods
Follow-up to ba871065e0f40e9197fa4ee0ffe76530bb6fca11
Change-Id: I5742e248b83d5955b1d110038dd1b4d79d701fbb
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I9be3c170c20aca8a7d3c8bb81b7b019cd555b3f1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Makes the naming of QPA logging categories the same across different
platforms, which makes it easier to debug an unfamiliar platform.
Change-Id: I60ed34892d154e86723c8e4bcff3c28fcab1f7a1
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
|
|\|
| |
| |
| | |
Change-Id: Idf471ca5c6cf211813466b539ce45bdc1ae9b97c
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since we made the NSMenu delegate a singleton we could not rely
on it to have enough information to implement worksWhenModal.
At the same time as the delegate change, we derived NSMenu into
QCocoaNSMenu. This allows us to extend the menu functionality
and, in this case, serve as target for the Cocoa menu items.
We also refactor setting the item's target/action.
Manually tested against menurama and bigmenucreator tests, the
test-case for QTBUG-17291, and the richtext/textedit example.
Change-Id: I222241f71db82611711b23d4a8c6122a741370ae
Task-number: QTBUG-66676
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
|
|\|
| |
| |
| | |
Change-Id: I110feec4750bd304975bab4f3f33d3a61a4e08bd
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If you enable both qt.qpa.input.touch and qt.qpa.cocoa.mouse you can
see the order and interleaving of the touch and scroll events.
Task-number: QBUG-66329
Change-Id: I8e1a63e2958b85f7964bb597e49cf8529cb3f32e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When QCocoaWindow::setWindowFlags is called, the window()'s flags have
not been updated, so re-computing the collection behavior based on those
would not be correct.
Change-Id: I5512da75104483eac7100880c164a9d08fd82984
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
|