Commit graph

22816 commits

Author SHA1 Message Date
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
Aleix Pol i Gonzalez
5214417ee3 screencasting: We need the opengl context to be current when creating dmabuf
Otherwise it (sometimes!) fails and gets very confused.
2022-07-04 22:52:40 +00:00
Aleix Pol
30e922c4d6 screencasting: Add support streaming dmabuf+modifier textures 2022-07-04 22:52:40 +00:00
Aleix Pol
d5ddf55e9b gbm: Don't pass any flags when creating buffers with modifiers
It seems it doesn't bring much and it may backfire. Especially don't
pass GBM_BO_USE_LINEAR as it will limit a lot the buffers that can be
created and GBM_BO_USE_RENDERING use seems to be more harmful than
helpful on most cases.
2022-07-04 22:52:40 +00:00
Aleix Pol
78d80123f1 xdgactivation: Properly prevent disabled activation notifications
The logic when checking the settings was wrong and it would always
notify unless both keys were actually disabled.

BUG: 454937
2022-07-04 17:44:10 +02:00
l10n daemon script
fb57b71e75 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-04 01:48:22 +00:00
Ismael Asensio
3c5c079aa5 TabBox: Do not highlight selected window for fullscreen switchers
This helps improving performance on those effects, where the
highlighted window is not even shown.

BUG: 449180
FIXED-IN: 5.25.3
2022-07-03 18:51:45 +02:00
l10n daemon script
7d08e5f251 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-03 01:57:17 +00:00
l10n daemon script
c0307bb402 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-02 02:03:09 +00:00
David Edmundson
b4536572d3 Ship kconf update script to clean animation factor from kwinrc
This is almost certainly leftover from a previous bug. Deleting
the entry will bring us back to the value in kdeglobals.
2022-07-01 13:24:44 +00:00
David Edmundson
ecdc73476f Fix apply button with animation slider speed
In updateUnmanagedItemStatus we compare the animation duration with
m_settings->animationDurationFactor
2022-07-01 13:24:44 +00:00
David Edmundson
0bb3eb2baf Write animation speed to kdeglobals
When the animation slider moved to look and feel a UI was kept within
the compositing KCM that was only visible for non Plasma users so they
still had a way to access this.

This non-plasma version still wrote to kwinrc. In theory this was fine
unless you used both. We also hit an issue where a stray
m_settings->save() call in `reenableGl` would sync the settings to the
wrong place.

This patch moves everything to write to kdeglobals and cleans up any old
entries here.

BUG: 431259
2022-07-01 13:24:44 +00:00
Aleix Pol Gonzalez
e04d9e1978 xdgactivation: Do not notify when applications try to activate themselves
There are some cases where this might happen, there's not much to
notify there anyway as it's more of an implementation detail.
2022-07-01 13:07:12 +00:00
Marco Martin
56d3b2ddc4 Set all timestamps for all touch events
in order for qml pointerhandlers to work correctly, they need
timestamps in all events (to decide for instance when to emit a
tapped or doubletapped)

BUG:456133
2022-07-01 12:13:18 +00:00
Vlad Zahorodnii
5975cd95e7 effects: Make setting WindowHeap layout mode nicer
Expose only the layout object and set its mode using "layout.mode:"
syntax rather than expose the layout object and its properties in the
WindowHeap.
2022-07-01 07:13:31 +00:00
l10n daemon script
6fa6c3f20b 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-01 01:52:46 +00:00
Alexander Lohnau
1ee1e011a3 Bump KWIn effects API version after changes to smart pointers in public API
BUG: 456155
2022-06-30 20:25:14 +00:00
Felipe Kinoshita
524e65813b effects/desktopgrid: Close windows on middle click
This makes it so that the windowview/overview/desktopgrid effects
all use the middle mouse button to close windows.

The previous behavior of pinning window is now assigned to the
right mouse button.

BUG: 456144
2022-06-30 20:23:17 +00:00
Xaver Hugl
0c453739b1 backends/drm: fix common mode generation
The unit for refresh rate was wrong, which caused insanely high as well
as negative refresh rates

BUG: 455477
2022-06-29 20:53:55 +02:00
Vlad Zahorodnii
a6d72d3f60 wayland: Introduce IdleDetector
The IdleDetector is an idle detection helper. Its purpose is to reduce
code duplication in our private KIdleTime plugin and the idle wayland
protocol, and make user activity simulation less error prone.
2022-06-29 20:27:50 +03:00
Xaver Hugl
da7dad1586 surfaceitem, surfacetexture: manage pixmaps and textures with std::unique_ptr 2022-06-29 13:18:51 +00:00
Xaver Hugl
1ff623e95e renderbackends: make SurfaceTexture creation methods use std::unique_ptr 2022-06-29 13:18:51 +00:00
Aleix Pol
696abac400 screencast: Do not send events when moving the cursor outside the viewport
e.g. when we have two outputs
2022-06-29 11:29:27 +00:00
Aleix Pol
a2913d1e2b screencasting: Have cursor move frames also send damage information
Otherwise we keep the last use of the buffer's which is clearly wrong.
2022-06-29 11:29:27 +00:00
Aleix Pol
7f73264f66 screencast: Also send the header when we just send the cursor update
When sending a frame that just updates the cursor, also increment the
sequential value of the frame
2022-06-29 11:29:27 +00:00
Xaver Hugl
84acb768ee effects: modernize some code
Mostly port away from manual memory management and clean up some headers
2022-06-29 10:34:50 +00:00
Vlad Zahorodnii
24dfdd70c0 effects: Drop WindowPaintData::modelViewMatrix()
It's unused and it conflicts in a way with PaintData::translation(),
PaintData::rotationAngle() and PaintData::scale().
2022-06-29 09:50:43 +00:00
Xaver Hugl
ef97158f96 backends/drm: suppress logging for direct scanout
BUG: 456089
2022-06-29 09:59:10 +02:00
Xaver Hugl
29625218d3 backends/drm: fix flicker with rotation on mobile
When we use a shadow buffer, we always render to the whole surface - setting
the damage region is incorrect and invokes undefined behavior. On the Lima
driver this caused flickering on screen rotation.
To fix this, don't set a damage region when we use a shadow buffer, which is
effectively setting the damage region to the full surface
2022-06-28 08:38:43 +00:00
Aleix Pol
3d3fcd7ab4 tablet: Leave the surface we were previously on, not the one we are going to
This sometimes results in a crash and it's logically wrong as it was.
2022-06-28 03:39:31 +02:00
Xaver Hugl
47c08d6f66 backends/drm: ensure modeset properties are reset properly
Without this, all atomic modeset commits fail on setups with a VR headset
2022-06-27 19:14:08 +00:00