While in principle Mesa should already check if the buffer can be scanned
out, this may not always work. If we can't create a framebuffer object for
the buffer, fall back to compositing.
CCBUG: 448818
XCURSOR_SIZE * scale factor is not the way to compute the current cursor
size. For example, with breeze cursor theme at an output with a scale of
2 and cursor size 24, cursor images will have the effective size of (64, 64).
Also, the cursor can change when passing over user interface elements.
In order to accommodate for all of that, this change makes kwin reserve
enough of space for a cursor of size 256x256. "256" is a magical number
that comes from DRM. With many drivers, the maximum cursor size is 256.
BUG: 448840
If there's only one configure event that changes the position of the
window and it gets acknowledged but no buffer is attached yet, and a new
configure is sent, then the ConfigurePosition flag won't be inherited
by the new configure event and the window will be misplaced.
In order to fix that, this change makes XdgSurfaceClient pop the last
acknowledged configure event from the m_configureEvents list only when
it's about to be applied for sure.
BUG: 448856
Encoders are not really relevant for the test result, except that one of
the encoders for the connector must be compatible with the crtc.
The kernel usually exposes only a single encoder per connector for this
reason, but if a driver exposes multiple then that means KWin will do a
lot more tests than is necessary.
In order to prevent that from happening, do fewer syscalls and simplify
code, only check supported encoders once per connector.
When setting the default value for `ElectricCornerRatio` in the UI form
we also need to update the default indicator for this field.
*Default value for this setting is 25%*
| BEFORE | AFTER |
|---|---|
|![screenedges_25_before](/uploads/2e9f21627cc05cd12fd45ec1a019b89e/screenedges_25_before.png)|![screenedges_25_after](/uploads/7106341983e4cce0a4fb26000fb8583f/screenedges_25_after.png)|
BUG: 448886
FIXED-IN: 5.24
Historically, noBorder() was used for two things:
* as a substitute for AbstractClient::isDecorated()
* to determine whether the AbstractClient should have a decoration
With async decoration updates refactoring, a few things around
noBorder() have changed, which exposed an existing bug in the handling
of borderless maximized windows.
It's possible to have a case where an initially maximized window makes
an xdg_toplevel.set_maximized request before the initial commit, but
creates the decoration object after the initial commit.
Since XdgToplevelClient::userCanSetNoBorder() would return false when
maximize() is called in XdgToplevelClient::initialize(), m_userNoBorder
won't be updated and therefore the window can end up having a server
side decoration.
Previously, it wasn't the case because kwin would do nothing if the
decoration is installed and its preferred mode changes after the initial
commit but before the surface is mapped. With async decoration fixes,
kwin would react as expected, which unfortunately has exposed the bug.
The root cause of the problem is the fact that noBorder() is overloaded,
which makes it error-prone.
This patch changes how the noBorder property is treated. Now, it only
indicates whether the compositor wants the window to have no borders. If
noBorder() is true, it means that the compositor doesn't want the window
to have a server-side decoration; on the other hand, if noBorder() is
false, it doesn't imply that the window should have a decoration.
BUG: 448740
X11Client can grab pointer when starting interactive move or resize so
all pointer events go to it and kwin can update the move resize geometry
based on the current interactive move-resize mode.
However, on Wayland, X11Client::motionNotifyEvent() is disabled and
pointer events go through a code path that requires no X11 pointer grab.
This signal is sent back to the ksldapp after the greeter has registered
a window with the compositor. Only once ksldapp gets this signal does it
release the lock delaying suspend.
With xdgshell/layershell we have a roundtrip of configuring before the
window is even exposed, so we move to a different signal. This also
helps encapsulate lockscreen code.
Ideally we want to add code tracking frame rendering per screen tracked
too, but that would be based off this change.
CCBUG: 316734
On wayland cursors are managed by kwin. During a move resize operation
kwin updates its own cursors in pointer_input. There is no need to sync
any cursor changes back to the X server as we end up setting it twice.
19c471405e7eb4b6026db24d776d205125dbc013 introduced a regression if
there are two gbm backend and the backend fail to choose drm format.
This fix does two things:
1. Current buffer format should not be reset after create new buffer,
otherwise current.format may just be empty after resetOutput.
2. force xrgb 8888 need to be set on the primary backend.
BUG: 448790
If the user is currently typing, do not highlight windows based on the mouse position. If the user types a window title before the effect opening animation is finished, he ends up in a situation where only one window is on the screen but it is deselected (because the mouse is not on the window) or another window is selected because of the mouse. With this change, the mouse input does not overwrite the window highlighting based on the search entered **if the user is currently typing.**
As the placeholder output gets added or removed in response to other outputs
getting enabled or disabled, the output list may change while iterating over
them and applying changes.
BUG: 448454
BUG: 448474
CCBUG: 448697
FIXED-IN: 5.24
Currently, finishInteractiveMoveResize() relies on a hidden behavior
in the sendToOutput() function that makes it treat fullscreen windows
differently, which is confusing.
With this change, finishInteractiveMoveResize() will use the
checkWorkspacePosition() function to make sure that the geometry of the
fullscreen window is adjusted to the new monitor. It allows to make
sendToOutput() more straightforward.
It also fixes checkWorkspacePosition() using wrong geometry type in the
fullscreen window path.
A while ago, geometryRestore() had to have a sane value even if the
window is not maximized because checkWorkspacePosition() used it.
Since checkWorkspacePosition() doesn't use geometryRestore() anymore, we
can stop updating the geometry restore.
geometryRestore() is no longer updated after mapping the window, so
setQuickTileMode() has to update geometryRestore() explicitly to the
correct value.
With this change, geometryRestore() will be updated as follows:
* if the window is tiled, geometryRestore() is valid, nothing to do
* the window has been dragged to the top edge, set geometryRestore() to
the geometry that the window had when starting move
* otherwise, use the current move resize geometry
After calling setMaximize(), the window should cover the maximize area.
The commit message of 516ea86341 doesn't
explain why only the y coordinate is enforced or why the x coordinate is
not enforced.
In order to make some sense of the code, this change removes the semi-
random enforcement of the y coordinate.
If the window is inactive and it enters fullscreen mode for some reason,
it can create a situation where keyboard goes to a window occluded by
the fullscreen window.
This change makes XdgToplevelClient::setFullScreen() not raise the
window. It's the responsibility of whoever requested the fullscreen mode
change.
If the configure event is acknowledged, the window's stack layer will be
invalidated and recomputed. If the window is active, it will be promoted
to the ActiveLayer, otherwise its stack position won't change.
dontInteractiveMoveResize() was added to workaround kwin sending bad
configure events when double clicking mpv to make it fullscreen.
With async geometry updates fixed, dontInteractiveMoveResize() can be
finally removed.
Another reason to remove dontInteractiveMoveResize() is that it can make
kwin crash with a debug build. For example, if you enable resizing
maximized windows in breeze decoration settings and resize a maximized
window, kwin would eventually crash in
the AbstractClient::handleInteractiveMoveResize() function because neither
isInteractiveMove() nor isInteractiveResize() return true.
Based on the implementation of wl_display_connect, WAYLAND_SOCKET is
always preferred over WAYLAND_DISPLAY, which means it is OK to have both
of them set. This allows subprocess of input method to have the correct
WAYLAND_DISPLAY variable set.
As formats are per output and also checked on crtc changes, there
is no reason to restrict used formats to those that are supported
by all primary planes anymore.
When the crtcs get switched around between outputs, their primary
planes and thus the supported formats also get switched around. In
order to make sure that doesn't cause any problems, always check
whether or not the format+modifiers used are supported.
Otherwise animated cursors won't work. Hopefully, this will fix pointer
input test.
It would be great to refactor cursor handling so it's simpler, it can be
done later.
Userspace is expected to do a modeset and set link-status to good again,
if link-status gets bad. This is needed to prevent some black screen situations.
BUG: 448177
This was deprecated in during the 5.24 development period. All KDE
consumers are ported away from it. Third parties will get meaningful
runtime messages which instruct them to register the plugins without keywords.
The create overloads which take keywords were already deprecated in KPluginFactory.
Currently, the invert effect doesn't work because it can't load its
fragment shader because builtin effects are static libs. We need
Q_INIT_RESOURCE() before reading shader code.
This modularizes builtin effects more, which makes easier to add and
remove builtin effects, as well as allows to have per effect resources.
Technically, changing the inner workings of the ShaderManager is an
API incompatible change, but ShaderManager::generateShaderFromResources()
can be used only by builtin effects so it's okay.
ShaderManager::generateShaderFromResources() had to be changed because
two resource files can't share the same prefix. Appending "_core" was
inspired by QtQuick.
We need CMAKE_INSTALL_FULL_LIBEXECDIR, otherwise `lib/x86_64-linux-gnu/libexec/kwin-applywindowdecoration`
will be the resulting path, which does not contains the cmake install prefix.
Consequently KNS would fail to find it at runtime.
BUG: 447284
FIXED-IN: 5.24.0
After finishing interactive resize, the window needs to be gravitated.
However, it won't be gravitated because isInteractiveMoveResize() will
return false.
In order to fix that, every configure event needs to carry the gravity,
that way the window can be gravitated even after leaving interactive
resize.
The gravity concept is a generic way to describe how a window must be
positioned during interactive resize. It works both when resizing the
window using a pointer or touch.
X11Client implicitly relied on the finishInteractiveMoveResize() function
to call moveResize() to synchronize the move resize geometry with the
server geometry. However, after removing that moveResize(), X11Client
got slightly broken.
A resize sync request may arrive shortly after finishing resize. In
order to properly handle it, this change makes X11Client handle late
sync requests.
It also makes handling interactive resize on x11 similar to how it's
done on wayland.
The main problem with not letting X11Client finish interactive resize
is that the Toplevel::bufferGeometry() may end up with an outdated value
and SurfacePixmapX11 will fail to create due to a mismatch between
Toplevel::bufferGeometry() and the server side geometry of the frame
window.
KWin loads glGetGraphicsResetStatus() on its own to handle ARB and EXT
extensions. After moving graphics reset handling to the RenderBackend,
kwin doesn't use its own glGetGraphicsResetStatus() function, but instead
uses the one provided by libepoxy, which panics if
glGetGraphicsResetStatus() is not in core spec. This change makes the
OpenGLBackend use kwin's glGetGraphicsResetStatus() function instead of
the one provided by libepoxy to avoid a crash.
This adds support for reading values from a "Libinput/Defaults" group in
the input config file. This allows specifying global defaults for
devices, that are preferred over the libinput defaults. Because of the
cascading mechanisms of KConfig, this then allows distributions and
hardware vendors to supply system-wide defaults for devices.
Rather than an awkward combination of template functions, function
pointers and multiple calls to almost-the-same-but-not-entirely
functions, make ConfigData itself a template and use type erasure to
store them in the config map. This makes the data object aware of its
type and allows us to specialise the reading of config values through
template specialisation. It also removes the need for multiple
constructors and setters in the ConfigData object.
As of now, we update cursor metadata only when the screen content changes, but
this results into not having smooth cursor movement. We can update only mouse
cursor location when it changes and send an empty buffer with mouse cursor
metadata so clients can have update mouse location.
If the first condition would match (for instance after moving a window),
`windowMove` would be `nullptr`, triggering the crash later.
By the looks of it, it was maybe a typo.
BUG: 445335
FIXED-IN: 5.24
CC: @nicolasfella
This provides a better fix for the header positioning bug in
the properties list sheet, instead of the previous workaround
(which wasn't enough in some situations)
Upstream bugfix (in the Kirigami component) is not advisable as
it could cause unintended consequencies in other uses/apps
See also: https://bugs.kde.org/show_bug.cgi?id=422289
BUG: 421583
FIXED-IN: 5.24
Currently KWin always uses the Options configured in kxkbrc because
QByteArray::constData() is never nullptr. This means that the system
default is ignored completely. Read ResetOldOptions to distinguish
between explicitly setting no options and using the system default.
After recent refactor changes to improve resizing of xdg-toplevel
surfaces with an aspect ratio, the resize effect got really broken. The
resize effect has always been a problem child on wayland.
Unlike X11, geometry updates are performed asynchronously on Wayland.
It's not possible to have a smooth transition after finishing
interactive resize from the resized state to the normal state, geometry
will jump from last moveResizeGeometry() to the current frameGeometry()
and when the client repaints the window, the window size will jump back
to the move resize geometry size. There are no ways to fix that without
contradicting to how the effect is advertised to work, e.g. sending
configure events behind the back. Keeping the frame geometry out of sync
with the xdg_surface window geometry size is also not the option,
geometry updates are already too complex (due to being async).
Another wayland related issue with the resize effect is that the
compositor doesn't know about aspect ratio or any other size
constraints, except min and max size. The client can provide a smaller
buffer to account for various geometry constraints. It will be confusing
to have a mismatch between resize outline and the final real geometry.
Aspect ratio or other geometry constraints won't be exposed to the
compositor, it's a common decision of many wayland devs (including KDE).
To some extent, the wayland issues can be addressed by performing content
updates, with active feedback, the mismatch between outline and the
final geometry would become less severe, but it won't be any different
than resizing without the effect.
Given the wayland issues and in part maintenance costs, this change
drops the resize effect. Note that it can be still reimplemented without
kwin core changes, but it would still suffer from the aforementioned
issues.
BUG: 443434
Currently the plugin needs to set a property in oder to be considered configurable.
In kpackage we have the concept of optional and required files, based on the existence of those
optional files we can define different behavior. For example in Plasma the applets can optionally have a config ui.
Because here we don not use The KPackage:Package class, it is simpler to check the existence of the files on disk.
In KWin we are allowed to break compat and here all first party consumers
have already been ported for quite a while.
Also the querying is very inefficient, because for every plugin where the
X-KDE-ConfigModule property is not defined all available KCMs have to be opened and
their metadata parsed.
This way we also get rid of the deprecation warning for KPluginMetaData::readStringList.
Doe to 1a0031c08a3b41458eb5bf2097b4cd6452ba3d09 we no longer require json metadata to be embedded.
Also we did not use the metadata anywhere, except for finding the correct plugin.
This way we do not need to embed json metadata in the plugins
and can consequently drop the metadata files entirely.
The resulting metadata object might still be invalid, however KCoreAddons
can handle such cases. See https://phabricator.kde.org/T15094 regarding
create better KCoreAddons API for such cases.
Not sure if this was left out on purpose as a kind of deprecation.
It would be necessary to allow port the tabbox switchers to the newer 3.0 API and use their components (such as `Workspace`)
Probably for `Plasma/5.25` now.
It's consistent with m_nextDecoration and m_requestedStates contains
both requested and "not requested" states (i.e. the ones set by kwin
without waiting for acknowledged from the client, e.g. activated).
Running a Plasma Wayland session as root is not insecure, it is in fact the
opposite. There is no way for other users to somehow influence this session
due to the user separation and the user is more likely to only use this for
administrative actions. This is in contrast to regular user sessions, which
most likely start a mix of unprivileged programs next to privileged windows
like some with authorized kauth helpers or even just sudo in a konsole tab.
This change replaces abort() with Q_ASSERT and Q_UNREACHABLE() macros to
make kwin code base consistent. Besides that, Q_UNREACHABLE may
potentially provide the compiler more info that can be used to generate
more efficient machine code.
When moving or resizing a window on X11, the window based screen edges
won't receive pointer input, so handleInteractiveMoveResize() explicitly
pokes the ScreenEdges to check if there's any approached screen edge.
On Wayland, it's not an issue. This change moves X11-specific code to
X11Client to avoid checking screen edges twice.
When finishing interactive resize operation, the move resize geometry is
already good and the client should have sent the corresponding configure
event. So, this moveResize() call is redundant.
This change moves code that is responsible for quitting maximized
horizontally or vertically mode to the start of the interactive resize
operation. It makes handling of MaximizeFull mode consistent, and it
kills one moveResize() call at the end of the interactive resize
operation, which is good because it makes simpler handling of resizing
aspect ratio aware windows on wayland.
However, in order to make resizing of aspect ratio aware windows good
for real, we will need to augment configure events with gravity info.
On Wayland, the move resize geometry and the frame geometry are
completely out of sync.
This change synchronizes emitting of the clientStepUserMovedResized
signal to the move resize geometry changes.
It simplifies code of InternalClient and XdgSurfaceClient, and makes
adding support for other shell surface protocols easier as there's less
boilerplate stuff that you would need to take care of.
With internal clients and xdg-shell clients, geometry updates occur in
asynchronous fashion when interactively resizing the window.
As is, performInteractiveMoveResize() will call resize() if the move
resize geometry is different from the current frame geometry. This can
result in kwin sending excessive configure events.
With this change, kwin will send less configure events during
interactive resize.
It's not practical, regular users don't care about window geometry. One
could argue that it can be useful for creating window rules, but window
rules kcm pulls relevant properties from kwin.
If needed, one can reimplement this feature as a QtQuick script that creates
an overlay window positioned above the window that is being interactively
moved or resized.
Instead of only allowing the current format, send the default tranches modified
to only contain formats and modifiers suitable for scanout.
In order to not fail when we can't do direct scanout with a given format
(because that may require a modeset, which we don't allow), keep a blacklist
of attempted formats and modifiers for the current client.
The fixed size of 1080p makes windows change their size and place. To
prevent that from happening, make the placeholder screen the same size
as the last disconnected screen.
This is not a bullet proof solution, only a fast one. Ideally KWin
should remember the window layout on a given monitor setup and restore
it when reconnected.
BUG: 447419
FIXED-IN: 5.24
This makes the Scene less overloaded and it's needed for things such as
render layers.
In hindsight, it would be great to merge checkGraphicsReset() and
beginFrame(), e.g. make beginFrame() return the status like in QRhi or
VkSwapchain. If it's OUT_OF_DATE or something, reinitialize the
compositor.
Same as real hardware wl_keyboard, key should be sent before modifier
change. For example, Left Ctrl press and release should produce
key events in the order of Control_L and Control+Control_L.
When creating the texture containing the window decorations, the drawing
code now directly handles the rotation for the left and right
decoration, instead of rotating the image after it has been drawn.
The padding, to prevent texture bleeding, is now a fixed value instead
of being scaled. With this change, there are no longer visual artifacts
for window decorations with rounded corners, when the scaling value is
fractional.
On X11, if buffer age is unsupported, kwin can do some quirks like
copying parts of the front buffer to back buffer to avoid repainting the
whole screen.
Currently, the copying is performed in the opengl scene, which is not
perfect because it makes the scene responsible not only for painting the
scene but also some low level platform specific shenanigans.
This change moves the copying step to the glx and egl backends. It
simplifies the opengl scene, makes it less overloaded and more open to
changes, but it also duplicates code, which is not ideal. However, given
the de-facto deprecated state of the X11 platform, it's sort of acceptable
as the main focus is now on wayland session and the things that are
needed to make it fly as expected.
It can help clients predict how KWin will react. Sometimes, the noise of
seeing a virtual keyboard pop up is reason enough not to focus an input
field.
Observed in kdevelop, that isEnabled() could be false when switching
between different tabs with Ctrl+Tab. But Qt may still call show()
if you click on the texteditor widget. This leads to isEnabled == false but
setActive(true) is called. This causes kdevelop in a usable state because
keyboard grab will be created and no key event will reach application
because isEnabled == false. Under normal circumstances, key will reach
widget first and triggers another text_input_v2 enable to make input
method work properly.
text-input-v3 does not have preedit styling, instead, it can only
specify the range of cursor. Try to keep track of any
highlight/selection style range and combine them together. If it matches
the cursor position, use it as the cursor range.
Ctrl+Meta+D is already taken by the Minimize All script. "W" in Meta+W
stands for "window". Meta+O wasn't chosen because it's one of a
finger-stretcher.
BUG: 445800
This commit makes 10 bits per color channel the default color depth, which
should reduce banding on outputs that support color formats with more than
8 bits per color channel. In order to support this the commit also removes
the dependency of the EglGbmBackend on a specific format and EglConfig and
instead makes those per-Output properties.
Qt usually request InputMethod::hide() upon unfocus, but
InputMethod::show() is actually never called if focus transfer is done
by keyboard, which leads to a permanent disabled input method state.
It can be easily reproduced with a window with two text field, e.g.
QFileDialog, by pressing tab to switch the focused widget.
The semantics of hide/show should not deactivate the input method.
Instead, it should simply hide/show the input panel. Also it should not
be a hard request for input method to permanently hide the window. When
input method asked to show it again, the input panel window should be
shown.
zwp_input_method_v1 has some different semantics comparing to
text-input-v3. There is no way to indicate that "clear preedit" with
zwp_input_method_v1. In some client (Namely, Gtk), receiving an empty
preedit string will also trigger replace selection action. For example,
focus into address bar in firefox will automatically select the URL in
the address bar, and a following empty preedit string will clear the
selection which is not desirable.
To avoid such behavior, simply send an empty "done()" to clear text
input v3 preedit if preedit is empty.
This allows us to decouple effects more and reduce the number of random
odd build failures on freebsd. Besides that, it provides more fine
grained control over logging, for example, one could select log output
from some concrete effect, etc.
This may be problematic for certain client, e.g. firefox, and cause
input always reset after any key press. Also, sending reset on an
activate also does not match the text input v3 semantics.
zwp_input_method_v1 does not support generic double buffered event.
deleteSurroundingText need to be followed with done().
zwp_input_method_v1 preedit event order is preeditCursor,
preeditStyling, preeditString. To align it with text-input-v3 semantices,
send done() after receiving preedit_string() from input method.
Currently, it's possible to have the case where the pointer input device
handler or the touch input device handler thinks that there's a focused
window, but the corresponding focused surface in wayland seat is unset,
because the pointer hovers the server side decoration.
If the server side decoration is destroyed, the input device handler will
fail to update wayland seat's focused surface.
In order to make pointer input device handler and touch input device
handler code more intuitive, this change makes focusUpdate() functions
ignore the decoration.
BUG: 411884
BUG: 440380
While finding this to be benficial when working on the activity
switcher I think it makes sense in general to keep focus on the
current client instead of potentially switching away.
KWin does not update activity status when setting `_KDE_NET_WM_ACTIVITIES`
to nullUuid outside of KWin, which causes "All Activities" not working
as expected for KWindowSystem.
`X11Client::activityList` is not kept in sync with
`AbstractClient::m_activityList`. Move `m_activityList` from private to
protected, and use it in `X11Client::readActivities`
BUG: 440496
They are used only by InternalClient. AbstractClient doesn't need to
handle the destruction of DecorationBridge because its lifetime matches
kwin's lifetime.
Currently, if a window switches between SSD and CSD, it is possible to
encounter a "corrupted" state where the server-side decoration is wrapped
around the window while it still has the client-side decoration.
The xdg-decoration protocol fixes this problem by saying that decoration
updates are bound to xdg_surface configure events.
At the moment, kwin sort of applies decoration updates immediately. With
this change, decoration updates will be done according to the spec.
If the compositor wants to create a decoration, it will send a configure
event and apply the decoration when the configure event is acked by the
client. In order to send the configure event with a good window geometry
size, kwin will create the decoration to query the border size but not
assign it to the client yet. As is, KDecoration api doesn't make
querying the border size ahead of time easy. The decoration plugin can
assign arbitrary border sizes to windows as it pleases it. We could change
that, but it effectively means starting KDecoration3 and setting existing
window deco ecosystem around kwin on fire the second time, that's off the
table.
If the compositor wants to remove the decoration, it will send a
configure event. When the configure event is acked and the surface is
committed, the window decoration will be destroyed.
Sync'ing decoration updates to configure events ensures that we cannot
end up with having both client-side and server-side decoration. It also
helps us to fix a bunch of geometry related issues caused by creating
and destroying the decoration without any surface buffer attached yet.
BUG: 445259
Many effects use the stacking order property of the effects handler in
their constructors. This means that windows should have compositing
setup by the time effects are loaded.
After changing how binary effect plugins are loaded, i.e. not queueing
loading effects, but loading them immediately, some effects broke
because the effects handler is created before windows setup compositing.
This change attempts to fix those effects by rearranging compositor
startup code so windows setup compositing first, then create the effects
pointer.
move() and resize() functions are not convenience helpers around the
moveResize() function. They communicate what kwin wants to see after the
corresponding change is applied. It's needed to make asynchronous
geometry updates work.
This change replaces a moveResize() during XdgToplevelClient
initialization with explicit move() and resize() function calls instead,
so it's more clear what the expected end result is.
A few plasma components cache QSGTexture. Those components rely on
texture references going away with QSGNode users. However, with the
current tear down logic, OffscreenQuickView won't destroy any paint
nodes.
Destroy QQuickRenderControl before QQuickWindow to ensure that are no
paint nodes left alive after OffscreenQuickView.
BUG: 444429
BUG: 444381
BUG: 444077
BUG: 444306
For all the task switchers on my system there is no KCM installed:
```bash
rg 'X-KDE-ParentComponents=(PlasmaXLight|org.kde.breeze.desktop|org.kde.breezedark.desktop|org.kde.breezetwilight.desktop|org.kde.breeze.desktop|org.kde.breezedark.desktop|org.kde.breezetwilight.desktop|org.kde.plasma.mycroft.bigscreen|small_icons|big_icons|compact|text|present_windows|thumbnail_grid|thumbnails|informative)'
```
As the docs state, this is only for buildin effects. Which means it is internal API.
Also I consider the choice of displaying a KCM *or* the preview odd, IMHO the preview
is the most important part.
I stumbled upon this when reviewing the metadata files as part of the preparation
for https://phabricator.kde.org/T14564.
Also this way of plugin loading is discouraged for performance reasons, because all the
plugins from the namespace have to be reopened to get their metadata.
Use standard easing curves in animations. OutCubic for the intro
animation and the InCubic for the outro animation.
Hidden opacity options were removed because I don't think they are
needed anymore. I made the starting opacity 0.4 to make the animation
look closer to what it would have been with an ease-out curve without
realizing it.
The output management test checks the implementation of output
management capabilities in the virtual backend, which is not helpful.
This change replaces it with a more useful test that verifies how
windows are placed after an output change.
Currently, if you move the cursor really fast between two outputs, there
may be stuck cursor on the previous output.
We need to query the old cursor visibility status before updating the
cursor position, otherwise the drm backend may not schedule an update to
move the cursor offscreen.
It's fine to have the animation duration hardcoded to 250ms. The main
issue with reading kscreen effect's config is that it adds inter-effect
dependencies, which is simply not worth the trouble.
The intro and the outro animations are very short and they usually
affect all windows on the screen. Windows have to travel a lot and in
very short time, this doesn't look.
Similar to other windows, this change makes the overview effect use the
out cubic curve for window movements (even though the HIG suggests us
using the InOutCubic easing curve). That way, user will look at
flatter parts of the easing curve more, i.e. the windows would move less
chaotically and simply jump to their target position.
Similar to the WindowHeap, this change makes the overview effect use the
out cubic everywhere else so the intro and the outro animations look
coherent.
Another advantage of the OutCubic easing curve is that it makes the
overview effect look more responsive and subtle.
Currently, the wayland server updates the server side decoration mode,
which is counter-intuitive, because it doesn't cache the last preferred mode.
With ServerSideDecorationInterface::preferredMode(), it can be simpler.
This commit does away with the special handling of the legacy cursor and
makes it be applied directly in DrmPipeline, using the same state as the
atomic cursor and without dirty flags.
Effect loading is already tested using integration tests, for example
the maximize test verifies that the maximize effect is loaded _and_ it
actually does something useful when a window is maximized or restored,
testScriptedEffectLoader only verifies that the effect is loaded, which
is less helpful than what integration tests provide us.
But perhaps the main problem with these tests is that they require us
building a mockverse around them. This litters code with ifdef
preprocessor directives and makes changing such code a living nightmare.
Another problem with these two tests is that they cannot use OpenGL
because it means mocking OpenGL, which we obviously not going to do.
With integration tests, it's not a problem.
The bottom line is that unit tests can be useful but they make life
notoriously difficult when it comes to testing components that depend on
other components.
The cursor being set out-of-band with atomic commits creates problems
because it can create false positive for atomic tests, if the cursor
state gets changed in between an atomic test and its matching commit.
This commit also ports the cursor to a swapchain instead of only one
image. This is not strictly required but may prevent artifacts and
will be needed for future optimisations.
Context properties don't work with QML effects. At the moment, no effect
needs to access the options object, but it makes the QML API consistent.
The workspace is already a singleton type.
The natural geometry can live in a different coordinate space than the
target area. Remove the premature optimization so the cell is properly
placed if the two are in different coordinate spaces.
Currently, the ExpoLayout wants the natural geometry to be in the local
coordinate space because of the default layout mode.
With the natural layout, the ExpoLayout will run a simple loop that
repels overlapping cells.
Once no two items overlap, the items will be scaled down based on their
bounding rectangle and the target area.
The problem is that the ExpoLayout includes the area where items will be
eventually placed when computing the bounding rectangle, which can
result in a sort of a bug where almost all windows are shifted to one
side of the screen, which is not at 0,0.
This change removes the target area from the bounding rect math so the
coordinate space where natural geometry is specified is irrelevant.
It fixes the issue where windows can be shifted to one side of the
screen after adding or removing a window. It also makes the ExpoLayout
API more simpler on the QML side and ensures that no relayouting will be
performed if only the position of the WindowHeap changes.
If the decoration is destroyed before the window is mapped, kwin can
respond with a configure event that has 0x0 size. New tests check that
problematic case.
BUG: 444962
Kwin announces a format with alpha when Dma-Bufs are available, even
when the texture doesn't contain any. This results in clients segfault
when trying to access the buffer assuming a maxsize wrt. the announced
format by ways of dimensions and bpp.
This patch moves the format masking to affect the Dma-Buf transport
only.
If eglSwapBuffers() fails, there won't be a buffer and so we need to
mark the frame as failed. Otherwise, the screen can be frozen.
eglSwapBuffers() can fail if some effect calls makeOpenGLContext()
between RenderBackend::beginFrame() and RenderBackend::endFrame(), which
is the case with the zoom effect. It can set wrong draw surface in
ZoomEffect::recreateTexture()
BUG: 445412
This simplifies focus related logic a bit. Instead of differentiating
between wayland and internal window focus, simply maintain window focus
that works both with regular wayland windows as well as the ones created
by kwin.
The thumbnail that represents the "desktop" in the switcher preview
is taken from the default wallpaper, and it will update automatically
as it changes in future versions of Plasma.
The current one is also added along the other thumbnails as a fallback.
BUG: 309401
FIXED-IN: 5.24
Currently, the test doesn't pass due to Xwayland encountering a protocol
error.
That protocol error occurs because the xdg-output is destroyed before
the wl_output.
This change moves the ownership of the xdg-output to wl-output so they
are destroyed together.
dmabuf-feedback allows the compositor to give the clients better feedback on what
formats and modifiers they should use, and for which device they should allocate.
This way they can reallocate for scanout whenever the compositor tells them to,
which makes direct scanout work for a lot more devices and applications.
KWin handles several types of pointing input devices, e.g. mice,
tablets, etc.
As is, enterEvent and leaveEvent are very ambiguous. This change
prepends "pointer" to those methods to make it explicit that they handle
pointer enter/leave events.
While it could be useful with tiled displays, the isFormatSupported and
supportedModifier functions can be called before prepareModeset, so where
m_formats is still empty. Additionally they're neither in a hot path nor
performance critical.
Whether or not we want to use explicit modifiers for our surfaces doesn't
matter for what format+modifiers drm planes support. This way direct scanout
works by default, without having to explicitly enable modifiers
While a stylus is in proximity we want to show its cursor. In this commit
it only gets shown on move because for a still unknown reason the position
is out of date before the first move event.
BUG: 443921
Ever since the effects were changed to static, each test of the
integration tests includes all the effects. The result of this is that
when doing a debug build each test is now 60MiB or more. With the amount
of tests, this results in ~8 GiB of diskspace used just for KWin's
binary output directory, which is rather excessive.
Since the tests all share a common framework library, we can change that
library to a shared library and that way avoid linking all the effects
into each test.
Most of this is shuffling around some link libraries in the integration
test CMakeLists, however, I needed to export the Xwayland class as it is
used by one of the tests but wasn't exported.
Tracking AbstractOutput properties in Toplevel is not extensible. Since
DecorationItem is the only one who needs Toplevel::screenScale(), make
it track the output device pixel ratio.
systemd takes care of setting and dropping master permissions when
sending PauseDevice and ResumeDevice signals.
When the ResumeDevice signal is received, the relevant drm device should
already have master permissions set up.
On the other hand, when the active property changes, there's still a
chance that systemd haven't granted drm master permissions to us.
For some reason, while touch doesn't have a middle button, the
taphandler for middle click close still triggered on tap. So make it
explicitly only support mouse/pen so we exclude touch events.
BUG: 445755
In case a modeset needs to be performed, the drm backend will test all
pipelines to ensure that new mode won't cause any bandwidth issues on
other outputs, etc.
To do that, it may delay presenting frames. If the new configuration
doesn't work, it needs to notify about failed frames.
However, the relevant code that notifies the RenderLoop about failed
atomic commits doesn't check if there's actually a pending modeset
present.
When switching between VTs, systemd can revoke master permissions from
kwin. To make things even more trickier, kwin can try to present a frame
in that short time span.