Commit graph

20183 commits

Author SHA1 Message Date
Aleix Pol
5f306ae93d Improve debug, no need to show a number when we can show the value 2021-09-10 18:00:53 +02:00
Ismael Asensio
f6796ac860 [effects/overview] Only show close button for closeable windows 2021-09-10 17:25:19 +02:00
Ismael Asensio
07551a4487 Workspace: Better check of registered client shortcuts
Do not discard a shortcut immediately when it is already registered
in KGlobalAccel, because there could be possible dangling shortcuts
if they weren't properly cleaned-up (ex. after a crash).

Instead we delay the check for conflicts with other client shortcuts
to the second loop, which we know is up to date.

BUG: 442215
FIXED-IN: 5.22.80
2021-09-10 13:00:36 +02:00
Vlad Zahorodnii
46e2d51044 scripting: Make thumbnaills use linear filter
QSGImageNode ignores QSGTexture's filter, one has to specify it using
QSGImageNode::setFiltering().

In hindsight, we need to figure out how to integrate the lanczos filter
with window thumbnails and use it instead.

BUG: 441709
2021-09-10 09:16:24 +03:00
l10n daemon script
84426e8082 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-09-10 01:18:40 +00:00
Xaver Hugl
1b504818a3 platforms/drm: improve warning messages in DrmPipeline 2021-09-09 19:52:01 +00:00
Xaver Hugl
a0a98d0b31 platforms/drm: only delete outputs if not pre-existing
When there aren't enough CRTCs to drive all the outputs this could
delete existing outputs.
2021-09-09 19:52:01 +00:00
Xaver Hugl
b89f04943c platforms/drm: only test combinations if there are any
Otherwise we could hit an assert in DrmPipeline
2021-09-09 19:52:01 +00:00
Xaver Hugl
ffc4c12548 platforms/drm: commit pipelines directly instead of testing
The current behavior seems to cause some issues, and this is faster and
more efficient.
2021-09-09 19:52:01 +00:00
Vlad Zahorodnii
748004d81e x11: Avoid discarding the window pixmap for no reason
If the buffer size changes after creating or destroying the decoration,
the surface item will discard the pixmap.

If the buffer size remains the same, we can continue using old pixmap.
2021-09-09 16:55:39 +00:00
Aleix Pol
2ef53e7350 drm: Make hardware rotation opt-in
The current implementation sometimes will leave the screens unusable,
therefore KWIN_DRM_SW_ROTATIONS_ONLY=1 is default.
Use KWIN_DRM_SW_ROTATIONS_ONLY=0 to test hardware DRM operations.
2021-09-09 16:54:35 +00:00
Nate Graham
d11b4c8084 kcmkwin/kwindesktop: disable double-click mouse area while in edit mode
Otherwise the mouse area eats clicks and prevents text selection using
the mouse from working.

BUG: 441963
FIXED-IN: 5.23
2021-09-09 10:51:53 -06:00
Aleix Pol
d5be2232e8 Fix build 2021-09-09 17:10:48 +02:00
Alex Richardson
af3602b48c Fix out-of-bounds copy in xcb_send_event() calls
xcb_send_event always copies 32 bytes, so we have to pad all xcb_*_event_t
to 32 bytes to avoid leaking uninitialized stack memory. I found this
problem while running kwin_x11 on a CHERI-RISC-V system (which has bounded
pointers). The xcb_send_event() implementation has a memcpy() that was
copying 32 bytes but the event passed was a bounded to 28 bytes, so this
resulted in a run-time exception in X11Client::sendClientMessage().
The same problem exists in Selection::sendSelectionNotify(), but this time
we could end up copying up to 8 bytes since xcb_selection_notify_event_t
is only 24 bytes.

This disclosure of uninitialized data could in theory have a security
impact if it leaks a pointer value (e.g. a return address) as part of an
exploit chain that needs to bypass ASLR. However, the selection notify
events go directly to the XServer and you most likely already have a
serious problem if an attacker has full control over the XServer. It is
possible that the configure notify events go directly to an untrusted
client, but even if they do this leak is not directly exploitable.

See also https://gitlab.freedesktop.org/xorg/lib/libxcb/-/issues/18
2021-09-09 15:03:44 +01:00
David Edmundson
a4cdcb6c87 Fix xwayland copying unit test
The current code set m_pasteProcess to null, before running the cleanup
function which tells the process to quit.

Which is why it always hung the CI. This patch addresses it in a way
that cleans up helpers even if we abort the test early.
2021-09-09 11:13:02 +00:00
David Edmundson
65f168e144 Use a direct connection for X to wayland drags
We already use a direct DataSource object for transfer.

Use of the new public SeatInterface::startDrag allows us to start our drag directly.
2021-09-09 11:13:02 +00:00
David Edmundson
400dd31db6 Drop the internal connection for wayland to X drags
An AbstractDragTarget is introduced. This contains either the DataDevice we are
dragging to or an Xwl bridge.

We set this on Seat along with the active surface.

In future this also allows getting rid of the move filter.
2021-09-09 11:13:02 +00:00
David Edmundson
7f976199b7 Adapt to kwayland-server icon changes
The icon is a property of the active drag which is managed by Seat, the
DataDevice should not cache this.
2021-09-09 11:13:02 +00:00
Vlad Zahorodnii
0aaa57e18e Assign default name if new virtual desktop has no explicit name
If a virtual desktop has empty name, kwin is going to end up in an
infinite cycle where VirtualDesktopManager::save() updates the
_NET_DESKTOP_NAMES property and then in the next event loop cycle,
RootInfoFilter::filter() is going to call VirtualDesktopManager::save()
because the _NET_DESKTOP_NAMES property has been changed.

This regression has showed up just now because some parts of kwin used
to increase virtual desktop count to create new desktops. Recently, that
code was ported to VirtualDesktopManager::createVirtualDesktop().

The main difference between createVirtualDesktop() and setCount() is
that the latter will set the desktop name to "Desktop N", the former
will use user-specified name.

If the user-specified name is empty, the createVirtualDesktop() method
should assign "Desktop N" name to the virtual desktop according to the
docs. However, it's not the case and this change addresses that.
2021-09-09 10:50:16 +03:00
l10n daemon script
16f5ce9361 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-09-08 01:27:17 +00:00
Xaver Hugl
b38bb41698 Test DrmPipelines for outputs
Not all combinations of connectors, crtcs and planes will work
on all hardware, so we need to test the pipelines before using
them.

BUG: 433107
CCBUG: 435265
2021-09-08 02:44:29 +02:00
Xaver Hugl
18a8245ca2 platforms/drm: rename user data in DrmPipeline to output 2021-09-07 23:36:32 +02:00
Xaver Hugl
65b55e2045 platforms/drm: change when to reset the output with eglstreams
In order to accomodate crtc or primary plane changes on outputs we
need to dynamically recreate rendering resources with EglStreams as
the stream is tied to the crtc or plane currently in use.
2021-09-07 23:36:32 +02:00
Xaver Hugl
d057bd41c9 AbstractWaylandOutput: always emit mode change when mode is set
Otherwise there can be situations where the platform sets a mode but
KScreen never gets notified of it.
2021-09-07 21:34:01 +00:00
Xaver Hugl
f82d9f3d23 platforms/drm: remove duplicated warning
The same warning already gets printed in DrmPipeline
2021-09-07 21:34:01 +00:00
Xaver Hugl
e59f50e599 platforms/drm: adjust how transforms are set
Instead of using setTransformInternal directly, have DrmOutput
set it in updateTransform, like with the other setters. Also use
updateTransform instead of setTransformInternal in DrmBackend, so
that hardware rotation can be used where possible.
2021-09-07 21:34:01 +00:00
Xaver Hugl
1af2067f40 platforms/drm: reload m_conn in DrmConnector::updateProperties 2021-09-07 21:34:01 +00:00
Vlad Zahorodnii
82dd480196 autotests: Fix testMoveResize
"2" is a copy paste typo, the expected number of outputs is 1.
2021-09-07 20:51:48 +03:00
Vlad Zahorodnii
2d9207e251 autotests: Fix testSceneQPainter
Scene::qpainterRenderBuffer() was ported to AbstractOutput but not
testSceneQPainter, which results in a few broken tests.
2021-09-07 17:44:10 +00:00
Aleix Pol
6d35d63acb Fix build 2021-09-07 13:27:44 +02:00
Kai Uwe Broulik
1f53db1b44 [kcmkwin/kwindecoration] Port last remnants of removed "units"
ButtonGroup was still using it...
2021-09-07 07:41:42 +00:00
Kai Uwe Broulik
8bebf5cee1 Port to function-pointer based QMetaObject::invokeMethod
It's more efficient and compile-time checked
2021-09-07 06:30:39 +00:00
Xaver Hugl
ed2d0979c7 platforms/drm: fix warning 2021-09-07 05:45:51 +00:00
Xaver Hugl
237ef3d47f platforms/drm: fix drmModeSetCursor2 fallback
the return value is -errno, not errno.
2021-09-07 05:45:15 +00:00
l10n daemon script
d63b06d7a5 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-09-07 01:25:46 +00:00
Méven Car
74cb7a5b45 kcm compositing: Hide preview option in Wayland 2021-09-06 12:22:20 +00:00
Aleix Pol
be96741803 Test first desktop file names with the .desktop extension appended
It's the right thing to do, without it's only a fallback for bogus
applications.
2021-09-06 11:48:46 +00:00
Aleix Pol
73279acc63 Fix absolute desktop file names
Qt understands that the spec wants the id without .desktop postfix and
chops it, so we need to add it back if we want to infer the desktop
file.
https://code.qt.io/cgit/qt/qtwayland.git/tree/src/client/qwaylandwindow.cpp?h=5.15#n161

BUG: 425403
2021-09-06 11:48:46 +00:00
Vlad Zahorodnii
935fa6a9e1 Move ownership of Shadow to Toplevel
This decouples the management of Shadow from the scene window and allows
multiple items share the same Shadow.

Currently, kwin has a single scene graph, but it makes sense to create a
scene graph per output as they could have different layers, etc. This
would also allow QtQuick share more textures with kwin, which is worth
doing for optimization purposes in the future.
2021-09-06 10:42:39 +00:00
Vlad Zahorodnii
b40fb76c71 platforms/wayland: Prepend KWayland::Client:: to Surface 2021-09-06 10:42:03 +00:00
Vlad Zahorodnii
200223e06e autotests: Prepend KWayland::Client:: to Surface
With a "Surface" type in kwin, KWayland::Client::Surface without fully
specified namespace will conflict with kwin's Surface type.

In some way, it also improves readability as it's clear where Surface
comes from.
2021-09-06 10:42:03 +00:00
Vlad Zahorodnii
1d54231df1 scene: Generate unnormalized shadow texture coords
This makes shadow texture coordinates consistent with surface and
decoration texture coords and allows reusing window quads between
kwin items and qtquick items more easily.
2021-09-06 12:17:44 +03:00
l10n daemon script
9b06492499 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-09-06 01:26:11 +00:00
l10n daemon script
a78a9f3275 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-09-05 01:21:09 +00:00
Guilherme Marçal Silva
06d1d45f24 kcmkwin: Add new keywords to KCMs for finding options more easily 2021-09-04 17:19:32 +00:00
Ismael Asensio
436011e0ec X11Client: emit isCloseableChanged when updated
This allows the decoration buttons to be updated accordingly
when the status changes.

We also need to explicitely update allowed actions when rules
are applied, as `isCloseable` is not a settable property, but
an allowed action

BUG: 424370
FIXED-IN: 5.22.90
2021-09-04 15:51:38 +02:00
Ismael Asensio
bb0f749ee7 xdgshellclient: Fix "noBorder" rule on initialization
The check for this rule was missing on window initialization,
so on Wayland it wasn't being applied until something would
trigger the check again.

BUG: 429171
FIXED-IN: 5.22.90
2021-09-04 12:47:09 +02:00
Ismael Asensio
2aacea5026 Set a minimum version check for pipewire
Fixes compilation on systems with a lesser version than required
The minimum version is set to 0.3.29 as indicated in
https://invent.kde.org/plasma/kwin/-/merge_requests/1210
2021-09-04 04:24:07 +02:00
Aleix Pol
5d73adf780 Fix crash on the debug console
Do not access fields in DataSourceModel::m_data that are not available

0  0x00007f3445a4bd22 in raise () at /usr/lib/libc.so.6
1  0x00007f3445a3590e in abort () at /usr/lib/libc.so.6
2  0x00007f3446362bb1 in qt_message_fatal (message=<synthetic pointer>..., context=...) at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/global/qlogging.cpp:1914
3  QMessageLogger::fatal(char const*, ...) const (this=this@entry=0x7fff288a4ff8, msg=msg@entry=0x7f3446663028 "ASSERT failure in %s: \"%s\", file %s, line %d") at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/global/qlogging.cpp:893
4  0x00007f344636203e in qt_assert_x(char const*, char const*, char const*, int) (where=<optimized out>, what=<optimized out>, file=<optimized out>, line=<optimized out>) at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/global/qglobal.cpp:3366
5  0x00007f344973e118 in QVector<QByteArray>::at(int) const (this=0x55f42c20d338, i=7) at /home/apol/devel/kde5/include/QtCore/qvector.h:449
6  0x00007f34497305df in KWin::DataSourceModel::data(QModelIndex const&, int) const (this=0x55f42c20d320, index=..., role=6) at /home/apol/devel/frameworks/kwin/src/debug_console.cpp:1657
7  0x00007f3447674ed1 in QModelIndex::data(int) const (arole=6, this=0x7fff288a55c0) at ../../include/QtCore/../../../../../devel/frameworks/qt5/qtbase/src/corelib/itemmodels/qabstractitemmodel.h:460
2021-09-03 18:06:50 +00:00
Columbariu s
2fbeb0abc1 screencast/pipewire: Add TODO marks for extending modifier capabilities
no_use_linear: dropping the gbm GBM_BO_USE_LINEAR flag on allocation
explicit_modifiers: moving from the modifier-less api to the modifier
aware one with explicit modifiers
2021-09-03 17:49:37 +00:00