Commit Graph

219 Commits (a15966c72383f7dd7793158f3de8a5eecd6eb9aa)

Author SHA1 Message Date
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 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
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
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
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
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
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 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
Aleix Pol 3a9d7a6e9d Port KWin to KWaylandServer
Summary: Away from KWayland::Server and KF5WaylandServer.

Test Plan: Builds, ran nested session

Reviewers: #kwin, #plasma, #frameworks, davidedmundson, zzag

Reviewed By: #kwin, #plasma, davidedmundson, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29278
2020-04-30 12:56:08 +02:00
Vlad Zahorodnii c61b85f502 Revert "Fix build with Qt 5.12, Qt::hex and Qt::endl"
This reverts commit d18449c743.

Differential Revision: https://phabricator.kde.org/D29147
2020-04-24 10:18:45 +03:00
Méven Car a94be708ef Merge branch 'Plasma/5.18' 2020-04-17 18:31:23 +02:00
Méven Car e8a1f8eccc Avoid crash in KWin::DrmOutput::updateCursor
Summary:
BUG: 420077

Sample stack traces :

From bug:

  #2  QImage::copy (this=this@entry=0x558117775e20, r=...) at image/qimage.cpp:1172
  #3  0x00007f22d0a24cdf in QImage::detach (this=this@entry=0x558117775e20) at image/qimage.cpp:1091
  #4  0x00007f22d0a25ae0 in QImage::fill (this=0x558117775e20, color=...) at image/qimage.cpp:1806
  #5  0x00007f22d0a25f5f in QImage::fill (this=this@entry=0x558117775e20, color=color@entry=Qt::transparent) at image/qimage.cpp:1780
  #6  0x00007f22bf3bdffd in KWin::DrmOutput::updateCursor (this=0x5581176fb780) at ./plugins/platforms/drm/drm_output.cpp:175
  #7  0x00007f22bf3b0e55 in KWin::DrmBackend::updateCursor (this=0x558117669b60) at ./plugins/platforms/drm/drm_backend.cpp:701

Locally reproduced:

  #0  0x00007f360611e159 in KWayland::Server::OutputDeviceInterface::transform() const (this=<optimized out>)
      at /home/meven/kde/src/kwayland/src/server/outputdevice_interface.cpp:590
  #1  0x00007f3607438059 in KWin::AbstractWaylandOutput::transform() const (this=this@entry=0x5645bed10f90) at /home/meven/kde/src/kwin/abstract_wayland_output.cpp:317
  #2  0x00007f35ecd8acd3 in KWin::DrmOutput::matrixDisplay(QSize const&) const (this=0x5645bed10f90, s=...)
      at /home/meven/kde/src/kwin/plugins/platforms/drm/drm_output.cpp:155
  #3  0x00007f35ecd8efa9 in KWin::DrmOutput::updateCursor() (this=<optimized out>) at /home/meven/kde/src/kwin/plugins/platforms/drm/drm_output.cpp:179
  #4  0x00007f35ecd81db5 in KWin::DrmBackend::updateCursor() (this=0x5645bec743a0) at /home/meven/kde/src/kwin/plugins/platforms/drm/drm_backend.cpp:701
  #5  0x00007f36049e7fe7 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
  #6  0x00007f36075ee43f in KWin::Cursors::currentCursorChanged(KWin::Cursor*) (this=<optimized out>, _t1=<optimized out>)
      at /home/meven/kde/build/kwin/kwin_autogen/EWIEGA46WW/moc_cursor.cpp:385

Test Plan: Could not reproduce

Reviewers: #kwin, zzag, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: ngraham, apol, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28889
2020-04-17 18:25:31 +02:00
Aleix Pol 85b322ad9c drm: Fix hotplugging docking stations
Summary:
It turns out DRM connectors are not static and may change over time.
This patch refreshes them right before looking for new outputs.

BUG: 419061
FIXED-IN: 5.19.0

Test Plan:
Seems to work better, it's still not ideal but I think there's an unrelated bug
sending updates to clients.

Reviewers: #kwin, davidedmundson, meven

Reviewed By: #kwin, davidedmundson, meven

Subscribers: dalbers, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28642
2020-04-09 00:45:23 +02:00
Aleix Pol 6a33533816 drm: properly access a scoped pointer
Differential Revision: https://phabricator.kde.org/D28680
2020-04-08 16:26:07 +02:00
Aleix Pol 16fe8dbd88 drm: Don't leak planes 2020-04-08 16:12:03 +02:00
Aleix Pol fa654bda59 drm: Improve QDebug of DrmOutput
Instead of printing as QObject, provide actual information of the
instance.
2020-04-08 16:11:44 +02:00
David Edmundson a13ecf8d0e [wayland] Add new XdgOutput properties
Summary:
AbstractOutput::name() behaviour is changed so that it matches the X11
behaviour, showing an identifier like "HDMI-0".

XdgOutput.name is set to this name.

XdgOutput.description is currently set to the manufacturer name and
model, but it's not exposed to Qt so we probably don't care too much.

This should fix plasmashell changing applets when switching between X11
and wayland.

Test Plan:
Relevant unit test
I still need to run it on my laptop.

Reviewers: #kwin, #plasma, zzag

Reviewed By: #kwin, #plasma, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28230
2020-04-08 10:39:59 +01:00
Aleix Pol f6029c3dbd debugging: Simplify printing DrmObjects through QDebug
Summary:
Print automatically a few properties as well as the type, so it's easier
to read debug information.

Test Plan: Debugged a fix with it

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28641
2020-04-07 13:23:05 +02:00
Aleix Pol 6abd23ed02 Make it possible to have a separate cursor for the tablet
Summary:
As is KWin only had 1 Cursor which was a singleton. This made it impossible for
us to properly implement the tablet (as in drawing tablets) support and show where
we're drawing.
This patch makes it possible to have different Cursors in KWin, it makes all the
current code still follow the mouse but the tablet can still render a cursor.

Test Plan: Tests pass, been using it and works as well as before but with beautiful tablet cursors.

Reviewers: #kwin, cblack, davidedmundson

Reviewed By: #kwin, cblack, davidedmundson

Subscribers: davidedmundson, cblack, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28155
2020-04-03 01:16:45 +02:00
Aleix Pol d18449c743 Fix build with Qt 5.12, Qt::hex and Qt::endl 2020-03-17 15:57:11 +01:00
Daniel Vrátil 9bd91e66cd
fix: make hwdata truly a runtime dependency
Summary: Followup to comments in D10041

Reviewers: #plasma, ngraham, davidedmundson, zzag

Reviewed By: #plasma, ngraham, davidedmundson, zzag

Subscribers: iasensio, wstephenson, davidedmundson, zzag, ngraham, kwin, cgiboudeaux

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27729
2020-03-17 15:39:17 +01:00
Aleix Pol cca0e15b45 Fix compiler warnings
Summary: No need to keep them around for no reason.

Test Plan: Tested the plugins I thought could be affected. Have been using it for a couple of days without problems

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28062
2020-03-17 15:07:52 +01:00
Vlad Zahorodnii be759b7d33 Use AbstractClient instead of XdgShellClient wherever possible
Summary:
Currently, we have only one shell client type - XdgShellClient. We use
it when we are dealing with Wayland clients. But it isn't really a good
idea because we may need to support shell surfaces other than xdg-shell
ones, for example input panel surfaces.

In order to make kwin more extensible, this change replaces all usages
of the XdgShellClient class with the AbstractClient class.

Test Plan: Existing tests pass.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27778
2020-03-04 09:57:13 +02:00
Roman Gilg 2c66e1f690 Remove orientation sensor
Summary:
This functionality will instead be implemented in KScreen such that manual and
automatic output rotation can be used and configured through a single UI in
unison together.

Test Plan: Compiles.

Reviewers: #kwin, davidedmundson, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin, bshah, davidedmundson, zzag

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D26036
2020-02-29 09:59:30 +05:30
Roman Gilg 7c70b344f5 [platforms/drm] Fix cursor output rotation
Summary:
The calculation of cursor position and orientation on outputs rotations other
than 0° and 180° was faulty.

This patch fixes both.

Test Plan: In live session cursor looks and moves as expected.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25909
2020-02-28 19:48:43 +05:30
David Edmundson 8ff01fa60c [platforms/drm] Rewrite rotation rendering to use MapTexture
Summary:
The previous code uses a fixed version of GSLS which does not match our suported GL targets. We need both, using kwin's existing MapTexture framework we can achieve the same thing in a better way with less code.

Test Plan:
Had some slight issues with the rotation, but everything appeared the same
as when I applied the patchset with the custom shader.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D26371
2020-02-28 12:22:42 +00:00
Roman Gilg 8180662233 [platforms/drm] Introduce Gl post-process output rotations
Summary:
In case the hardware is not able to rotate the output for the configured
rotation value do this rotation in a post-process step.

For that rendering the current view into a separate framebuffer bound to a
texture that then gets sampled to the default framebuffer in an additional
rendering pass through a simple shader rotating it.

This allows us to leave the Effects system and internal model-view-projection
matrix untouched. The rotation in the post-processing step is isolated.

BUG: 389665
FIXED-IN: 5.18

Test Plan: With KScreen all rotations work.

Reviewers: #kwin

Subscribers: davidedmundson, PureTryOut, z3ntu, zzag, univerz, kwin

Tags: #kwin

Maniphest Tasks: T6106

Differential Revision: https://phabricator.kde.org/D25907
2020-02-28 12:22:42 +00:00
Roman Gilg dfea5798f1 [platforms/drm] Add hardware transformation API
Summary:
Planes might be able to do transformations without compositing required.
When changing the current transform try this with the primary plane. If this
fails fall back to no transformation at all through hardware and communicate
the fact and other information through some getters.

Also adds an environment variable to never do hardware transformations.

Test Plan: Compiles.

Reviewers: #kwin

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25906
2020-02-28 12:22:42 +00:00
Daniel Vrátil 33a1777a5a
Decode full monitor vendor name from EDID using hwdata
Test Plan:
KScreen now shows "Dell Inc." instead of DEL and
"Eizo Nano Corporation" instead of ENC in output names, which
matches closer to what's written on my monitors.

Reviewers: graesslin, davidedmundson, #plasma

Reviewed By: davidedmundson, #plasma

Subscribers: apol, feverfew, ngraham, davidedmundson, mart, kwin, sebas

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D10041
2020-02-26 12:37:11 +01:00
Nicolas Fella 7159684ced Revert "[kcm/effects] Clip ListView"
Bad merge

This reverts commit b713044216.
2020-02-22 11:53:59 +01:00
Nicolas Fella b713044216 [kcm/effects] Clip ListView
Summary:
Otherwise the content overflows the frame when scrolling.

QQC2 scrollview docs say "ScrollView does not automatically clip its contents. If it is not used as a full-screen item, you should consider setting the clip property to true"

Test Plan:
Before:
{F8121150}

After:
{F8121152}

Reviewers: #kwin, #plasma, ngraham

Reviewed By: ngraham

Subscribers: ngraham, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27558
2020-02-22 11:52:49 +01:00
Nicolas Fella cdc5ea19ab Revert "[kcm/effects] Clip ListView"
Bad merge

This reverts commit 5babf52df4.
2020-02-22 11:50:30 +01:00
Nicolas Fella 5babf52df4 [kcm/effects] Clip ListView
Summary:
Otherwise the content overflows the frame when scrolling.

QQC2 scrollview docs say "ScrollView does not automatically clip its contents. If it is not used as a full-screen item, you should consider setting the clip property to true"

Test Plan:
Before:
{F8121150}

After:
{F8121152}

Reviewers: #kwin, #plasma, ngraham

Reviewed By: ngraham

Subscribers: ngraham, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27558
2020-02-22 11:48:51 +01:00