The switch case statement allows the compiler to optimize code. More
specifically, if the values are densely packed, then the compiler may
generate a jump table. The switch statement also looks cleaner.
As for the if statements in adjustWorkArea(), they were overlooked by
me after LayerSurfaceV1Interface::exclusiveEdge() had been introduced.
QPointer is a really useful way to store a pointer over time.
It doesn't make have any value as a return value used by a short-lived
method.
There isn't a good copy constructor, it's effectively the same as
creating a new QWeakPointer reference that has to be cleaned up.
Testing if something is null is still the same. A new QPointer can be
made by the caller if it actually is needed.
Input handling is a very hot path called many times a frame, so it's
important to keep this light. focus() and at() are called a lot which
added up to slightly over 1% of CPU time when moving the mouse about.
This change introduces a shell integration class for input panel
surfaces. This effectively breaks the direct dependency between our
virtual keyboard component in kwin and the input_panel protocol,
which means that an input method server could use the layer-shell
protocol instead of the input_panel protocol.
We assume that the input method server has at most one surface at a time,
which corresponds to the virtual keyboard. But it's not guaranteed to be
always true.
For example, an xdg_toplevel surface can be created for a configuration
dialog, in which case isInputMethod() should not return true.
The layer-shell protocol allows wayland clients to create surfaces that
can be used for building desktop environment components such as panels,
notifications, etc.
The support for the plasma-shell protocol will be dropped once plasma in
all its entirety is ported to the layer-shell protocol.
Previously qtvirtualkeyboard was integrated weirdly so that it was
acting as the focus object and proxy for input methods, however now that
we support proper input methods, this code is totally unused in the QPA
and actually prevents the QT_IM_MODULE from working now that
qtvirtualkeyboard is dropped.
See: f26f2fe181 for the reference of the
code deleted.
Previously qtvirtualkeyboard was integrated weirdly so that it was
acting as the focus object and proxy for input methods, however now that
we support proper input methods, this code is totally unused and it is
confusing to have it here, so just drop it
See: f26f2fe181 for the reference of the
code deleted.
Previously we were either sending out this information to InputMethod of
the QApp (i.e kwin itself) which is no longer case since we switched to
using the proper wayland protocol instead of the qtvirtualkeyboard
inside the kwin.
This fixes the issue with the weston-keyboard at least that in field
which accepts digits it shows the keyboard with digit layout. I still
have some issues with maliit-keyboard but that might be bug on the
maliit-keyboard side.
xcb_connect_to_fd() will never return a NULL pointer, even if an error
has occurred.
Right after creating an xcb connection, xcb_connection_has_error() needs
to be called in order to determine if the connection has an error.
When two outputs are positioned on top of each other in a way that one covers
most of the height or width of the onter one with exception of a small gap this
gap might be too small to later on substract the orner offset and stay
positive. In this case do not create the edge at all.
The screen edges test passes again.
A timer could have fired at any time. We process mulitple QtQuickViews
on timers which change the GL context.
Deleting a kwin GLTexture calls glDeleteTextures/glDeleteFramebuffers.
Surprisingly I haven't seen a crash report from this, but it doesn't
look right.