Summary:
A small helper class is added which manages inhibiting idle for the
ShellClients. So far only very basic functionality is added. That is
only the inhibition on the Surface is followed. It is not yet checked
whether the ShellClient is visible at all. That needs some changes in
ShellClient.
BUG: 385956
FIXED-IN: 5.12
Test Plan: New test case passes
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8856
Summary:
KWin was quite good in ensuring that you don't need to install by
passing paths to the tests. The new way is much nicer, so code is
adjusted for the new way. Also if we require a newer ECM in future we
need to support the new way.
No guarantee that the tests don't pick something up from the system env,
that needs more testing.
References: https://community.kde.org/Guidelines_and_HOWTOs/Making_apps_run_uninstalled
Test Plan: The tests which loaded helpers pass
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7543
Summary:
This change introduces an OrientationSensor class which wraps a
QOrientationSensor. The OrientationSensor is hold by Screens and gets
enabled if Screens knows about an internal (e.g. LVDS) display which
supports rotation. In addition the OrientationSensor holds an KSni to
enable/disable the automatic rotation support.
The drm platform plugin is adjusted to make use of the OrientationSensor.
The API is defined in a way that this can also be implemented on other
platforms supporting rotation. Most important are hwcomposer and X11
standalone. The latter should be straight forward as rotation is provided
through XRandR. The former needs addition for rotation support first.
Test Plan: Rotated my Yoga 12
Reviewers: #kwin, #plasma, sebas
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D8699
Summary:
Loads settings on whether QtQuick uses GL or software rendering
Aurorae needed a fix. The rest "just works" with up-to-date plasma framework.
Test Plan:
Alt tabbed
Showed an OSD
Grepped kwin's QML for any custom shaders.
(which is the only part that doesn't work here)
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: graesslin, plasma-devel, kwin, #kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8040
Summary:
This change adds a DBus API to query whether the virtual keyboard is
currently enabled and provides DBus methods to request that the virtual
keyboard gets enabled/disabled. This is useful for e.g. providing a
Plasmoid or for convertables where the tablet mode needs to be enabled.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8166
Summary:
The Platform API is extended by a call to create the EffectsHandler. In
X11 standalone Platform a new EffectsHandlerImplX11 is added which
contains the X11 only parts of the EffectsHandler, such as grabbing the
X keyboard and the X11 mouse interception window.
The EffectsHandlerImpl gains some virtual methods for the parts which
are now done in the X11 specific implementation. In return we get rid of
lots of if-else structures checking for the operation mode.
Test Plan: Only compile tested.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7955
Summary:
Unfortunately a rather large change which required more refactoring than
initially expected. The main problem was that some parts needed to go
into platformsupport so that the platform plugins can link them. Due to
the rather monolithic nature of scene_opengl.h a few changes were
required:
* SceneOpenGL::Texture -> SceneOpenGLTexture
* SceneOpenGL::TexturePrivate -> SceneOpenGLTexturePrivate
* texture based code into dedicated files
* SwapProfiler code into dedicated files
* SwapProfiler only used in x11 variants
* Safety checks for OpenGL scene moved into the new plugin
* signal declared in SceneOpenGL moved to Scene, so that we don't need
to include SceneOpenGL in composite
Test Plan: Nested OpenGL compositor works
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7740
Summary:
Splitting out the handling from events.cpp and moves it into a
dedicated class created together with RootInfo.
Test Plan:
Test case for NET window move which goes through this
code path still passes.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7808
Summary:
The base idea behind this change is to keep the system responsive no
matter what other processes do. All input and rendering needs to go
through the windowing system, so keeping it responsive is important.
Currently KWin competes with all other processes for resources and this
can render the system unusable. Consider some processes running amok. In
this case the user might not be able to easily close the applications as
KWin does not get the cpu time to perform the input tasks requested by
the user.
Or in the case of playing a demanding game it is important that KWin
gets scheduled to forward the pointer input events. The user doesn't
want that the game (or another process) wins against the windowing
sytem.
The disadvantage is that KWin always wins against other processes with
real time scheduling. This could result in KWin running amok stalling
the system. On the other hand this is no change to the current situation
as if KWin runs amok the sytem is unusable.
The change uses libcap to set CAP_SYS_NICE on kwin_wayland executable.
KWin_wayland on start sets the scheduling policy to SCHED_RR with the
lowest possible priority. Thus any other SCHED_RR process will win
against KWin. So real time processes are not affected by this change!
After adjusting the scheduling (which requires CAP_SYS_NICE) KWin drops
this capability again.
Test Plan:
Verified that KWin adjusts the scheduler, that it is not passed
to child processes, that the capability gets dropped and not passed to
child processes.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7757
Summary:
So far both Workspace and Toplevel emitted signals for every property
notify event on the root window and the respective Toplevel windows. The
signals were only used in EffectsHandlerImpl to forward to the effect
system in case the property which changed is registered by an effect.
This change introduces a dedicated event filter for this which is only
created in EffectsHandlerImpl in case an X11 connection is available. It
supports a restart of the X11 system.
The signals used so far are removed from Workspace and Toplevel.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7853
Summary:
Only needed for kwin_x11 variant (required for the non-composited
Outline). As that's nowadays in the x11 platform, we can move the
complete XRenderUtils support into the platform. Thus KWin core does
no longer require to link it.
Test Plan: Compiles
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7760
Summary:
This change introduces a dedicated X11EventFilter for the mouse
interception on X11. The filter gets created together with the start
of mouse interception and destroyed again when the mouse interception
ends. Thus we don't need to check for each event like it was the case
so far.
Unfortunately the existing methods cannot be removed (yet) as they are
still used by TabBox. Needs investigation whether this is actually
needed.
Test Plan: Xephyr+kwin_x11+Present Windows
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7842
Summary:
CXX_STANDARD is only available since 3.1.
$ git show 913394af2: cmTarget: Add CXX_STANDARD and CXX_EXTENSION...
$ git tag --contains 913394af2 | head -n: v3.1.0
3.1 also has CMakePackageConfigHelpers (available since 3.0),
allowing to drop ECMPackageConfigHelpers (it actually fixes a CMake
warning when requiring >=3.0).
Furthermore move cmake_minimum_required(VERSION 3.1 FATAL_ERROR) to
the top of CMakeLists.txt like suggested by CMake's documentation.
Test Plan: cmake .. & ninja
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7784
This change is similar to D7232 and moves the scene_qpainter into a
dedicated plugin. Compared to the XRender case it's more complicated as
the platform plugins need to implement a platform specific backend.
The base implementation for this part used to be in scene_qpainter. As
the idea is to completly move it away from KWin core it would be point
less to still have the backend definition in KWin core, but it cannot
be in the scene plugin as otherwise all platforms need to link the
plugin.
To solve this a new platformsupport subdirectory is added which contains
the scene platform backend as a static library. For the OpenGL scene such
a static library will also be required.
Test Plan: SceneQPainter test still passes, nested compositor still works
Reviewers: #kwin, #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D7259
Summary:
First step for loading the compositor Scenes through plugins. The general
idea is that we currently needlessly pull in all the Scenes although only
one will be used.
E.g. on X11 we pull in QPainter, although they are not compatible. On
Wayland we pull in XRender although they are not compatible.
Furthermore our current Scene creation strategy is not really fault
tolerant and can create situations where we don't get a compositor. E.g
on fbdev backend the default settings won't work as it does not support
OpenGL.
Long term I want to tackle those conceptional problems together:
we try to load all plugins supported by the current platform till we have
a scene which works. Thus on Wayland we don't end up in a situation where
we don't have a working compositor because the configuration is bad.
To make this possible the switch statement in the Scene needs to go and
needs to be replaced by a for loop iterating over all the available
scenes on the platform. If we go there it makes sense to replace it
directly with a plugin based approach.
So this is a change which tackles the problem by first introducing the
plugin loading. The xrender based scene (as it's the most simple one)
is moved into a plugin. It is first tried to find a scene plugin and only
if there is none the existing code is used.
Test Plan: Tested all scenes
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7232
Summary:
This ensures that the X11 specific events are only read on X11 but not
on Wayland. Also moves quite some X11 specific code out of TabBox.
Test Plan: Compile checked, currently on Wayland, so no way to test.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7395
Summary:
Splits out the X11 specific window movement handling so that it's not
used in the Wayland case at runtime. As a nice side effect it
un-spaghetties the X11 event handler.
Test Plan:
Run nested KWin on Xephyr and nested KWin/Wayland to verify
that move/resize of X11 windows is still working
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7374
Summary:
KWin::updateXTime only delegates into the platform API where the method
is a no-op. The actual implementation is moved into the X11 standalone
platform as it uses QX11Info which is non functional except on the X11
standalone platform.
This change exposes a problem with timestamp handling: on Wayland the
X11 timestamp does not get updated at all, causing e.g. window sync not
work correctly (c.f. bug 374881). We cannot implement the updating in the
same way as QX11Info/Qt xcb platform does it as that would introduce a
blocking roundtrip to XWayland which is dangerous.
As a side-effect this change removes linking to Qt5::X11Extras in kwin
core as it's no longer needed.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7515
Summary:
The KWindowSystem call which we used doesn't work on Wayland as it's only
implemented in the xcb variant and cannot be made available for Wayland
in an easy way as it is still XLib based.
This change turns the optional XCB-ICCCM dependency in a required one
and thus can use the functionality provided by said library to implement
what KWindowSystem provided.
BUG: 382789
Test Plan: New test case which failed with old code
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7046
Summary:
Workspace monitors the X11 events to detect when the user first
interacts with the system. This is only required on X11 for activating
the same client from previous session. So far this was spread over many
parts in the long event switch statement. To make this more contained a
dedicated event filter is introduced which also gets deleted again once
the first user interaction got recognized.
Test Plan: Compiles
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7371
This is a totally stupid warning for an older code base such as KWin. It
generates hundreds of warnings as on legacy code no method uses override.
The output is totally spammed, so it's better to disable it.
This will hopefully also prevent that someone tries to fix it again by
changing all of KWin - which we don't want.
Summary:
Only build
* `virtual_terminal.cpp` in the presence of `linux/vt.h`
* `fbdev`-backend in the precense of `linux/fb.h`
Test Plan:
Reviewers: #kwin, #freebsd, graesslin, bcooksley
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D6847
Summary:
KWin already used C++14 constructs in a conditional way. This doesn't
make much sense today, it's better to just require C++14.
For KWin only gcc and clang are currently compilers of relevance. Gcc
supports C++14 since version 5 and defaults to C++14 since 6.1 [1].
Clang supports C++14 since version 3.4 [2].
An overview of compiler support in various distributions:
* Debian stable (stretch): gcc 6.3, clang 3.8
* Debian oldstable (jessie): 4.9, clang 3.5
* Ubuntu 17.04: gcc 6.1, clang 3.8
* Ubuntu 16.04: gcc 5.3, clang 3.8
* openSUSE Tumbleweed: gcc 7.1, clang 4.0
* openSUSE Leap 42.3: gcc ?, clang ? [3]
* FreeBSD: clang >= 34 in ports
* Slackware 14.2: gcc 5.3
This overview shows that every distro out there has at least one
supported compiler which can still compile KWin with this change.
[1] https://gcc.gnu.org/projects/cxx-status.html#cxx14
[2] https://clang.llvm.org/cxx_status
[3] Sorry I fail to understand openSUSE's package repository.
It seems that there is gcc 7 available, but gcc package is 4.8
Test Plan: Compiles on my neon system
Reviewers: #plasma
Subscribers: plasma-devel, kwin, #kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D6634
Summary:
The current way to specify the OpenGL context attributes does no longer
scale as can be seen in D6344. There are too many different context
attribute sets and with every addition we grow lots of copied code. The
chances to introduce errors in that code which is difficult to debug are
very high. As can be seen in the glx backend which defines major 1,
minor 2, but it should be major 2, minor 1.
This change reworks this code by creating a builder class which contains
only an abstract definition of what needs to be in the attributes.
E.g. the version, whether it's robust and so on.
Now we can just have a list of possible attributes in a well described
way:
auto builder;
builder.setVersion(3, 1);
builder.setRobust(true);
All possible builders are added to a list and operated on in a for loop
which tries to creat a context. Once it succeeded it breaks the list.
In addition a debug statement is added which prints out the set of
options which went into the context.
So far this is only done for EGL, GLX can follow once D6344 is merged.
Test Plan: New unit test added, kwin_wayland OpenGL tests run and verified
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D6396
Summary:
Normally the xclipboardsyncer should terminate because the socket
becomes unusable. But we have reports of it not really going down and
running amok.
In order to prevent such situations this change registers SIGTERM to be
sent to xclipboardsyncer when the parent process (that is kwin_wayland)
dies in whatever way. This ensures that xclipboardsyncer cannot become
an orphan.
BUG: 371862
Test Plan: Only compile tested, no way to get into the problematic situation
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D5589
Summary:
This change introduces the initial support for keyboard layout switching
policies like in the X11 session. This first change only adds support for
Global and Virtual Desktop policy. This means the current layout is
stored in context to the current virtual desktop. Whenever one changes
the virtual desktop the previous layout is restored. If the user has not
yet navigated to this virtual desktop a switch to default layout is
performed.
This is the first code interacting with the new Virtual Desktop API which
is not based on integer ids. To fully support this the API is slightly
extended.
Test Plan: Added test case
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D5301
Summary:
So far KWin did not properly handle popup windows. That is when a popup
surface got created and a click outside the surface happened KWin did not
send out the popupDone Wayland event.
This change makes KWin aware of whether a surface is a popup and tracks
through a new PopupInputFilter whether there are popup windows. In case
there are popups the new filter waits for mouse press events and cancels
the popups if the press does not happen on any surface belonging to the
same client. To quote the relevant section of the Wayland documentation:
The popup grab continues until the window is destroyed or a mouse
button is pressed in any other client's window. A click in any of the
client's surfaces is reported as normal, however, clicks in other
clients' surfaces will be discarded and trigger the callback.
So far the support is still incomplete. Not yet implemented are:
* support xdg_shell popup windows
* verifying whether the popup is allowed to be a popup
* cancel the popup on more global interactions like screen lock or
kwin effect
BUG: 366609
FIXED-IN: 5.10
Test Plan: Auto test and manual testing with QtWayland client
Reviewers: #plasma, #kwin
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D5177
Summary:
This change adds global touchpad swipe gestures to the
GlobalShortcutsManager and hooks up the swipe gestures as defined at the
Plasma Affenfels sprint:
* swipe up: Desktop Grid
* swipe down: Present Windows
* swipe left: previous virtual desktop
* swipe right: next virtual desktop
The main work is handled by two new classes: SwipeGesture and
GestureRecognizer. This is implemented in a way that it can be extended
to also recognize touch screen gestures and pinch gestures.
The SwipeGesture defines what is required for the gesture to trigger.
Currently this includes the minimum and maximum number of fingers
participating in the gesture and the direction. The gesture gets
registered in the GestureRecognizer.
The events for the gesture are fed into the GestureRecognizer. It
evaluates which gestures could trigger and tracks them for every update
of the gesture. In the process of the gesture tracking the
GestureRecognizer emits signals on the Gesture:
* started: when the Gesture gets considered for a sequence
* cancelled: the Gesture no longer matches the sequence
* triggered: the sequence ended and the Gesture still matches
The remaining changes are related to hook up the existing shortcut
framework with the new touchpad gestures. The GlobalShortcutManager
gained support for it, InputRedirection and EffectsHandler offer methods
to register a QAction. VirtualDesktopManager, PresentWindows and
DesktopGrid are adjusted to support the gesture.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel
Tags: #plasma_on_wayland
Differential Revision: https://phabricator.kde.org/D5097
Summary:
So far KWin put a version requirement on Breeze which is the current
version number of KWin. This is technically correct, but distributions
seem to have problems with it. E.g. I noticed twice in Debian testing
that kwin defaults to Plastik which happens when Breeze is not found.
I reported it, it got fixed, now it's again broken.
Thus I think that distributions have problems with the requirement of
building Breeze prior to KWin. As KWin does not depend on the minor
version, let's depend only on the actual required version, which is
5.8 in the 5.8 branch, 5.9 in the 5.9 branch and master.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D4644
Summary:
The functionality regarding triggering modifier only shortcuts is moved
out of Xkb - where it doesn't belong to - and is turned into an input
event spy listening for the changes it is interested in. Previously
the state got queried by asking e.g. for the pressed buttons, now it's
tracked directly.
The X11 side needs a larger change due to that as now pushing the events
into Xkb does not trigger modifier only shortcuts any more. Instead the
"normal" way through the platform API needs to be used which triggers the
processing of filters and spies.
The problem here is that our redirections only process events if they are
inited and that only happens on Wayland. We cannot call init on them as
that would create all the Wayland filters and spies and processing would
probably break. As an intermediate solution the spies are now processed
and there we know that it won't matter. A future solution would be to
remove the init checks completely and just send through both filters and
spies and ensure that on X11 only the supported ones are loaded.
Closes T5220
Test Plan: Tested on Wayland and X11
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Maniphest Tasks: T5220
Differential Revision: https://phabricator.kde.org/D4578
Summary:
This replaces the previous solution to require at least gcc 4.8 which
did not cover clang. As cmake has a proper way to check for 11, let's
use that.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D4486
Summary:
Increases minimum Qt version to 5.7. This allows to drop the pre-5.7
virtual keyboard and various ifdefs for now unsupported versions.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D4485
Summary:
So far the keyboard repeat handling was triggered directly from
KeyboardInputRedirection::processKey. With the introduction of
InputEventSpies it is no longer required to be done like that, we can
split it out into a dedicated spy.
This means that processKey only has to care about processing the key
and allows us to better extend in future. So far keyboard repeat is
only functional for libinput based platforms. But it should also be
possible to use it in nested setups. By splitting it out we can
prepare for that.
Test Plan: Auto-test using repeat still passes
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D4304
Summary:
as the plasmapkg2 utility is dead, scripts and tabboxes couldn't
be installed anymore, as plasmapkg2 was launched with an hardcoded
package type (and had a bunch of custom code for it)
and no packagestructure for the relevant package types existed.
the port of scripts and tabboxes to kpackage in kwin is quite
incomplete and somewhat strange (given the fact that was started by
looking manually for the file as it couldn't link to libplasma)
this makes things a bit better as now scripts and tabboxes have an actual
package structure, making it installable by kpackagetool5.
in the future, the port should be completed and replace all the manual lookup
of files with package::filePath as it should work now given that valid
structures exist
BUG:374766
Test Plan:
tabbox plugins and kwin scripts can be installed from knewstuff
again and can be successfully loaded
Reviewers: #plasma, graesslin, subdiff
Reviewed By: #plasma, graesslin
Subscribers: graesslin, plasma-devel, kwin, #kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D4202
Summary:
So far the implementation of keyboard layout handling was split between
KeyboardInputRedirection and Xkb. KeyboardInputRedirection registered
the global shortcut and did the handling for layout switch and config
changes. Xkb did the notification on layout change.
Layout changes can nowadays be detected through an InputEventSpy. It
can only happen after a key change or an explicit layout switch. Thus
it does not need to be in Xkb anymore which allows to reduce Xkb to
only care about the Xkb keymap and state tracking.
This change introduces a new class KeyboardLayout which is an
InputEventSpy and takes over the task of the layout change notification
from Xkb and the layout management from KeyboardInputRedirection. Thus
everything related to management of keyboard layout is together in one
class.
This allows in future to add unit test to it (requires further cleanup
of Xkb to be able to use it and drop the InputRedirection dependency) and
opens the possibility to also take over keyboard layout management on X11
for the Plasma desktop.
Test Plan: Manual testing
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D4135
This brings back global menu support in KWin.
The DBusMenu infrastructure is different that we just read the DBus service name and
menu object path from the windows rather than passing around window IDs on DBus which
won't work on Wayland.
Differential Revision: https://phabricator.kde.org/D3089
Summary:
This change removes the workaround added with
421824b654.
Xkbcommon 0.7 introduces the needed API to make this work without a
workaround.
Test Plan: Test case still passes
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D3809
Summary:
Recently we noticed that there are multiple areas where KWin needs to
inform the user about how to operate. Examples are:
* Screenshot
* ColorPicker
* Pointer constraint enabled
* Pointer constraint about to be removed
* Kill Window
For Screenshot and ColorPicker we used an EffectFrame to render it. But
this is not an optimal solution as it's lacking many features we would
need. We cannot properly use it from within KWin core, we cannot
implement features like hide on mouse over, etc. etc.
This change introduces an OnScreenNotification which supports:
* showing an icon
* showing a message
* timeout
It is Qml styled, so that it can be easily adjusted. This is a big
improvement over the EffectFrame solution. The Qml file creates a Plasma
Dialog of type OSD. Thus KWin places it like the normal OSD windows and
also looks kind of similar. In the case of KWin the focus is more on the
message, than an icon, so the icon is placed left of the text.
While the OnScreenNotification is supposed to be used like a singleton,
it doesn't use the KWin singleton pattern. Instead a small wrapper
namespace OSD is introduced which provides a convenient API for KWin
internal areas to show/hide the notification. By not using the KWin
singleton pattern, the OnScreenNotification does not depend on any other
parts of KWin and can be easily unit-tested.
A few features are still missing and will be added in further commits:
* hide-out on mouse over
* optional skip close animation (needed for screenshot)
* X11 support (not that important as it's mostly for Wayland features)
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3723
This patch is made in preparation for the Touchpad KCM for Wayland.
Summary:
* KWin has a Libinput version requirement bump to 1.5
* new isTouchpad property to distinguish touchpads from mice
* new lmrTapButtonMap property
* new disableWhileTyping property
* new pointerAccelerationProfile property
* new defaultPointerAcceleration property
* save to config mechanism added for new propertys and pointerAcceleration
* new D-Bus interface org.kde.KWin.InputDeviceManager and method devicesSysNames
* removed unnecessary additional D-Bus service name org.kde.KWin.InputDevice
* changing acceleration in the Mouse KCM doesn't influence touchpads anymore
Reviewers: #kwin, #plasma, davidedmundson
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3479
Summary:
It's only needed by the GLX backend, so only find if we have GLX at all
and only link where needed. As it was handled incorrectly before, it's
now using proper ifdef.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3448
Summary:
QSpinBox can't handle plural suffixes. Something previously done by
KIntSpinBox.
Using setSuffix(ki18np("pixel", "pixels")).toString() does nothing, as
at the time of conversion we don't know which one to use.
This patch uses KPluralHandlingSpinBox and correct ki18np.
Note, "new" dependency was already linked implicitly in other kwin, but
we need to add it for this KCM.
Test Plan:
Opened KCM (in English) set counter to 1 pixel and 2 pixels.
No longer had a big warning. Also appropriate number of s's appeared.
Reviewers: #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3222
Summary:
The Xkb class now creates a compose key table and a state object and
feeds all key presses through the compose state machine.
Xkb now tracks the latest keysym which is provided through new method
currentKeysym. This is now used when creating a QKeyEvent instead of
passing the key code to the xkb state. With that the keysym can also
be updated through the compose state system.
This only affects KWin internal usage where text is composed, e.g. the
present windows effect filter. Wayland clients do not gain compose key
support, though.
Minimum xkbcommon version raised to 0.5 as compose key support is new
in that version.
Test Plan: Enabled compose key support in keymap and verified through DebugConsole
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2622
At the same time the xinput2 integration is split out of X11Cursor
and made a standalone part of the platform plugin. XInput integration
is nowadays not only used by the cursor position polling, but also
for modifier only shortcuts.
By splitting it out the modifier shortcuts start to work also when
one doesn't have anything requesting a mouse position polling.
This also simplifies the conditional builds: xinput integration is
only included if we have support for it at compile time without having
to have many ifdefs in the cursor implementation. For the inclusion of
cursor in the kcmkwin this also removes all the ifdefs.
The key events are only requested if we have xinput 2.1. Otherwise we
would not get all raw events if the input device gets grabbed.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2473
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.
The capability tablet tool is new in Libinput 1.2. As build.kde.org
does not yet support this version, it's only an optional check.
So far the code only detects whether the capability exists and reports
this accordingly.
Summary:
The egl implementation for the virtual platform tries to use a render
node if available. If there is no render node it looks for a virtual
(kernel driver vgem) device, which unfortunately does not create a
render node in mainline kernel (there are patches in ChromiumOS).
For this the Udev wrapper is extended to search for renderNode devices
and for virtual dri devices.
If either render node or vgem dri device is found, it is tried to be
opened (without logind escalation) and on success a gbm device is
created on it. If any step of this fails the so far default behavior
of default device is tried for creating the EGLDisplay.
All of this is compile optional, so that the virtual platform does not
hard depend on udev and/or gbm.
Test Plan:
Auto tests which need OpenGL executed and verified that they
use the render node or vgem device.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2216
Summary:
The clipboard sync is done by a dedicated helper binary launched by
KWin. This helper binary is forced to xcb platform to piggy-back on
Qt's implementation of the X11 clipboard. In addition it implements
the Wayland clipboard - which is much simpler. Reading the Wayland
clipboard is based on the implementation in QtWayland.
KWin internally knows the DataDeviceInterface belonging to the helper
application. Whenever an xwayland client is focussed, this DataDevice
is allowed to set the selection and KWin manually updates the current
selection in the SeatInterface. By that the sync from X11 to Wayland
is implemented. When afterwards a Wayland client is selected, it's sent
the current selection which references the X clipboard and a data
transfer can be initiated in the normal Wayland way.
For the other direction KWin sends the current selection to the helper's
DataDevice whenever an xwayland window is focused. The helper application
reads the Wayland clipboard and sets it on the X11 clipboard. Thus the
Wayland clipboard is synced to X11.
The approach used here will also be useful for implementing a clipboard
manager (aka klipper).
Currently the implementation is not yet fully completed. We need to
make sure that the helper application gets restarted in case of a crash.
Test Plan: See added test case
Reviewers: #plasma_on_wayland, #kwin
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D1973
Summary:
Sets notifications on all desktop and doesn't activate them.
Unfortunately doesn't work on Plasma yet. Seems the windows don't get
tagged properly.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D1930
Summary:
The idea is to have KWin provide a virtual keyboard. To support this
KWin uses the QT_IM_MODULE qtvirtualkeyboard and makes sure that the
QPA plugin loads it.
KWin has a new class VirtualKeyboard which acts as the focus object and
the "proxy" for input methods. The QPA plugin ensures that this is the
focusObject, so that all input method related events are sent to this
class. From there it will be possible to delegate to other applications
through the Wayland interfaces.
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D1638
Summary:
The signals emitted by LibInput::Connection carry the Device for which
the input event was received. This Device is passed to the input handlers.
Custom event classes are added which extend QMouseEvent, QKeyEvent and
QWheelEvent respectively and expose the Device. The Device is only passed
around as a forward declared pointer, so even if compiled without libinput
support, it should still compile.
Event handlers which need to get access to the Device can now just cast
the event pointer to the custom class and access it. This can be used in
future to handle device specific key codes, etc.
As we don't have a proper event classes for touch events the event
handlers do not yet have access to the Device. Here the internal API
needs to be adjusted in future.
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D1667
Summary:
CompositingPrefs is only relevant for X11 standalone. It had some
"hacks" to make it not block Compositing on Wayland. Thus it was in
its current form not really useful.
Now all the functionality is provided through Platform with a default
implementation which is sensible for Wayland platforms.
The X11 standalone platform implements the new methods with the
Wayland checks removed.
In addition all calls to CompositingPrefs now go through the platform
directly and CompositingPrefs is completely dropped.
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1576
Summary:
If a user specifies the QT_WAYLAND_FORCE_DPI env variable, KWin uses
it to force a logicalDPI, just like QtWayland.
Test Plan: Normally sized window decorations
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1605