Commit graph

22762 commits

Author SHA1 Message Date
Xaver Hugl
4874066423 port many Qt shared pointers to standard smart pointers
There are a few benefits to using smart pointers from the standard library:
- std::unique_ptr has move semantics. With move semantics, transfer of ownership
can be properly expressed
- std::shared_ptr is more efficient than QSharedPointer
- more developers are used to them, making contributions for newcomers easier

We're also already using a mix of both; because Qt shared pointers provide
no benefits, porting to standard smart pointers improves consistency in
the code base. Because of that, this commit ports most of the uses of QSharedPointer
to std::shared_ptr, and some uses of QScopedPointer to std::unique_ptr
2022-06-04 16:57:29 +00:00
l10n daemon script
138000020f 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-06-04 01:44:31 +00:00
Nate Graham
701fc52a4a effects/desktopgrid: re-add shortcuts to add and remove desktops
This got lost in the QML port.

BUG: 451848
2022-06-03 15:34:27 +00:00
Nate Graham
529c3c29d3 Change global shortcuts to use the Meta key by default
The current shortcuts could conceivably override app shortcuts, since
they don't use the Meta key. The following changes are made:

Switch keyboard layout:               Ctrl+Alt+K   -> Meta+Alt+K
Activate window that wants attention: Ctrl+Alt+A   -> Meta+Ctrl+A
Kill Window:                          Ctrl+Alt+Esc -> Meta+Ctrl+Esc

These are safe to change in the code rather than adding new ones and
keeping the old ones around for compatibility's sake because
KGlobalAccel::setDefaultShortcuts by default preserves old shortcuts
when they are changed, and we aren't overriding that behavior here. So
only new installs will get the new shortcuts and existing user installs
will be untouched.
2022-06-02 07:20:54 -06:00
Aleix Pol
9db4fd1a17 DmaBufTexture: The modifier is a global dmabuf attribute
We don't get one per plane, but one per allocation.
2022-06-02 03:42:13 +02:00
Aleix Pol
51bfadab63 backends/wayland: Fix behaviour when disabling outputs
Makes sure disabled outputs are reported as such, leaving behind the
assumption that all outputs are always enabled.
Ensures the corresponding outputEnabled/Disabled signals are emitted.
Updates the window title to reflect the output state.
2022-06-01 10:53:03 +00:00
l10n daemon script
465aa7edee 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-06-01 01:57:49 +00:00
Xaver Hugl
e7365bf43f backends/drm: don't do direct scanout if transformations don't match
Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2128>
2022-05-31 07:10:08 +00:00
l10n daemon script
0a7ae31e4c 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-05-31 02:02:56 +00:00
David Edmundson
cd234c96f7 [tabletmodemanager] Avoid unnecessary signalling
oldEffectiveTabletMode was currently unused
2022-05-30 19:38:26 +01:00
David Edmundson
87fbdd04fe [xdgshell] Remove unused captured variable 2022-05-30 19:37:46 +01:00
David Edmundson
bc4d1cf129 [libkwineffects] Fix minor compiler warnings 2022-05-30 19:37:24 +01:00
David Edmundson
2662d20da1 [input] Remove unused local variables 2022-05-30 19:36:46 +01:00
Xaver Hugl
671672871b LogindSession: adjust warning when openRestricted fails
Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2482>
2022-05-30 12:44:22 +00:00
Luca Carlon
2d563dc63f AppletPopup window type should accept focus.
AppletPopup window type should accept focus, behaving like other window types like
Dock. At the moment it is instead behaving like notification, which seems wrong.
This should also fix a failing unit test.
2022-05-30 09:41:01 +00:00
Luca Carlon
7865a9b355 AppletPopup window type should be shown on all desktops.
AppletPopup's are typically supposed to be attached to the panel and
should remain visible when the virtual desktop is changed. If the
AppletPopup is pinned and the virtual desktop is changed, without
this patch, the window does not remain attached to the panel. This is
how AppletPopup was supposed to work even according to the unit test
which currently fails.
2022-05-30 08:36:52 +00:00
Malte Dronskowski
d8da0c7708 Fix typo in latency policy
The lowest latency setting wasn't applied because the internal 
implementation contained an excess 'e' in comparison to the setting 
exposed to the user

BUG: 453694
2022-05-29 18:07:37 +00:00
l10n daemon script
450d8e286a 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-05-29 01:45:37 +00:00
l10n daemon script
df7e386714 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-05-28 02:21:02 +00:00
Luca Carlon
da0dd1e367 Support new AppletPopup window type
See the discussion in https://invent.kde.org/frameworks/plasma-framework/-/merge_requests/500.

BUG: 411462
BUG: 332512
FIXED-IN: 5.25
2022-05-27 21:49:37 +00:00
Xaver Hugl
615cd352fb add autotest for touchscreen gestures 2022-05-27 17:49:59 +00:00
Xaver Hugl
61efc4c2e1 input: don't fail touchscreen gestures with invalid physical size 2022-05-27 17:49:59 +00:00
Xaver Hugl
9957f8c84a input: fix touchscreen gesture detection
When a gesture is cancelled because of the distance between fingers or the
time it took to register them all, no gesture has been taken yet. In that
case, the canceling would never be ended, effectively disabling all touchscreen
gestures.
2022-05-27 17:49:59 +00:00
Vlad Zahorodnii
97a82c97df effects: Fix QQuickItem::mapToGlobal() in qtquick effects on wayland
On Wayland, we create a dummy window to fix HiDPI issues. At the moment,
the QQuickRenderControl::renderWindow() returns a fixed offset 0,0.

As it turns out, QQuickItem::mapToGlobal() will poke the
QQuickRenderControl::renderWindow() function to map the specified point
to the global coordinate space.

Since the renderWindow() function returns hardcoded offset, the
mapToGlobal() function is sort of broken in fullscreen effects.

In order to fix mapToGlobal() on Wayland, this change makes the
EffectQuickRenderControl return the position of the associated
OffscreenQuickView.
2022-05-27 15:43:00 +00:00
Xaver Hugl
f86f159fd5 backends/drm: fall back to a software cursor if drmModeAddFB2 fails
CCBUG: 453860
2022-05-27 15:24:27 +00:00
Marco Martin
f6db8b1178 Toggle all desktop on middle click
restores the behavior of the old desktop grid which toggled on all desktops on middle click

BUG:454001
2022-05-27 08:29:57 +00:00
Vlad Zahorodnii
6180a9b144 effects/zoom: Fix repainting with zoom factor of 1
When zoom factor is 1, the zoom effect will paint the scene in an
offscreen texture, but not actually paint the textures on the screen.

Zoom factor can be 1 when the effect has been just stopped.

BUG: 454407
2022-05-27 08:14:21 +00:00
Marco Martin
207c59002b Properly reset offToCornerId and apertureCorner when the effect closes
When the effect closes, all the extra data attached to the window
(offToCornerId and apertureCorner properties) are not valid anymore
and need to be reset right after the animation end.
also manage the two edge cases where a window either appeared or
got minimized while the effect was running to either show it or not

BUG: 454280
2022-05-27 08:00:32 +00:00
Vlad Zahorodnii
1f6d9d482f effects/zoom: Schedule a fullscreen repaint if stopped zooming
On Wayland, screens are repainted independent of each other. If zooming
animation stops on one screen, other screens may still be stuck in the
zoomed state and therefore result in potential flickering. Issue a full
screen repaint when zooming stops to ensure that other screens are
repainted with "unscaled" contents.

BUG: 454407
Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2472>
2022-05-27 07:27:06 +00:00
Vlad Zahorodnii
f3b291bce0 Make TimeLine API ergonomic with presentation timestamps
Currently, if you want to use TimeLine, you need to track the last
presentation timestamp which boils down to carrying some boilerplate
code.

The current situation can be improved by making TimeLine work with
presentation timestamps.

Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2473>
2022-05-26 17:10:07 +00:00
Vlad Zahorodnii
6a5173b6c4 effects/zoom: Use GL_LINEAR filter
The magnification filter was changed to GL_NEAREST with the reasoning
that "pixel granularity" would be more correct. Perhaps that was not a
bright idea. Change it back to GL_LINEAR.

BUG: 454408
Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2471>
2022-05-26 10:11:01 +00:00
Kai Uwe Broulik
b6001d12cc backends/x11/windowed: Don't create cursor pixmap from null image
There's no point and it results in a "QImage::scaled: Image is
a null image" warning.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2469>
2022-05-26 06:51:46 +00:00
Kai Uwe Broulik
b062d09fdc backends/x11: Support resizing the windowed output
In response to a XCB_CONFIGURE_NOTIFY on the output window, the new size
is set as mode and the output layer buffer is recreated.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2459>
2022-05-26 06:38:32 +00:00
Vlad Zahorodnii
486d229cae effects/desktopgrid: Fix config group name
The config group is formed as "Effect-" + plugin id, i.e. "desktopgrid"

Config migration from DesktopGrid to desktopgrid is already handled by
a kconf_update script.

BUG: 454102
Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2464>
2022-05-25 18:11:57 +00:00
Kai Uwe Broulik
b018dd3204 qpa: Provide a QPlatformNativeInterface
Under Gnome/Unity/XFCE, but not Plasma(!), QFontconfigDatabase queries
the platform native interface for certain font settings
(e.g. antialiasingEnabled). Without a QPNI this would crash KWin
as soon as it tried to query for fonts.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2468>
2022-05-25 16:37:32 +00:00
Vlad Zahorodnii
f2be602266 kcms/touch: Fix crash
"effects" is a typo, we need to populate "m_scripts"

BUG: 454360
Tested-by: Merge Service <https://invent.kde.org/plasma/kwin/-/merge_requests/2465>
Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2465>
2022-05-25 10:26:03 +00:00
Vlad Zahorodnii
e57be93108 backends/drm: Specify clear color for cursor plane
Otherwise the results are undefined.

BUG: 454068
Tested-by: Merge Service <https://invent.kde.org/plasma/kwin/-/merge_requests/2466>
Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2466>
2022-05-25 09:45:18 +00:00
Vlad Zahorodnii
572a0904d8 autotests: Register ElectricBorder type
QSignalSpy yells about it.

Tested-by: Merge Service <https://invent.kde.org/plasma/kwin/-/merge_requests/2460>
Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2460>
2022-05-25 08:40:24 +00:00
Vlad Zahorodnii
7c849ee05a Use font metrics to compute corner offset
The problem with the current approach is that it doesn't work reliably
on wayland. Outputs can have different pixel density, etc.

Tested-by: Merge Service <https://invent.kde.org/plasma/kwin/-/merge_requests/2461>
Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2461>
2022-05-25 06:29:28 +00:00
l10n daemon script
68f6734d5c 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-05-25 01:46:45 +00:00
Kai Uwe Broulik
f013dc410e Don't block screen edge for fullscreen effects
Otherwise in overview effect you cannot go back out the way you came.

Tested-by: Merge Service <https://invent.kde.org/plasma/kwin/-/merge_requests/2416>
Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2416>
2022-05-24 23:58:33 +00:00
Kai Uwe Broulik
d143f6e3c4 backends/x11: Arm vsync monitor in EglX11Backend
This was originally on `EglX11Backend::endFrame` and got lost
as part of refactoring in 7358daa9, breaking nested `kwin_wayland`
rendering with GL.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
Tested-by: Merge Service <https://invent.kde.org/plasma/kwin/-/merge_requests/2458>
Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2458>
2022-05-24 14:44:59 +00:00
Aleix Pol
cad5ddbab3 xdg_activation_v1: Do not bounce icon if the desktop file was not found
It's annoying and doesn't buy us much.
Additionally, take X-KDE-StartupNotify into account as we are meant to.

BUG: 453940
Tested-by: Merge Service <https://invent.kde.org/plasma/kwin/-/merge_requests/2415>
Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2415>
2022-05-24 13:14:43 +00:00
Vlad Zahorodnii
221f114d80 effects/zoom: Render scene in an offscreen texture
This fixes integration of the zoom effect with the blur effect and qtquick
effects such as overview or window view.

The main con of the proposed solution is that offscreen rendering can be
a bit overkill. But on the other hand, it's the most robust way to
ensure that fullscreen effects integrate correctly with the zoom effect.
For example, without it, the quick scene effect would need to figure out
what screen views to paint for the given screen. There are also more
finicky cases, e.g. the screen transform effect.

BUG: 447002
BUG: 447670
BUG: 453467
Tested-by: Merge Service <https://invent.kde.org/plasma/kwin/-/merge_requests/2451>
Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2451>
2022-05-24 12:29:11 +00:00
Vlad Zahorodnii
cc487d4292 effects/zoom: Specify effect chain position
Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2451>
2022-05-24 12:29:11 +00:00
Vlad Zahorodnii
80b9617bad effects/fallapart: Fix glitch
The WindowItem visibility reference must be dropped after, not before
starting painting. It also makes the fall apart effect code consistent
with other effects.

BUG: 454243
Tested-by: Merge Service <https://invent.kde.org/plasma/kwin/-/merge_requests/2455>
Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2455>
2022-05-24 12:06:09 +00:00
Kai Uwe Broulik
cfd3676e96 backends/x11: Restore dedicated XRenderUtils::init function
Under kwin_wayland `kwinApp()->connection()` is for communicating with
XWayland, but in X11Windowed backend we need to talk to the host XServer.

Restore `XRenderUtils::init` and set it accordingly based on
whether we're running standalone or windowed, so that `kwin_wayland`
works running nested in an X session again.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
Tested-by: Merge Service <https://invent.kde.org/plasma/kwin/-/merge_requests/2457>
Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2457>
2022-05-24 11:45:52 +00:00
Vlad Zahorodnii
8b644fee58 backends/x11: Ensure that Output::geometryChanged is emitted when modes change
BUG: 453696
Tested-by: Merge Service <https://invent.kde.org/plasma/kwin/-/merge_requests/2454>
Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2454>
2022-05-24 09:51:44 +00:00
Alexander Lohnau
38eef5e2b7 Adjust name of KCM desktop files
The name should match the KCM plugin id, otherwise the entry can not be fond when the KCM should get pinned in the task manager
2022-05-23 19:40:26 +02:00
Vlad Zahorodnii
e6a2cbc345 wayland: Simplify keystate protocol implementation
Access input machinery directly to monitor modifiers.

Tested-by: Merge Service <https://invent.kde.org/plasma/kwin/-/merge_requests/2447>
Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2447>
2022-05-23 07:06:29 +00:00