Commit graph

3608 commits

Author SHA1 Message Date
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
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
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
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
Xaver Hugl
a71146c999 backends/drm: don't remove connectors the kernel doesn't consider removed
Removing connectors that are still powered leads to a mismatch in atomic
commits: the crtc is still powered, but the connector also still there.
If KWin tries to disable the crtc afterwards, the atomic commits fail because
the connector needs to be disabled at the same time and it's missing from the
atomic commit request.

To fix this, whenever we fail to fetch information or get wrong data from
the kernel (like 0 modes), use the cached information instead and keep the
connector.

BUG: 456298
2022-07-05 19:11:33 +00:00
David Edmundson
4ced407828 Emit scaleOverride changed signal 2022-07-05 17:00:38 +00:00
Guenther Grau
5998326374 Extract duplicate line in present in both if branches
Use more concise code to assign workArea
2022-07-05 17:27:31 +02:00
Nate Graham
85e0d5ea55 effects/overview: make add/delete Virtual Desktop buttons consistent
These are proper nouns and should be capitalized. And let's consistently
use the term "Virtual Desktop", not just "Desktop" (which can be
confused for the desktop with the wallpaper).
2022-07-05 08:53:15 -06:00
Nate Graham
f53bb84009 effects/overview: clean up code for buttons with tooltips 2022-07-05 08:50:40 -06:00
Nate Graham
abbbc0b72c WindowHeapDelegate: add tooltip and accessibility info to close button
BUG: 456242
FIXED-IN: 5.26
2022-07-05 08:41:32 -06:00