So far updating the cursor image was not really defined. It was possible
to use the cursor image from the wayland seat or have a custom set cursor
image. But there are no rules in place to decide which one to use when.
With this change a dedicated CursorImage class is introduced which tracks
the cursor image changes on the seat, on the decoration, in the effects
and so on. In addition it tracks which is the current source for the
image, that is whether e.g. the cursor from the seat or from effects
override should be used. Whenever the cursor image changes a signal is
emitted, which is connected to the signal in AbstractBackend.
Based on that the backends can directly show the image. The existing
code in the backends to install a cursor shape or to install the cursor
from the server is completely dropped. For the backend it's irrelevant
from where the image comes from.
A new feature added is that the cursor image is marked as rendered. This
is then passed on to the frame rendered in the Surface and thus animated
cursors are finally working. Unfortunately animated cursors are broken in
Qt (see https://bugreports.qt.io/browse/QTBUG-48181 ).
Like in the drm backend we use an InputEventFilter to turn the backlight
on and off. In this case the filter needs to be always installed as key
event should also turn the screen off. We cannot use a global shortcut
as it would not trigger while the screen is locked.
Unlike the filter in DRM backend only the power key can toggle the
backlight, other key events are ignored. For pointer we are optimistic
and already support enabling the backlight. Double tap to wake is also
implemented, but at least on reference hardware (Nexus 5) doesn't work
as disabling the backlight also disables touch input.
Reviewed-By: Bhushan Shah
If the output is off a double tap (touch) can re-enable it. The two
taps have to happen in the double click interval (we don't have
something better and it kind of matches) and have to be by only one
touch point. If there are multiple touch points it's not considered
as a double tap. A todo is to restrict the possible distance of the
two taps to one thumb.
Tested-By: Marco Martin
So far the DrmOutput connected to all input events when going into
power saving. As we now have the input filters it's better to just
install a filter when an output goes into powersave and remove the
input filter again when all outputs are enabled again.
To make this work InputRedirection gains a new method to add a new
filter as the first filter. This is a potentially dangerous method
as it allows to have a filter before LockScreenFilter gets the
events. But in case of DPMS it's something we actually want.
A nice new feature possible with the input filter is that we can
filter out the event which re-enables the outputs. Thus when getting
on a system with output off and screen locked, the first key hit
doesn't go to the lock screen.
Reviewed-By: Bhushan Shah
BUG: 341201
Fixed-in: 5.6.0 (Wayland-only)
This is needed to make KWin build-able on non-Linux, but is actually
only a workaround. The dependency should also be available on non-Linux.
This disables the EGL integration in the Wayland backend (QPainter still
available) and the EGL fallback in the qpa plugin (preferred context
sharing still available, but requires a working OpenGL Scene).
REVIEW: 126202
The implementation of VirtualTerminal is too linux specific and doesn't
compile on e.g. freebsd. Currently the most usage is in combination with
libinput. Only usage is:
* libinput related functionality in InputRedirection
* backends without custom input handling
Thus binding the feature to whether libinput is available is currently
the least invasive approach to get it compile on non-Linux.
In the long run this needs a different solution. The functionality
provided by VirtualTerminal is required and without the backends don't
work. It's needed to get notified about VT switches, when KWin needs to
stop rendering. So a solution for non-Linux needs to be found if
non-Linux wants to provide Wayland in future.
REVIEW: 126182
All backends already have an init method so far called from the ctor.
This change moves the call to init out of the OpenGL backends and makes
it the responsibility of the creating code to also call init on the
backend.
This change makes it easier to have virtual methods being called during
the initialization.
The backend is prepared for managing multiple x11 windows. Currently
it's still only one window, but it's all internally working through
the architecture for multiple windows.
We use the hw module's backlight and set the color to either 0
or FF depending on whetehr we want to have the screen on or off.
This turns the backlight off properly. It is bound to the toggleBlank
functionality so that we always turn on/off the backlight depending
on whether our compositor is on or off.
In addition we listen to key release events on the power button to
toggle the state.
REVIEW: 126083
If we don't have a dedicated device identifier we should use the default
mechanismn which involves using the WAYLAND_DISPLAY or WAYLAND_SOCKET env
variable.
We are going to switch to a proper nested approach similar to the
x11 backend. Given that we don't want to run on fullscreen anymore
but just open a nested window.
This gives a better tear down experience as it goes to black instead
of showing outdated screen and also it disables vsync which fixes a
crash on teardown.