Commit graph

22752 commits

Author SHA1 Message Date
Vlad Zahorodnii
9e61f5039e Remove some Screens::count() usages
Screens is obsolete, use Platform::enabledOutputs().
2022-07-13 21:51:03 +00:00
Xaver Hugl
7f04ea578f backends/drm: handle broken legacy drivers better
Some legacy drivers either don't accept gbm buffers suitable for cursors,
or don't handle them properly. In order to work around that, always do a
CPU import with legacy and use dumb buffers instead.

BUG: 453860
CCBUG: 456306
2022-07-13 21:10:19 +02:00
Vlad Zahorodnii
e09ca74295 wayland: Make workspace responsible for creating Screens
The Screens object is created by Workspace on X11. This change makes X11
and Wayland behave more similar. As is, the Screens is a helper for
window management code, don't use it in backends. Note that the X11 backend
already uses the Screens, it needs to be addressed individually.
2022-07-13 17:54:35 +00:00
Xaver Hugl
137cd9c031 xdgshell: don't allow applet popups to be moved 2022-07-13 17:00:34 +00:00
Vlad Zahorodnii
5be18da8ac backends/virtual: Remove unused includes 2022-07-13 16:01:46 +00:00
Vlad Zahorodnii
728e369a4d backends/virtual: Remove eglSwapBuffers() call
It's noop, we use EGL_MESA_platform_surfaceless.
2022-07-13 16:01:46 +00:00
Vlad Zahorodnii
b442c1e81b qpa: Port from Screens 2022-07-13 15:42:27 +00:00
Arjen Hiemstra
8284740cdf InputMethodTest: Only create the windowAddedSpy when actually needed
We don't really care about the window showing up until we're calling
showInputPanel, but since Workspace::windowAdded is triggered for any
window that gets added, the test sometimes fails because count() is 2
instead of 1. To avoid that, only create the spy when it's actually
relevant instead of all the way at the start before any other setup is
done.
2022-07-13 15:24:19 +00:00
Xaver Hugl
c050716a3b wayland/drmlease: correct DrmLeaseDeviceV1Interface::setDrmMaster 2022-07-13 12:27:54 +00:00
Xaver Hugl
9ac3c64d4c wayland/drmlease: split up DrmLeaseV1Interface::deny 2022-07-13 12:27:54 +00:00
Xaver Hugl
919b56e9a2 drmlease: send device done event correctly 2022-07-13 12:27:54 +00:00
Vlad Zahorodnii
71bfbe815c backends/virtual: Manage VirtualQPainterLayer using std::unique_ptr 2022-07-13 11:07:18 +00:00
Vlad Zahorodnii
26d4a06818 backends/virtual: Port from Screens 2022-07-13 11:07:18 +00:00
Vlad Zahorodnii
b3d3ca8c0f backends/drm: Remove unused screens.h includes 2022-07-13 10:21:44 +00:00
Arjen Hiemstra
a4fe17653f Remove alignment requirements from data in vertex/index buffers
We now rely on auto-vectorisation to generate the appropriate SSE or
other instruction set code. We can also assume that takes care of
handling any alignment requirements and thus remove the need for manual
alignment things.
2022-07-13 09:25:12 +00:00
Arjen Hiemstra
5287422f46 Add unroll hint to inner loop in WindowQuads::makeInterleavedArrays
The inner loop here has a fixed size and unrolling it allows better
vectorization. Both GCC and clang recognise the `#pragma GCC unroll`
directive.
2022-07-13 09:25:12 +00:00
Arjen Hiemstra
a95b556868 Drop custom SSE code from WindowQuads::makeInterleavedArrays
Both GCC and Clang do auto vecrization these days and testing shows that
that actually produces faster code, so dropping the SSE stuff makes
things both simpler and faster.
2022-07-13 09:25:12 +00:00
ivan tkachenko
0c8d87f9d4
[kwineffects] Fix wrong object being passed as a QQuickItem* context
Without this patch the following warning is issued:

    Could not convert argument 1 at
        onTriggered@file:///usr/share/kpackage/kcms/kcm_kwin_effects/contents/ui/Effect.qml:129
        onClicked@file:///usr/lib/qml/org/kde/kirigami.2/templates/SwipeListItem.qml:485
    Passing incompatible arguments to C++ functions from JavaScript is dangerous and deprecated.
    This will throw a JavaScript TypeError in future releases of Qt!
2022-07-13 10:53:42 +03:00
Arjen Hiemstra
d7fd53e9b0 Correct bottom left corner when placing a bottom toplevel input panel
`bottomLeft()` is affected by the same issue as anything else using
bottom, that is, it is off by 1. So instead use top() + height() for the
bottom edge.
2022-07-12 22:43:56 +01:00
Arjen Hiemstra
78c8ebc345 Make MoveResizeWindowTest::testResizeForVirtualKeyboard data-driven
This allows us to easily expand the things the test tests for and allows
testing some corner cases more properly.
2022-07-12 22:43:56 +01:00
Arjen Hiemstra
083437d487 Don't use QRect::bottom when applying virtual keyboard geometry
Bottom is unreliable because of "historical reasons" in Qt. So don't use
bottom, instead calculate the proper height and top manually.
2022-07-12 22:43:56 +01:00
David Edmundson
36f7bae36a Revert "inputpanel: Compensate the 1px difference in height for panel position"
This reverts commit 8d588f165c.
2022-07-12 22:31:38 +01:00
Rodney Dawes
8d588f165c inputpanel: Compensate the 1px difference in height for panel position
It seems there is a 1px offset in the availableArea height, so compensate
by subtracting an extra pixel from the input panel height, to avoid a gap
below the panel.

Fixes https://invent.kde.org/teams/plasma-mobile/issues/-/issues/150
2022-07-12 14:34:10 -04:00
Vlad Zahorodnii
64f811107e scenes/opengl: Remove unused includes 2022-07-12 17:49:41 +03:00
Vlad Zahorodnii
86f741ebe7 scenes/qpainter: Remove unused includes 2022-07-12 17:47:02 +03:00
Vlad Zahorodnii
02bfc8ecae scripting: Port from obsolete Screens 2022-07-12 12:22:18 +00:00
Vlad Zahorodnii
7d00766629 backends/drm: Make drm backend not touch output configuration if all outputs are disabled
This behavior was added in order to fix a crash reported in bug report
442990. However, the analysis was not 100% correct, kwin failed to
create a placeholder because the relevant check was incorrect. The drm
backend was checking the list of all connected outputs rather than the
list with enabled outputs to decide whether to create a placeholder output.

As a safety measure the proposed behavior makes sense, however the drm
backend is not the right layer to implement it. If the last enabled
output is disconnected, kscreen should view it as a new output
setup and re-enable outputs in order to ask user what desired output
configuration should be.
2022-07-12 09:54:50 +00:00
Vlad Zahorodnii
694c32cf2c Fully port EffectsHandler from Screens
This port the remaining bits in EffectsHandler from Screens. It does
make sense to deprecate or remove workspace geometry bits in
libkwineffects as the interpretation of the workspace layout is very
effect-specific, e.g. as in the slide effect.
2022-07-12 10:40:23 +03:00
Vlad Zahorodnii
79e0051b04 autotests: Port more tests from obsolete Screens 2022-07-12 07:05:45 +00:00
l10n daemon script
8d08c31de0 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-07-12 01:49:58 +00:00
ivan tkachenko
e9ad2b530b
[kcm/kwindesktop] Bump QML imports & fix JavaScript code style 2022-07-11 21:52:30 +03:00
ivan tkachenko
4f419afe30
[kcm/kwindesktop] Emit rowsChanged signal to fix default state highlighting
Without this, the rowsChanged signal wasn't emitting at startup, so the
binding `highlight: kcm.desktopsModel.rows !== 2` didn't work correctly.

FIXED-IN: 5.24.7 5.25.3 5.26
2022-07-11 21:52:25 +03:00
Xaver Hugl
0d302d5c66 backends/drm: also check for properties in DrmPipeline::needsModeset
Otherwise we may be missing situations where a modeset is needed

BUG: 455814
2022-07-11 14:31:55 +00:00
Vlad Zahorodnii
8f18dc5b7d Make Item::repaints() not guess repaints
The guessed repaint region is not optimal on wayland. Second, if it's a
new output, it's expected that there will be already a scene repaint
that covers all items on the given output so items don't need to provide
redundant repaint region.
2022-07-11 14:21:53 +03:00
l10n daemon script
c442f582a3 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-07-11 01:48:31 +00:00
Xaver Hugl
2d43f3eee2 backends/drm: handle disconnected but not removed connector objects properly
The kernel doesn't disable connector objects that represent physical ports
when the output gets removed. If KWin tries to change the output configuration
without explicitly disabling the connector, atomic commits can fail.
2022-07-10 11:55:57 +00:00
Alexander Lohnau
e96b9ba499 Improve docs for creating KWin effects
- use kcoreaddons_add_plugin CMake macro, the other one is KWin internal
- reference embedded json metadata in section about macros
- Provide codesnippet to json metadata
- Do not explicitly define plugin id in metadata, instead we can derive it from the library name
2022-07-10 10:05:55 +00:00
l10n daemon script
b97d12efc0 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-07-10 01:51:16 +00:00
l10n daemon script
19fb451be2 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-07-09 01:50:01 +00:00
Xaver Hugl
5451c7e0db windowview: handle windows from other virtual desktops better
Sometimes windows on other desktops are higher in the stacking order,
which causes them to unexpectedly jump above windows from the current
desktop in the effect.

To fix that, the z index is adjusted to be higher for windows on the active
virtual desktop, and windows from other desktops get reduced opacity in the
beginning of the animation
2022-07-08 17:03:16 +00:00
David Edmundson
c49620658f Create large enough atlas texture for decorations
When we render individual component of a decoration into an atlas we
ceil the positions for the individual component parts so they don't risk
overlapping. See SceneOpenGLDecorationRenderer::render

This isn't done when we set the overall texture height. This can cause
the bottommost part of the atlas (the right edge) to go out of view.

BUG: 453745
2022-07-08 12:34:22 +00:00
David Edmundson
06db7fc7ff Map XdgSurface to XdgWMBase instances properly
xdg_wm_base is a global that with a single instance in our high level
wrapper. Our surface wrapper needs to get the xdg_wm_base::Resource
instance on occastion.

Currently we go via wl_client for the mapping, but this breaks down
should a client bind wm_base twice.

BUG: 456349
2022-07-08 11:57:57 +00:00
Rodney Dawes
6af5a5e651 inputmethod: If KWIN_IM_SHOW_ALWAYS variable is set, show the keyboard
To allow for easier testing in development and for debugging purposes, when
the KWIN_IM_SHOW_ALWAYS environment variable is set, treat it as allowing
the keyboard to be shown, even when not using touch input.
2022-07-07 15:15:28 -04:00
David Edmundson
df1938b8af Fix flickering in slide effect with multi screen
The slide effect translates all windows as we switch desktop. In a multi
screen setup we don't want windows to enter a different screen during
this animation.

The current code masks everything to the current output. This is broken
for any window that spans across screens even slightly. It will not be
visible during the transform then appear on top at the end.

The new algorithm is, for each screen in each window we crop the painted
area to the intersection of the screen and the screen's translated
position.
2022-07-06 14:25:57 +00:00
Aleix Pol
298424d089 XdgOutput: Ensure we update the output size when the overrideScale changes
scaleOverride is set by KScreen through KConfig, so it's asynchronous to
the rest of update calls that may happen.
2022-07-06 12:57:30 +00:00
Vlad Zahorodnii
fa78de6219 kwineffects: Strip ScreenPaintData of transforms
ScreenPaintData provides a way to transform the painted screen, e.g.
scale or translate. From API point of view, it's great. It allows
fullscreen effects to transform the workspace in various ways.

On the other hand, such effects end up fighting the default scene
painting algorithm. For example, just have a look at the slide effect!
With fullscreen effects, it's better to leave to them the decision how
the screen should be painted. For example, such approach is taken in
some wayland compositors, e.g. wayfire, and our qtquick effects already
operate in similar fashion.

Given that, strip the ScreenPaintData of all available transforms. The
main motivation behind this change is to improve encapsulation of item
painting code and simplify model-view-projection code in kwin. It will
also make the job of extracting item code for sharing purposes easier.
2022-07-06 11:10:54 +00:00
Vlad Zahorodnii
53d25c7228 Remove assumption that the workspace starts at (0, 0)
If a leftmost output is temporarily disabled but outputs on the right
hand side are not moved, some windows may stop being movable because the
Workspace will return bad FullArea. In order to improve handling of
that case, make the FullArea same as the workspace geometry.
2022-07-06 10:27:14 +00:00
Xaver Hugl
7d5d35928f backends/drm: don't create a new output every time 2022-07-06 09:52:49 +00:00
Vlad Zahorodnii
b5ea9381d1 wayland: Send drm-lease-device::done event to the correct resource
When sending the drm_lease_device_v1.done event, we pass a connector
resource, but we need to pass a device resource.
2022-07-06 11:36:55 +03:00
Vlad Zahorodnii
40fb202aed Make IdleDetector not emit resumed signal when it's inhibited
At the moment, when an IdleDetector is inhibited, it can emit the
resumed signal. It makes sense on one hand, but also it doesn't.
Inhibited != resumed.

According to the idle-inhibit-v1 protocol specification, we don't
need to emit the resumed signal:

> Likewise, the inhibitor isn't honored if the system was already idled at
> the time the inhibitor was established, although if the system later
> de-idles and re-idles the inhibitor will take effect.
2022-07-05 20:36:04 +00:00