Commit graph

19128 commits

Author SHA1 Message Date
Vlad Zahorodnii
f534b64e5c platforms/drm: Associate drm objects with their gpus
This makes the code more consistent. At the moment, we initialize drm
objects either with the corresponding gpu object or with its fd.
2021-04-01 14:15:42 +03:00
Vlad Zahorodnii
75e7562953 platforms/drm: Fix handling of missing EDID
drmModeGetPropertyBlob() may return null and we should handle that. In
addition to that, m_conn is not initialized in DrmConnector so kwin will
crash whenever the connector info is accessed.
2021-04-01 11:01:53 +00:00
Vlad Zahorodnii
53f7bda7d2 platforms/drm: Make DRM backend less chatty
These warnings can be safely ignored, their priority can be lowered.
2021-04-01 13:21:33 +03:00
Xaver Hugl
2efb9c473d Move Edid and DPMS into DrmConnector 2021-03-31 16:08:33 +00:00
Vlad Zahorodnii
326d211691 platform: Use damage tracked by SurfaceItem
There is no need for both kwin and kwaylandserver track damage.
2021-03-31 13:56:55 +00:00
Vlad Zahorodnii
2ade92d69b platform: Make OpenGLBackend::scanout take SurfaceItem
This allows removing SurfaceInterface::trackedDamage().
2021-03-31 13:56:55 +00:00
Vlad Zahorodnii
36b55261da Drop AbstractClient::addRepaintDuringGeometryUpdates()
It's not needed since the scene keeps track of repaints.
2021-03-31 13:56:55 +00:00
Vlad Zahorodnii
98b0b13f98 libkwineffects: Drop windowPaddingChanged signal
It makes no sense on Wayland.
2021-03-31 13:56:55 +00:00
Vlad Zahorodnii
a9d5b84596 scene: Refactor damage teardown in X11SurfaceItem
This introduces the markedAsZombie signal, which is emitted when the
window is about to become deleted. The X11SurfaceItem uses this signal
to determine when the damage must be destroyed.
2021-03-31 13:56:55 +00:00
Vlad Zahorodnii
47113e09b8 scene: Introduce window items
Currently, dealing with sub-surfaces is very difficult due to the scene
design being heavily influenced by X11 requirements.

The goal of this change is to re-work scene abstractions to make improving
the wayland support easier.

The Item class is based on the QQuickItem class. My hope is that one day
we will be able to transition to QtQuick for painting scene, but in
meanwhile it makes more sense to have a minimalistic internal item class.

The WindowItem class represents a window. The SurfaceItem class represents
the contents of either an X11, or a Wayland, or an internal surface. The
DecorationItem and the ShadowItem class represent the server-side deco and
drop-shadow, respectively.

At the moment, the SurfaceItem is bound to the scene window, but the long
term plan is to break that connection so we could re-use the SurfaceItem
for things such as software cursors and drag-and-drop additional icons.

One of the responsibilities of the Item is to schedule repaints as needed.
Ideally, there shouldn't be any addRepaint() calls in the core code. The
Item class schedules repaints on geometry updates. In the future, it also
has to request an update if its opacity or visibility changes.
2021-03-31 13:56:55 +00:00
Vlad Zahorodnii
b61c800cee libkwineffects: Introduce windowExpandedGeometryChanged()
This signal can be useful if you want to know when the visible geometry
has changed to update cached repaint region during an animation.
2021-03-31 13:56:55 +00:00
Vlad Zahorodnii
c6d2eee3c1 Introduce signals to notify about Shadow changes
These signal can be useful if you need to know when the shadow must be
repainted or its geometry has changed.
2021-03-31 13:56:55 +00:00
Vlad Zahorodnii
0f1afdbdc0 scene: Pass dirty region to SceneOpenGLTexture::updateTexture 2021-03-31 13:56:55 +00:00
Vlad Zahorodnii
369b768f36 wayland: Mark Xwayland windows ready for painting when mapped
This makes the logic that determines when Xwayland windows can be marked
as ready for painting more robust.

At the moment, we call setReadyForPainting() when the surface is damaged,
but we want Toplevel stop managing damages.
2021-03-31 13:56:55 +00:00
Vlad Zahorodnii
0bb5a51da8 x11: Move damage fetching code to X11Compositor
This is needed to make damage fetching specific to X11 surfaces.
2021-03-31 13:56:55 +00:00
Xaver Hugl
c0c3ec09af Refactor DrmObject 2021-03-31 10:19:42 +00:00
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
343338049c Drop libinputtest
There's little practical value behind it. If there are input related
issues, we will ask for WAYLAND_DEBUG output.
2021-03-23 08:01:19 +00:00
Vlad Zahorodnii
f6217be2ad Drop testLibinputContext 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
e56acf7118 PlasmaWindowManagement: Adapt to changes to kwayland-server
Also call setStackingOrderUuids when the stacking order changes.
2021-03-19 13:39:14 +00: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