Commit graph

19355 commits

Author SHA1 Message Date
Nicolas Fella
0ea9969cee [kcmkwin] Remove unused PlasmaCore import 2021-02-09 20:50:12 +00:00
Nicolas Fella
2c6c1a7e76 [kcms/compositing] Remove definitions handling
QT_NO_URL_CAST_FROM_STRING is defined in the top-level CMakeLists.txt

Don't remove definitions, it builds fine with them
2021-02-09 19:48:01 +00:00
Nicolas Fella
eedb8e44ea Use imported target for Threads 2021-02-09 20:32:29 +01:00
Nicolas Fella
a110231f68 Use imported target for QtGui private headers
It's nicer
2021-02-09 19:59:51 +01:00
Alexander Lohnau
2b721200fb Port kwintabbox KCM away from KNS3::DownloadDialog 2021-02-09 12:00:19 +00:00
Alexander Lohnau
309e278561 Port kwineffects KCM to KNS QML components 2021-02-09 12:00:18 +00:00
Alexander Lohnau
09b1cea056 Port kwindecoration KCM to KNS QML components 2021-02-09 12:00:18 +00:00
David Edmundson
2d68196536 [xwl] Cache KWaylandServer::DataSourceInterface as a QPointer
Seat correctly emits dragEnded when a DataSourceInterface is destroyed,
and stops the drag.

However WlToXSource lives slightly longer to finish handling any other
visits. See the guarded delete statement in Dnd::endDrag.

With recent fixes use is mostly a hypothetical, but we still don't want
dangling pointers in our code.
2021-02-09 10:11:15 +00:00
David Edmundson
4bab721db8 [xwl] Cancel the visit when a drag ends
XWL only clears up when a "visit" finishes.

If we end a WlToXDrag through clicking we call "WlToXDrag::end" but the
visit object stays alive, which obviously will never finish.

Both the visit and the drag object then effectively leak and are used on
the next drag.
2021-02-09 10:11:15 +00:00
David Edmundson
f3d46cee15 [xwl] Avoid deletion of Transfer in signals from Transfer.
Transfer emits "finished" mid way through it's own methods. If we delete
here transfer is left in the middle of methods like Transfer::timeout
with a dangling "this".
2021-02-09 10:11:15 +00:00
Vlad Zahorodnii
335d9c4192 xwayland: Generate Xauthority file
This allows running Xwayland apps as root. Xwayland started with an
empty Xauthority file. After kwin has received the display number, the
file is updated with an actual authority entry.

BUG: 432625
2021-02-09 00:14:31 +02:00
Vlad Zahorodnii
8137b8a3ab xwayland: Fix initialization of WM_S0 selection owner
The selection owner must live as long as the X11 connection is valid;
otherwise Xwayland won't catch the corresponding selection ownership
change event, and the initialization sequence will be incomplete.
2021-02-08 22:12:06 +00:00
Laurent Montel
3c63750f6e GIT_SILENT: don't use deprecated cmake variable 2021-02-08 20:19:33 +01:00
Xaver Hugl
4890db3f16 Fix hotplugging for VR headsets 2021-02-06 10:54:44 +00:00
Vlad Zahorodnii
9acf04e2b7 Refactor Toplevel::opacity
The major difference between this version and the previous is that kwin
no longer forwards the opacity to the app window if it runs as a
window window manager and a compositing manager. As Keith Packard said [1]

> The window manager support is only needed to forward the property from the
> application window to the frame; with the Composite extension, a
> compositing manager can then take that value into account when
> constructing the desktop image.  Any X server can implement the Composite
> extension; the one in the X server project at freedesktop.org is just one
> such.  It would be trivial to implement this extension in a direct FB
> based X server, or any other X server which places windows in off-screen
> images.

There are a couple of reasons to do so: (a) simplifies code, (b) we don't
temper with opacities on override-redirect windows.

[1] https://listman.redhat.com/archives/xdg-list/2003-December/msg00153.html
2021-02-06 11:13:36 +02:00
Vlad Zahorodnii
7995112550 Change type of opacity to qreal
The rest of code assumes that it's qreal.
2021-02-06 00:42:44 +02:00
Vlad Zahorodnii
e117caa3eb x11: Fix damage region updates
We cannot use addDamage() in getDamageReply() because the former sets
back the m_isDamaged flag.
2021-02-04 18:27:17 +02:00
Vlad Zahorodnii
72fda78cf6 wayland: Schedule repaints even on empty commits
If only frame callbacks have been committed, the compositor must still
schedule compositing.

BUG: 428499
2021-02-03 06:50:06 +00:00
Xaver Hugl
e30b1a0f92 Don't allow direct scanout when using software cursor 2021-02-02 22:15:50 +01:00
Xaver Hugl
bda47c9043 Fixes for direct scanout 2021-02-02 16:19:30 +01:00
Vlad Zahorodnii
16f27d2dc6 Annotate Intel GPUs with architecture generations 2021-02-02 15:17:24 +00:00
Vlad Zahorodnii
cfb212e470 Detect more Intel GPUs
This allows detecting Intel GPUs up to Xe graphics.
2021-02-02 15:17:24 +00:00
Nate Graham
57b6091bd5 [effects/presentwindows] Activate even if only one window is open
Requested by VDG.

BUG: 428301
FIXED-IN: 5.22
2021-02-02 14:59:17 +00:00
Vlad Zahorodnii
f5925e2f17 wayland: Introduce internal popup event filter
The event filter allows dismissing the user actions menu by clicking
anywhere outside of it.

BUG: 428408
2021-02-02 14:09:44 +00:00
Xaver Hugl
30464e5c8b Implement direct scanout for the gbm backend 2021-02-02 13:26:43 +00:00
Aleix Pol
66f87138b1 Make it possible to restart kwin_wayland from a command line argument
A recent patch made it possible to restart KWin when it crashes, this
opens the possibility to do it for development purposes. So far it could
be done using `killall -9 kwin_wayland`. This patch embraces this
functionality under --replace so it's a bit more documented and under
its own semantics.
It is done by returning the process with 133 exit code and picking that
code specifically as a wish to restart.
2021-02-02 12:20:13 +00:00
Vlad Zahorodnii
e7dc64028c GIT_SILENT: kdecorations: Port away from Q_ENUMS to Q_ENUM
Q_ENUMS has been deprecated since Qt 5.5.
2021-02-02 09:55:56 +02:00
l10n daemon script
1d8ebfa475 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2021-02-02 07:28:08 +01:00
Vlad Zahorodnii
76effae5ca platforms/x11: Disable swap events by default on Intel
Some users reported performances issues after recent compositing
scheduling changes, in particular animations being laggy.

The issue is that sometimes it may take more than a vblank interval for
a buffer swap to complete. Previously, compositing was driven by a
timer and it wasn't synchronized to vblanks. If some frame is running
late, the compositor will just start painting a new frame, i.e. the
screen will be rendered triple buffered.

This change disables the swap events code path on Intel to restore the
previous behavior. Unfortunately, that may add an extra frame of latency.

The swap events code path can be enabled explicitly on Intel by setting
the KWIN_USE_INTEL_SWAP_EVENT environment variable to 1.
2021-02-01 18:51:59 +00:00
Vlad Zahorodnii
6aea213c84 platforms/x11: Build own vsync monitors only when GLX backend is built
The SGIVideoSyncVsyncMonitor and OMLSyncControlVsyncMonitor use GLX,
thus they should be compiled only if the GLX backend is built.
2021-02-01 18:49:16 +00:00
Vlad Zahorodnii
ffc013292f platforms/x11: Don't monitor vblanks on the root window
This makes scrolling in Firefox, which also monitors vblanks on the root
window, laggy.
2021-02-01 18:49:16 +00:00
Vlad Zahorodnii
b338c4cb0e platforms/x11: Move GLXFBConfig selection code in a separate file
This allows reusing the GLXFBConfig selection code.
2021-02-01 18:49:16 +00:00
Vlad Zahorodnii
4dcb3c495c effects/highlightwindows: Re-implement as AnimationEffect
On Wayland, the highlight window effect is not guaranteed to work all
the time because it uses the opacity to determine if the animation has
completed.

This change rewrites the highlight window effect using AnimationEffect
API to make it work both on X11 and Wayland. The implementation is based
on how the translucency effect works.
2021-02-01 13:07:11 +00:00
Xaver Hugl
f8d9b3bc6c Actually use a linear buffer format for multi-GPU
BUG: 431968
2021-02-01 11:28:28 +00:00
Xaver Hugl
2c6d19fec1 Only release shared buffers right before the next frame
BUG: 425586
2021-02-01 11:26:42 +00:00
David Edmundson
ed793dca21 Add option to enable XWayland debug 2021-02-01 09:14:17 +00:00
Vlad Zahorodnii
230b560ffc autotests: Fix TestXdgShellClient 2021-02-01 09:59:02 +02:00
Vlad Zahorodnii
21eee7de18 autotests: Fix TestDbusInterface
Activities had been exposed via the dbus interface in
6eda92a0fd.
2021-02-01 09:30:58 +02:00
Nicolas Fella
99947c8bd8 Use versionless Qt cmake target
This makes it easier to build against both Qt5 and Qt6

GIT_SILENT
2021-01-30 17:18:21 +01:00
Aleix Pol
46adeb79ec input methods: improve closing process
Make sure it's destroyed when kwin shuts down, make sure we don't start
it, for example because it crashed when we killed it like maliit does.
2021-01-29 17:11:14 +00:00
Laurent Montel
88b6076b2f GIT_SILENT: dont use deprecated cmake variable 2021-01-29 11:34:52 +01:00
Vlad Zahorodnii
b2d120a4dd Lower message severity of self test log messages
It is reported that the self test produces false positives with some
drivers. At quick glance, there is nothing in particular extremely wrong
with the test. Since not a lot can be done about the test except making
changes in drivers, the severity of the log messages should be lowered
to avoid polluting logs.
2021-01-28 20:00:05 +00:00
Aleix Pol
92c00d1dc3 screencasting: generate the composed textures with the proper size
Don't neglect the scale of the buffer for windows that we are rendering
on the spot.
Otherwise we will be offering a smaller size to what we are generally
using. More importantly, the ScreencastManager expects the buffers
scaled. This causes glitches when the stream starts otherwise as the
first frame triggers a resize.

CCBUG: 428594
2021-01-28 18:24:40 +00:00
Aleix Pol
38e656ba7e screencast: Properly report the initial size of windowed streams
Otherwise we'll be triggering a resize request first thing and never
hear back from the stream until a new frame is requested (which is often
rare when looking at a thumbnail).

BUG: 428594
2021-01-28 18:24:40 +00:00
Arjen Hiemstra
a53100dd55 ColorDevice: Always update on creation
ColorDevice gets recreated when outputs get removed and added back. This
means the output can be in an unknown state that does not match the
values in ColorDevice. So ensure we update after creating the device to
set it to a known proper state.
2021-01-28 17:25:08 +00:00
Vlad Zahorodnii
d074b47aab Fix logical error
It makes more sense to access position() if positionValid() returns true.
2021-01-28 17:18:43 +00:00
Vlad Zahorodnii
3e739ff877 Simplify InputDeviceHandler::updateDecoration() 2021-01-28 17:14:25 +00:00
Yuri Chornoivan
afcd2e031b Minor documentation formatting fixes 2021-01-28 17:47:15 +02:00
Vlad Zahorodnii
3788a8285d Remove QPointer from function prototypes in some input code
As it was pointed out in 6acf35e4cc, it is
better to return raw pointers than qpointers because returning a qpointer
is equivalent to constructing a new one.
2021-01-28 16:49:29 +02:00
Vlad Zahorodnii
a78754b695 Fix recorded render time when glXSwapBuffers() blocks
If glXSwapBuffers() blocks, the render loop will also record how long
kwin was blocked. Obviously, we don't want that.
2021-01-28 12:55:10 +00:00