Commit graph

23233 commits

Author SHA1 Message Date
Arjen Hiemstra
9a6c1e60e8 X11 backend: Retry enabling compositing when it was disabled a while ago
This removes the "OpenGLIsUnsafe" flag and replaces it with a timestamp
that we can check to see how long ago we tried enabling compositing, so
we can retry it if a certain amount of time has elapsed.

BUG: 452344
2022-09-27 10:23:04 +00:00
Xaver Hugl
21b833f9f5 effects: bump minor version 2022-09-27 08:57:20 +00:00
Xaver Hugl
4b82c639e0 effects/contrast: use effect-local data instead of window data 2022-09-27 08:57:20 +00:00
Xaver Hugl
cc0434d34c effects/blur: use effect-local data instead of window data for blur regions 2022-09-27 08:57:20 +00:00
Vlad Zahorodnii
1d8c9c62cf backends/drm: Fix 100% cpu usage after tty switch
The drm fd can get stuck in readable state, in which case the
QSocketNotifier will fire the activated signal as often as it can
leading to high cpu usage.

We need to read() the drm fd in order to make the socket notifier stop
firing QSocketNotifier::activated.

This change removes the m_platform->isActive() check to ensure that
drmHandleEvent() gets called, in general, it should be safe as we only
notify the outputs about completed pageflips.

BUG: 452726
2022-09-27 07:29:05 +00:00
Aleix Pol
2c874fc3e0 tablet: Ensure persistency of the outputName property
With this change, when the specified output is disconnected, it will
just behave as if none were selected but when it's connected again it
will pick it back up.

BUG: 456857
2022-09-27 07:11:38 +00:00
ivan tkachenko
e45cc7a807 effects/windowview: Add ExposeClassCurrentDesktop shortcut to KCM
See also: f2defd1dfa
2022-09-27 06:29:20 +00:00
David Edmundson
105af544c9 Don't accept space and enter key events in empty WindowHeaps
This fixes being able to select an empty desktop.

CCBUG: 457910
2022-09-27 06:26:38 +00:00
David Edmundson
e924b1cb23 Fix clamping in screenContainsPos
QRect.contains(somePointF.toPoint()) will round the values.

This is problematic for the case of a mouse being at -0.4, we will
consider it in bounds for the screen, but obviously this doesn't match
any surfaces.

The detection and confineToBoundingBox need to behave the same and
floor.

BUG: 459328
2022-09-26 10:37:53 +01:00
Andreas Cord-Landwehr
0a22d390d6 Explicitly include cmath 2022-09-25 17:20:33 +02:00
Aleix Pol
95742bf2e5 inputpanel: Do not start a display process while shutting the panel down
The panel is getting destroyed and shouldn't be shown anymore.
2022-09-24 20:21:48 +00:00
Xaver Hugl
a056ef3f56 autotests: fix InputMethodTest 2022-09-24 20:21:48 +00:00
Xaver Hugl
b4e9443820 inputpanelv1window: fix showing and hiding
Instead of InputMethod directly calling showClient() on the input panel,
call methods that properly show or hide the panel as needed, with readyForPainting
set appropriately. This removes the cases where it's shown without being ready for
painting, which causes crashes.

BUG: 459404
2022-09-24 20:21:48 +00:00
l10n daemon script
1c6a95bceb 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"
2022-09-24 01:48:13 +00:00
David Redondo
16a5831fee Implement xwayland-keyboard-grab protocol
Only XWayland can see and bind to this global.
When a XWayland surface is focused that has a grab, shortcuts
are inhibited.
BUG:455159
FIXED-IN:5.26
2022-09-23 15:49:01 +02:00
Xaver Hugl
3af2d93c2e waylandserver: handle lock state changing properly
BUG: 316734
2022-09-23 14:48:49 +02:00
Vlad Zahorodnii
3546cc0541 wayland: Send wl_data_offer.source_actions before wl_data_device.enter
This makes kwin's behavior consistent with other wayland compositors
(sway, GNOME Shell, etc) and it's reasonable to provide all the
information about the data source before wl_data_device.enter. It also
makes Firefox happier.

Relevant discussion upstream: https://gitlab.freedesktop.org/wayland/wayland/-/issues/322

CCBUG: 445661
2022-09-23 11:43:41 +03:00
Vlad Zahorodnii
7b3ae310e6 Emit clientMaximizedStateAboutToChange when maximized mode is actually about to change
Window rules code can call maximize(requestedMaximizeMode()), in which
case the Window will emit clientMaximizedStateAboutToChange but the
maximize mode may not actually change.

This change moves the emission of of the clientMaximizedStateAboutToChange
signal to Window::changeMaximize(). The reason for doing so is that
window rules have the final decision what the maximize mode will be.

CCBUG: 459301
2022-09-22 12:16:56 +00:00
ivan tkachenko
f2defd1dfa
effects/windowview: Make sure "Toggle Present Windows…" shortcuts are initialized
The last fix was not complete without registering the shortcut from the
start. It worked after changing it in system settings at runtime though.

Amends 984388dba4.
2022-09-22 09:55:36 +03:00
Vlad Zahorodnii
169c784c51 wayland: Bump plasmashell protocol version
See https://invent.kde.org/libraries/plasma-wayland-protocols/-/merge_requests/48
2022-09-21 13:46:55 +00:00
l10n daemon script
1680fa1318 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"
2022-09-21 01:47:35 +00:00
ivan tkachenko
501136b222
effects/windowview: Animate the placeholder just like the search field
FIXED-IN: 5.26
2022-09-20 12:37:08 +03:00
ivan tkachenko
8ac4901068
effects/windowview: Turn placeholder on when there are actually no visible windows
This may happen when all windows are minimized, and the effect was
started in "Window class on current desktop" mode (Ctrl+F7).

BUG: 459244
FIXED-IN: 5.26
2022-09-20 12:35:24 +03:00
Vlad Zahorodnii
d32aebb747 Lower severity of "Got invalid timestamp" message
BUG: 459405
2022-09-20 10:59:08 +03:00
Vlad Zahorodnii
d6234d0411 effects/windowview: Re-order placeholder text and window heap
This ensures that the proxy thumbnail item is stacked above the
placeholder text.
2022-09-19 19:26:52 +00:00
Vlad Zahorodnii
14513ebcda effects/mousemark: Specify effect chain position
BUG: 457639
2022-09-19 19:10:57 +00:00
Nicolas Fella
fdb40395f0 [kcms/scripts] Make plugin id and translation domain match
KQuickAddons::ConfigModule sets the translation domain based on the plugin id

That is kcm_kwin_scripts. However the translation domain is kcm-kwin-scripts, which breaks loading translations

Also fix Messages.sh to extract from QML

BUG: 458438
2022-09-19 15:01:21 +00:00
Vlad Zahorodnii
4696bdaa05 scripting: Add js object <-> QRectF/QSizeF/QPointF conversion helpers
The js code contains code such as

    window.frameGeometry = {x: 42, y: 42, width: 100, height: 50};

However, QJSEngine doesn't know how to convert js object to QRect. For
that purpose, we need to register conversion functions.

So far, we kept registering converter functions only for integer based
geometry types, i.e. QRect, QSize and QPoint. In 5.26, Window was ported
to QRectF, QSizeF and QPointF, but the corresponding conversion helpers
were not added.

BUG: 459369
2022-09-19 13:58:44 +00:00
Aleix Pol Gonzalez
b81123865d tabbox: Makes sure we are not calling a null pointer
The desktopClient is a weak pointer and therefore can be null. This
makes sure that we are not calling a null instance of it.

It seems likely it was introduced here 45486ce515

This is a blind non-reproduced fix for the issue here:
https://errors-eval.kde.org/organizations/kde/issues/158/
2022-09-19 13:49:14 +00:00
ivan tkachenko
ab79fe47ce
effects/private: Add another guard for multi-screen Drag&Drop
Unlike D&D actions, this method does not return any feedback as to
whether an item drop was accepted by any other screen, and so whether it
is going through destruction process already, so the best we can do is
add another typeof/undefined check after calling that method.

Fixes the following error:

    file:///usr/lib/qml/org/kde/kwin/private/effects/WindowHeapDelegate.qml:415:
    TypeError: Cannot read property 'deleteDND' of undefined
2022-09-19 15:13:13 +03:00
Vlad Zahorodnii
d8faf8ab08 Fix multi-screen drag-and-drop in WindowHeap
DND was failing with the following error

file:///data/projects/usr/lib/qml/org/kde/kwin/private/effects/WindowHeap.qml:96: TypeError: Cannot read property 'mapToGlobal' of undefined
2022-09-19 13:09:29 +03:00
Eric Edlund
6d9f740d6f Better handle windows on all desktops in slide effect
Change the render cycle for slide effect. Now, windows will be drawn on each desktop or not in the paintWindow() loop instead of the paintScreen() loop. This allows us to respect stacking order better by painting all of the same window together instead of per VD.

BUG: 457486
BUG: 458622
2022-09-19 07:00:42 +00:00
Nicolas Fella
3ee921a7a9 [kcms/scripts] Enable Apply button when clicking Defaults
BUG: 459320
2022-09-18 13:20:10 +02:00
ivan tkachenko
d7c6a87f39
effects/overview: Bind to search field using textEdited signal
This special signal was designed to remove the need for such
bikesheddings and workarounds. Use it to react to user-driven changes.

BUG: 459202
FIXED-IN: 5.26
2022-09-17 14:44:11 +03:00
ivan tkachenko
de6c0289a0
effects/overview: Implement the searchText backing property
It is used in QML code, just like in windowview (Present Windows)
effect, but developers forgot to copy the implementation in C++
backend.

BUG: 459202
FIXED-IN: 5.26
2022-09-17 14:44:05 +03:00
ivan tkachenko
a3c6db3ee7
effects/windowview: Bind to search field using textEdited signal
This special signal was designed to remove the need for such
bikesheddings and workarounds. Use it to react to user-driven changes.

FIXED-IN: 5.26
2022-09-17 11:12:18 +03:00
ivan tkachenko
984388dba4
effects/windowview: Fix "Toggle Present Windows (Window class on current desktop)" shortcut
The effect was not turning off when pressing a shortcut again, unlike
other flavors of this effects.

BUG: 156155
FIXED-IN: 5.26
2022-09-17 01:57:35 +03:00
ivan tkachenko
3aa1411d94
effects/desktopgrid: Fix background highlight having extra size
Without window title being shown, background highlight should shrink as
well, otherwise it created a questionable gap at the bottom e.g. in a
Desktop Grid effect.

FIXED-IN: 5.26
2022-09-16 21:37:35 +03:00
ivan tkachenko
5cf4320040
effects/desktopgrid: Replace highly opmitized animators with animations which work
Unfortunately, *Animator QML types have some problems with rendering,
sometimes affecting general smoothness, other times (like here, for me)
just not animating entirely. On my NVIDIA graphics system the animation
or a desktop returning from drag just looks like a freeze for a second,
then it suddenly jumps back to {0,0}. So let's just replace with less
optimal NumberAnimation which works fine.

FIXED-IN: 5.26
2022-09-16 21:37:35 +03:00
ivan tkachenko
9889e0df11
effects/desktopgrid: Fix cursor shape being lost while dragging a desktop
DragHandler does not travel along with its target heap, so it only
affects the cursor shape when the mouse pointer is directly over it; but
when a desktop is dragged far outside, the cursor resets.

Besides, this is how we already implemented it in WindowHeapDelegate.

FIXED-IN: 5.26
2022-09-16 21:37:35 +03:00
Fabian Vogt
494feb2eea Fix build with older libgbm
The code for the !HAVE_GBM_BO_GET_FD_FOR_PLANE case needed an explicit
constructor call.
2022-09-16 17:51:36 +00:00
Xaver Hugl
fa538edc74 waylandserver: don't emit windowRemoved if it's not been added yet
This can happen when a client destroys the window before it ever got ready
for painting
2022-09-16 17:13:34 +00:00
ivan tkachenko
574b51f095
Amend "effects/Overview: Use SearchField from PlasmaExtras"
This commit amends 4eefd27f61.

Changes were pushed to the wrong branch, so the MR got merged not in its
final state.
2022-09-16 19:40:26 +03:00
ivan tkachenko
3af565b616
Amend "effects/private: Merge two state machines into one with substates"
This commit amends 9897afa55f.

Changes were pushed to the wrong branch, so the MR got merged not in its
final state.
2022-09-16 19:40:18 +03:00
ivan tkachenko
96a8980861
effects/Overview: Add "pressed" effect to desktop bar 2022-09-16 18:02:56 +03:00
ivan tkachenko
4eefd27f61
effects/Overview: Use SearchField from PlasmaExtras 2022-09-16 18:02:55 +03:00
ivan tkachenko
4a6879e6ee
effects/Overview: Move delegate handlers to the bottom close to each other 2022-09-16 18:02:55 +03:00
ivan tkachenko
329731be2d
effects/private: Encapsulate DND management, and clean up the store
Use methods with semantic naming instead of raw data manipulation, and
make sure to perform clean up of DND data, so it won't haunt us back
later e.g. when a window delegate is recreated not because of a drag
of itself but due to a desktops rearrangement.
2022-09-16 18:02:55 +03:00
ivan tkachenko
1f0a0c893a
effects/private: Nuke an unnecessary loop
Yes, Marco, there is a more efficient way.
2022-09-16 18:02:55 +03:00
ivan tkachenko
d3a5a72a46
effects/private: Fix crash when shutting down desktop grid and overview
Because of const/non-const issues, iterator got invalidated in the loop,
which led to a crash.

Cases that trigger it: interaction with a thumbnail while the effect is
returning to initial state and shuts down. For example, slightly
dragging and releasing a thumbnail such that both TapHandler & DragHandler
would react and play each their own transition (yes, it's another bug);
or by pressing Escape key while dragging.
2022-09-16 18:02:54 +03:00