It is possible for updateOutputs to be called when a pageflip is pending.
Freeing a DrmOutput with a pending pageflip is not allowed (see ~DrmOutput assert - the page flip handler will be called on the freed memory, possibly leading to use-after-free).
This works around the problem by delaying the destruction with teardown().
BUG: 422460
In atomic setting mode, when external display tears down, it will blank
crtc with dump buffer by legacy api, then re-plug the external display,
the blank can not be removed. We think the blank is not needed in atomic
mode setting.
Signed-off-by: Chaojiang Luo <chaojiangluo@163.com>
The surface size is a logical size, which renders it unsuitable for
deciding whether the window pixmap needs to be discarded.
We need to discard window pixmaps when the buffer size changes. That
has a drawback though, discarding textures is kind of an overkill with
linux-dmabuf. However, fixing that would involve changes in kwayland
server that are far from being trivial.
BUG: 422459
In order to ensure that no configure events will be sent before the full
initial state is committed, we need to queue maximize and full screen
requests or else the client may receive an "unexpected" configure event
and we miss to call initialize().
It was udpated when we received a configure event but not in the initial
track.
The symptom of this being missed out was that blur would not be applied
to the window.
BUG: 423405
CCBUG: 423297
A seemingly unrelated change to cursors broke xwayland's clipboard
syncing, presumably because of a change in how startup is ordered with
regards to syncing between our internal wayland connection causing a
crash.
It was fixed with a flush, but ultimately guarding things coming up in
the natural order works better.
Long term plans are to finish removing the internal connection.
See xwayland_selections_test in autotests.
When the user selects all of the types or none of them, the "types"
property must be set to a special value (`NET::AllTypesMask = -1`),
different than the sum of all the flags together.
This re-implements this behaviour as the old KCM, fixing some heuristics
that prevented finding the rule corresponding to the current window.
The enum name that handles this property has been changed to `NetTypes`
to make it more explicit.
BUG: 423214
FIXED-IN: 5.19.3
TEST PLAN:
1. Open the `Application specific settings` on a window via menu
2. Select every "Window Type" (or none of them)
3. Give the rule a different name than the default and save
4. Open it again and check that the same rule is found
Depending on the current focus stealing prevention level, it's possible
for kwin to call XSetInputFocus() on a window that already has the input
focus. In which case, we won't receive the corresponding FocusIn event
and the client will remain inactive from kwin's perspective even though
it isn't.
In order to work around this issue, we can move the input focus to the
null window. By doing so, it's guaranteed that we're going to receive
the matching FocusIn event for the client.
This commit indirectly fixes a bug where fullscreen games are displayed
below panels.
Property `wmclass` of a window rule works in a special way, as it can have
two meanings depending on `wmclasscomplete` flag:
- false: only matches `resourceClass`
- true: matches `resourceName` and `resourceClass`
This MR fixes two subtle bugs when detecting the properties of a window:
In the first case, `resourceName` was being wrongly set instead, which
prevented window matching for windows where those two values differ.
Also, the `wmclass` field was always set to `resourceName` independently
of `wmclasscomplete` property.
BUG: 423138
FIXED-IN: 5.19.3
Due to a bug in the XI2 protocol, clients have to reset scroll valuators
on XI_Enter because the scroll valuators might have changed while the
pointer was elsewhere. The XI_Enter event is usually sent when an input
device enters the window, but it can also be generated by a passive grab.
If an XI_Enter event has been generated by a passive grab, the client
should not reset scroll valuators. Unfortunately, there is no any
reliable way for the client to determine if an XI_Enter event has been
sent in response to a deactivated passive grab. A correct fix for the
scroll issues in GTK apps would involve changes in the XI2 protocol.
As a work around, we can hold a passive grab only if the current mouse
wheel action is either "Activate and scroll" or "Activate, raise, and
scroll."
BUG: 394772
FIXED-IN: 5.19.3
WaylandCursorImage::loadThemeCursor(const T &shape) uses templates.
These templates are used by input.cpp but the deifnition is in
pointer_input.cpp
On some setups this creates a compilation problem.
This patch introduces an explicit non-templated declaration with the
defintion explicitly complied into the same class.
In master this has been refactored away anyway, so this is a minimal
patch to make things working in the least invasive way.
BUG: 423052
QDebug& operator<<(QDebug& stream, TopLevel*)
calls TopLevel::debug(stream)
So our implementation has to provide something custom not call the base
class.
Debug here is loosely based on X11Client. It probably can be expanded on
in time, but at least it won't crash.
We send two async actions via another process
We do a wait for one
We check that we received two events
This is racey. QTRY_COMPARE can allow both events to arrive separately.
The surface-to-buffer matrix provides a generic mechanism for mapping
things from the surface-local coordinate space to the buffer coordinate
space. If it changes, we know for sure that the texture coordinates
have to be re-computed.
The usage of geometryShapeChanged() is highly discouraged because it is
emitted when geometry of any kind has been changed, e.g. buffer geometry,
frame geometry, etc.
This change ports DecoratedClientImpl to the clientGeometryChanged()
signal, so the cached client size will be updated only after the client
geometry has actually changed.
In most cases, we don't need to react to client geometry changes, but in
code that deals with server-side window decorations, we need to react to
client geometry changes. The problem is that frame and client geometry
updates are not correlated even though there is a connection between the
frame geometry and the client geometry.
This change introduces the client geometry in the Toplevel class in order
to allow monitoring client geometry updates from DecoratedClientImpl.
Since WaylandCursorImage no longer flushes the internal connection
connection and dispatches events, the DataBridge must do it to ensure
that the selections are initialized prior to receiving a ProperyNotify
event.
Currently in order to load an Xcursor theme, kwin uses libwayland api,
which looks really awkward because of the way how the compositor talks
to itself via the internal connection.
The main motivation behind this change is to limit the usage of kwayland
client api in kwin.