19252 Commits (22ee512ba6ab203e0e3dfd26eb6296602256dce9)
 

Author SHA1 Message Date
Xaver Hugl eb7703cd64 Only use drmModeAddFB2WithModifiers if supported 4 years ago
Xaver Hugl c1635c1179 Explicitly preserve buffer contents in EglDmabuf 4 years ago
Xaver Hugl c737fde3da DRM: Use QSharedPointer 4 years ago
Vlad Zahorodnii 5c15cca190 wayland: Switch to SeatInterface::notifyPointerButton() 4 years ago
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.
4 years ago
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.
4 years ago
Vlad Zahorodnii 343338049c Drop libinputtest
There's little practical value behind it. If there are input related
issues, we will ask for WAYLAND_DEBUG output.
4 years ago
Vlad Zahorodnii f6217be2ad Drop testLibinputContext 4 years ago
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.
4 years ago
Cyril Rossi 7c55f5ed7d KCM KWin Window Behavior : fix KCM default/reset state. Add KCModuleData to show default indicator at module level
BUG: 433379
4 years ago
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
4 years ago
Bharadwaj Raju 8c352f685e Make ghost windows in highlight effect be fully transparent
BUG: 298487
FIXED-IN: 5.22
4 years ago
Kevin Ottens 9a10af9569 Wire the activity protocol parts to AbstractClient 4 years ago
Weng Xuetian d612d76e09
Replace xdg output done with explicit wl_output done
BUG: 433224
4 years ago
Usarin Heininga e56acf7118 PlasmaWindowManagement: Adapt to changes to kwayland-server
Also call setStackingOrderUuids when the stacking order changes.
4 years ago
Usarin Heininga af53647cf7 Set stackingOrderUuids as well. 4 years ago
Nate Graham 37445d9c29 [kcmkwin/kwinrules] Add explanatory text to placeholder messages 4 years ago
Xaver Hugl ca23bca813 Port DrmSurfaceBuffer to drmModeAddFB2 4 years ago
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
4 years ago
Xaver Hugl 38a15996f4 Consider the opaque region for direct scanout 4 years ago
Xaver Hugl 6569bf80c3 EglGbmBackend: use output reference
CCBUG: 432707
4 years ago
Alexander Lohnau 3cbbdbee99 GIT_SILENT Silence warning about unused parameter in windows runner 4 years ago
Xaver Hugl 20fca90855 Consider the tool type for distinguishing between tools 4 years ago
Alexander Lohnau 81b40966ed GIT_SILENT Add trailing comma to enums 4 years ago
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.
4 years ago
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.
4 years ago
Vlad Zahorodnii 7b68644974 wayland: Adjust input code to SeatInterface with some renamed methods 4 years ago
Adrien Faveraux 37731af7d2 adapt Output management to kwaylandserver change 4 years ago
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.
4 years ago
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).
4 years ago
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.
4 years ago
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.
4 years ago
Méven Car ef19948c00 Reflect changes in kwayland-server changes
https://invent.kde.org/plasma/kwayland-server/-/merge_requests/180
4 years ago
Vlad Zahorodnii 00fcc3a423 wayland: Adjust kwin to SeatInterface changes 4 years ago
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
4 years ago
Nicolas Fella a406eef9a0 Update link to kwin-scripting-api-generator 4 years ago
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.
4 years ago
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.
4 years ago
Vlad Zahorodnii 83388295c8 wayland: Adjust kwin to PointerInterface changes 4 years ago
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.
4 years ago
Kevin Ottens da0aed5446 Enable KActivities integration by default in kwin_wayland 4 years ago
Kevin Ottens 41766d3594 Activities now accept AbstractClient, no need to downcast
Which means now it doesn't need to be limited to X11Clients only.
4 years ago
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.
4 years ago
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.
4 years ago
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.
4 years ago
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.
4 years ago
Vlad Zahorodnii 9a786cd8bf effects/screenshot: Minor style fixes
We prefer pragma once and put braces on the same line as the if
statement.
4 years ago
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
4 years ago
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.
4 years ago
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.
4 years ago