Commit graph

472 commits

Author SHA1 Message Date
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
David Edmundson
3092043be5 [platforms/x11] Fix valigrind warning copying window icon for windowed mode
Summary:
windowIcon.pixmap().bits() creates and deletes the QPixmap object.

Which means data is dangling when we call m_winInfo->setIcon()

Surprisingly harmless in real life.

Test Plan: Reran kwin_wayland on X11 with valigrind

Reviewers: #kwin, apol

Reviewed By: apol

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28667
2020-05-01 16:13:40 +01: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
a9d2bad007 [x11] Enable synchronized resizing for Xwayland clients
Given that we now query the current X11 time stamp on Wayland, we can
enable synchronized resizing for Xwayland clients.

Differential Revision: https://phabricator.kde.org/D29250
2020-04-29 16:37:23 +03:00
Vlad Zahorodnii
0323825f76 [x11] Update X11 time stamp on Wayland
Assume that Xwayland's current X11 time stamp corresponds to the system
monotonic time. Unfortunately, we cannot make roundtrips to Xwayland and
we cannot query the time stamp asynchronously because it may introduce
regressions in the standalone X11 window manager.

Differential Revision: https://phabricator.kde.org/D29250
2020-04-29 16:37:02 +03: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
77782efc1f x11: register the cursor as well
BUG: 419595
CCMAIL: kwin@kde.org

Committing as is because it crashes on load
2020-04-03 20:01:09 +02:00