There are cases where the minimum luminance can be lower than the transfer function's minimum; in those
cases, the transfer function's minimum would get mapped to a value greater than black in the target
transfer function. To avoid that, this just takes the max. of the metadata and transfer function minimum
BUG: 494854
(cherry picked from commit cef6656ff5)
When a mapped window doing reparent, xorg will generate a unmap and map
sequence.
In KWin, If a mapped Unmanaged is doing reparent, KWin will receive a
unmap and map sequence because KWin won't release the Unmanaged
immediately. When the MapNotify comes, its parent is not longer the root
window. However, KWin still create an Unmanaged to manage it. As a
result, a ghost Unmanaged remains in the list.
(cherry picked from commit 2f4005cd67)
Co-authored-by: zeming huang <huangzeming@uniontech.com>
Since we removed auto commit on input method forwarded key event, just
remove the test for it all together.
(cherry picked from commit 9e46767b64)
Co-authored-by: Weng Xuetian <wengxt@gmail.com>
A common usecase for this is when preedit is not empty, but key event is
bypassed is when modifier key is pressed. For example, user may want to
send Shift+A to input method, but input method will ignore the Shift key
press and forward shift to application. This allows certain usecase if
application reacts to modifier only key event.
While it "may" causes some issue when input method decide to send key
that produce text when preedit is not empty, this does not happen in
practice and should be considered a bug on input method engine side.
(cherry picked from commit aa8c55775d)
The added test ensures that setQuickTileMode doesn't misbehave when a window rule
forcing the window in question to be maximized is in place
(cherry picked from commit d351c4c554)
Co-authored-by: Xaver Hugl <xaver.hugl@gmail.com>
The issue was fixed upstream. Technically, it also introduces a new
behavior: super keys are interpreted as meta keys now by default. It
matches what qtwayland does and, in general, Qt controls handle super
keys very poorly. Wayland clients still receive native scan codes,
they are not affected by these changes.
(cherry picked from commit 805414c071)
Co-authored-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
Otherwise, unmaximizing the window will move it to a different screen than it's
currently on, which is confusing
BUG: 489488
(cherry picked from commit dadf3f3a97)
Co-authored-by: Xaver Hugl <xaver.hugl@gmail.com>
If a focussed window is to a new virtual desktop we need to update focus. It
does not make sense for focus to remain on a now-invisible window. This patch
re-uses the same path as when virtual desktop is changed.
BUG: 481574
(cherry picked from commit b96e6cf0b3)
Co-authored-by: David Edmundson <kde@davidedmundson.co.uk>
Using xyY values to specify the primaries for XYZ doesn't quite work out, so this
commit changes Colorimetry to use (normalized) XYZ values for the primaries and
adds a test that verifies XYZ->XYZ transformations to be identity
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>
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.
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
This is done by
- fixing isFuzzyScalingOnly to not check the [3, 3] component, which is always 1
- making the comparison between transfer functions fuzzy, so small floating point
errors don't prevent two practically identical functions to be optimized out
- switching manual optimizations to use addMatrix instead, which removes the
matrix or replaces it with a multiplier
and the autotest is expanded to test transformations between color descriptions with
transfer functions and reference luminances that are just scaled versions of each
other
...by removing the keyboard flag, moving keyboard shortcut handling into a separate
method and making the position to tile the window at explicit
This also means KWin doesn't do as many intermediary changes to window geometry on output
hotplugs, which may work around some clients not always reacting to no-op changes.
CCBUG: 479694
Right now it's just a helper to mark items as being affected by some effect,
to prevent direct scanout of the relevant item without needing to block direct
scanout for the whole screen
Rendering intents describe how to handle mapping between different colorspaces,
what to do with out of gamut values and what to do if the whitepoint doesn't match.
This way, clients can choose which behavior their content should get.
Using the custom values for min. and max. luminance in transfer functions, we can reduce the
ranges of values in the shadow buffer to be limited to [0, 1], and with that we can switch
from a floating point buffer back to a normalized format. As gamma 2.2 encoding is much more
efficient at storing color values, this also drops the buffer from 16bpc down to 10bpc.
Furthermore, this offloads the gamma 2.2 -> PQ conversion to KMS when possible, and then uses
the scanout buffer with gamma 2.2 encoding directly. This way the shadow buffer gets completely
skipped and performance and efficiency get improved a lot.
BUG: 491452
CCBUG: 477223
It just tests rec.709 <-> rec.2020 at 0%, 50% and 100% rec.709 luminance, to have
a very simple indicator for when something's gone really wrong while working on
color pipeline changes
This redefines the transfer functions to have a custom luminance at encoded
value zero, and a custom luminance at encoded value 1, neither of which are
tied to the reference luminance, even for relative transfer functions.
The goal of that is that we can use a gamma 2.2 transfer function for the shadow
buffer, with the reference luminance being much lower than the maximum luminance.
For example, on an HDR screen you might have the reference luminance of 600 nits,
while the maximum luminance is 1000 nits. By representing this in gamma 2.2, we
can use a much smaller amount of bits per color to store the values than if we
used a linear transfer function. An additional benefit is that this way the values
in the buffer can be scaled by arbitrary amounts, for example to limit the range of
values to [0, 1], which can be represented in a normalized buffer
Clients can have valid reasons to change the selection when the
same user action that also caused the selection request
to lose keyboard focus. This is notbaly the case for menus
created from a Plasma panel which itself will not take focus
but when clicking on action it only triggers after the menu
is closed.
This also matches what weston and sway do.
BUG:490803
We optionally send some keys to xwayland through the filter when no x11
client has focus. This allows shortcut handling in X11 apps to work.
When kwin is grabbing keys we don't necessarily want X11 to sniff these
keys as things can get out of sync. A key place is the tabbox. The X11
client sill has focus, but xwayland is not active. This means we pass
tab keys to X which then go to application incorrectly.
Part of this patch changes the tabbox filter to not intercept the alt
key release event. This ensures xwayland's concept of pressed modifiers
stays in sync.
BUG: 484992
In some IM backends pre-edit text should be submitted on user interaction, in some it should be discarded.
In TextInputV1 and V2 this was a flag sent to the client along with
the commit string ahead of time.
TextInputV3 does not have a flag for this, so we handle it compositor side.
We flush the text to be committed :
- when we change keyboard focus, before the current client gets wl_keyboard.leave
- when a mouse is pressed in the relevant surface
- when a key is pressed and the InputMethod doesn't have a grab
- when the InputMethod forwards a key to the client
(which includes the InputMethod passing on grabbed keys)
When the tabbox grabs input, the key events won't be sent to the client.
It's not good for a couple of reasons: first, it can fool the client into
repeating a previously pressed key; and the server side and the client
side can be out of sync after the task switcher is dismissed.
In order to handle that properly, this change makes the tabbox reset the
keyboard focus when it's shown or hidden. When the task switcher is
dismissed, an enter event will be sent with the current state of the pressed
keys.
Ideally, the same needs to be done with the pointer focus but it's
challenging to achieve with the current input pipeline design. An input
grab abstraction is needed to handle pointer focus when the task switcher
is active.
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
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