Some clients (for example Chromium and LibreOffice) display a certain
behavior in that they will set the clipboard twice in short succession
deleting the data source in between and using the same serial twice.
This allows setting the clipboard with the same serial as
the current clipboard which only the current owner (or previous
owner when the source was deleted) should know.
The current implementation for DMA-Buf sharing on kwin is slightly broken.
When a client connects to the kwin screencast's stream, it supplies a `SPA_PARAM_EnumFormat` list, containing entries for every supported format, and the drm modifier list for that format (for dmabuf sharing).
Usually, the `SPA_FORMAT_VIDEO_modifier` property from the consumer has the `SPA_POD_PROP_FLAG_DONT_FIXATE` flag set. Kwin then receives the full choice list, and gets to pick a relevant modifier.
In situations where the DONT_FIXATE flag is missing, pipewire chooses an arbitrary match between the consumer and kwin. In that case, kwin currently assumes DRM_FORMAT_MOD_INVALID is to be used no matter what, which goes against the comment right above it within the screencaststream.cpp file. Even worse, if DRM_FORMAT_MOD_INVALID is not supported by the consumer, this also causes the param_changed callback to freak out, as one of the conditions to update the stream params is `!receivedModifiers.contains(m_dmabufParams->modifier`. Since m_dmabufParams->modifier contains DRM_FORMAT_MOD_INVALID, which is not among the modifiers kwin receives, the params are changed continuously and no buffer sharing can happen.
--
I'd be happy to supply code to reproduce what I attempted to describe above if needed. I'm not aware of any program currently affected, but I found this out when messing around myself.
Relevant docs are here :
<https://docs.pipewire.org/page_dma_buf.html>
> If the SPA_PARAM_Format contains a modifier key, without the flag SPA_POD_PROP_FLAG_DONT_FIXATE, it should only contain one value in the SPA_CHOICE_Enum. In this case announce the SPA_PARAM_Buffers accordingly to the selected format and modifier.
The combobox for window type matching in the rules kcm currently uses
list-remove (represented by a minus sign) as its icon; while
semantically ill-fitting, it was visually a good match and breeze-icon-
theme does not have a dedicated panel icon. Recently however, the icon
was changed and now depicts a red X. This makes it a bad fit all-around
for its use in this kcm.
This change replaces it with another visually good fit that doesn't
match semantically, namely spinbox-decrease (also a minus sign), as a
temporary measure until a proper panel icon is ready (tracked in BUG
492341).
The HIG recommend sentence case for combobox entries. The comboboxes in
the rules kcm currently mostly use title case for their entries. The
property names mostly use sentence case, although there are few
exceptions using title case. The HIG are not explicit here (although
sentence case seems to be in the spirit of the guidance); in any case it
should be consistent.
This change converts the labels and property names to sentence case. It
also includes some minor phrasing touch-ups, in particular regarding on-
screen displays which are now spelled correctly and consistently.
The HIG recommend sentence case for combobox entries. The window border
combobox in the decoration kcm currently uses title case, except for the
option following the theme default, which uses mixed title and sentence
case.
This change converts the labels to sentence case. The "Theme's default"
option is also renamed to "Theme default", as this is a shorter and more
common construction in UI strings.
We write window code with an assumption that the compositor will do the
right thing when a window is shown or hidden or activated, so our qpa can
leave stub implementations for raise() and lower() to suppress the
warnings produced by the stack manipulation functions in Qt.
While on pointers and keyboards the focus patterns follows rather
naturally, on touch screens it doesn't so much.
This change adapts our touch infrastructure to allow for multiple
surfaces to be issued touch events without forcing all interactions into
the same one.
Signed-off-by: Victoria Fischer <victoria.fischer@mercedes-benz.com>
The HIG recommend that comboboxes use sentence case. The Screen Edges
kcm has a combobox that allows users to configure when to switch
desktops by moving to the edge, which uses title case for its entries.
This change makes this combobox use sentence case for its labels.
As far as I know, the reason that the CursorTheme provides a QPoint
hotspot is mostly due to the historical reasons. At the time, all
hotspot math had relied upon integer hotspots. After
4cd25cf571 it is no longer the case.
Amends 7ab825cba1.
This shadow "directScanout" variable breaks
if (!directScanout) {
if (!m_backend->present(output, frame)) {
m_backend->repairPresentation(output);
}
}
which can result in present() function getting called twice with the
same `OutputFrame` object: first, at line 359, and the second time at
line 386. That, in its turn, would queue two drm commit objects with
the same OutputFrame and then the behavior is undefined.
Otherwise the last call uses the default, which overrides the previous
calls.
Test plan:
- Go to system settings - shortcuts
- Verify the category for layout switching is now correctly called
"Keyboard Layout Switcher"
CCBUG: 492019
xyz -> xy and xy -> xyz conversions have divisions in them, so we need to
handle the edge cases of the divisor being zero. This can happen if an ICC
profile is invalid, or if the XYZ color space is used.
Avoid using Window::frameGeometry() because its position is invalid.
In the future, the XdgToplevelWindow would need to run the placement
code before updating the Window::frameGeometry(). In order to prepare
for that, this change also makes placeSmart() pull the window size from
a cached QSizeF() object.
Avoid using Window::frameGeometry() because its position is invalid.
In the future, the XdgToplevelWindow would need to run the placement
code before updating the Window::frameGeometry(). In order to prepare
for that, this change also makes placeCascaded() pull the window size
from a cached QSizeF() object.
The main motivation behind this change is to ensure that every placeXyz()
function issues only one move() or moveResize() function so the placement
code is more refactorable, and in general, it's a good idea to avoid
changing the geometry until the final geometry is finally known.
Note that it changes the behavior of placeOnMainWindow() and
placeUnderMouse(). Those methods will not anymore potentially resize
the window. It was done to avoid a flicker glitch on Wayland. This is
the responsibility of the caller (X11Window) to further inspect whether
the window needs to be resized. However, for now, let's keep things
simple and revisit this if somebody actually complains about it.
Workspace::cascadeOffset() can be called by placement code before the
frame geometry has a valid position. That is wrong. In order to avoid
that, use the placement area that we are given.
When the user closes the active window, with separate screen focus disabled, a
window on the other screen might get activated, which also switches the active
screen to the other one. As this is quite unintuitive, and in my testing having
separate screen focus enabled didn't have any other unintuitive side effects,
this commit enables separate screen focus by default
Instead of just clipping when HDR content is brighter than the maximum luminance the
screen can show, when HDR metadata indicates this could happen, KWin now
- converts the rgb colors to ICtCp, to split luminance and color
- applies a tone mapping curve that maps the intensity component from
- [0, reference] to [0, newReference] linearly
- [reference, max content luminance] to [newReference, max display luminance] nonlinearly
- converts the resulting ICtCp color back to rgb
The result is that HDR content looks much, much better on SDR displays, at least when decent
HDR metadata is provided.
As wrong metadata could cause this tone mapping to wrongly kick in in games for example, the
environment variable KWIN_DISABLE_TONEMAPPING is provided to disable tone mapping and fall back
to clipping again instead.
If effects->grabKeyboard() fails and effects->ungrabKeyboard() is called
later, kwin will crash due to an assert in the ungrabKeyboard() function.
This matters only on X11.
It's more readable and it also makes code more refactorable. For example,
if somebody makes Workspace::stackingOrder() return a normal QList, KWin
won't crash at this code.
The synthetic ConfigureNotify event is not sent when the stack mode is
TopIf and BottomIf, i.e. the way the restackWindow() function handles
the "send_event" argument is inconsistent.
And the window manager doesn't have to send a synthetic configure event
when processing a _NET_RESTACK_WINDOW client message. It must do it only
after handling a ConfigureRequest request, which
the X11Window::configureRequestEvent() function already does.
So rather than fixing the handling of the "send_event" argument, this
change removes that boolean trap instead.