Commit graph

1114 commits

Author SHA1 Message Date
l10n daemon script
b461111130 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-16 01:18:13 +00:00
Severin von Wnuck
05af11b4ed qpa: Fix EGL config selection
The configs returned by eglChooseConfig are sorted from highest to lowest buffer sizes.
Filter the configs to find a suitable candidate that matches the requested attributes of the surface.
This fixes the corrupted Aurorae window decorations on Wayland with the proprietary Nvidia driver.
2021-09-16 00:37:19 +02:00
Andreas Sturmlechner
38e24ecd64
Fix build with 32-bit
Follow-up to 839710201c

Tested-by: David Flogeras <dflogeras2@gmail.com>
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2021-09-15 19:06:23 +02:00
Vlad Zahorodnii
f4b504c476 wayland: Fix google chrome fullscreen mode
Conceptually, a configure event inherits its parent's state and adds
some of its own. This allows the compositor to skip intermediate
configure events in ack_configure handler and jump to the last one.

Currently, the only field that XdgSurfaceConfigure objects need to
inherit is flags. The geometry info and window states are filled in by
role commit implementations to their latest values.

XdgSurfaceConfigure::flags indicates if the configure event moves the
window. This flag is important to resolve conflicts between geometry
updates initiated by the user and the ones that are made in response to
acknowledged configure events, e.g. after maximizing the window, etc.
(effectively, if the user moves a window, kwin will cancel scheduled
moves in configure events)

If configure flags are not inherited, we can end up with the following
case:

* configure event A (flags: {position})
* configure event B (flags: {})

If the client acknowledges configure event B, kwin will skip configure
event A, and thus it won't move the window to the right place. This is
the root cause of fullscreen mode misbehaving with apps such as google
chrome.
2021-09-15 16:17:17 +00:00
Vlad Zahorodnii
d58246961e scene: Fix previous pixmap ref'ing
discardPixmap() increases the reference counter, but there's no matching
place where the ref count is decreased, which results in the previous
pixmap not being released even if it's not needed anymore.
2021-09-15 16:16:42 +00:00
l10n daemon script
46a69357a7 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-15 01:22:44 +00:00
Andrey Butirsky
987c68f5a5 fix: [Wayland] Context menu opens behind apps launcher and popups
BUG: 437139
2021-09-14 13:28:09 +00:00
Xaver Hugl
b8d69a326c platforms/drm: improve VT switching behavior
Instead of setting pipelines one by one, use DrmGpu::updateOutputs to
set all the outputs on a GPU with a single atomic commit. This makes
the switch both faster, more reliable and in case the other drm master
changes the output configuration, prevents blanking.
2021-09-13 16:58:49 +02:00
Aleix Pol
2bd02f660b wayland platform: Remember to call setTransformInternal() from updateTransform() 2021-09-13 10:11:09 +00:00
Vlad Zahorodnii
839710201c x11: Fix build with EGL_NO_PLATFORM_SPECIFIC_TYPES
eglCreateWindowSurface() wants a Window (unsigned long), but with
EGL_NO_PLATFORM_SPECIFIC_TYPES, EGLNativeWindowType is defined as an
opaque pointer, i.e. void*.

BUG: 440372
2021-09-13 06:37:19 +00:00
Xaver Hugl
e10f2ce06e platforms/drm: correct property blob handling
If a property blob got created by another drm master we can't rely on
re-using it, so create a new blob of our own with the data copied over
when the kernel destroys it.
Also free property blob objects when we don't need them anymore.

BUG: 440294
2021-09-13 01:28:47 +02:00
l10n daemon script
abe6b41534 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-11 01:16:54 +00:00
Aleix Pol
050c6ae76b Improve behaviour upon rotation with keyboard on
We make sure our client stays maximised as the screen geometry changes.

Fixes https://invent.kde.org/plasma/plasma-phone-components/-/issues/91
2021-09-10 23:37:55 +00:00
Aleix Pol
883dbfda17 drm: Properly check for the need for transformation
At the moment we were checking for size difference between the buffers
which works for rotation but not for flipped or up-side down screens.

This changes how we check it by comparing the effective transform vs the
supported one in drm to see if they differ.

Fixes https://invent.kde.org/plasma/plasma-phone-components/-/issues/112
2021-09-10 20:11:57 +02:00
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
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
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
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
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
Columbariu s
150ebf0cf7 screencast/pipewire: announce format with modifier 2021-09-03 17:49:37 +00:00
Columbariu s
8a2475da63 screencast/pipewire: Add buildFormat method 2021-09-03 17:49:37 +00:00
Columbariu s
b05900e242 screencast/pipewire: Check for a modifier in the format negotiation via pipewire 2021-09-03 17:49:37 +00:00
David Edmundson
78439fd3e7 Avoid test commit whilst constructing DrmOutput
Otherwise we'll try to render a frame on an output before making the
output, which segfaults.
2021-09-03 16:43:48 +00:00
Xaver Hugl
c48ac020cd platforms/drm: correct cursor dirty handling 2021-09-03 18:26:23 +02:00
Vlad Zahorodnii
8891cdb74f effects/overview: Remove "wip" from description
Removing (WIP) will result in more work for translators. There are other
ways to indicate the effect is not ready for its prime time yet, e.g.
being disabled by default.
2021-09-03 13:00:05 +03:00
David Redondo
1c074d81e2 Add clipboard tab to debug console
Can be useful when investigating clipboard related problems, by checking
which source KWin thinks is the current clipboard. Displays clipboard and
primary selection.
2021-09-03 08:40:07 +00:00
Vlad Zahorodnii
c0bec3e27b effects/overview: Add missing desktop filters 2021-09-03 09:40:39 +03:00
Vlad Zahorodnii
43a50be325 effects/overview: Display window icon and caption
BUG: 441312
2021-09-03 06:38:54 +00:00
Vlad Zahorodnii
79a7cf1aec effects/overview: Allow setting ExpoCell margins 2021-09-03 06:38:54 +00:00
Ismael Asensio
9995f984c3 kwinrules: Use a list of desktop UUIDs to set and store the rules setting
Port the RuleSettings and KCM to store and use a list of virtual desktop
 UUIDs, instead of the previous x11 positional id, continuing the work on
This allows to set a rule with several desktops on Wayland.

On X11 it has no visible change for the user, but internally it uses the
more modern concept, helping to simplify the related code.

The relevant key on kwinrulesrc changes from `desktop` to `desktops`.
A kconf_update script handles the migration.
2021-09-02 22:11:46 +02:00
Xaver Hugl
5da8df39a5 AbstractWaylandOutput: make updateMode use uint32_t 2021-09-02 14:34:07 +02:00
Xaver Hugl
26ad8e194f platforms/drm: support Broadcast_RGB setting
This allows the user to switch between full and limited rgb.

BUG: 375666
BUG: 353689
2021-09-02 13:53:02 +02:00
Xaver Hugl
f096629f89 platforms/drm: refactor drm property enums 2021-09-02 13:48:58 +02:00
Vlad Zahorodnii
dc39745f14 effects/overview: Remove duplicate Qt.Key_Escape 2021-09-02 09:32:59 +00:00
Vlad Zahorodnii
717fae2af5 effects/overview: Improve search user experience
If the window has only one visible window and user presses Enter key,
activate that window.
2021-09-02 09:32:59 +00:00
Vlad Zahorodnii
9bd0eb1074 effects/overview: Add search field
The present windows allows the user to search windows by their caption
or window role. This change brings that functionality to this effect.

BUG: 441302
2021-09-02 09:32:59 +00:00
David Redondo
c562a5c04f DragWlToX: Do not send position before enter
According to the spec, enter has to be send before position.
Sending position first seems to confuse clients, before this
change X windows only seemed to get data when the pointer left and
entered them for a second time. Now it works straight away.
BUG:437406
2021-09-02 11:17:53 +02:00
Janet Blackquill
0042d2d8c1 effects/desktopgrid: port to realtime gestures
This ports the Desktop Grid effect to realtime gestures,
both to have the end-user result, and to demonstrate how
effects can have realtime gestures.
2021-09-01 19:49:21 -04:00
Janet Blackquill
6231699ac1 Lay some groundwork for realtime gestures in Wayland
This lays down some groundwork for realtime gestures in Wayland,
so that gestures that are 1:1 with user motion on a touchpad are
now possible to implement.

Due to earlier commits, this is mostly just glue code to make a
convenient API.

Gestures implemented with this API are four-finger gestures, to
avoid conflicting with apps that may use two or three-finger
gestures.
2021-09-01 19:48:41 -04:00
Tatsuyuki Ishi
81389a6e17 blur: pass projection matrix by const reference
Passing QMatrix4x4 by value can result in copying a non-trivial amount (16)
of floats, so avoid that.
2021-09-01 21:42:56 +00:00
Tatsuyuki Ishi
c193efc962 blur: add noise in perceptual space
The previous implementation added noise in linear space, which resulted in
the effect becoming more pronounced on black backgrounds. This patch
changes the process to be applied in perceptual space, by making the noise
addition pass a separate draw call and disabling GL_FRAMEBUFFER_SRGB during
that.

After this change, noise will look much more suppressed and almost never
grainy. This change also changes the range of the noise from
[-strength..strength) to [0..strength), as blending can only be either
additive or subtractive. As a result, users might need to ramp up their
noise parameter after this change.

v2: Add more explanation around the draw call.
v3: Fix noise not fading out with the fade out effect.
v4: Restore an accidentally removed comment.
v5: Add CCBUG.
v6: Rebase.
v7: Fix a formatting issue.

CCBUG: 409620
2021-09-01 21:42:56 +00:00
Méven Car
0a2c511489 Wayland: Add support for protocol kde-output-device_v2, allow to detect drm mode changes
CCBUG: 407058
2021-09-01 13:37:43 +00:00
Vlad Zahorodnii
03b64331f2 wayland: Remove special input method case in XdgToplevelClient
Input method surfaces have input_panel_surface role, so the special case
for input method windows can be dropped.
2021-09-01 10:26:16 +00:00
Vlad Zahorodnii
99e208e30f wayland: Always setup window management for xdg-shell clients
kscreenlocker uses the layer-shell protocol, so the special lock screen
case can be removed.
2021-09-01 10:26:16 +00:00
Vlad Zahorodnii
1717de8a59 Port XdgToplevelClient::updateShowOnScreenEdge() to AbstractOutput 2021-09-01 10:10:24 +00:00
Vlad Zahorodnii
cdd3f96fe1 Port X11Client::fullscreenMonitorsArea() to AbstractOutput 2021-09-01 10:10:24 +00:00
Vlad Zahorodnii
26e470b7ff Port screenContainsPos() to AbstractOutput 2021-09-01 10:10:24 +00:00
Vlad Zahorodnii
25a6515e05 Port AbstractClient::checkQuickTilingMaximizationZones() to AbstractOutput 2021-09-01 10:10:24 +00:00
Vlad Zahorodnii
8b85fdcedf wayland: Setup window management integration on initial commit
Originally, there was ShellClient class that was the predecessor to
WaylandClient subclasses. If the main surface is unmapped, the
corresponding instance of ShellClient would be kept around. That had
been changed with the introduction of XdgToplevelClient and
XdgPopupClient.

Since ShellClient had been kept alive even if the corresponding surface
were unmapped, it did make sense to setup window management integration
when the surface is mapped.

However, this also means that plasma will not know about initially
minimized windows.

Since unmapped windows are handled differently now, we can setup window
management after the client performs the initial commit. If the main
surface is unmapped, the XdgToplevelClient object will be destroyed and
with it, the window management integration.
2021-08-31 23:42:07 +00:00
Carson Black
63b16cdf9d Increased edge margins 2021-09-01 01:33:51 +02:00
Aleix Pol
0b74aa62c9 Support PlasmaWindowInterface::sendToOutput 2021-08-31 21:25:18 +00:00
Xaver Hugl
a3cbaf48dc platforms/drm: fix modifier env variable
Like the name suggests, modifiers were meant to be enabled by default
2021-08-31 16:30:03 +00:00
Vlad Zahorodnii
d70cfadf96 platforms/drm: Fix outputDisabled signal
The outputDisabled() signal must be emitted **after** removing the
output from a list of enabled outputs.
2021-08-31 16:02:19 +00:00
Vlad Zahorodnii
b0c26cc424 effects/overview: Layout window thumbnails in updatePolish()
Currently, ExpoLayout delays layout updates by using a singleshot timer
(primarily due to the author of the effect not being aware of
QQuickItem::polish() and QQuickItem::updatePolish()).

This change makes ExpoLayout schedule layout updates using QtQuick's
native item polish machinery, which gets triggered before rendering and
thus we can batch more geometry updates.

In addition to that, this change simplifies the initialization code in
ScreenView by making the fact that ExpoLayout is arranged right before
rendering internal to the WindowHeap type.
2021-08-31 12:51:29 +00:00
Vlad Zahorodnii
683bf20168 Port ScreenEdges away from Screens 2021-08-31 11:17:46 +03:00
Vlad Zahorodnii
cbaf39e270 Port the remaining usages of Screens::geometry(i) in Workspace to AbstractOutput 2021-08-31 09:45:20 +03:00
Vlad Zahorodnii
9bf6e2bd68 Port Workspace::supportInformation() to AbstractOutput 2021-08-31 09:41:22 +03:00
Vlad Zahorodnii
1b2e8437ac Use precomputed workspace geometry in Workspace::initializeX11()
When initializeX11() is called, the workspace geometry is known, so it
doesn't need to be computed again.
2021-08-31 09:35:27 +03:00
Vlad Zahorodnii
e198727e15 Drop Toplevel::isOnScreen()
It's unused. Its replacement is Toplevel::isOnOutput().
2021-08-31 05:45:55 +00:00
l10n daemon script
96c6f964e6 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-08-31 01:29:11 +00:00
Xaver Hugl
85a6dc3cad platforms/drm: correct multi-gpu mistake
As all outputs from secondary GPUs are in the same map as the ones from
the primary GPU, EglMultiBackend::findBackend always returned the
primary backend. To fix that, search in secondary backends first
2021-08-30 23:00:19 +02:00
Vlad Zahorodnii
89d49b4d5d platforms/virtual: Add new outputs before removing old outputs
This is to prevent hitting the case where there are no any outputs.
Ideally, it shouldn't matter in which order outputs are added or
removed, but the Workspace and AbstractClient subclasses don't work
with true headless mode. If there are no outputs, kwin can crash.
2021-08-30 15:08:52 +00:00
Vlad Zahorodnii
f8ad513648 Unvirtualize property getters in Screens
MockScreens is gone so property getters in Screens can be regular
methods now.
2021-08-30 14:46:00 +00:00
Vlad Zahorodnii
8fd1914f83 Port Edge to Platform::outputAt() 2021-08-30 14:46:00 +00:00
Vlad Zahorodnii
901e479482 autotests: Rewrite testScreenEdges as an integration test
Due to the screen edges test not being an integration test, it's very
hard to change output related code in libkwin. screens.cpp needs to have
a few ifdefs to successfully compile.

This change rewrites the screen edges test as an integration test in
order to allow us using other components of kwin in screens.cpp and
screenedge.cpp without ifdef guards.

It's not a one-to-one port.
2021-08-30 14:46:00 +00:00
Xaver Hugl
42b516b567 fix drag and drop raise with Xwayland windows
They shouldn't be raised immediately. The same strategy as with
Wayland native clients should be used.

BUG: 440534
2021-08-30 16:31:28 +02:00
Xaver Hugl
f4d63bb8ed platforms/drm: first emit outputDisabled, then remove output
The current behavior is in contradiction to the description of
Platform::outputDisabled
2021-08-30 16:24:25 +02:00
Xaver Hugl
dbf4a59527 platforms/drm: prevent having zero outputs at any time
Instead of updating all outputs first, create the placeholder output
before the last output gets removed.
2021-08-30 16:24:08 +02:00
Vlad Zahorodnii
2696030b00 Port AbstractClient::setQuickTileMode() to output() 2021-08-30 13:58:52 +00:00
Vlad Zahorodnii
8a93a33b96 x11: Make sure that outputs are stored in xinerama order
With the new output query algorithm, position of an output may not align
with its xinerama index. This can be problem on x11 as some protocols,
e.g. startup feedback, use xinerama indices to identify outputs.

Technically, the RandR specification doesn't say that CRTCs are stored
in the xinerama order, it only mentions that the first CRTC corresponds
to the primary output. However, such assumption was made by kwin prior
to output query changes, this change merely restores that behavior.
2021-08-30 13:28:53 +00:00
Vlad Zahorodnii
7016da39c8 Move active output tracking to workspace
Active output is a window management concept. It indicates what output
new windows have to be placed on if they have no output hint. So
Workspace seems to be a better place for it than the Screens class, which
is obsolete.
2021-08-30 13:28:23 +00:00
Vlad Zahorodnii
16bc522bfc Rename Workspace::setCurrentOutput() to switchToOutput() 2021-08-30 13:28:23 +00:00
Vlad Zahorodnii
813804d5a0 x11: Port X11Output::setGammaRamp() to Application::x11Connection()
It's faster.
2021-08-30 12:16:24 +00:00
Vlad Zahorodnii
96830d2295 x11: Simplify X11Output::geometry()
There is a separate type for placeholder x11 outputs, so X11Output can
return its geometry without performing any checks.
2021-08-30 12:16:24 +00:00
Vlad Zahorodnii
9dfccfc95c Port some of kwin to Workspace::geometry() 2021-08-30 12:26:16 +03:00
Vlad Zahorodnii
71aeb5528a Cache workspace geometry in Workspace
This allows us to drop obsolete Screens class.

Currently, the Screens class is a thin wrapper around platform outputs +
some extra tracked state, e.g. active output, workspace geometry, etc.
2021-08-30 12:26:14 +03:00
Vlad Zahorodnii
d9686a0caa Avoid using Screens in Workspace::updateClientArea()
Use AbstractOutput for consistency sake.
2021-08-30 12:17:08 +03:00
Vlad Zahorodnii
acb5c04fae Drop Workspace::clientArea(clientAreaOption opt, const Toplevel *window, int screen)
It's unused.
2021-08-29 21:55:07 +00:00
Vlad Zahorodnii
b80fbe6fb0 Merge WindowRules::checkScreen() and WindowRules::checkOutput() 2021-08-29 21:55:07 +00:00
Vlad Zahorodnii
a1f1039b58 Store AbstractOutput in Toplevel
Since AbstractOutput is used more than int screen ids in kwin, it's
worth storing AbstractOutput for better performance.
2021-08-29 21:55:07 +00:00
Vlad Zahorodnii
6ca411a84a Port AbstractClient::sendToScreen() to AbstractOutput 2021-08-29 21:55:07 +00:00
Vlad Zahorodnii
22649137d6 Port FocusChain to AbstractOutput 2021-08-29 21:55:07 +00:00
Vlad Zahorodnii
02a9457bbc Port Workspace::clientUnderMouse() to AbstractOutput 2021-08-29 21:55:07 +00:00
Vlad Zahorodnii
e0c941109c Allow setting current AbstractOutput 2021-08-29 21:55:07 +00:00
Vlad Zahorodnii
507c5140b7 Port Workspace::topClientOnDesktop() to AbstractOutput 2021-08-29 21:55:07 +00:00
Vlad Zahorodnii
95e5f5fc1a Introduce Toplevel::output()
This is a little helper that can be very convenient with our transition
from int-based screen ids to AbstractOutput.

As is, the main issue with int screen ids is that they are extremely
dynamic.
2021-08-29 21:55:07 +00:00
Ismael Asensio
77325dbb79 kcm/rules: Port KCM loading to KPluginMetadata
Passing just the plugin name to the KCM loader has been
deprecated in 5.85. This just affects the standalone loading of
the KCM via the window menu.
2021-08-29 13:13:33 +02:00
l10n daemon script
216233c2ec 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-08-29 01:20:37 +00:00
Xaver Hugl
0054d825c4 platforms/drm: directly check for required properties
Instead of crashing because a nullptr property gets accessed, use
an explicit error message and ignore the offending object. This also
acts as documentation
2021-08-27 20:25:18 +00:00
Vlad Zahorodnii
5a1b98d148 Allow passing Toplevel to Workspace::clientArea()
This allows us to re-use the same code path for alive and deleted
windows.
2021-08-27 19:33:47 +00:00
Vlad Zahorodnii
d228829abb Introduce Platform::outputAt()
With AbstractOutput being used more heavily, it makes sense to have
something like Screens::number() in the Platform class. As is, the steps
to get an output for a given point are awkward - first, get the screen
id, then use the screen id to get the output.
2021-08-27 21:51:05 +03:00
Vlad Zahorodnii
1dc749333e Remove desktop argument in AbstractClient::electricBorderMaximizeGeometry()
With the new virtual desktop model, we have an issue where the old
code that uses desktop() needs to be ported to desktops().

However, using no desktop() is better as we don't need to deal with
cases where a window can be on several desktops, which can be annoying
sometimes.

This change removes the desktop arg in electricBorderMaximizeGeometry()
and ports it to a Workspace::clientArea() overload that requires no
desktop.

Under the hood, Workspace::clientArea() still uses desktop(), but it
could also use a different strategy to compute the client area if the
window is on several virtual desktops, e.g. intersect client area on
every virtual desktop.
2021-08-27 15:12:59 +00:00
Vlad Zahorodnii
e5f6039a68 Remove desktop() usage in Workspace::activateClient()
Explicitly make the last virtual desktop current. This improves code
readability and gets rid of a desktop() usage.
2021-08-27 15:12:25 +00:00
Xaver Hugl
d6de38c1d6 platforms/drm: use drm formats instead of gbm formats
There's no need to guard the code, gbm and drm format definitions
are the same. Using GBM_BO_FORMAT_* even caused bugs, as that is
an enum and not a proper format identifier.

BUG: 441253
2021-08-27 11:56:36 +00:00
Xaver Hugl
092660613a platforms/drm: fix legacy mode
CCBUG: 441253
2021-08-27 11:50:02 +00:00
Vlad Zahorodnii
fff32f64e6 effects: Drop EffectsHandler::screenGeometryChanged()
It's confusing to have two signals (virtualScreenGeometryChanged() and
screenGeometryChanged()) that indicate the same thing.
2021-08-27 09:23:33 +00:00
Vlad Zahorodnii
ff87b33a8a Port away from EffectsHandler::screenGeometryChanged() to EffectsHandler::virtualScreenGeometryChanged()
It's confusing to have two signals (virtualScreenGeometryChanged() and
screenGeometryChanged()) that indicate the same thing.

This change ports parts of kwin from the screenGeometryChanged() signal
to the virtualScreenGeometryChanged() signal with the main motivation to
drop the former.

The virtualScreenGeometryChanged() signal was chosen as the replacement
for the consistency sake with EffectsHandler's virtualScreenGeometry and
virtualScreenSize properties.
2021-08-27 09:23:33 +00:00
Vlad Zahorodnii
894ed68ff4 effects: Wire EffectsHandler::screenGeometryChanged() to Screens::geometryChanged()
Currently, the EffectsHandler has two signals that are emitted when the
combined geometry of all outputs change - virtualScreenGeometryChanged()
and screenGeometryChanged(). Having two signals is most likely a
historical artifact.

This change untangles the screenGeometryChanged() signal from the
Workspace and makes it the same as the virtualScreenGeometryChanged()
signal.
2021-08-27 09:23:33 +00:00
Vlad Zahorodnii
6c62f12bc1 effects/overview: Specify effect chain position
The present windows effect specifies a chain position of 70. Do the
same in the overview effect.
2021-08-27 12:02:35 +03:00
Vlad Zahorodnii
bd6d04b417 x11: Pass the output name to X11Output constructor
The output name is static, i.e. it cannot change, so there's no point
for having a setter.
2021-08-27 08:23:22 +00:00
Vlad Zahorodnii
a8810e0c33 x11: Rework how X11 outputs are queried
Currently, there are a couple of issues with output querying on X11:

(a) if an output is changed, for example its transform has been changed,
    then all outputs will be destroyed and created again

(b) it's possible to encounter the case where the platform has no
    outputs. The X11Platform destroys all outputs, then queries new
    outputs. The Workspace and AbstractClient sub-classes handle having
    no outputs very poorly! It's even possible to hit a crash.

With this change, outputs will be queried similar to how it's done on
Wayland.
2021-08-27 08:23:22 +00:00
Nate Graham
205fb923cb [effects/overview] Speed up animation
The current duration is 300ms, which is inappropriate for two reasons:

1. It's too slow
2. It doesn't match one of the standard durations. The effect should
   ideally use those durations directly, but if this is not possible
   for technical reasons, it should use the effective value of one of
   those durations. Units.longDuration is 200ms which is the most
   appropriate one to use here.

Therefore, change the animation duration from 300ms to 200ms to match
the standard Units.longDuration duration.

BUG: 441308
FIXED-IN: 5.23
2021-08-26 16:15:39 +00:00
Vlad Zahorodnii
0931e4f8cc effects/overview: Pad screen borders in qml
This makes it easier to spot if the effect is activated while there is
only one maximized window.

Note that anchors.margins cannot be used unfortunately as it won't take
effect until the ExpoLayout item is fully constructed. It may take a
couple of cycles for the geometry to settle down, which makes reasoning
about how the effect works difficult.

BUG: 312146
2021-08-26 19:11:27 +03:00
Vlad Zahorodnii
028421c4d7 effects/overview: Disable animations until started
Once an animation starts due to property change, it cannot be easily
re-targeted. This can cause undesired animation jumps if a property
changes during startup (for example from 0 to its final value).

With this change, the window heap's animation will be disabled until
the effect starts the intro animation.
2021-08-26 19:11:27 +03:00
Vlad Zahorodnii
8e0264d034 effects/overview: Delay starting the intro animation
The ExpoLayout delays relayouting for optimization purposes. However,
this means that new geometry will be available only after returning to
the event loop.

This change delays starting the intro animation so it can be started
with new geometries.
2021-08-26 19:11:27 +03:00
Xaver Hugl
83ccfbb571 platforms/drm: exit more cleanly if we can't find a buffer config 2021-08-26 16:10:26 +00:00
Xaver Hugl
ef48c247e6 platforms/drm: re-add some logging for egl configs
But only print it when KWin can't find a fitting config

CCBUG: 441253
2021-08-26 17:38:58 +02:00
Vlad Zahorodnii
035d0077dc Remove AbstractWaylandOutput::internal()
It's unused.
2021-08-26 17:16:35 +03:00
Vlad Zahorodnii
8d422f3005 Remove globalPos() in AbstractWaylandOutput
It's confusing to have globalPos() and geometry() as both can return the
same information.

This change drops globalPos() function as it's not used outside the
AbstractWaylandOutput class and renames setGlobalPos() to moveTo() to
avoid having a setter without matching getter.
2021-08-26 16:35:41 +03:00
Vlad Zahorodnii
d841733ed8 effects/overview: Call base QQuickItem::geometryChanged() in ExpoLayout
According to the Qt documentation, if an item overrides the
geometryChanged() method, it must call the base class method.

QQuickItem::geometryChanged() is responsible for emitting signals such
as xChanged(), yChanged(), etc.
2021-08-26 08:34:59 +00:00
Ahmad Samir
2c2469f991 Fix clazy warning: Use QString() multi-arg
No need to use arg(QString::number(int )), when arg() already has a int
overload.

Also replace "endl" with "Qt::endl".

GIT_SILENT
2021-08-25 20:09:55 +00:00
Vlad Zahorodnii
ac7eb252f1 Remove Workspace::hasClient() micro-optimization
Workspace::hasClient(X11Client *) is unused and not worth optimizing as
it doesn't appear in any hot path.
2021-08-25 18:54:45 +00:00
Vlad Zahorodnii
c5d22b68b6 wayland: Simplify startup sequence
If there are no outputs, the drm backend will create a placeholder
output, so continueStartupWithScreens() can be removed.
2021-08-25 18:54:19 +00:00
Vlad Zahorodnii
78b5330824 Drop VirtualDesktopManager::name()
It's confusing to have two ways to query the same information.
2021-08-25 20:12:07 +03:00
Vlad Zahorodnii
ad6039c7c3 Remove unused Workspace::clientArea() overload 2021-08-25 15:14:27 +00:00
Aleix Pol
30959c2efb Include a transform effect
It should be used to decorate changes on the display like rotation.
2021-08-25 14:44:03 +00:00
Aleix Pol
9a4bbdf226 Make it possible for an effect to render a screen
Useful in case it needs the contents of the screen but they can't be
blitted, as the state of the framebuffer is unknown.
2021-08-25 14:44:03 +00:00
Aleix Pol
4d1f30301b Make KWin::TimeLine::progress() public
This way we can have animations that act slightly different in different
parts of the animation
2021-08-25 14:44:03 +00:00
Aleix Pol
24cc93ec5b effects: Allow exposing an EffectScreen::transform
This way an effect can know the transformation that is applied on a
display.
2021-08-25 14:44:03 +00:00
Aleix Pol
34cfc6680b effects: Include signals notifying about outputs changing 2021-08-25 14:44:03 +00:00
Xaver Hugl
5cc5d81cea guard gbm version for gbm_bo_get_fd_for_plane 2021-08-25 14:39:35 +00:00
Vlad Zahorodnii
a234e5aaf4 Forbid passing "-1" as screen to Workspace::clientArea()
This simplifies Workspace::clientArea() implementation. Also, it will be
very handy with transition from int-based screens to AbstractOutput.
2021-08-25 14:31:30 +00:00
Vlad Zahorodnii
fddbd57d09 Port Workspace::clientArea() to VirtualDesktop
This makes Workspace APIs that take virtual desktops more consistent.
2021-08-25 14:31:30 +00:00
Vlad Zahorodnii
5b3c87f105 Rename LayerShellV1Client::output() to desiredOutput()
This is to avoid hitting bugs if the Toplevel class gains an output
property. The new name also better describes what the function returns.
2021-08-25 13:58:49 +00:00
Xaver Hugl
1be65e818c Port screenId based rendering methods to AbstractOutput 2021-08-25 13:53:33 +02:00
Xaver Hugl
e6cab81b53 platforms/drm: multi-gpu buffer import with modifiers 2021-08-25 13:30:49 +02:00
Aleix Pol
35ec9b87a7 Port away from KPluginMetaData::instantiate
It's deprecated according to the documentation, QPluginLoader works just
as well (it's what kcoreaddons was using anyway).
2021-08-25 10:46:40 +00:00
Vlad Zahorodnii
7ffd72cbfa Decouple activation feedback from window management 2021-08-25 09:35:57 +00:00
l10n daemon script
e227e93792 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-08-25 01:15:54 +00:00
David Edmundson
2fb52274d0 Only try to deactivate overview whilst activate
BUG: 441325
2021-08-24 21:45:17 +02:00
Xaver Hugl
fbff8636b9 platforms/drm: fix gpu removal
As soon as m_backends.removeOne(*it) returns, "it" no longer
points to the same value.

CCBUG: 441372
2021-08-24 12:36:44 +00:00
l10n daemon script
6f6944058b 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-08-24 01:20:52 +00:00
Ahmad Samir
731564f04d Fix clazy warnings: potential Qt containter detaches in range-for loops
GIT_SILENT
2021-08-23 23:03:06 +00:00
Ahmad Samir
9f41691684 fix clazy warning: Pass a context object as 3rd connect parameter
GIT_SILENT
2021-08-23 23:02:46 +00:00
Xaver Hugl
1e572a4299 platforms/drm: make debug logging less verbose 2021-08-23 21:53:21 +00:00
l10n daemon script
5246408660 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-08-23 01:27:10 +00:00
l10n daemon script
76d1de48a8 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-08-22 01:17:35 +00:00
Xaver Hugl
1490215f0d effects/overview: exit on background click
BUG: 441301
2021-08-21 22:08:04 +02:00
l10n daemon script
17b161213c 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-08-21 01:16:14 +00:00
Alexey Varfolomeev
6336bb71ba No symbolic icons 2021-08-20 19:34:28 +00:00
Aleix Pol
e729478d09 plasma-window-management: Support new activation concepts 2021-08-20 07:05:34 +00:00
Vlad Zahorodnii
1eb0c09292 scripting: Make ClientFilterModel take VirtualDesktop 2021-08-20 06:54:27 +00:00
Vlad Zahorodnii
5419e3df4a scripting: Introduce workspace.currentVirtualDesktop property
It's the same as the currentDesktop except that it's a VirtualDesktop
object.

The main advantage of the currentVirtualDesktop property is that it
doesn't change if a virtual desktop is added or removed in the middle.
It also makes dealing with virtual desktop changes easier.
2021-08-20 06:54:27 +00:00
Vlad Zahorodnii
9a2a1c0435 scripting: Add desktops property to AbstractClient
With the new virtual desktops model, a window can be on several virtual
desktops. Currently, scripts have no any way to get the list of desktops
the window is on. This change addresses that.
2021-08-20 06:54:27 +00:00
Vlad Zahorodnii
fc52531f44 effects/overview: Make the window heap cover the maximize area
Currently, window thumbnails may be placed behind the panel, which
doesn't look good.

With this, the window heap will cover the same area as the maximize
area.
2021-08-19 16:35:28 +00:00
David Redondo
bc17d0aebd xwl: Use direct way of syncing clipboard
Like the primary selection, sync the clipboard directly without
doing any roudntrips through the internal connection.
2021-08-19 14:59:13 +00:00
Vlad Zahorodnii
66d74f4398 effects/overview: Use Kirigami.ScenePosition
This makes the WindowHeap more robust to layout changes. Currently, the
main issue with it is that thumbnails will be misplaced if the heap's
scene position changes.

Kirigami.ScenePosition automagically keeps track of the item's scene pos.
2021-08-19 14:27:19 +00:00
Vlad Zahorodnii
ba0f5981bf Port Workspace::slotWindowToDesktop*() to VirtualDesktop 2021-08-19 11:08:32 +00:00
Vlad Zahorodnii
b85edc08d2 Port Workspace::switchWindow() to VirtualDesktop
If a window is on several virtual desktops, Workspace::switchWindow()
will not work as expected because AbstractClient::desktop() returns the
id of the last virtual desktop.

Since the active window is most likely on the current virtual desktop,
we can use that for filtering out irrelevant windows.
2021-08-19 11:08:32 +00:00
Vlad Zahorodnii
7937aa78ef Port X11 desktop user actions menu to VirtualDesktop
It's mostly identical to the virtual desktop user actions menu on
Wayland.
2021-08-19 11:08:32 +00:00
Vlad Zahorodnii
d5c2518973 Add Workspace::clientArea() that take no desktop
The new overloads take the client (as context) and the desired screen id
or a point and return the client area.

The main motivation behind this change is to make the transition to the
new virtual desktop model where a window can be on several desktops less
painful.
2021-08-19 10:49:40 +00:00
David Edmundson
2b88432b17 Export our nested environment to kwin's env
In the recent refactor we made it so environment variables got synced to
the Application::processStartupEnvironment.

It then seemed safe and cleaner to remove the qputenv calls, but this
was not the case. It regressed the unit tests on CI and kglobalaccel
which is another path where kwin spawns clients.
2021-08-19 09:17:43 +00:00
David Redondo
6104dc50cf xwl: Sync primary selection
Syncs the primary selection from wayland to X and from X to wayland.
Instead of doing it through the internal connection like the clipboard,
this sets/reacts to changes in SeatInterface::prrimarySelection directly.

BUG:422426
FIXED-IN:5.23
2021-08-19 06:46:23 +00:00
David Redondo
fddb83200f Fix typo
GIT_SILENT
2021-08-19 06:46:23 +00:00
Vlad Zahorodnii
4f66cd4c78 effects/overview: Make expo layout spacing configurable
This allows setting "hidpi-aware" spacing on X11.
2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
6132329c2c Add Overview effect
This effect is meant to be as a replacement for the present windows and
the desktop grid effect. It is written using QML.

So far, this effect implements only the basic features of the present
windows effect. Desktop management features will be added later.

CCBUG: 295775
CCBUG: 303438
2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
30da8f497c scripting: Draw window thumbnails with drop shadows 2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
c66f38ba7d kwineffects: Add properties to EffectScreen
This allows exposing EffectScreen to effects that use js or qml.
2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
9675da6325 kwineffects: Allow specifying render window for EffectQuickView
QtQuick can use the render window to compute the device pixel ratio for
the managed QQuickWindow.
2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
c51de0f370 wayland: Don't track last focused internal window
QGuiApplication::focusWindow() can be used instead.
2021-08-19 06:30:55 +00:00