Commit graph

20854 commits

Author SHA1 Message Date
Alexander Lohnau
abcf22b4d6 Clean up defunct version header for kwinscripts kcm 2022-03-06 19:11:01 +01:00
Michail Vourlakos
bcff044c73 [aurorae] - support blurregion from kdecoration2
This is an approach for aurorae engine to publish masks for its decorated windows in order to avoid out of window blurring at the decoration corners. Aurorae themes are now able to specify a **mask** element inside **decoration.svg** file like plasma themes already do. Mask is used afterwards to calculate theme's blur region.


| Before | After |
| ------ | ----- |
|![before](/uploads/26014e79c3d5d45ba12fa5cf62294b1c/before.png)|![after](/uploads/923d7021eaaf322be96b611c73558666/after.png)|

Adjusted Aurorae theme for testing: [ROUNDED-DARK.tar.gz](/uploads/082f60ad4311e3e296b7faeeb7c97dac/ROUNDED-DARK.tar.gz)

BUG:395725
2022-03-06 09:58:11 +00:00
Kai Uwe Broulik
32daab286d Use workspaceLayer as context object
Otherwise the connection isn't severed when the layer is destroyed,
leading to crashes when screen resolution changes.

We don't actually need `this` to access `workspace()`, and we have
a guarded `output` as sender in the other case.
2022-03-04 22:26:38 +01:00
Aleix Pol
b11499d95e Remove AbstractWaylandOutput::isBeingRecorded
It's not being used anywhere
2022-03-04 04:05:24 +01:00
Aleix Pol
4c814590fe Fix textureForOutput for the EglWaylandBackend
Ensure we get our texture from the right output
2022-03-04 02:56:35 +01:00
l10n daemon script
eb760505ac 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"
2022-03-04 01:43:35 +00:00
Kai Uwe Broulik
85aca384b9 gitlab-ci: Add minimal build configuration
Ensures KWin is also built with features disabled to catch when code is
added that requires a build-time guard

Signed-off-by: Eike Hein <eike.hein@mbition.io>
2022-03-03 16:07:56 +01:00
Kai Uwe Broulik
a55ea639a1 autotests: Guard tabbox_test by KWIN_BUILD_TABBOX
Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2022-03-03 14:34:10 +00:00
Kai Uwe Broulik
0793c24249 Add KWIN_BUILD_NOTIFICATIONS option
Notifications are really only useful in a setting with a full
shell environment where there is a notification center to display them.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2022-03-03 15:06:36 +01:00
Vlad Zahorodnii
0f448a83d9 autotests: Test moving pointer between windows 2022-03-03 13:45:47 +00:00
Vlad Zahorodnii
12ec886ccc Port to SeatInterface::notifyPointer{Enter,Leave} 2022-03-03 13:45:47 +00:00
Manuel Stoeckl
a2b7c09a11 Allow direct uploads of 16-bpc QImage formats
This commit expands the QImage-to-GL formatTable to include entries
for RGBX64, RGBA64_Premultiplied, and Grayscale16 image formats.
Uploading 16-bit-per-channel formats is supported by OpenGL and, with
the GL_EXT_texture_norm16 extension, GLES.
2022-03-03 10:23:31 +00:00
Marco Martin
e00d836708 Force cancel of any drag in progress when Escape is pressed
when escape is pressed when dragging between different clients,
cancelling any drag is compositor's responsibility

BUG:405267
2022-03-03 09:54:18 +00:00
Alex Richardson
d789ecc6d1 Use #cmakedefine01 for all KWIN_BUILD_* macros
This ensures that we get a warning if the config header is not included
instead of compiling the code as if it was disabled. Interestingly, some
checks already used #if KWIN_BUILD_*, so those were generating -Wundef
warnings when the feature is disabled. Commit 886173cab assumed that all
those features were already 01, so this unbreaks the build if any of the
features is disabled.

Fixes: 886173cab ("Reduce ifdefs in Workspace::supportInformation()")
2022-02-28 18:59:04 +00:00
Xaver Hugl
dea33cb311 backends/drm: consider zero modes as failure
If there's no modes, we can't use the output
2022-02-28 17:26:29 +00:00
Xaver Hugl
6bd6ad9d59 backends/drm: let DrmGpu handle mode changes
Doing a test is not sufficient for mode changes

BUG: 450804
2022-02-28 17:26:29 +00:00
Xaver Hugl
907cf72bb0 backends/drm: only update modes if actually necessary
This prevents some unneeded modesets
2022-02-28 17:26:29 +00:00
Xaver Hugl
72d9711e5d backends/drm: fix recording with direct scanout
BUG: 450943
2022-02-28 17:27:44 +01:00
Kai Uwe Broulik
1256ab4b84 scripting: Build generic scripting KCM only with KWIN_BUILD_KCMS
Without scripting KCM there is no access to script configuration either

Signed-off-by: Eike Hein <eike.hein@mbition.io>
2022-02-24 21:29:53 +00:00
Kai Uwe Broulik
4a14ac51ed effects: Build effect config only with KWIN_BUILD_KCMS
Without effects KCM there is no access to effect configuration either

Signed-off-by: Eike Hein <eike.hein@mbition.io>
2022-02-24 21:29:53 +00:00
Aleix Pol
4c9c5f9fd5 inputmethod: fix placing the virtual keyboard at the bottom
We should use the output area as the margin size as where to position
rather than the panelSize.

This ensures that the keyboard ends up in the right place right above
the panels.
2022-02-24 18:11:45 +01:00
Laurent Montel
cf6cc51651 Allow to use new kauth includes 2022-02-24 07:14:23 +01:00
Vlad Zahorodnii
aaa07f0605 Revert "Remove mysterious s_cursorUpdateBlocking boolean flag in pointer_input.cpp"
This reverts commit 3d0bdc56a4.

seat->setFocusedPointerSurface() before notifyPointerMotion() is needed
to prevent sending a motion event that's outside the previously focused
surface.

BUG: 449273
2022-02-23 22:03:27 +02:00
Kai Uwe Broulik
d54723cbf2 Add KWIN_BUILD_SCREENLOCKER option
Allows to build KWin without lockscreen support and thus drops the
kscreenlocker dependency.

Signed-off-by: Eike Hein <eike.hein@mbition.io>
2022-02-23 14:39:25 +01:00
Kai Uwe Broulik
5db527a053 effects/mousemark: Port away from KPluralHandlingSpinBox
It's the only user of KTextWidgets in the entire repository.

Signed-off-by: Eike Hein <eike.hein@mbition.io>
2022-02-23 13:48:43 +01:00
Kai Uwe Broulik
8f21921843 effects: Don't call load() from KCM constructor
It is automatically called (and documented as such) by KCModule
after the constructor is run.

This avoids calling a virtual method from the constructor.

Signed-off-by: Eike Hein <eike.hein@mbition.io>
2022-02-23 11:47:32 +00:00
Kai Uwe Broulik
aef8ba8d1a Port KComboBox to QComboBox
None of the features it adds ontop of `QComboBox` are used.

Allows to drop the dependency on KCompletion.

Signed-off-by: Eike Hein <eike.hein@mbition.io>
2022-02-23 11:28:47 +00:00
Kai Uwe Broulik
ad4bbba08a kwinrules: Use KWindowSystem::isPlatformX11()
No need to use QX11Info if we already have KWindowSystem

Signed-off-by: Eike Hein <eike.hein@mbition.io>
2022-02-23 11:36:37 +01:00
Kai Uwe Broulik
7e16130eea effects/overview: Don't link against KF5::Completion
None of its classes are used in this effect.

Signed-off-by: Eike Hein <eike.hein@mbition.io>
2022-02-22 15:27:31 +00:00
Kai Uwe Broulik
3aa23093e2 effects: Explicitly link against CoreAddons
Don't rely on another framework to pull it in.
It's where `KPluginFactory` lives.

Signed-off-by: Eike Hein <eike.hein@mbition.io>
2022-02-22 15:27:31 +00:00
Kai Uwe Broulik
2591afc7e7 effects: Remove unused KAboutData includes
Signed-off-by: Eike Hein <eike.hein@mbition.io>
2022-02-22 15:27:31 +00:00
Xaver Hugl
b530a5b66d backends/drm: fix layer destruction
Layers need to release their resources whenever the render backend gets
replaced.
2022-02-22 14:52:52 +01:00
Xaver Hugl
a04bdf2355 backends/drm: port DrmPipeline and DrmGpu to use layers
Instead of having the render backends manage layers, have DrmGpu and DrmPipeline
do it. This makes it possible to unify code paths for leased and normal
outputs, remove some redirection and have more freedom with assigning layers
to screens.
2022-02-22 14:52:52 +01:00
Xaver Hugl
cdac2690d1 backends/drm: port layers to DrmDisplayDevice 2022-02-22 14:52:52 +01:00
Xaver Hugl
dd198461ea backends/drm: introduce DrmDisplayDevice
DrmDisplayDevice is a new parent class for both normal and lease outputs,
which makes it possible to simplify a few things
2022-02-22 14:52:52 +01:00
Xaver Hugl
ddb6dadfc2 backends/drm: port qpainter to layers 2022-02-22 14:52:52 +01:00
Vlad Zahorodnii
153d5965f8 wayland: Remove unpolish() calls
It's leftover after the times when widget style was using wayland
connection. Breeze had to destroy all wayland resources before
terminating the internal connection.
2022-02-22 07:36:47 +00:00
Xaver Hugl
b063031313 backends/drm: block input with the placeholder output
This is to prevent the user from accidentally changing application state
while they don't have an output connected
2022-02-21 20:11:38 +00:00
Vlad Zahorodnii
4326d3f029 effects/blur: Avoid shrinking unrelated opaque regions
Currently, the blur effect will shrink an opaque region even if it
doesn't intersect m_currentBlur.

This ensures that the blur effect won't do a stupid thing such as
clipping the opaque region of the desktop window.
2022-02-21 16:02:46 +00:00
Vlad Zahorodnii
e27ecfe88d Remove excessive damage region clipping
We already try to ensure that the surface damage is within render target
bounds. Avoid clipping surface damage in render backend, which is a bit
excessive task and perhaps it should be done an abstraction level above.
2022-02-21 15:30:30 +00:00
Vlad Zahorodnii
05de198c41 scene: Check SurfacePixmap's alpha channel to determine if surface is translucent
If the main surface is translucent (e.g. it contains only the drop
shadow) but its subsurface is opaque, the "window->isOpaque()" check
will produce a false positive.
2022-02-21 14:48:01 +00:00
Vlad Zahorodnii
ae3dc3f3c6 effects/colorpicker: Pick color in paintScreen()
It's not guaranteed that there will be current render target in
postPaintScreen() as all painting have been completed. paintScreen() is
a much safer place to pick color.
2022-02-21 14:34:49 +00:00
Vlad Zahorodnii
6d20b977ab effects/screenshot: Capture screenshot in paintScreen()
It's not guaranteed that there will be current render target in
postPaintScreen() as all painting have been completed. Furthermore,
even the docs of the postPaintScreen() function indicate that no
painting should be done there, you can do only cleanup things, e.g.
schedule a repaint, etc. paintScreen() is a much safer place to
capture screenshot.
2022-02-21 14:34:49 +00:00
Alex Richardson
24eee2df7c Cast via uintptr_t when converting between integers and pointers
When casting from integer to pointer, promoting the integer to (u)intptr_t
will ensure that the resulting type can be converted to a pointer without
problems. These two casts changed in this commit trigger a warning when
building for CHERI-enabled architectures such as Arm Morello. This is not
just limited to CHERI, the cast from xcb_pixmap_t (uint32_t) to void*
should also be flagged by -Wint-to-void-pointer-cast when using Clang,
however, it appears that warning only handles C-style casts, and not
reinterpret_cast (https://github.com/llvm/llvm-project/issues/53964).
2022-02-21 13:27:29 +00:00
Vlad Zahorodnii
dd6d0b22cc Port software cursor to RenderLayer
Software cursor has always been a major source of problems. Hopefully,
porting it to RenderLayer will help us with that.

Note that the cursor layer is currently visible only when using software
cursor, however it will be changed once the Compositor can allocate
a real hardware cursor plane.

Currently, software cursor uses graphics-specific APIs (OpenGL and
QPainter) to paint itself. That will be changed in the future when
rendering parts are extracted from the Scene in a reusable helper.
2022-02-21 09:33:59 +00:00
Vlad Zahorodnii
8739258f2f Drop Platform::isPerScreenRenderingEnabled()
At this point, it's safe to assume that only X11 has weird rendering
model, which stands in the way of making rendering abstractions nice and
intuitive, so let's check operation mode. If OperationModeX11 is
dropped, this will also simplify finding X11-specific code in kwin.
2022-02-21 09:33:59 +00:00
Vlad Zahorodnii
5933a21641 Introduce render layers
This is the first tiny step towards the layer-based compositing in kwin.
The RenderLayer represents a layer with some contents. The actual
contents is represented by the RenderLayerDelegate class.

Currently, the RenderLayer is just a simple class responsible for
geometry, and repaints, but it will grow in the future. For example,
render layers need to form a tree.

The next (missing) biggest component in the layer-based compositing are
output layers. When output layers are added, each render layer would
have an output layer assigned to it or have its output layer inherited
from the parent.

The render layer tree wouldn't be affected by changes to the output
layer tree so transition between software and hardware cursors can be
seamless.

The next big milestone will be to try to port some of existing kwin
functionality to the RenderLayer, e.g. software cursor or screen edges.
2022-02-21 09:33:59 +00:00
Vlad Zahorodnii
65ccfd336f Add dummy OutputLayer type
It's needed to make repaint scheduling in render layers simple.
2022-02-21 09:33:59 +00:00
Vlad Zahorodnii
203d7b3b8a Move direct scanout management to Compositor
The responsibilities of the Scene must be reduced to painting only so we
can move forward with the layer-based compositing.

This change moves direct scanout logic from the opengl scene to the base
scene class and the compositor. It makes the opengl scene less
overloaded and allows to share direct scanout logic.
2022-02-21 09:33:59 +00:00
Alex Richardson
886173cabe Reduce ifdefs in Workspace::supportInformation()
All of these preprocessor constants are defined to 0 or 1, so we can use
a ternary expression instead of `#if+#else`.
2022-02-20 21:08:07 +00:00