On X11 we get focus in and out events for normal input and when grabs
change. Kwin's concept of the active window should only follow the
normal focus changing.
Testing done:
Run Xfreerdp and move the pointer outside the window, the cursor
decoration should not change. It should still be the active window.
If the graphics buffer view is null, GraphicsBufferView::image() will
point to a valid memory location but the QImage at that address is going
to be null.
This effect is used to implement the visual bell accessibility feature.
It allows to implement it on Wayland and significantly improve it on X11,
where it's currently rather broken.
It offers two modes:
- Inverting the colors (code is based off the invert effect)
- Flashing a solid color
Make the window caption without suffix available in
the scripting API by adding a `captionNormal` property.
Update the doc for the `caption` property to mention that
`captionNormal` can be used to get the caption without
added suffix, instead of suggesting to call a getter with
a bool param that was dropped in
commit f0652970f4
Date: Sun Aug 20 09:35:15 2017 +0200
Drop boolean parameter from AbstractClient::caption
We return early for screens with physical height reported as ≤ 0mm.
However some extremely dumb screens report a value for their height
greater than zero but absurdly small, causing the scale calculator to
go ballistic. Theoretically this could happen for widths, too.
Let's loosen the detection to flag a physical screen size as invalid if
either its width or height is less than 3mm. There is no screen that
can possibly make sense to exist at this physical size given the angular
resolution of the human eyeball. And if for some reason it does, 100%
scale is fine for it.
BUG: 490777
FIXED-IN: 6.2.0
This is needed to better support emitting mouse button events when
pressing tablet buttons. It's common in many art programs that an action
is tied to a mouse button + a modifier, such as panning the canvas. So
being able to send keyboard modifiers in tandem with mouse buttons is
very useful when rebinding.
Tests are added for this new feature.
CCBUG: 469232
The matching X11 focusIn event will never arrive, and so the window is stuck
in the list and messes with activation until it's no longer the active window
and then active later again
BUG: 484155
Re-doing the frame scheduling for an already scheduled composite cycle was meant to
adjust to small timing changes in the presentation timestamp, but if the expected
compositing time was close to vblank, it could happen that this would instead move
the target presentation timestamp and effectively drop a frame.
To fix that, this commit makes the presentation timestamp be adjusted only to be more
accurate, but still target the same vblank interval.
BUG: 488843
The way it was implemented it only changed the target pageflip, but not the time at which
KWin would start compositing, which could make it skip scheduling a frame for each second
vblank and drop the refresh rate to half of what it should be that way
CCBUG: 488843
KeyboardInterface is a multiplexer, it has a global state to kwin
that forwards events the single focussed window.
XWayland also forwards events to clients, but uses the keyboard interface.
It has some overloads that take a specific client, this was used for key events
but not modifiers.
The end result was not only that XWayland could miss a modifier update, but
also that wayland clients would get modifier updates out of order.
Key events must come first.
BUG: 490270
This is problematic as then we do not catch changes to animation speed
settings, it also doesn't make the code more readable when it's
only used in one place.
BUG: 490703
Window::maximize() maximizes the window regardless of size constraints.
If the window can't be maximized, just fallback to the default (centered)
placement policy.
As it used the frame geometry, the check for covering windows was sometimes wrong,
and additionally overwrite changes to the window position Placement had made before,
which could end up with the window origin wrongly not being put inside of the screen
in some cases.
CCBUG: 489500
If an output is deleted, the Workspace::desktopResized() is going to
re-assign windows to the new outputs. It is done so so the workspace
re-arrangement procedure is deterministic and has concrete order.
However, with the current Window lifecycle management, it's possible
to encounter the follwing case:
- xdg_toplevel gets created on output A
- xdg_toplevel initial state is committed
- output A is removed
- a wl_buffer is attached to the xdg_toplevel, which results in a
geometry change and an output change
- Window::setMoveResizeOutput() is called, but the previous output
is a dangling pointer
CCBUG: 489632
We are currently using the touch border to activate the task switcher, but it's almost impossible to activate on a phone screen. We used to use 8px (invisible panel) when the task switcher was implemented in plasmashell, I think that can work here.
In default settings if the clipboard or selection is empty klipper will try to
replace it with cached data.
To avoid an occurring race condition if a client deletes and then recreates a
selection kwin will deny klipper if another mimedata is present at the time
it tried to replace an empty clipboard.
Klipper also considers the presence of a valid mime data without any offers
to be an empty clipboard, whereas kwin did not.
If a super weird client set the clipboard to a valid entry with no offers,
klipper would get into an infinite loop of trying to set it's own selection
for it to be continually denied with no other valid offer from klipper's perspective
ever received.
BUG: 469644
Currently, the code assumes that the primary and the cursor layers are
always present. However, it's not guaranteed if the render backend cannot
be recreated. Specifically:
- the Compositor destroys the EglGbmBackend. The egl gbm backend, in its
turn, resets the primary and the cursor layers to null
- the Compositor tries to create the EglGbmBackend but that fails so it
is destroyed. EglGbmBackend::~EglGbmBackend() calls DrmGpu::releaseBuffers(),
but it hits an unexpected null primary layer.
Normally, the primary and the cursor layers would be created when the
Compositor successfully creates the WorkspaceScene. Since the RenderBackend
fails to initialize, the WorkspaceScene is not created and the DrmGpu
doesn't recreate the layers.
Since the tablet cursor and the mouse cursor is tracked separately,
rebinding a tablet button to a mouse click is sort of wonky. For
example, if you assign it to Right Click and attempt to open a context
menu it will appear to open in the wrong place.
So before we send the mouse button event, set the mouse position to
the tablet cursor position. A test is added to ensure this functionality
works as intended and doesn't regress.
- Remove unnecessary bindings to enabled: Properties that are not
enabled are not shown in the list anyway, and it fixes QML warnings:
RuleItemDelegate.qml:16:5: Unable to assign [undefined] to bool
RuleItemDelegate.qml:93:17: Unable to assign [undefined] to bool
- Remove unnecessary colorSet
- Port away from javascript `var`
- Remove outdated comment
The list to add properties can be empty because no entry matches
the filter text or if all the properties have been already added.
Show a placeholder instead of leaving the view just empty
Changing the text and meaning of the button unexpectedly for a
regular operation is not consistent with any other place, and
disregarded by the HIG.
The sheet can be closed by tapping outside of it, or throught
the close button in its titlebar, as usual elsewhere.
This KCM is usually called via the application menu, which uses
kcmshell, so it doesn't benefit from the SystemSettings minimum size.
Slightly increse its height, so there is more space for properties
in the list views, either to configure them or to add them, so it
feels less cramped.
On a lot of hardware, using bigger plane sizes than necessary means wasting power.
This is specifically problematic with the cursor plane, where we so far only had a
single fixed size hint through drm caps, even though the hardware often could use
a smaller cursor size.
This adds support for the per-plane SIZE_HINTS property, which allows us to pick a
smaller cursor size when the cursor image fits into it, and should save some power
that way.
Usually, only a small subset of cursors would be used, for example the
default shape, the pointer shape, the text shape, etc.
Another reason why this change makes the KXcursorTheme load cursors on
demand is to prepare the cursor loading machinery to SVG cursors.
Both kwin and plasma have different placement strategies during interactive
move resize. That can result in the window flipping between two positions.
In order to prevent that, this change makes kwin placement take precedence
over the window position specified using the plasmashell protocol. This can
be considered as a workaround.
BUG: 481829
There's generally a lot of problems with higher than 8bpc in docking stations,
especially when multiple monitors are involved. Until these problems are hopefully
eventually fixed on the driver side, limit the bpc to 8 with docks by default
Otherwise, prePaintPass, postPaintPass and possible future overhead like overlay
plane matching aren't accounted for, which can cause frames to be dropped.
CCBUG: 488782
While they are harmless, they can result in the client repainting more
than needed and resulting in the opposite edge "bouncing" when resizing
the window.
Initialize X11Window::m_client geometry with a proper value so, later, the
X11Window::configure() function can properly determine whether the client
window is resized.
Some clients (like xdotool) can send multiple events for the same
key. In some instances the number of presses and releases can even
be mismatched leading to stuck keys. While we clean up pressed keys
when the client vanishes, this doesnt help when it doesnt immediately
disconnect (for example Xwayland keeps client connections live
longer than the actual x client to reuse them).
Also fixes a copy paste mistake where key presses where also written
to buttons.
This avoids regressing compared to PowerDevil in 6.1 which also
protected against setting internal display brightness to 0.
CCBUG: 430439
CCBUG: 483490
It's completely unused. If brightness modification is desired for night light
for example, it should be tied in with the actual brightness controls for outputs
instead
With programmable LUTs, consecutive transfer functions, inverse transfer functions and
multipliers can all be combined into one LUT. This allows offloading operations in more
situations and makes the operations more efficient too, as potentially fewer LUTs have
to be programmed
This is useful for autotests and some other special cases where we need to calculate
the result of a color pipeline on the CPU. Long term, this should replace
ColorDescription::mapTo
When the GLX or the EGL backend is destroyed, it is going to reset the
RenderLoop state, including the number of frames in flight. It does so
because of the historical reasons. At the time, there was no output frame
object to track the lifecycle of a frame.
After introducing the OutputFrame and hooking it into the RenderLoop,
the pending frame count will be reset automatically in RenderLoop when
the GLX or the EGL backend is destroyed. But we forgot to remove
the invalidate() function calls. So, when the GLX backend goes down, it
resets the pending frame count to zero and then it destroys the pending
OutputFrame object, which would result in decreasing the pending frame
count by 1 and triggering an assert in the RenderLoopPrivate::notifyFrameDropped()
function.
Since there is the OutputFrame helper now, the invalidate() function
can be dropped. Technically, the invalidate function did more than just
reset pendingFrameCount to 0, for example also stop the compositeTime.
But that should be fairly harmless new behavior.
Switching to triple buffering requires dropping a frame, so if we constantly
switch back and forth between double and triple buffering, that can cause
very visible performance issues
CCBUG: 488843
sched_setscheduler() is implemented as a stub in musl that does
nothing because Linux provides no way to set scheduling parameters
per process.
Use pthread_setschedparam() to change the scheduling parameters of
the threads instead.
BUG: 487996
Wayland specification is that the compositor chooses the actions based
on keyboard modifiers rather than the application initiating the drag
being told the modifiers.
Some distributions do not wish to build the KWin X11 backend as
they do not use it, even though they wish to maintain X11 support
for Xwayland when using KWin as a Wayland compositor.
Allow this choice by splitting the build flag and setting it up to
forcibly disable building the backend when building X11 code is
switched off.
These were off by one because the surface tab was removed.
Insetad of numbers look up the indices of the widgets so its
less prone to break in the future.
Apparently the night light kcm allows to set the custom times so the
evening is earlier than the morning to handle extreme cases close to
the North and the South pole.
NightLightManager::updateTransitionTimings() should require no changes.
BUG: 489366
With recent change of using show desktop with plasma's edit mode,
wayland input method becomes unusable when trying to type in the search
box of widget explorer. This is because the input method window will
currently break showing desktop under wayland.
Under X11, an input method window is traditionally implemented as an
override redirect window. Under Wayland, the window should be treated
similarily, but now we have a special type for input method window.
BUG: 489057
FIXED-IN: 6.1
This allows the user to change the brightness level of content even if there's no
actual underlying "backlight" device. This is the case with many internal OLED
screens for example.
BUG: 413451
This way, KWin can set the brightness on internal panels or external monitors with
DDC/CI support, without being exposed to the mess that is actually directly setting
the brightness.
This also adds a capability flag for brightness control to the output management
protocol. Powerdevil will expose a brightness slider for each output and change the
brightness setting of the output accordingly. KWin in turn changes the brightness
levels of the actual brightness device, or of a multiplier in compositing accordingly.
It's sometimes wanted that you disable certain buttons on the device,
such as an annoyingly place side button on a drawing tablet. This now
makes it possible to do so by putting "Disabled" in the config. The
rebind filter will then ensure the events are stopped and none are
emitted.
The effect only modifies the opacity of individual windows that
WorkspaceScene::scanoutCandidate will reject anyways, so there's no reason
for it to block direct scanout.
Once a more proper solution for blocking direct scanout on individual items
is in place, this can be removed again
BUG: 487780
textureSize() can temporarily mismatch the target buffer size. It can be
a problem if glGetTexImage() gets called. glGetTexImage() assumes that
the provided buffer is as big as the texture. If it's not, it will write
data outside the bounds of the buffer.
BUG: 489764
When disabling sticky keys while a key is latched or locked we unlatch the key, but don't tell the client until the next key event
Call forwardModifiers to tell the client immediately
We map AltGr to Qt::GroupSwitchModifier, but then ignore it
Instead map it to Mod5, which for some reason xkbcommon doesn't expose a define for
Also, since the Qt modifiers enum doesn't map nicely to XKB modifiers introduce our own enum to avoid confusion
CCBUG: 444335
It can happen that when the xwayland scale factor changes, the logical geometry
will remain the same, but the x windows still need to reconfigured to update the
native geometry.
In order to address that, this change makes X11Window track the buffer scale
so if the logical geometry is the same, the x windows will be still reconfigured
with the new xwayland scale.
X11Window::doInteractiveResizeSync() configures the x windows but it only
does a half of the things that should be done. The rest of it is assumed
to be performed by X11Window::updateServerGeometry() when XSync request is
acked later. The current state is not ideal and error prone.
This change makes X11Window::moveResizeInternal() and X11Window::doInteractiveResizeSync()
share the same code to configure the x windows to simplify the code.
It also drops X11Window::m_last{Frame,Client,Buffer}Geometry to further
simplify the code and make X window geometry tracking even more robust.
If identity transformations aren't properly optimized out, we can have additional
rounding errors and reduced performance. This test ensures that doesn't happen
After !5532 existing behavior in public scripting API was changed for maximized Windows.
Maximized Windows didn't have a tile on purpose.
This behaviour was changed, as after refactoring separate members for storing QuickTileMode in Window and tile itself were unified
Previously QuickTileMode::Maximize was only set in the Window itself in m_quickTileMode, while tile itself was removed (by setTile(nullptr)).
Current QuickTileMod for current Window isn't part of public scripting API, so it's okay to break it.
This restores compatability with scripts created for KWin 6.0.5 and earlier
BUG: 489463
Signed-off-by: Alik Aslanyan <inline0@pm.me>
This matches what we do without color management, and is more what users and app
developers expect. Going with linear blending before was mostly from it being more
"correct" / how physical blending of light works, but that doesn't really matter
when existing software expects it to behave differently.
BUG: 476868
CCBUG: 479755
Poll the screen cast scale from the source rather have code on top of
ScreenCastStream and ScreenCastSource that figures out by itself how the
cursor should be scaled. It ensures that the cursor size will be
consistent and it makes the ScreenCastStream initialization code simpler.
when creating a QDataStream object, if the file has not been successfully opened
before (file.open() fails), the created QDataStream object 'ds' may not function
properly. If you continue to perform the operation 'ds << icon;' in this case,
it may cause kwin to crash. Therefore, it is essential to ensure that the file
has been successfully opened before creating the QDataStream object.
Signed-off-by: likai <likai@kylinos.cn>
This makes direct scanout of SDR content on an HDR screen and vice versa possible,
as well as direct scanout while night color is active or the brightness isn't 100%.
This exposes the degamma->ctm->gamma pipeline as a drm color op, which can
be set to a generic color pipeline. The same code can later be adapted to
program the upcoming per-plane color pipeline properties.
This allows encapsulating color operations in a generic way, which can then be used in KMS or shaders.
The class automatically optimizes out unnecessary color operations like identity matrices, and
combines consecutive operations like
- matrix + matrix
- multiplier + multiplier
- matrix + multiplier
- EOTF + inverse EOTF
- relative EOTF + multiplier
to improve efficiency and make KMS offloading easier
There are two shapes that the WM needs to be concerned about: the input
shape and normal shape.
If the client window has custom input shape, the window manager should
synchronize it with all parent windows or ensure that its frame window
has an input shape as big as the client's input shape. The input shape
needs to be updated either when the client changes it or when the
X11Window is resized or its borders have changed. updateInputShape()
accomplishes that.
The normal shape is slightly different. If the window is decorated, the
window manager could ignore the shape set by the client. If the window
is not decorated, it's a good idea for the WM to synchronize client's
shape with the frame window's shape (if there's any). The frame window
shape doesn't need to be updated when it's resized, but if the client
window moves inside the frame window, it needs to be updated.
This change removes too generic updateShape() in the
X11Window::moveResize() code path and replaces it with a more targeted
code to update the shape, so updateServerGeometry() does not emit the
shapeChanged signal and it can be reused in the doInteractiveResizeSync()
function. Note that on wayland, it's unnecessary to synchronize the
shapes because the client window never moves in the frame window but it
is done anyway to minimize the differences between X and Wayland sessions
for easier maintenance.
Otherwise the window might still be referenced from the opening animation, which
can lead to the effect wrongly keeping a reference to the window and staying active.
CCBUG: 485425
This avoids doing multiple atomic tests with outdated state for when multiple
outputs change simultaneously, and avoids crashing because outputs get used
before they're fully constructed
(https://crash-reports.kde.org/organizations/kde/issues/40960)
Qt applications use Static window gravity by default. This means that if
a window decoration is created, the client window should remain at the same
position in the global coordinate space. To do that, X11Window needs to
move the frame geometry by (-borderLeft(), -borderTop()).
On the other hand, after making X11Window::framePosToClientPos() round
the window borders, the client window can end up being moved more than
expected when applying the gravity adjustment.
This change makes X11Window also round the gravity adjustment so the math
is consistent there and in the framePosToClientPos() function.
BUG: 489016
don't blindly access m_tileManagers as it can assert
with out of bounds when output is not valid. This can happen
from scripting side as this function is wrapped in the javascript api.
Adds whitespace between documented members of the header file.
Currently the members are all bunched together, making it difficult to
read as one flows directly into the next. This change adds a newline
between each member, making it easier to read.
The internal effects implement some of the core plasma functionality, for
example screenshots, but being an effect is rather an implementation detail.
Also we have pivoted towards unloading the desktop effects kcm and moving
effect configuration in more appropriate places.
BUG: 488988
This ensures that different content on the screen matches with the user configured
reference / SDR luminance, and both simplifies SDR<->HDR mapping by removing the need
for special casing that situation and significantly improves the mapping in some cases.
As we don't get any reference luminance values for HDR content (yet), this commit
assumes that HDR content is prepared for the reference luminance of the preferred
color description.
Brightness is a loose word for how bright we perceive things to be, but the
values we're using are about objective measurements, about luminance instead.
If a context is forward compatible, that means the deprecated functions are not
available, and if the QSurfaceFormat::DeprecatedFunctions option is set, that means
they are available.
Wrongly setting QSurfaceFormat::DeprecatedFunctions thus causes Qt to use OpenGL in
a way the context doesn't actually support.
CCBUG: 486460
If two mouse areas are stacked on top of each other and a button press
event is sent so one of them accepts it, QMouseEvent::isAccepted() will
still return false. It's a QtQuick bug, see the associated upstream bug
report https://bugreports.qt.io/browse/QTBUG-126733.
On the other hand, given that the MenuButton implements its own input
handling, we can port it away from DecorationButton to mitigate the issue.
BUG: 488993
The preedit struct holds values that need to be effectively double
buffered till the preedit string is set. There is no need to store the
text in this struct as it is reset at the end of setPreeditString
It's usefulness is doubtful, the current visuals poorly map to the
wayland abstractions, and it's partially incomplete because surface
previews are only shown for surfaces that have wl_shm buffers attached.
Tree hierarchy changes are also handled very poorly.
There are a couple of reasons why it's worthwhile doing:
The first is that it makes the logic in the updateServerGeometry()
function reusable for the interactive code path. As of now, when the
window is being interactively resized, doInteractiveResizeSync() will
issue some xcb_configure_window() calls but then it also implicitly
assumes that updateServerGeometry() will call updateShape() and
updateInputWindow() but skip m_frame.setGeometry() later. That is
confusing, and error prone. For example, if somebody drops
m_lastFrameGeometry in favor of m_frame.geometry() (which is an
absolutely reasonable thing to do btw!!), a regression will be
introduced: things would appear to work at first, but then eventually
bug reports about input working weirdly would start piling up.
The second is hidpi scaling of wayland clients. toXNative(a + b + c)
is not the same as toXNative(a) + toXNative(b) + toXNative(c). By
switching to the device geometry, we leave less space for making an
error.
The third is that lets us clean up some geometry manipulation code.
When dealing with window hierarchies, it's more convenient to have
m_window.position() rather than a dedicated property in the X11Window
class such as wrapperPos().
If the logical geometry changes, the X11Window still needs to verify
whether the currently applied native geometry differs from it. In order
to do that, the X11Window needs to map the logical geometry to the device
pixels. Given that X11Window already maps the logical pixels to the
device pixels, the Xcb::Window doesn't need to map the geometry again.
Also, the way different coordinate spaces are handled now is inconsistent.
Some things (Xcb::Window) work only with the logical pixels, while other
(e.g. client messages) require the user manually mapping the geometry
between the different coordinate spaces. With this change, it would be
more consistent.
Regarding the porting process, it was performed in a single step because
all the code that changes or reads Xcb::Window geometry is neatly
encapsulated in the X11Window class in a couple of functions.
The mastering display colorimetry describes what part of the colorspace
is actually used, which is important when we're sending desired metadata
about a screen using the rec.2020 container colorspace, or when the client
uses an "infinite" / extended colorspace like scRGB
This is to prevent disconnecting clients that sometimes struggle with
keeping up with the events that the compositor sends. 1 MiB was eyeballed.
Wayland's wire protocol consists of a stream of messages. Every message
consists of a header (2 words: 1 word for object id, the other word
specifies the message size + event/request opcode) and the arguments.
Considering the compositor sending motion events generated by a mouse
with 1000Hz polling rate, we have
- wl_pointer.motion event size: (4 bytes for serial + 4 bytes for x +
4 bytes for y + 8 bytes for header) = 20 bytes
- wl_pointer.frame event size: 8 bytes for header
So in total, if the client freezes for a second, the client buffer size
should be at least (20 + 8) * 1000 / 1024 = 27 KiB. 1 MiB corresponds to
the client not processing the motion events for approximately 30 seconds.
Some old hardware is very limited in the amount of instructions it can support.
In order to not have KWin fail to composite, reject using hardware acceleration
in this case and fall back to llvmpipe or QPainter
BUG: 482868
This helps avoid some frame drops after the GPU may have went into a lower power
state. While this isn't generally noticeable, avoiding this makes noticing and
debugging actually relevant frame drops easier
CCBUG: 488843
Makes it so the GlobalShortucts object gets built and its KGlobalAccelD
parts get disabled.
Addresses the TODO in GestureHandler.
Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
If a SwipeGesture or a PinchGesture is cancelled, the associated QAction
is going to be triggered. It is against the expectations of the gesture
handlers.
In order to address that, this ports the gesture handlers to the native
gesture apis, which expose whether the gesture has been started or cancelled
better.
After !5532 a new code path was triggered during Workspace::rearrange call.
When first Polonium window opens on any screen, there is no active tile yet.
This forces geometry calculation in Window::checkWorkspacePosition -> Window::ensureSpecialStateGeometry
To return empty QRect, which depending on the screen arrangement will move window to the other screen.
This confuses Polonium plugin, as it receives wrong outputChanged signal in scripting API.
BUG: 488898
Signed-off-by: Alik Aslanyan <inline0@pm.me>
The currently used cursor theme can be different from the configured one.
For example, if the configured theme cannot be used.
In order to ensure that that case is handled well, this change makes the
shake cursor plugin uses the same cursor theme as PointerInputRedirection.
At the moment, the shake cursor respects the current cursor shape. But
there are couple of drawbacks behind doing it: the first is that it's
very likely that the cursor pixmap has low resolution, the second is
the cursor can be hidden client-side.
This change makes the shake cursor plugin load the Xcursor theme with
a high enough size and display the default cursor shape regardless of
what the client has set in order to address the two aforementioned issues.
At the moment, the FocusChain has Q_ASSERT()s to prevent inserting closed
windows back into the focus chain. It makes sense on paper. But, there
are code paths that could still hypothetically call FocusChain::update(),
they are harmless except the logic in the FocusChain.
So instead this change makes the FocusChain ignore closed windows, i.e.
take a more defensive approach. There are a few reasons why it's
worthwhile doing: the first is that it would prevent inserting closed
windows back into the focus chain in release builds and potentially even
back into the stack, debugging such crashes is absolutely no fun; the
second is that it would be preferred to avoid sprinkling random
isDeleted() checks in the Window code here and there and thus making
the code harder to follow.
Otherwise we might miss some changes that come without a hotplug event,
like adaptive sync becoming available after the output has been initialized
BUG: 486149
It's printed whenever any opengl context is created, which can flood the
logs. On the other hand, this information is also included in the support
information, which we often ask in the bug reports.
BUG: 489000
Data like target vs. actual pageflip time, and render times is often needed for
debugging or optimizing render time predictions, so this commit makes KWin print
that information to a file in the home directory whenever KWIN_LOG_PERFORMANCE_DATA
is set.
CCBUG: 488843
Now that they will be shown and hidden in the proper state, we can set
up the input panel slide as the window gets added and ignore the
geometry changes that it will have in its lifetime.
Do not markAsMapped an unpositioned panel, it would confuse the sliding
popups effect and force it to figure out its state in creative ways.
Mark the panel window as hidden as it gets destroyed.
These flags affect kwin in general so WaylandServer is not the best place
for them to live in. For such things, we typically add properties in the
Application object, which is what this change does.
The way the glide effect works is that it takes 2D geometry and applies
the perspective projection to it on the CPU side. The reason we do it is
that the scene is 2D.
However, this leaves us with the well known problem where a texture
that's mapped to a trapezoid won't be correctly interpolated along the
diagonal.
It can addressed by performing a perspective division in the fragment
shader, but given the way the effect is structured, it's off the table. So
instead subdivide the window grid.
BUG: 488840
We are doing half a job of resetting spa_meta_cursor, the actual cursor
content is still left as is. On the other hand, it should plenty enough
to simply reset the cursor id. The clients are expected to call
spa_meta_cursor_is_valid().
currentTemperature, targetTemperature, and mode properties have "u" type.
But there is a mismatch between the property types declared in the
Q_PROPERTY macro and the org.freedesktop.DBus.Properties.PropertiesChanged
signal.
This change makes the property types consistent and match the types
declared in the xml file.
Amends a136a159f9 which changed the value in the kcfg file that the kcm reads, KWin uses options.kcfg
4f322e24d3 changed the in code default but this will be later overriden when loading the options.
Adds support for BGR888 and RGB888.
Some clients use it and we just fail to render them, making devs
thinking that kwin is broken.
Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
KWin already supports following org.freedesktop.locale1 for the
keyboard keymap, but only by passing a command-line option. This is
typically used in SDDM when running the greeter in kwin_wayland.
We want to use locale1 mode in livesys environments too, so that
environment-agnostic installers can configure the keyboard and also
immediatly apply the same configuration to the running desktop.
When KWin is started through `startplasma` we cannot easily supply
an extra command-line option, so we need to make this configurable
from the external environment, in the form of a KConfig.
The command-line option will keep precedence over the KConfig.
In case the current state and the pending state have the same buffer for
a particular side or a corner, that buffer can be prematurely released
because the buffer in the current state is unreferenced first.
The ref/unref order should be vice versa to ensure that the GraphicsBuffer
is not released prematurely.
This effects is off by default, which means to instruct someone how to
use it for debugging purposes, you need to both tell them to enable it,
and then also teach them how to assign a shortcut for it.
Since it's off by default, there's no harm in setting a shortcut, which
simplifies the enablement instructions. I've chosen Meta+Ctrl+Alt+P,
which uses so many modifiers that it won't conflict with anything.
This allows us to make the code that computes transition timings more
cleaner, and other time constants are in milliseconds, so it makes sense
to make m_transitionDuration store milliseconds too.
The current code is unreadable:
- it creates a lambda that captures two local variables for latitude and longitude
- then it copies values from the config to those local variables
- calls the lambda
- and finally copies the data from the local variables to the NightLightManager fields
That code can be simplified by simply calling checkLocation() directly
and using an if statement.
Morning and evening timings should be ordered correctly. When computing
the daylight duration, that ternary operator should not be needed and it
hides other bugs.
There are a couple of reasons why it's worth removing it:
- it's error prone. If one forgets to pass correct "force" flag, night
light will break
- it contributes some complexity
- updateTransitionTimings() is not called in any hot path and the code
that calculates the position of the Sun is not resource intensive
Currently, resetSlowUpdateTimers() will start a timer that will pass
m_next.first as the current time to resetSlowUpdateTimers(). This kind
of works, but there are more code paths where updateTransitionTimings()
can be called.
This change hardens updateTransitionTimings() against the current time
being very close to the start of the next transition by introducing a
time fudge factor.
If we are currently 1 second away from the start of the next transition,
then it is assumed that that transition has been reached, and we need
to calculate the timings of a transition after that.
This change simplifies the color temperature interpolation code by doing
the following:
- compute a progress value so 0 corresponds to target1, i.e. the beginning
of the transition, and 1 corresponds to target2, the end of the
transition, instead of vice versa
- and use std::lerp() function
Rounding to a multiple of ten is not needed, it is for nicer digits in
the applet, but if the applet really cares about it, it could perform
such rounding on its own. In the night light manager, it's better to avoid
rounding the interpolated values because that can result in the final
temperature getting outside of the [target1, target2] interval.
The interpolated temperature can get out of the bounds of [target1, target2]
if the current time is slightly earlier than m_prev.first, which can be
unexpected. This change addresses that by adding a relevant guard.
There are two mechanisms to throttle ConfigureNotify events during
interactive resize:
- either using XSync
- or by a dummy QTimer
The QTimer approach is pretty straightforward: the wm configures the
window, blocks the interactive resize operation and arms a timer to
unblock it some time later in the future.
With the xsync approach, the wm sends an xsync request, makes a
call to XConfigureWindow(), and blocks interactive resize until
the xsync request is acked by the client. When the client sees the
ConfigureNotify event, it is going to repaint and ack the xsync request.
When the xsync request is acked, the wm will apply new geometry and
unblock interactive resize.
After the scaling changes, the logical geometry can have some fractional
part, which gets rounded when configuring the X windows. Due to that,
it's possible to encounter the case where the logical geometry changes,
but the native/device geometry does not due to std::round(). In that
case, the wm should not send an xsync request because the client won't
ack it because the device geometry has not changed.
BUG: 488223
In order to match dnd actions, we need both a data source and a data
offer. If the preferred actions of either change, then a new dnd
must be chosen.
The code that sets up the monitoring of the preferred actions of the
data offer sets the correct receiver context object (data source).
But the code that sets up the monitoring of the preferred actions of
the data source uses the data source as the receiver context object,
however we would like to break the matchOffers connection when either
the data source or the data offer is destroyed.
After the screen edge is reserved, the touch screen gestures will be
registered or unregistered when the Edge::activatesForTouchGesture()
signal is emitted.
On the other hand, Edge::reserveTouch() lacks code to emit that signal,
which results in touch screen gesture not working if the same screen
edge is reserved both for pointer and touch input.
BUG: 451349
While the scaling mode has caused some issues with external displays, we've had several
reports that using "unify outputs" has caused the internal display to no longer show
anything, as it changes to an unsupported mode. This sets the scaling mode so that the
driver handles the scaling internally, instead of leaving it up to the panel, and it only
does so on internal displays with generated modes, to minimize the risk of further breakage.
BUG: 488111
The effect does not work very well for two main reasons:
Some clients will make a new popup rather than move an existing one, so
whether it does anything is highly unpredictable as a user.
Popups can be of massively different sizes with different amounts of
text. This means the text in the smaller popup gets resized which
doesn't look like a natural in-between state of the two popups. This
defeats the objective of looking smoother.
On top of that, it's rather glitchy.
This effect was purely visual, no functionality changes.
BUG: 473411
BUG: 466638
BUG: 416048
BUG: 461501
BUG: 466637
The SPA_FORMAT_VIDEO_modifier property has the following format:
preferred_value,alternative1,alternative2,...
The preferred value is usually the same as the first alternative value.
It can also happen that the modifier list the compositor has supplied is
not good either and it contains duplicate entries, specifically
`DRM_FORMAT_MOD_INVALID` to indicate that modifier-less buffers are
supported.
In order to deal with that, the screencast plugin removes the
duplicates by sorting the modifier list and then using std::unique().
That is not good, there is no written rule that the order of the
modifiers passed to the graphics buffer allocator matters but it
typically does, some drivers in mesa assume that the modifiers are
sorted in the preference order. The graphics buffer allocator might be
also very lazy and just look at the first supplied modifier instead of
wisely choosing the best modifier.
This change makes the ScreenCastStream remove the duplicate modifiers
in a more conservative fashion preserving the relative order of the
modifiers. It also removes an extra `{DRM_FORMAT_MOD_INVALID}` because
this kind of thing should be dictated by the render backend.
showfps is a handy plugin when deploying to a new platform because it
will render something that says "I am here".
Since both kirigami and quickcharts are quite high level, we add a
variant that just depends on QtQuick and shows the fps which is what we
promise anyway.
Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>