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 problematic as it means anything requiring a fixed position
in the chain cannot be added or removed at runtime. This is bad for both
performance and code cleanliness as all code ends up input.cpp rather than
where it semantically belongs.
Remaining users that prepend event filters have the problem of the order
being effectively undefined.
This patch adds a weight attribute to the filter allowing filters to be
installed and removed at runtime whilst maintaining a specific deterministic
order.
Currently the order is defined by an enum based on the filter names.
This gives an easy to read explicit order for anyone reading kwin code, but
it is left cast to an int so we have future flexibility.
This fixes not sending frame callbacks for tablet cursors. And in general
this simplifies the code by removing a level of indirection responsible for
communicating the frame timestamps, the Compositor can tell the CursorSource
the frame time directly.
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.
This is to not destroy the tablet state for the next test (which is
added in the next commit.) We could also explicitly do a tablet tool
up/down dance here, but all we need is the tablet tool to be in
proximity for the tablet button event to fire.