This one uses a hybrid approach. Standalone NSSliderCell has
proven to be quite useless. However, we can access the cell
of a properly configured NSSlider. Then, the cell can be to
render all the QSlider parts as well as getting their rects.
Change-Id: Idedad3e6d80e70631b01125596ed24dae5fde6c7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
One of those routines could recurse back. This was a pre-existing
problem for Pre-Pre routines, but commit a92ee2518fdbd77fcbe3f8ef4f412aa
made qAddPostRoutine also use the same mutex.
Task-number: QTBUG-63008
Change-Id: I38341f8155354cc4a776fffd14e17a037d25475f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
It has been there since the first commit 6d70e543aa
of VNC platform plugin, and it has never actually been used.
Change-Id: I6a9c4e6a27de042e18650fa88728a1849a99b094
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Default scroll increment on other platforms (e.g. XCB, Windows) is 120.
With libinput it was 15 * 120 = 1800, which results in non-smooth scolling
experience. This patch also replaces deprecated versions of
QWindowSystemInterface::handleWheelEvent().
Change-Id: I363f13a2922fd871a93dbd1bd611778fa18f6122
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
I guess this signal pattern was copy-pasted from evdev input integration
code, where we use similar signals in combination with QDeviceDiscovery.
In libinput, device notifications are delivered via libinput APIs, so
these signals are not necessary. In evdev we do some logging from
slots that are connected to these signals. In libinput this is handled
via libinput_log_set_handler. As we can see, we can simply drop this code.
Change-Id: I50b519784e89b59ceeb3cf296780705fe98a8cbf
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This results in less boilerplate code, among other benefits that
come with functor-based connections. Simple expressions have been
converted to use lambda.
Change-Id: I6887980524027eada24beed95e6f9ba43f0fc8d5
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The backing store was assigned the sRGB color profile
as an unintended side effect of the QImage -> CGImage
conversion function refactoring in ac899f6d. This
caused Core Graphics to add a color convert step, which
in some cases caused performance issues.
Restore fast, previous behavior by assigning the target
display color profile to the backing store image.
Color correctness is still a goal, but we’ll add API
for it and make it opt-in.
Task-number: QTBUG-61384
Change-Id: Ia36d29404c64d8030a100f6a71816d84e484308b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Adds QWindowsDropDataObject as a QWindowsOleDataObject subclass
specialized for handling Drag & Drop, which only allows "text/uri-list"
data to be exported as CF_HDROP, to allow files dragged from
Qt applications and dropped into other applications to be recognized as
attachments or opened. Otherwise, files would be imported as URLs and
inserted as local hyperlinks.
[ChangeLog][Important Behavior Changes][Windows] On Windows, a drag
& drop operation of local files URIs, like QListView items backed by a
QFileSystemModel, will result in the attachment or opening of the files
by the target application, instead of the creation of hyperlinks.
Task-number: QTBUG-62662
Change-Id: I51efa4a56574b5e5fb3ee736ede14b5da24caac4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
AppKit will clear the needsDisplay state of a view when finishing the
display cycle, so if the client requested an update when delivering
the expose event, the update request would not be delivered unless
the view was otherwise exposed in some way at a later point.
Task-number: QTBUG-62964
Task-number: QTBUG-62963
Change-Id: I5ac9bf2f19af775294d093c8b7a414af22efee92
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This patch does not attempt to add the necessary functionality
to support other tablet buttons, it simply replaces deprecated
version of QWindowSystemInterface::handleTabletEvent(), by keeping
the previous logic.
Task-number: QTBUG-62886
Change-Id: I23597077774d482492136fda2e998700f8b27e9c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Logic that utilizes these event handlers was added by
f610814b05 and few months
later broken by 2b20ed5af4.
The original code used an event mask to select press/release/
motion events when creating window with XCreateWindow.
The XCB replacement (xcb_create_window) changed event mask to 0,
which means that these event handlers have been unused for
about ~4 years and can be safely removed. The eglfs_x11
integration receives mouse input directly from libinput/evedev.
Change-Id: Iac1521365445b8423898a16c3e609deb0806ce5e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
They aren't used in the API, so let's stop wasting library size.
Change-Id: I6e9274c1e7444ad48c81fffd14db247ecf825a57
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
If one wants to add them on demand, threads may have started, so these
functions should be thread-safe. That includes the calling of the
registered functions: some other thread could be adding post routines
too. Of course, if you're racing, it's your own fault, but we need to
support the routines registered with qAddPostRoutine adding more post
routines.
[ChangeLog][QtCore] qAddPostRoutine() and qRemovePostRoutine() are now
thread-safe.
Task-number: QTBUG-62915
Change-Id: I38341f8155354cc4a776fffd14dffa68bde8345d
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
There's no need for us to walk our own ancestor chain to figure out which
cursor to set. AppKit will automatically call cursorUpdate: on the view
that would be the hitTest target of the current mouse position, and by
falling back to super when no cursor is set for the current view, we
automatically get the behavior that effectiveWindowCursor tried to solve.
In addition, it solves the case of applyEffectiveWindowCursor applying
the arrowCursor when no cursor was set, which would mean that if any
native parent view of our view _did_ have a cursor set, we would not
fall back to the native view's cursor, but instead override it with
the arrow cursor. Following the responder chain gives the correct
behavior in this case.
Unfortunately, due to rdar://34183708, if a subview of one of our
views uses the legacy cursorRect approach to cursor management, the
cursor will not be reset back to our cursor via cursorUpdate: when
leaving the child and entering the parent view (our view). Moving
our implementation over to the legacy API would solve this problem,
but just propagate it to native parent views of our views, which
could potentially use NSTrackingAreas, and would not have _their_
cursors re-set.
Change-Id: Id20cc03136f0b1d4b9120750fe63ddc455363aaf
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Instead of masking window blitting via a CGImage mask, we use the window's
mask directly to intersect the region that we blit during flushing of the
QCocoaBackingStore. This approach also enables masking of child windows.
We now also support setting a mask for layer-backed views, by setting a
CAShapeLayer as the layer's mask.
The window shadow invalidation has been moved out of QNSView, as the view
should not be involved in that process. For layer-backed views, the shadow
is not invalidated as expected after the initial mask has been set, but
this bug has been left as a fix for a later stage as it requires more
research.
Change-Id: Ie0127d8df49d95b2d6144816b19559f3d3c95d13
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Calling [self cursorUpdate:] doesn't make much sense, and was probably
an oversight. The event is also delivered straight to the view, not to
the owner of the tracking area (as the documentation says it should),
but we keep this method implemented just in case.
Change-Id: I176a2aa782da316d1fe11ce15a89195595d80618
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This is preferable to the timer-based default implementation of
QPlatformWindow, as it gives AppKit more control of when to schedule
the update, and makes sure the update is scheduled along with other
views in the normal display-cycle, reducing the number of push flushes
we do. QtWidgets still need to plumb the update() method to updateRequest
for that to have any real effect though.
In the future we may consider scheduling the update via a display link,
if the window surface is set up for GL, for example.
Ideally we'd also have a platform hook for the repaint() method, so that
we could funnel it through display and get synchronous painting with
AppKit still taking care of drawing and compositing child views.
Change-Id: I136a9afa087b922aad69086548c2aa190ce75b6b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
- Add view to contentView, to allow checking parent view interaction
- Render via requestUpdate instead of manual timer
- Add two windows to check subview interaction
Change-Id: Ib028e62f585d45e42c0429e69ea6f45c8a90fe54
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Conflicts:
examples/examples.pro
qmake/library/qmakebuiltins.cpp
src/corelib/global/qglobal.cpp
Re-apply b525ec2 to qrandom.cpp(code movement in 030782e)
src/corelib/global/qnamespace.qdoc
src/corelib/global/qrandom.cpp
src/gui/kernel/qwindow.cpp
Re-apply a3d59c7 to QWindowPrivate::setVisible() (code movement in d7a9e08)
src/network/ssl/qsslkey_openssl.cpp
src/plugins/platforms/android/androidjniinput.cpp
src/plugins/platforms/xcb/qxcbconnection.cpp
src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
src/widgets/widgets/qmenu.cpp
tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
Change-Id: If7ab427804408877a93cbe02079fca58e568bfd3
... by using the new QIODevice::skip() function.
Change-Id: I943c4feb896d677f3150da542950595d7f485e75
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
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>
The former takes into account dynamically generated key-value-observing
(KVO) subclasses, of the form NSKVONotifying_*, which would result in
class_getSuperclass returning QNSWindow and recursing back to the original
call site of qt_objcDynamicSuper.
Change-Id: I4b8b1aa64d2834d9d1baa395c877319e99084bc8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This reverts commit 8561281768.
This change needs to be reverted because Windows 10 Creator's
Update doesn't fail on this test anymore during CI runs.
Reason for this is unknown.
Change-Id: Ice250ecedb14ac96fb3693b2d9884ef452a91cc2
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Compile examples/opengl only in case opengl support is available.
Task-number: QTBUG-62372
Change-Id: I742a1eb7b7639a5a722c4d5e9b4ee070b629b02e
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
It is (end - start) that represent the number of pixels being worked on
and needs to be smaller than the buffer size.
Change-Id: I75a22bc2656ac1c7d231278c3a1931758090f8ce
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
QTBUG_10735_crashWithDialog started to show flakyness recently - it crashes,
but not every time (which fits the definition of UB perfectly).
While the test itself is doing weird things and puts our event dispatcher
into a weird state, our API allows to:
1. Using QDialog to enter event loop (with runModalSession under the hood), then ...
2. to call from a slot (e.g. timer-attached) QApplication::closeAllWindows() while ...
3. we are still inside that special loop and using the 'session' object, thus ...
4. on the next iteration with [NSApp runModalSession:session] we'll re-use already released
session (released by endModalSession which in turn was called indirectly by closeAllWindows).
And Cocoa gives us a warning/hint: "Use of freed session detected. Do not call
runModalSession: after calling endModalSesion:."
Task-number: QTBUG-62589
Change-Id: Ie651cee1fba43cfd2b0fc44af5eddc5fd52e2907
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
This reverts commit 3d5bf00f18.
This change needs to be reverted because Windows 10 Creator's
Update doesn't fail on this test anymore during CI runs.
Reason for this is unknown.
Change-Id: I9f1c88606c97afc5952af34e04310612b783a9c2
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Delegating the border painting to qDrawPlainRect ensures that there are
no off-by-one pixel issues.
Task-number: QTBUG-61849
Change-Id: I56dc849da80fad00d02a0f9c60dbb621e6de7c48
Reviewed-by: Michael Winkelmann <michael.winkelmann@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Use QImageReader::supportsOption() instead of ::supportsAnimation(),
since the former checks what the handler supports in general, not just
the particular device.
Task-number: QTBUG-61642
Change-Id: I57db24425b4fd8821446659936e6a8ca55008921
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
If the style changes after the browser already jumped to an anchor,
the resulting browser position will be messed up.
So, after we changed the style we need to make sure that we jump
to the anchor again.
Since browsers do not jump to anchors that they already jumped to,
that means first jumping to the top, then to the actual anchor.
Task-number: QTCREATORBUG-18448
Change-Id: I86c736adab6940903276f8a896b4054ddae11ebe
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Dialogs and Sheets by default have the WindowsContextHelpButtonHint
set, which adds a question mark button to dialogs on Windows. This
button then triggers the 'What's this' mode by changing the cursor,
and letting the user explore the UI by showing whatsThis tooltips.
Anyhow, the paradigm is little used today and a lot of applications
do not set any whatsThis properties, leaving the mode pretty
non-functional. It's therefore common to explicitly remove the
WindowsContextHelpButtonHint from dialogs. However, this has to
be done for _every_ dialog.
Instead, this patch adds a global application flag to not set the
WindowsContextHelpButtonHint by default. This allows developers to
already buy into the Qt 6 behavior, where the flag will not be set
anymore by default.
[ChangeLog][QtWidgets] Added AA_DisableWindowContextHelpButton
attribute. Setting this attribute globally prevents the automatic
"What's this" button on dialogs on Windows
(WindowsContextHelpButtonHint).
Change-Id: I497a79575f222c78b2d5d051a6de346b231f72d3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
It's true that formattedDataSize is useful for formatting file sizes
from QFileInfo, but these links don't make sense here, and also cause
qdoc warnings due to lack of class scoping.
Change-Id: I9dd28200aa9d0da048db0c02ac66dc20c1b42e5c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
nullptr can be used directly in the Qt code since Qt 5.7.
Use it in generated code for consistency.
Change-Id: I249aeaf0a39b46ce1106b29d3ea4569a399908b7
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
CID 158429 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking ctx suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
Coverity-Id: 158429
Change-Id: I6d202599e962dae5ea4a45401f34237dd496d38b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This amends patch f27d1ccbb2.
Change-Id: I4c7a390a5f2cdd3307007c7b6708692c36f861b4
Task-number: QTBUG-62396
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>