Summary:
If caps lock is on the shift key should not trigger. Similar pressing
caps lock should neither on activation press nor on deactivation press
trigger the shortcut. Related to that are latched modifiers aka sticky
modifiers: if the modifier is still on after releasing the key the
shortcut should not trigger. We must assume the user wanted to use the
modifier to activate the modifier, not to activate the shortcut.
This change ensures that we don't track for modifier only shortcuts if
a modifier is active before press or after release.
The added test case demonstrates for caps lock, latched modifiers is
currently still untested. (Needs a way to mock it).
Test Plan: See test case for caps lock.
Reviewers: #kwin, #plasma
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D2467
We should be able to restart the Compositor also on Wayland.
As the Compositor might be terminated after Workspace we need to
ensure to not call into Workspace while doing finishCompositing.
Reviewed-By: bshah
For the exit-with-session option in kwin_wayland there is a chance that
the window which triggered termination is currently a Deleted. The
Wayland shutdown sequence terminates Workspace before the Compositor
which results in that Deleted's Scene::Window surviving the shutdown
process and thus the Shadow not being removed from the cache. This
makes KWin assert very late in the shutdown process when the decoration
shadow cache gets destroyed.
Summary:
So far when deleting a Shadow we used deleteLater which caused it
to be deleted in the next event cycle. This could in worst case result
in the Shadow being deleted after compositing got suspended. Thus the
Shadow not getting removed from the DecorationShadowCache which in
turn would mess up rendering on resume of compositing as the cache
returns a texture created for a different context.
BUG: 361154
FIXED-IN: 5.7.4
Reviewers: #kwin, #plasma
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D2483
Summary:
The new effect is based on the mouse click effect and uses the same
rendering code (this could be improved by merging them better).
Unlike mouse click there is no keyboard shortcut needed to activate:
as soon as the effect is loaded all touch points are visualized.
The visualization creates an animated circle for each touch down
position, motion and up position. The ids are tracked and each touch
id gets the same color. The first ten different touch ids get a
different color. As touch ids are stable the first finger will always
have the same color.
Reviewers: #kwin, #plasma_on_wayland, bshah
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2464
Summary:
KKeyServer does an incorrect translation to keysyms: it always
translates to the uppercase variant.
This change makes the default go through xkbcommon and tries to get
the keysym from matching the unicode representation. E.g. an "a" is
then recognized as the lower case a, and an "A" as the uppercase one.
Only if the translation through text fails we pass back to KKeyServer
which does a reasonable translation for non-text symbols.
Reviewers: #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2471
Summary:
The Xkb class loads keyboard layouts from the users configuration. This
makes tests fail locally if the user has a layout which behaves
differently to the one the test expects. E.g. on a German layout the
right alt key is different to the one of US layout.
In order to have a more stable test base the env variable
KWIN_XKB_DEFAULT_KEYMAP forces the loading of the default keymap, thus
tests have a common layout set.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2466
Summary:
Now powerdevil can adjust brightness using leds subsystem, however, kwin
as well sets brightness to 0 for turning off screen and 0xff when
turning screen back on. This resets the brightness set by the powerdevil
to 100%.
As a solution now kwin listens to brightnessChanged dbus signal of
brightnesscontrol and book-keeps the changed brightness, if screen is
turned off it sets brightness to 0 and when turning screen on, it resets
to old brightness.
If powermanagement service doesn't appear on dbus by default it restores
100% brightness.
Test Plan:
Appearantly this still doesn't work as-it-is on phone, because powerdevil
doesn't emit brightnessChanged dbus signal because of bug in the driver of
backlight control, driver doesn't seem to trigger uevents for changes in
backlight. But with hack in powerdevil to emit brightnessChanged when setting
brightness, this works
Reviewers: broulik, #plasma_on_wayland, graesslin
Reviewed By: #plasma_on_wayland, graesslin
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2468
Creating a dedicated method for the leave event on client.
This restructuring of the test should hopefully work around the
failing test condition on build.kde.org.
Summary:
The Effect class is extended by three new virtual methods:
* touchDown
* touchMotion
* touchUp
The methods return a boolean value so that the events can be filtered
out. E.g. an effect which has also a mouse grab installed wants to
filter out all events, other effects don't need the events exclusively.
This is a difference to how e.g. keyboard and pointer events are handled.
But is more close to how KWin's internal input event passing works and
makes it easier to get touch event: one does not explicitly has to grab
the events. It's also closer to Wayland where all input events are
available.
As a first example the Present Windows effect is adjusted and allows to
activate windows through the touch screen. As much code as possible is
shared with pointer input.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2450
Summary:
With this change KWin/X11 reuses Wayland's modifier only shortcut
architecture. The XInput2 event filter also listens for
* XI_RawKeyPress
* XI_RawKeyRelease
Those events are also reported if another X11 client grabs keyboard
input. Thus KWin gets all key events, just like on Wayland.
All key events are then sent through the Xkb class which performs the
mapping from key codes to key syms and is able to detect whether the
modifier got pressed/released without another key being pressed.
This change will require a few follow up changes, which are required
also for Wayland:
* ignore if another input device got interacted (e.g. mouse press,
touch screen, scroll, etc)
* use the layout from XServer instead of using our own (needed on
Wayland in nested setup)
The biggest disadvantage of the change is that it triggers a wake
up of KWin on every key event. But as KWin already listens to all
pointer events that's not a big difference and normally a key event
will wake up the compositor any way.
Reviewers: #plasma
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D2425
If the screen is locked the modifier only shortcuts should not trigger.
Also if the screen gets locked while a modifier is hold the shortcuts
should not trigger.
Reviewed-By: bshah
This extends the test helper for locking the screen and unlocking the
screen to also wait for the ScreenLockerWatcher to have that state.
This is going to fail on build.kde.org as we don't have EGL there and
the greeter crashes. This needs an extension to fake that we have a
screen lock window.
If we try to query before WaylandServer created the KSldApp the service
owner change is never delivered. Thus a delay till we know that the
service is there on Wayland. On X11 the initialization can be done
directly.
To know when the WaylandServer is fully initialized an additional
signal is added to WaylandServer.
Summary:
So far when KWin intercepted a key event a leave was not sent to the
Wayland surface currently having keyboard focus. This could result in
the Wayland application to start repeating keys. E.g.
1. application gets key press event
2. This triggers an internal window to show
3. key release goes to KWin internal window
4. application starts to repeat key as there is no release
With this change whenever KWin intercepts the key event e.g. due to
* internal window
* Effects grabbing key event
* Tabbox
the focused keyboard surface is set to null, thus triggering a leave
event and the client not starting to repeat the event.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2402
Summary:
Restores feature parity with X11. Global shortcuts need to trigger
also for repeat events. An example is the volume key or screen
brightness.
For other shortcuts like showing yakuake it does not make sense to
trigger on repeat. Thus a long term solution is to add a flag to
global shortcuts whether the key should trigger on repeat.
BUG: 366608
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2413
Summary:
A new method to tell the effects system whether the compositor scene
is able to drive animations. E.g. on software emulation (llvmpipe) it's
better to not do any animations at all.
This information can be used by effects to adjust their behavior, e.g.
PresentWindows could skip transitions or effects can use it in their
supported check to completely disable themselves.
As a first step all scripted effects are considered to be unsupported
if animations are not supported. They inherit AnimationEffect and are
all about driving animations.
The information whether animations are supported comes from the Scene.
It's implemented in the following way:
* XRender: animations are always supported
* QPainter: animations are never supported
* OpenGL: animations are supported, except for software emulation
In addition - for easier testing - there is a new env variable
KWIN_EFFECTS_FORCE_ANIMATIONS to overwrite the selection.
Reviewers: #kwin, #plasma
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D2386
The autotests are failing on build.kde.org due to the generated DBus
object path not being valid. This might be due to sysName having been
empty by default.
Summary:
The Connection exposes a new service called org.kde.KWin.InputDevice
and every Device registers an own object exposing all properties.
This allows an external configuration tool to change the behavior of
the devices at runtime. E.g. to test configuration settings.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2407
Summary:
We need to call Workspace::clientHidden when minimizing. Otherwise
Workspace doesn't update the active client and the now minimized
window is still active.
BUG: 366634
Test Plan:
Test case works now and also tested in nested setup that
active window changes.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2410
Summary:
If the user clicked a pointer button or scrolled a pointer axis the
held modifier was most likely intended to modify the pointer event.
Thus the modifier only shortcut should not be triggered.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2435
Summary:
The mouse polling is also used to detect mouse button press/release
events. This is used e.g. by the MouseClickEffect. The XInput2 filter
only selected for Raw Motion events which means mouse button events
are missed in case it's not combined with a motion.
This change makes the input filter also select for raw button press
and release events. To support this the X11EventFilter needed to
be adjusted to support multiple generic event types to filter for.
BUG: 366612
FIXED-IN: 5.7.4
Reviewers: #kwin, #plasma
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D2406
It's created together with input, so that the input mechanismn already
has a way to check whether screen is locked.
Effects doesn't hold a member variable any more and instead uses the
singleton instance.
Being able to monitor whether the screen is locked is useful not only
to the effects system but overall in KWin. Thus to make it possible to
use it from more locations as a first step it's moved into dedicated
source files.
If a pointer axis is scrolled while a modifier is hold, the modifier only
shortcuts should not trigger. The user wanted to use the modifier for the
pointer axis.
This is not implemented yet, thus all is QEXPECT_FAIL.
If a pointer button is pressed or gets pressed while a modifier is
hold, the modifier only shortcuts should not trigger. The user wanted
to use the modifier for the pointer button.
This is not implemented yet, thus all is QEXPECT_FAIL.
This test verifies the functionality of modifier only shortcut
activation. The base test case uses a helper object which is exported
to DBus and has a slot which can get triggered.
The test configures the individual modifiers to call that DBus method
when the shortcut is triggered. It simulates pressing the modifier and
verifies the DBus method was invoked or not.
client->isOnActivity("foo") will return true if the client is on no
activities, as that's the equivalent of saying we are on all activities.
In our case we do want to check activities() shows the right thing.
Summary:
This fixes a bug I had where Session Management restored a window on an
activity that didn't exist that, meaning I was unable to access it.
setOnActivity() already has this check
BUG: 362620
Test Plan:
Using my broken session, restored and got my ghost process back
on all activities
Added a window to activity 2, checked it came back there and
only there.
Reviewers: #plasma, graesslin
Subscribers: ivan, luebking, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D1982
Verifies the condition from D1982 with expected_fail. That is sets
a Client on non existing activities and expects that it should be on
all activities.
For Xwayland Unmanaged needs to override the addDamage method and
update the repaints_region accordingly, otherwise the repaint is not
triggered for the Unmanaged window.
Reviewed-By: bshah
Summary: No need to parse the OpenGL version twice with different algorithms.
Reviewers: #kwin, bshah
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D2414
Summary:
The Qualcom Adreno classes are recognized and a version detection
workaround is added for libhybris which only announces GLES version 2
although GLES version 3 is supported. KWin at least used to work with
GLES version 3 which gives us e.g. framebuffer blit.
Reviewers: #kwin, bshah
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D2415