Commit graph

192 commits

Author SHA1 Message Date
Xaver Hugl
e262c8df33 Move pageFlipHandler to DrmGpu 2021-03-30 14:32:43 +02:00
Vlad Zahorodnii
72cc1daf22 wayland: Introduce an environment variable to disable Xauthority
This is primarily intended for debugging purposes.
2021-03-29 11:37:28 +00:00
David Edmundson
a7aee99a23 Port kwin from Plasma Components2
Testing done:
 - ran present windows, checked the button
 - changed desktop with the OSD enabled
 - toggled nightcolour (which shows the other OSD)
2021-03-27 23:26:31 +00:00
Ismael Asensio
3048d92c09 kcm/kwinrules: Unify windows properties methods in KCM class
Put together the two methods about window properties and rules
into the same class, since they are tightly related and they seem
a bit out of place within RuleBookModel

Small refactor patch. No behavior changes
2021-03-27 01:51:39 +07:00
Vlad Zahorodnii
6fdfd8be5f wayland: Switch to new keyboard event notify methods in SeatInterface 2021-03-26 12:33:12 +02:00
Aleix Pol
57aec19744 Remove cleanTabBox duplicated code 2021-03-25 13:56:17 +01:00
Xaver Hugl
ad7a826ea1 Drag'n'drop: only activate clients after still hover
BUG: 395368
2021-03-25 12:40:16 +00:00
Jan Blackquill
1f39c45a10 PopupEventFilter: handle keyboard events too
XDG popups want keyboard events routed to the topmost popup
as well as the pointer-outside-of-popup-cancels functionality.
2021-03-25 12:38:43 +00:00
Nate Graham
63b96d7c0d Correct use of KUIT markup in kill dialog text
<p> is HTML; the correct KUIT tag is <para>.
2021-03-24 16:46:30 -06:00
Vlad Zahorodnii
0683597099 effects/screenshot: Introduce dbus interface version 2
With the new interface, the compositor sends raw image data instead of
encoding it as a png image, which causes a lot of overhead on Wayland.

In addition to that, the new interface is more extensible, for example
we can add new options or change the written image data format, however
the latter is less likely to happen.

BUG: 433776
2021-03-24 10:52:22 +00:00
Xaver Hugl
eb7703cd64 Only use drmModeAddFB2WithModifiers if supported 2021-03-23 22:13:00 +00:00
Xaver Hugl
c1635c1179 Explicitly preserve buffer contents in EglDmabuf 2021-03-23 20:00:00 +00:00
Xaver Hugl
c737fde3da DRM: Use QSharedPointer 2021-03-23 15:47:59 +00:00
Vlad Zahorodnii
5c15cca190 wayland: Switch to SeatInterface::notifyPointerButton() 2021-03-23 11:20:50 +02:00
Vlad Zahorodnii
ade861d6de Refactor session code
At the moment, the session code is far from being extensible. If we
decide to add support for libseatd, it will be a challenging task with
the current design of session management code. The goal of this
refactoring is to fix that.

Another motivation behind this change is to prepare session related code
for upstreaming to kwayland-server where it belongs.
2021-03-23 08:01:19 +00:00
Vlad Zahorodnii
aad767f91f Fix initialization of ColorManager
There might be some outputs during the initialization of the color
manager, we need to handle this case.
2021-03-23 08:01:19 +00:00
Vlad Zahorodnii
9e999fe2a1 x11: Move event filter logic to kwinApp()
This allows the X11 platform plugin to create event filters before the
workspace object is created.
2021-03-23 08:01:19 +00:00
Cyril Rossi
7c55f5ed7d KCM KWin Window Behavior : fix KCM default/reset state. Add KCModuleData to show default indicator at module level
BUG: 433379
2021-03-22 17:30:52 +01:00
Xaver Hugl
a8055e4546 Refactor DRM presentation
Presentation doesn't have to go through DrmBackend and by moving
DrmGpu::deleteBufferAfterPageflip into DrmBuffer some code can be
simplified
2021-03-22 13:52:50 +00:00
Bharadwaj Raju
8c352f685e Make ghost windows in highlight effect be fully transparent
BUG: 298487
FIXED-IN: 5.22
2021-03-22 12:00:38 +00:00
Kevin Ottens
9a10af9569 Wire the activity protocol parts to AbstractClient 2021-03-22 11:29:41 +00:00
Weng Xuetian
d612d76e09
Replace xdg output done with explicit wl_output done
BUG: 433224
2021-03-19 09:53:22 -07:00
Usarin Heininga
af53647cf7 Set stackingOrderUuids as well. 2021-03-19 13:39:14 +00:00
Nate Graham
37445d9c29 [kcmkwin/kwinrules] Add explanatory text to placeholder messages 2021-03-19 13:13:31 +00:00
Xaver Hugl
ca23bca813 Port DrmSurfaceBuffer to drmModeAddFB2 2021-03-19 08:59:58 +00:00
Ismael Asensio
a82be242ea [kwinrules] Launch full KCM when editing from window menu
When rules configuration is invoked from window `Alt+F3` menu,
we call a custom binary `kwin_rules_dialog` which currently provides
only the rule edition dialog by embedding `RulesEditor.qml` within a
QQuickView.

This MR changes that behavior to call the full KCM from the menu.
The code to match previous rules, or compose a new one based on window
properties has been ported to the KCM from the dialog, so the overall
interaction is similar.

It has several advantages:
 - uses only one entry-point to the code
 - adds discoverability to the full KCM (I guess many users know how to
   create a rule, but not where to delete it later)

And a drawback:
 - only one instance of the KCM can be called at a time, so it will show an
   error when calling it from two different windows, or if the KCM is open
   in System Settings

This drawback can be solved after adding argument passing via dBus in KCM
infraestructure.

BUG: 433837
CCBUG: 417923
2021-03-19 10:16:01 +07:00
Xaver Hugl
38a15996f4 Consider the opaque region for direct scanout 2021-03-18 23:51:29 +01:00
Xaver Hugl
6569bf80c3 EglGbmBackend: use output reference
CCBUG: 432707
2021-03-18 15:22:31 +01:00
Alexander Lohnau
3cbbdbee99 GIT_SILENT Silence warning about unused parameter in windows runner 2021-03-16 08:45:29 +01:00
Xaver Hugl
20fca90855 Consider the tool type for distinguishing between tools 2021-03-14 23:58:17 +01:00
Alexander Lohnau
81b40966ed GIT_SILENT Add trailing comma to enums 2021-03-14 18:06:22 +01:00
Vlad Zahorodnii
75d39f6a8e Revert "wayland: Emulate tablet events only if there is pointer"
This reverts commit ee54fa7898.

Unfortunately, this is not a totally correct fix. If there's no pointer,
we need to announce the wl_pointer capability anyway so clients that do
not support tablet input devices can still receive emulated pointer
events.
2021-03-12 14:13:20 +02:00
Vlad Zahorodnii
ee54fa7898 wayland: Emulate tablet events only if there is pointer
If the seat has no pointer, there is no point for emulating tablet
events.
2021-03-12 10:20:22 +00:00
Vlad Zahorodnii
7b68644974 wayland: Adjust input code to SeatInterface with some renamed methods 2021-03-12 10:19:47 +00:00
Adrien Faveraux
37731af7d2 adapt Output management to kwaylandserver change 2021-03-12 10:14:52 +00:00
Vlad Zahorodnii
5b6c36f953 wayland: Check that seat has wl_pointer before canceling gestures
The seat must have the wl_pointer capability in order to gestures work.
2021-03-12 09:15:40 +02:00
Aleix Pol
9786ea3c58 input: prevent seat touch methods from being called when there's no touch
Otherwise we get a crash as we are asserting with Q_ASSERT(d->touch).
2021-03-11 14:08:40 +00:00
Aleix Pol
58debd72a3 Only scanout when the texture matches the display size
Otherwise drmModeAtomicCommit() in DrmOutput::doAtomicCommit() fails due
to unmatched buffer sizes.

While rendering continues working properly, this makes drm freak out and
try to go back to a previous state (see the test commit in
presentAtomically()) that in turn starts issuing screen events to every
process even though it's just to say the same thing. The fact that this
happens per frame makes the system unusable as soon as fullscreen starts
happening on a scaled display.

Another thing we could do is get EglGbmBackend::scanout() to take care
of the resizing.
2021-03-11 15:01:09 +01:00
David Edmundson
82551e143d Adapt to window management changes
Our wayland interface lifespan only needs to live as long as the window
is mapped.

Given this corresponds directly to the lifespan of AbstractClient we can
just set a parent and everything is handled implicitly.
2021-03-11 12:02:35 +00:00
Méven Car
ef19948c00 Reflect changes in kwayland-server changes
https://invent.kde.org/plasma/kwayland-server/-/merge_requests/180
2021-03-11 08:24:33 +00:00
Vlad Zahorodnii
00fcc3a423 wayland: Adjust kwin to SeatInterface changes 2021-03-11 07:36:31 +00:00
Kevin Ottens
0ab41802f4 Avoid KWin starting kactivitymanagerd synchronously
Prevent KWin from synchronously autostarting kactivitymanagerd. Indeed,
kactivitymanagerd being a QApplication it will depend on KWin
startup... this is unsatisfactory dependency wise, and it turns out
that it leads to a deadlock in the Wayland case
2021-03-10 23:40:59 +00:00
Nicolas Fella
a406eef9a0 Update link to kwin-scripting-api-generator 2021-03-10 17:40:24 +01:00
Aleix Pol
3953c0c650 inputmethod: Use the object to connect to slots
Otherwise I see the Qt::UniqueConnection not working sometimes making
(at least) commitString happen twice consecutively.
2021-03-10 15:32:51 +01:00
Aleix Pol
178e7e22e4 wayland: Do not force qtvirtualkeyboard
Remnant from the past, it made it work weird on some systems, should
have been removed when we removed elsewhere in KWin.
2021-03-10 14:29:12 +00:00
Vlad Zahorodnii
83388295c8 wayland: Adjust kwin to PointerInterface changes 2021-03-10 14:10:16 +00:00
Kevin Ottens
c812ffbe1d Move basic activities support from X11Client to AbstractClient
We're now sharing most of the X11Client activity behavior accross all
clients. This allows to cleanup some of the existing virtuals and remove
quite a bit of code overalls.

Has to introduce an extra platform specific hook since X11Client
serializes the activity information in an atom and we will probably need
to do something similar on the Wayland platform at some point.

This allows us to start interacting with the activities with kwin
wayland. They are not restored properly accross sessions though since
nothing is really persisted and the session management still seems to
be amiss.
2021-03-09 15:22:55 +00:00
Kevin Ottens
da0aed5446 Enable KActivities integration by default in kwin_wayland 2021-03-09 15:22:55 +00:00
Kevin Ottens
41766d3594 Activities now accept AbstractClient, no need to downcast
Which means now it doesn't need to be limited to X11Clients only.
2021-03-09 15:22:55 +00:00
Kevin Ottens
228a6e444a Get Activities to depend only on AbstractClient
Since all the services are available on the abstract class, there is no
need to depend on X11Client anymore.
2021-03-09 15:22:55 +00:00
Kevin Ottens
c795e8a3d8 Move setOnActivity to AbstractClient
Since we want to support activities for wayland clients too this needs
to move up in the hierarchy.
2021-03-09 15:22:55 +00:00
Kevin Ottens
391b7e023e Receive the activity list as a const reference
This is mainly to make that coherent with common coding style in other
places.
2021-03-09 15:22:55 +00:00
David Edmundson
0eb37563e9 Restore script DBus API
The Script class has a DBus API we want to export. At some point this
has got broken and the run method is not exported.

It's a bit messy with script subclasses also having other invokables
that we want to export to scripts, so an adaptor is used to keep things
separated.

The interface name has technically changed, but KWin was doing something
weird and using the same interface names for the manager. Fortunately
calling Plasma code doesn't specify an interface so this still works.
2021-03-09 09:14:13 +00:00
Vlad Zahorodnii
9a786cd8bf effects/screenshot: Minor style fixes
We prefer pragma once and put braces on the same line as the if
statement.
2021-03-09 08:58:22 +00:00
Vlad Zahorodnii
1fb44b5bd5 effects/screenshot: Prepare for versioned dbus interface
On Wayland, when the compositor sends a screenshot to the requesting
app, it encodes the screenshot as a PNG image and sends the encoded data
over the pipe. The requesting app (Spectacle) then needs to decode the
data.

The issue is that encoding PNG images is not cheap. This is the main
reason why Spectacle is shown with a huge delay after you press the
PrtScr key.

In order to fix the latency issue, we need to transfer raw image data.
Unfortunately, the current dbus api of the screenshot is too cluttered
and the best option at the moment is to start with a clean slate.

This change prepares the screenshot effect for versioned dbus interface.
Most of existing dbus logic was moved out in a separate class. In order
to schedule screen shots, the screenshot effect got some new API.

    QFuture<QImage> scheduleScreenShot(window, flags)
    QFuture<QImage> scheduleScreenShot(area, flags)
    QFuture<QImage> scheduleScreenShot(screen, flags)

If a dbus interface needs to take a screenshot, it needs to call one of
the overloaded scheduleScreenShot() functions. Every overload returns a
QFuture object that can be used for querying the result.

This change also introduces "sink" and "source" objects in the dbus api
implementation to simplify handling of QFuture objects.

Note that the QFutureInterface is undocumented, so if you use it, you do
it on your own risk. However, since Qt 5.15 is frozen for non-commercial
use and some other Plasma projects already use QFutureInterface, this
is not a big concern. For what it's worth, in Qt 6, there's the QPromise
class, which is equivalent to the QFutureInterface class.

CCBUG: 433776
CCBUG: 430869
2021-03-09 08:58:22 +00:00
Vlad Zahorodnii
38996d9725 libkwineffects: Introduce EffectScreen
This provides the compositor a way to indicate what output is being
rendered. The effects such as the screenshot can check the provided
screen object in order to function as expected.
2021-03-09 08:58:22 +00:00
Vlad Zahorodnii
b3e7031893 platforms/drm: Fix potential stack corruption
If the file descriptor of the DRM device is greater than FD_SETSIZE, the
stack will be corrupted. However, it is highly unlikely that we ever hit
this case because DRM devices are opened at startup of kwin, so the file
descriptors should small.

In order to prevent the potential stack corruption, this change replaces
the usage of select() with poll().

Unlike select(), the api of poll() is much more sensible. Back 20 or so
years ago the main argument against poll() was that it's not implemented
by all platforms. But, nowadays, it's supported on all major platforms.
2021-03-09 10:27:17 +02:00
l10n daemon script
fd68cf3ff4 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"
2021-03-08 07:03:02 +01:00
Aleix Pol Gonzalez
05811535d4 Apply 1 suggestion(s) to 1 file(s) 2021-03-06 03:37:51 +00:00
Aleix Pol
92d3cb2f22 inputmethod: If the client hides itself, act accordingly 2021-03-06 03:25:48 +00:00
Xaver Hugl
7a937fc7af Ignore fully translucent Toplevels for direct scanout 2021-03-05 19:59:48 +01:00
Nicolas Fella
ecd9e1c98d Use imported target for Threads 2021-03-04 15:11:30 +00:00
Bhushan Shah
debea631f3 platforms/drm: inhibit the renderloop when screen is turned off
Otherwise we will continue using gpu resources even when we can not show
any content on screen.
2021-03-04 15:01:15 +00:00
Vlad Zahorodnii
691df1ae00 qpa: Use imported targets for QtCore and QtGui private headers 2021-03-04 13:11:27 +00:00
Chaojiang Luo
fdc7e976fe screencast: Add OpenGLES support for screencasting
OpenGLES does not support glGetTextureImage, we use glReadPixels to
replace it.
2021-03-04 09:29:57 +00:00
Vlad Zahorodnii
d9ec482257 x11: Initialize opacity when starting to track Unmanaged
This is a minor regression that was introduced with the refactoring of
Toplevel::opacity().

Previously, neither X11Client nor Unmanaged had to explicitly initialize
the opacity because it was queried from the net info object in
Toplevel::opacity().

With the refactored version, X11-specific opacity code was removed from
the Toplevel class. When starting to manage a window, the opacity must
be explicitly initialized.

BUG: 432744
2021-03-03 11:58:16 +00:00
l10n daemon script
5f7a2806f0 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"
2021-03-03 07:52:05 +01:00
Xaver Hugl
7cc95d931b Improvements for direct scanout
Instead of cancelling direct scanout if the client buffer is not
fitting, adjust the atomic planes. Also ignore all toplevels from
other screens.
2021-03-02 17:17:36 +00:00
Aleix Pol
4638f2f309 inputmethod: Refactor VirtualKeyboardDBus to have its own InputMethpd
This way we can have it call methods directly instead of connecting to
its signals.
2021-03-02 13:55:35 +00:00
Aleix Pol
63a7b25801 inputmethod: Provide DBus API so the shell can integrate with it
It makes it possible to show if the virtual keyboard is being shown and
if it is to hide it.
2021-03-02 13:55:35 +00:00
Vlad Zahorodnii
6a26540065 wayland: Query pkg-config if Xwayland supports listenfd
-listen <fd> option is deprecated in favor of the -listenfd option. This
change makes kwin query whether Xwayland supports the -listenfd option
at build time. If the pkg-config file is missing, we'll use the old listen
option.
2021-03-02 13:29:22 +00:00
Aleix Pol
b409f523f0 Revert "cmake: Get XKB information directly from PkgConfig"
This reverts commit 3c97cecdb0.

It seems to break on the CI and I don't understand why.
2021-03-02 02:14:39 +01:00
Aleix Pol
3c97cecdb0 cmake: Get XKB information directly from PkgConfig
Rather than having it abstracted in a local FindXKB package.
Makes the code more standard and removes a custom finder we ultimately
don't need.
2021-03-01 20:33:38 +01:00
Aleix Pol
618c330ca8 Do not attempt to compare iterators of potentially different containers
I got this crash after leaving my system unattended:
```
0  std::__atomic_base<int>::load(std::memory_order) const (this=0x0, __m=std::memory_order_relaxed) at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/bits/atomic_base.h:426
1  QAtomicOps<int>::loadRelaxed<int>(std::atomic<int> const&) (_q_value=...) at /home/apol/devel/kde5/include/QtCore/qatomic_cxx11.h:239
2  QBasicAtomicInteger<int>::loadRelaxed() const (this=0x0) at /home/apol/devel/kde5/include/QtCore/qbasicatomic.h:107
3  QtPrivate::RefCount::isShared() const (this=0x0) at /home/apol/devel/kde5/include/QtCore/qrefcount.h:101
4  QMap<KWin::Group*, KWin::Layer>::detach() (this=0x7f1b577b7870 <qt_array+48>) at /home/apol/devel/kde5/include/QtCore/qmap.h:357
5  QMap<KWin::Group*, KWin::Layer>::find(KWin::Group* const&) (this=0x7f1b577b7870 <qt_array+48>, akey=<optimized out>) at /home/apol/devel/kde5/include/QtCore/qmap.h:861
6  KWin::Workspace::constrainedStackingOrder() (this=this@entry=0x564b368c6290) at /home/apol/devel/frameworks/kwin/src/layers.cpp:502
7  0x00007f1b5708d027 in KWin::Workspace::updateStackingOrder(bool) (this=0x564b368c6290, propagate_new_clients=false) at /home/apol/devel/frameworks/kwin/src/layers.cpp:110
8  0x00007f1b571629be in KWin::X11Client::setFrameGeometry(QRect const&, KWin::AbstractClient::ForceGeometry_t) (this=0x564b374b4e60, rect=<optimized out>, force=<optimized out>) at /home/apol/devel/frameworks/kwin/src/x11client.cpp:4193
9  0x00007f1b57003fbf in KWin::AbstractClient::blockGeometryUpdates(bool) (this=this@entry=0x564b374b4e60, block=<optimized out>) at /home/apol/devel/frameworks/kwin/src/abstract_client.cpp:871
10 0x00007f1b570054f1 in KWin::GeometryUpdatesBlocker::~GeometryUpdatesBlocker() (this=<optimized out>) at /home/apol/devel/frameworks/kwin/src/abstract_client.h:1334
11 KWin::AbstractClient::checkWorkspacePosition(QRect, int, QRect) (this=0x564b374b4e60, oldGeometry=..., oldDesktop=1, oldClientGeometry=...) at /home/apol/devel/frameworks/kwin/src/abstract_client.cpp:3189
12 0x00007f1b571409e0 in KWin::Workspace::updateClientArea(bool) (this=<optimized out>, this@entry=0x564b368c6290, force=false) at /home/apol/devel/frameworks/kwin/src/workspace.cpp:2234
13 0x00007f1b57138fc6 in KWin::Workspace::updateClientArea() (this=0x564b368c6290) at /home/apol/devel/frameworks/kwin/src/workspace.cpp:2243
14 KWin::Workspace::desktopResized() (this=0x564b368c6290) at /home/apol/devel/frameworks/kwin/src/workspace.cpp:1980
15 0x00007f1b57707806 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7fff671a2e50, r=0x564b368c6290, this=0x564b372f1860) at ../../include/QtCore/../../../../../devel/frameworks/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:398
16 doActivate<false>(QObject*, int, void**) (sender=0x564b368a0fe0, signal_index=4, argv=0x7fff671a2e50) at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/kernel/qobject.cpp:3886
17 0x00007f1b57707806 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7fff671a2f30, r=0x564b368a0fe0, this=0x564b368a10f0) at ../../include/QtCore/../../../../../devel/frameworks/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:398
18 doActivate<false>(QObject*, int, void**) (sender=0x564b36775640, signal_index=3, argv=0x7fff671a2f30) at /home/apol/devel/frameworks/qt5/qtbase/src/corelib/kernel/qobject.cpp:3886
19 0x00007f1b4ee2f9c3 in KWin::DrmBackend::updateOutputs() (this=this@entry=0x564b36775640) at /home/apol/devel/frameworks/kwin/src/plugins/platforms/drm/drm_backend.cpp:374
20 0x00007f1b4ee31d54 in KWin::DrmBackend::openDrm()::$_2::operator()() const (this=<optimized out>) at /home/apol/devel/frameworks/kwin/src/plugins/platforms/drm/drm_backend.cpp:328
```
2021-03-01 15:11:52 +00:00
Aleix Pol
e4bed6ea27 Still mark setUnresponsive(false) when the pings arrive late
It usually means that the client was busy and couldn't answer the ping
as early as we'd hoped but there's a good chance the process is healthy
again.
2021-03-01 14:10:46 +01:00
Yuri Chornoivan
b5f9d9fda8 Fix disambiguation found by gettext 0.21 2021-02-28 11:59:10 +02:00
l10n daemon script
7b557527f5 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"
2021-02-27 06:24:41 +01:00
Xaver Hugl
1f7e794b82 DrmGpu: add gbm device nullptr check
BUG: 433145
2021-02-25 19:14:02 +01:00
Vlad Zahorodnii
37c145e94b wayland: Fix PrepareForSleep dbus connection
This is a typo. We must use the path of the manager rather than the
session path, which is not initialized yet.
2021-02-25 07:34:27 +00:00
Đoàn Trần Công Danh
5ba3284712 ftrace: use quint32 for context counter
Some old platforms don't have atomic integer supports for 64-bit wise
integer.

As indicated in GPUVis:

	// Erase all knowledge of this ctx so it can be reused

We can reuse numbers after end_ctx, so with we should be fine with
32-bit integer.

Let's use a 32 bit integer for context.
2021-02-24 23:45:19 +00:00
Đoàn Trần Công Danh
5cc062c77c 3rdparty/xcursor: build with _DEFAULT_SOURCE
For both DT_UNKNOWN and DT_LNK.
2021-02-24 16:36:49 +00:00
Đoàn Trần Công Danh
7800f15587 helper: wl-socket: fix build for musl
bind(2) expects its second parameters is a "const struct sockaddr*",
let's cast the "struct sockaddr_un*" to "struct sockaddr*" before
passing into bind(2).

SUN_LEN is a BSD extension that also implemented by GNU, let's define
_DEFAULT_SOURCE before including "sys/un.h".
2021-02-24 16:36:49 +00:00
Vlad Zahorodnii
9977f21980 wayland: Honor NoPlugin option
If decorations are disabled, don't send xdg-toplevel-decoration
configure events requesting ssd mode.
2021-02-24 10:44:29 +00:00
Vlad Zahorodnii
6c9e0781cd Simplify code that destroys plugins and color manager
This reduces some code duplication and ensures that plugins and the
color manager are destroyed while Platform is still valid.
2021-02-24 09:38:56 +00:00
Vlad Zahorodnii
e1279e516c wayland: Track already existing subsurfaces in SubSurfaceMonitor
When the monitor is created, the surface may already have child
sub-surfaces. The childSubSurfaceAdded signal won't be emitted for them,
we need to handle this case explicitly.

BUG: 433511
FIXED-IN: 5.21.2
2021-02-24 10:25:36 +02:00
Vlad Zahorodnii
73dd65f452 Fix build 2021-02-23 15:21:04 +02:00
Aleix Pol
65ad7ffb27 inputmethod: do not cover panels with the input method (e.g. virtual keyboard)
This way we can adapt the panels themselves to show useful UX like
hiding the keyboard or switching.
2021-02-23 12:10:28 +00:00
Vlad Zahorodnii
220a1e0441 Add QDebug stream operator for AbstractOutput
This can be useful for debugging purposes.
2021-02-23 12:47:16 +02:00
Vlad Zahorodnii
33ba2974eb effects: Properly copy previous geometry
In QJSEngine, QRect is an Object, which is correct. This means that we
cannot use simple assignment operator to copy geometries, we need to use
standard ways to copy Objects, such as Object.assign() or the spread
operator, which is not available in QJSEngine yet.
2021-02-23 07:47:01 +00:00
Vlad Zahorodnii
bd4d17b3a1 Drop QtScript dependency
QtScript is not used anywhere anymore plus it's dropped in Qt 6.
2021-02-23 07:47:01 +00:00
David Edmundson
ae6e6dc63c [scripting] Port ScriptedEffects to QJSEngine
Summary:
QScriptEngine is deprecated for years and suffers bitrot.
Plasma hit one super major bug with it in 5.11.0 and has now ported
away.

Main porting notes:
- creating low level functions no longer exists
The old global functions are exposed on the ScriptedEffect instance
and then the QJSValue wrappers of the globalObject are modified to
trampoline the methods at a wrapper level.

- We can then use QJSEngine to automatically do argument error checking
rather than unmarshalling a QJSValue manually which significantly
reduces a lot of code.

- We can't make FPX2 a native type, so these are QJSValue args and
unboxed there.

Long term I want overloads for animate that take int/QSize/QPoint which
are native JS types, but that might be an API break.

Test Plan:
Hopefully comprehensive unit test which passes
Tested fade/fadeDesktop manually.

It's a very invasive change, so I expect some things will be broke
please help test any JS effects.

Reviewers: #kwin, mart, fvogt

Subscribers: fvogt, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14536
2021-02-23 07:47:01 +00:00
Vlad Zahorodnii
566d4aa27b scripting: Port Script to QJSEngine
QtScript is not well maintained and deprecated in favor of QJSEngine.
2021-02-23 07:47:01 +00:00
Bhushan Shah
28d2650f24 [platforms/drm] include missing errno.h include
CCMAIL: Xaver Hugl <xaver.hugl@gmail.com>
2021-02-23 12:07:17 +05:30
Xaver Hugl
6703bc9d24 Improve teardown of DrmGpu 2021-02-22 21:56:03 +01:00
Bhushan Shah
ae8e69b4bb [platforms/drm] accept both keypress and keyrelease event in filter
We don't want to pass out either of key press or release event to other
filters.
2021-02-22 21:52:57 +05:30
Vlad Zahorodnii
58bee8e38a Fix build 2021-02-22 18:11:06 +02:00
Bhushan Shah
b24fc72969 [platforms/drm] only enable output on key press not release
Otherwise if powerdevil for example is configured to turn screen off on
the power key press, we will turn it right back on when we get key
release event.

Suggested-by: David Edmundson <kde@davidedmundson.co.uk>
2021-02-22 21:16:00 +05:30
Vlad Zahorodnii
4061cbc97d Create Xcursor sprites with correct format
"ARGB32" is a typo, it needs to be "ARGB32_Premultiplied."
2021-02-22 15:28:50 +02:00
l10n daemon script
553b6d39c6 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"
2021-02-22 06:57:46 +01:00
Vlad Zahorodnii
33e3b92946 effects/wobblywindows: Allow model geometry and real geometry get out of sync
Currently, the wobbly windows effect assumes that the window data will
be updated on every repaint. However, there are legit cases when the
time diff between frames can be 0, for example when per screen rendering
is on.

If we are unlucky enough and the geometry of the window changes in that
very short moment, the mapping between window quads and the bezier
patch will be wrong. The window will most likely bounce back and forth.

In order to improve handling of that tricky case, this change makes the
computeBezierPoint() function take the "uv" coordinates rather than the
absolute "xy" coordinates of window vertices. This loosens the
connection between the real geometry of the window and the cached bezier
patch, and overall makes the effect's timing code more robust.

This can be also useful if the wobbly windows effect starts accumulating
time diffs and performing the integration step every N msecs with the
purpose of maintaining uniform "wobbliness" across different refresh rates.

BUG: 433187
2021-02-19 16:34:15 +00:00