Commit graph

486 commits

Author SHA1 Message Date
Vlad Zahorodnii
0c266e760b Replace remaining usages of old connect syntax with new connect syntax
This change replaces the remaining usages of the old connect syntax with
the new connect syntax.

Unfortunately, there are still places where we have to use SIGNAL() and
SLOT() macros, for example the stuff that deals with d-bus business.

Clazy was used to create this change. There were a few cases that needed
manual intervention, the majority of those cases were about resolving
ambiguity caused by overloaded signals.
2020-09-24 09:33:45 +00:00
Aleix Pol
9479c0d6b4 Do not call randomly eglGetError() after eglMakeCurrent
If it failed, it will return accordingly, and then we get to call
eglGetError, only when it fails.
2020-09-23 10:05:30 +00:00
Aleix Pol
61e655f7f7 Centralize WindowPixmap buffer updating code
Uses a setter and clear method pattern rather than having the code
repeated.
Instead of keeping a QPointer, now we are a QObject and we get notified
about destruction intention directly, so we can clear the pointer when
necessary.
2020-09-22 13:04:35 +00:00
Aleix Pol
06e26212a2 Add missing const-referenece
I assume it was a typo
2020-09-17 03:12:59 +02:00
Aleix Pol
fec4e058e5 Do not try to create a gbm dmabuf when gbm is not available
Allows us to take the fallback path instead of just crashing
2020-09-15 15:45:44 +02:00
Aleix Pol
75321a2166 Don't check if there's a non-rendered output twice
We are already doing it on the line above.
2020-09-09 17:46:56 +00:00
Aleix Pol
a7ecaa55e3 Prefer constant iterators when we don't change the container 2020-09-09 17:46:56 +00:00
Vlad Zahorodnii
848f7f3177 Revert "plugins/drm: Link against Wayland::Server"
This reverts commit efb9e0edb2.

libwayland-server is now in the link interface of kwayland-server.
2020-09-02 19:31:29 +03:00
Vlad Zahorodnii
efb9e0edb2 plugins/drm: Link against Wayland::Server
We need to link against Wayland::Server because the EGL Streams protocol
wrapper uses wl_array in its public API.
2020-09-02 16:10:25 +00:00
Vlad Zahorodnii
f55ae15788 Remove unused wayland-cursor.h includes 2020-09-02 15:59:36 +03:00
Aleix Pol
eeeac04974 Implement EGL_KHR_partial_update and EGL_EXT_swap_buffers_with_damage
Summary:
Notify the driver about the parts of the screen that will be repainted.
In some cases this can be benefitial. This is especially useful on lima
and panfrost devices (e.g. pinephone, pinebook, pinebook pro).

Test Plan:
Tested on a pinebook pro with a late mesa version.
Basically I implemented it, then it didn't work and I fixed it.
Maybe next step we want to look into our damage algorithm.
2020-08-19 14:51:42 +00:00
Aleix Pol
d5da366507 Add a generic Output::transformation method
Makes it possible to map any space into the output's coordinates system
2020-08-19 14:51:42 +00:00
Aleix Pol
b755e6d91b Fix using --scale on kwin_wayland windowed mode 2020-08-18 10:55:21 +00:00
Vlad Zahorodnii
4ce853e8e4 Prettify license headers 2020-08-07 19:57:56 +00:00
Vlad Zahorodnii
1fb9f6f13a Switch to SPDX license markers
The main advantage of SPDX license identifiers over the traditional
license headers is that it's more difficult to overlook inappropriate
licenses for kwin, for example GPL 3. We also don't have to copy a
lot of boilerplate text.

In order to create this change, I ran licensedigger -r -c from the
toplevel source directory.
2020-08-07 19:57:56 +00:00
Andrey Butirsky
307a9bc559 Avoid crash in KWin on Session leave
BUG: 420077

- hunk of original commit e8a1f8ecc seems was lost during a94be708e merge,
so restoring it again
- add missing check

Original Differential Revision: https://phabricator.kde.org/D28889
2020-08-06 12:21:03 +00:00
Vlad Zahorodnii
e7d02ad355 Introduce X11 default screen property in Application
This spares unnecessary looping through all available X11 screens.
2020-08-05 08:48:00 +00:00
Vlad Zahorodnii
d4ec18d844 Fix build 2020-07-29 15:35:50 +03:00
Chaojiang Luo
def9817a7e fix:Check image map nullptr error
The map may be failed, we should check the image map is succeed first.

Signed-off-by: luochaojiang <luochaojiang@uniontech.com>
2020-07-29 12:11:17 +00:00
Aleix Pol
03b12d1dfc drm: Use introspection to print enums
Removes a bit of code and allows to list the supported
transformations on the same line, which is useful to be able to
grep over the output.
2020-07-29 10:39:47 +00:00
l10n daemon script
e15004ff98 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"
2020-07-28 06:11:46 +02:00
Aleix Pol
4eda4d2b5d drm: prevent cursor buffer leakage
Use smart pointers to make sure we don't dereference valid pointers.
2020-07-27 09:29:11 +00:00
Aleix Pol
edb6159396 drm: we must not call showCursor when softwareCursor is on
Otherwise we'll show a dangling cursor but otherwise the cursor will be
updated by other code paths, so we end up with a weird cursor in the
middle of the screen that doesn't move.
2020-07-27 09:29:11 +00:00
Vlad Zahorodnii
e7b8a5ad5e Remove remote-access leftovers
We've switched to PipeWire for screen casting \o/.
2020-07-23 18:19:49 +03:00
Aleix Pol
4ddefd37bd screencasting: Remove deprecated RemoteAccessManager interface
In favour of zkde_screencast_unstable_v1
2020-07-23 13:14:31 +02:00
Aleix Pol
02042908aa screencasting: implement wayland output streaming for egl and wayland backends 2020-07-23 13:14:31 +02:00
Aleix Pol
42e543c5b2 screencasting: implement intefraces to create dmabuf textures 2020-07-23 13:14:22 +02:00
Aleix Pol
27ea1b9527 screencasting: Expose necessary information to implement efficient screencasting 2020-07-23 13:14:22 +02:00
Aleix Pol
7f1abd5dad Allow testing transformations on windowed KWin 2020-07-21 12:03:12 +00:00
Vlad Zahorodnii
036ad759e0 [wayland] Adapt to SurfaceInterface changes 2020-07-15 12:46:28 +00:00
Adrien Faveraux
bb138d7668 Adapt EglStream to KwaylandServer 2020-07-14 10:09:43 +00:00
Andreas Haratzis
6c9026628c Fix DrmOutput sometimes being freed with a pending pageflip, often when waking from sleep.
It is possible for updateOutputs to be called when a pageflip is pending.
Freeing a DrmOutput with a pending pageflip is not allowed (see ~DrmOutput assert - the page flip handler will be called on the freed memory, possibly leading to use-after-free).
This works around the problem by delaying the destruction with teardown().

BUG: 422460
2020-07-07 18:33:28 -07:00
Chaojiang Luo
0ef5ddfd47 [drm] Do not blank crtc in atomic mode
In atomic setting mode, when external display tears down, it will blank
crtc with dump buffer by legacy api, then re-plug the external display,
the blank can not be removed. We think the blank is not needed in atomic
mode setting.

Signed-off-by: Chaojiang Luo <chaojiangluo@163.com>
2020-07-03 12:09:34 +08:00
Aleix Pol
e1bf133de7 Fix support for systems with age disabled
If no damage is supported, repaint all the output rather than nothing.
2020-06-22 09:46:27 +00:00
Vlad Zahorodnii
cb7a9456c0 [wayland] Rework Xcursor theme loading code
Currently in order to load an Xcursor theme, kwin uses libwayland api,
which looks really awkward because of the way how the compositor talks
to itself via the internal connection.

The main motivation behind this change is to limit the usage of kwayland
client api in kwin.
2020-06-18 07:14:58 +00:00
l10n daemon script
c10fe06d06 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"
2020-06-18 05:44:57 +02:00
Vlad Zahorodnii
f79d4ba05f Merge branch 'Plasma/5.19' 2020-06-17 18:07:23 +03:00
Vlad Zahorodnii
cff2070ab2 Merge branch 'Plasma/5.18' into Plasma/5.19 2020-06-17 18:07:12 +03:00
l10n daemon script
8027ccd6d6 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"
2020-06-17 16:54:45 +02:00
Vlad Zahorodnii
96774e79e7 [x11] Create egl scene textures with right size
Or client-side decorated clients will be rendered incorrectly.
2020-06-17 17:52:17 +03:00
l10n daemon script
0e117c49a1 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"
2020-06-17 14:12:29 +02:00
Vlad Zahorodnii
da6c775d11 Merge branch 'Plasma/5.19' 2020-06-17 11:05:27 +03:00
Vlad Zahorodnii
bc2df9f84b [x11] Provide physical dimensions for outputs
Since ScreenEdge no longer uses physicalDpiX() and physicalDpiY() from
the QPaintDevice class in favor of our own helpers, we need to ensure
that the X11 platform provides valid output physical dimensions.

BUG: 422816
FIXED-IN: 5.19.2
2020-06-17 10:53:12 +03:00
l10n daemon script
29915632df 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"
2020-06-04 05:12:36 +02:00
Méven Car
5c3e03259a DrmOutput: Ensure waylandOutput dpms mode matches DrmOutputs
After 797ccca48c
It appeard WaylandOutput (OutputInterface) would never get their Dpms
mode.
2020-05-27 10:07:39 +02:00
Méven Car
f0f465ccbd Wayland: avoid binding disabled outputs to surfaces
We don't need to bind disabled outputs to surfaces that overlaps them.
This prevents error down the line and warnings about ignoring surface.enter events with Qt.

BUG: 419749
2020-05-26 17:18:11 +02:00
Méven Car
797ccca48c Wayland: avoid binding disabled outputs to surfaces
We don't need to bind disabled outputs to surfaces that overlaps them.
This prevents error down the line and warnings about ignoring surface.enter events with Qt.

BUG: 419749
2020-05-26 15:14:13 +00:00
Bhushan Shah
6caad6ee2f Merge branch 'Plasma/5.19' 2020-05-21 14:26:28 +05:30
Bhushan Shah
b2df11bf7e [platforms/drm] show cursor only when it is enabled
In previous code we used to update/show cursor even when the pointer
device was present, e.g mobile device. Guard it behind the cursor
enabled check.

BUG: 418977
FIXED-IN: 5.19.0
2020-05-21 12:38:02 +05:30
Méven Car
b77d29119e Drm backend: delete DrmOutput* after DrmScreens notified its users
Test:

Plug-in and out HDMI screen

Before:
Crash when pluggin-in
After:
No crash
2020-05-19 17:25:19 +02:00