Summary:
This dbus method is intended to be used by the kwin rules dialog. KWin
can pass the internal id to the rules dialog through a command line
argument (or similar way) and the dialog can query the information
through the dbus call for the provided id. Thus it's possible to
implement one way to query the information which works on both X11 and
Wayland without any windowing system specific functionality.
Test Plan: See new added integration test
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17433
Summary:
This document describes my own practices on how I develop and work on
KWin. Since we have nested KWin/Wayland my ways of developing completely
changed. Especially since it's possible to run without installing. Due
to that I thought it's a good idea to document how one can easily build
and run KWin.
Why a new document in the source tree instead of the wiki?
The main reason for using a wiki was that it allows to format, to link,
etc. This was prior to markdown and prior to code hosting places like
github or phabricator rendering the markdown pages. Given that I think
the information belongs in the repository and not in an external wiki.
Why not fix the existing page?
Our documentation on the wiki is quite outdated:
* Qt 4 based
* only X11
* reviewboard
* information about file structure which does not match reality
Especially the last point is where I think we need to do a clean cut and
just drop such information. Documentation about code belongs in the code
and not detached in wiki. It will outdate.
How to prevent this document will not become outdated?
Of course difficult. But I tried to not describe anything which might
change, such as file layout, etc.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17600
Summary:
This file has not been tracked for years. Nobody added when new features
were added, when existing code was broken, etc. E.g. none of the changes
since EWMH 1.4 is listed, none of the kde specific extensions is listed.
The document does not contain anything about Wayland protocol support.
I would not trust this document at all to say whether KWin is compliant,
but would check the source code. And after all most of the compliance is
done in KWindowSystem and KWayland, not in KWin.
Also the document lists compliance of other non-KWin elements such as
Qt, kicker (kde 3 thing, not application launcher), etc. This shows it's
also something which doesn't belong in KWin's source tree.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17601
Summary:
If a parent window is minimized, then its transients have to be
minimized as well, so the minimize behavior is the same on both
X11 and Wayland.
BUG: 401950
FIXED-IN: 5.15.0
Reviewers: #kwin, graesslin
Reviewed By: #kwin, graesslin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17570
Summary:
The idea behind this autotest is to verify that different window
open/close animation effects behave similarly.
Currently, we just check whether Fade/Glide/Scale effect tries to animate
the appearing or the disappearing of toplevels. In the future, the
autotest will be extended to verify that there are no conflicts between
those three effects and the Login/Logout effect, etc.
Test Plan: Ran the test, found a bug in the Fade effect, fixed it.
Reviewers: #kwin, graesslin
Reviewed By: #kwin, graesslin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17526
Summary:
Recently, libkwineffects got some changes that break ABI compatibility,
so we have to bump the API version.
Test Plan:
When using a binary effect, which is made against 226 version, KWin no
longer crashes.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17444
Summary:
qobject_cast has several advantages over dynamic_cast:
* it works without RTTI;
* it's usually faster.
Also, when it comes to casting QObjects, qobject_cast is de facto
standard.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17427
Summary:
We use a function template, so static_cast in getMainWindows looks out
of place. Also, it's not good idea to do static_cast based on output of
isDeleted().
Test Plan: The Dialog Parent effect works.
Reviewers: #kwin, graesslin
Reviewed By: #kwin, graesslin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17426
Summary:
It also searches for the platform plugin, so we need to ensure it finds
it in the build directory.
This was a regression caused by building all platform plugins in the
correct location.
Test Plan: strace on the failing test, verified correct plugin is loaded
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17573
Summary:
Currently, if a virtual desktop was removed, then we'll try to send all
clients to the last virtual desktop even though most of those clients
weren't present on the removed virtual desktop.
Test Plan: Manually.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17576
Summary:
This change removes a small difference between X11 and Wayland clients.
It ensures that all transients are sent to the same desktop as the main
window. A similar check is already in AbstractClient::setDesktop, so in
general it already worked. This is just a special case for
sendClientToDesktop which supports sending to the same desktop so that
all transients are sent to that desktop.
Test Plan: New test case which fails without this change
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17546
Summary:
When launching the touchpad kcm we see the following warning:
Error on d-bus read of "supportedButtons"
And the Gui shows "Error while loading values. See logs for more
information. Please restart this configuration module".
By extending the unit test for reading back the properties through DBus
I noticed that it's not trivially possible to export QFlags to DBus. As
the QFlags can be implicitly casted to int, the property is changed to
an int value.
Test Plan: Test case adjusted, did not pass prior to change, passes now.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17472
Summary:
This brings KWin a step closer to be run from build dir without having
to install at all. The integration tests are adjusted so that the
virtual platform is still found which makes the code be closer to what
is used in normal kwin_wayland.
Test Plan: ctest passes, manually verified correct plugin is loaded
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17388
Summary:
This command line option is useful for KWin in embedded use case. That
is when KWin is just used as a compositor for one application instead of
a complete desktop environment. In such a setup global shortcuts are not
wanted and interfere with the application. E.g. one does not want Alt+F4
to close the window, that would render the system unusable.
This change introduces a command line option and disables the following
event filters and spies:
* global shortcuts
* modifier only shortcuts
* terminate session
* virtual terminal switching
* screen edges
KGlobalAccel still gets inited, otherwise the (non-functional) binary
would be launched when KWin registers it's global shortcuts.
Test Plan:
New test added based on existing tests for the global
shortcuts, ctest passes
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17304
Summary:
On touch events the mouse cursor gets hidden, on next mouse event the
mouse cursor is shown again. This IMHO significantly improves the system
interaction if touch is the primary user interface.
Test Plan: Test case added and ctest passes
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17280
With 05ca6c97f8 removing all touch points always induces
an at surface change to null. But the decoration leave event
is already sent in the decoration input filter. Do not send
it again in the cleanup function.
This makes the decoration input test pass again.
Reviewed by David Edmundson as part of review of 05ca6c97f8.
Summary:
Certain input devices like touch screens can be in a state of having no input
target at all. In case of touch screens when there are no current touch points.
In this case unset and block at-surface targets until a touch point is
available again.
Test Plan: Auto test window-selection passes again.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: graesslin, davidedmundson, zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17537
Summary:
the newly introduced resize button shouldn't be visible on the phone and
for some reason using a ToolButton prevents the qml to load at all on
the phone (the problem seems right into the C++ part of ToolButton as
is broken on every QQC2 style)
Test Plan: work again on phone, still work on laptop
Reviewers: #plasma, bshah
Reviewed By: #plasma, bshah
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17483
Summary:
Provide the important debug messages which can be used to debug why
virtualkeyboard is not starting.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17454
Summary:
Currently, testDontCrashReinitializeCompositor is unstable because it
doesn't take into account that effects can be loaded asynchronously.
In general, we don't need all default effects in this test, so let's
disable them.
Test Plan: This should fix ASan issues.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17386
Summary:
If updating a shadow means that there should be no shadow, shadow ends
up deleting itself midway through the method.
It's cleaner and safer to leave that to the caller.
This new change matches the existing documentation for
Shadow::updateShadow which states
> In case the Property has been withdrawn the method returns @c false.
> In that case the owner should delete the Shadow.
Test Plan:
Created an ASAN of kwin
Relevant testMaximised no longer fails
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17380
Summary:
213239a0ea tried to address the case when
a wayland client gets shadow after it was mapped, but because of poor
testing from my side, another bug was introduced. If a decoration tooltip
or the user actions popup is shown, then in some cases it can be blank.
Usually, SurfaceInterface::shadowChanged proceeds SurfaceInterface::sizeChanged,
so when the shadow is installed, window quads cache is rebuilt. But
because shell client already knows the geometry of the internal client,
goemetryShapeChanged is not emitted, thus the cache is not updated.
It would be better just to invalidate the cache when the shadow is
installed, uninstalled, or updated. This reduces the number of
unnecessary invocations of Scene::Window::buildQuads and also moves
handling of the window quads cache away from the Shadow class.
BUG: 399490
FIXED-IN: 5.15.0
Test Plan: Decoration tooltips are no longer blank.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17215
Summary:
Currently, --about doesn't have any effect. In addition to that, the about
data contains outdated information.
This change hopefully addresses all previously mentioned issues.
Test Plan: Ran kwin_wayland --author.
Reviewers: #kwin, graesslin
Reviewed By: #kwin, graesslin
Subscribers: graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17319
Summary:
Use the new functionality in KWayland to support drag and drop via touch
screens.
Either a drag and drop session with pointer or touch is possible, but not
both at the same time. Pointer/touch gets deactivated if a touch/pointer
drag and drop session is active.
Test Plan: Manually.
Reviewers: #kwin, davidedmundson
Subscribers: davidedmundson, alexde, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D15466
Summary:
This patch aims at improving the Toplevel, internal window and decoration
focus tracking.
In detail the goals are:
* Clean tracking of beneath and focus Toplevel as well as decoration and
internal windows. Splitting this up in well defined sub routines.
* Minimal find Toplevel operations on window stack.
* Reduce code duplication in pointer and touch child classes.
* Reuse tracking in drag operations.
* Allow direct usage of Wayland input interfaces for decoration and internal
windows in the future.
* Update touch focus on external events like VD switches correctly.
Test Plan: Manually and existing autotests.
Reviewers: #kwin
Subscribers: kwin, zzag
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D15595
Summary:
Some members were declared protected. Better style is to have them private
with public or protected getters and setters.
This also removes the unnecessary m_input variable.
Test Plan: Builds and runs.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D15519
Summary:
We lost information when using QMouseEvent::globalPos, since
it is integer. Use instead InputRedirection::globalPointer,
which is updated before the filters are processed and is
float.
Test Plan: Manually.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: anthonyfieroni, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D15502
Summary:
Compositing is suspended/finished in a very hard way fashion, effect
windows are destroyed without notifying effects about it.
AnimationEffect tries gracefully release deleted windows, but because
in some cases(like when suspending compositing) a deleted window can
be already destroyed, a segmentation fault can happen.
This change adjusts the order in which effect windows and effects are
destroyed, so AnimationEffect (and other effects) cannot access dangling
pointers.
BUG: 400788
FIXED-IN: 5.15.0
Reviewers: #kwin, graesslin
Reviewed By: #kwin, graesslin
Subscribers: graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17311
Summary:
When suspending compositing, SceneOpenGLShadow cannot cleanup cached
decoration shadow textures because the effects handler is already gone.
This sometimes can result in a crash when running kwin_x11 --replace
(we're hitting an assert statement).
To fix that, let's use the scene instead of the effects handler for
making the OpenGL context current.
Test Plan:
No longer hit the assert statement:
ASSERT: "m_cache.isEmpty()" in file /home/vlad/Workspace/KDE/src/kde/workspace/kwin/plugins/scenes/opengl/scene_opengl.cpp, line 2025
Application::crashHandler() called with signal 6; recent crashes: 1
QCoreApplication::applicationFilePath: Please instantiate the QApplication object first
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = kwin_x11 path = /home/vlad/Workspace/KDE/usr/bin pid = 5407
KCrash: Arguments: /home/vlad/Workspace/KDE/usr/bin/kwin_x11 --replace
Reviewers: #kwin, graesslin
Reviewed By: #kwin, graesslin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17306
Summary:
WaylandServer provides the initialization flag to disable lock screen
integration. This couldn't be used yet as there is no command line flag
for it. This change adds a new command line argument and hooks up the
functionality.
The no lock screen integration is useful for the embedded use case where
KWin is just used to render one application.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17279
Summary:
EffectsHandlerImpl::unloadAllEffects can be very useful when writing
tests, e.g.:
auto effectsImpl = qobect_cast<EffectsHandlerImpl *>(effects);
QVERIFY(effectsImpl);
effectsImpl->unloadAllEffects();
QVERIFY(effectsImpl->loadEffect(QStringLiteral("kwin5_effect_foobar")));
but because unloadAllEffects doesn't clean up effect_order, the old
effects can be re-added back into loaded_effects when a new effect is
loaded. Such behavior can result in a segfault.
Test Plan: Existing tests pass.
Reviewers: #kwin, graesslin
Reviewed By: #kwin, graesslin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17283
Summary:
For supporting Wayland windows in the kwin_rules_dialog we need a way to
pass a window id for Wayland windows to the dialog. This id needs to be
sent to the dbus interface to query window information just like the
interactive query. For Wayland windows we don't really have a window id
and it would require to also pass the windowing system to
kwin_rules_dialog and back through the dbus interface.
To not complicate things this change introduces a windowing system
independent id based on UUID. This could in future also be used
internally for areas where it's window id based and used in both
windowing systems.
Test Plan: Adjusted test cases to verify the uuid is generated and passed to Deleted
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16986
Summary:
Main reason for using QPainter was the fact that build.kde.org did not
support OpenGL back when the test got introduced. As we have vgem
support nowadays we can switch back to OpenGL.
Test Plan:
100% tests passed, 0 tests failed out of 130,
but the test is flaky with and without this change
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16940
Summary:
When running ctest in my session a few OpenGL/waylandonly tests crashed
on tear down. This does neither happen on build.kde.org nor when running
ctest in a tty. Comparing the env variables of tty and session pointed
to the session variables. Unsetting those makes the test not crash. This
makes sense as e.g. plasma-integration no longer gets loaded.
As our test suite is intended to test KWin and not plasma-integration or
gnome integration we should have a clean and reproducable environment,
so the variables are unset.
Test Plan: 100% tests passed, 0 tests failed out of 130
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16939
Summary:
When running the complete test suite the ScriptedEffectsTest::testShortcuts
registers the shortcut meta+shift+y. But GlobalShortcutsTest::testX11ClientShortcut
also tries to use this shortcut for a window shortcut which fails if it
is already registered. So when running the complete test suite it
depends on the order of execution whether the GlobalShortcutsTest passes
or not.
Test should be clean - also the globalshortcuts. As the config is read
from test directory anyway, we can delete the file prior to init of
kglobalaccel.
Test Plan: Run ctest, test did not fail anymore
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16932
Summary:
One of the things I dislike most about our virtual keyboard integration
is it's size. It's at least on my system covering too much vertical
space. Unfortuantely the keyboard API does not offer a way to control
the vertical space - one can only control the width. Thus it's also not
possible to just provide the keyboard in the optimal size.
This change tries to address the problem by adding a resize button. When
pressed one can dynamically decrease and increase the width of the
keyboard and thus also the height.
The button is added to the top/right corner. Ideally it would be added
to the symbol button row, but either I couldn't find the appropriate API
hooks or it's not possible.
Test Plan: Started KWin with the change and tested with touch input
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16485
Summary:
The idea of opening the compositing kcm was to show a warning. But that
broke quite some time ago without noticing. We had two ways:
* pass through --args command line argument
* use dbus call to already open kcm
Neither of the two ways is working. The kwincompositing doesn't parse
the arguments and the dbus interface doesn't exist any more.
Following the advice to remove functionality nobody noticed that it is
broken, this is removed with this change. This probably broke with
introducing the new KCM which happened IIRC for Plasma 5.0.
BUG: 393845
FIXED-IN: 5.14.0
Reviewers: #kwin, #plasma
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13235
Summary:
It crashes occasionally as the connection thread is still processing events
when the app is tearing down. These changes bring it in line with the
other tests using WAYLANDTEST_MAIN.
Test Plan:
Relevant test now passes.
Ran repeatedl without a crash
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17254
Summary:
EffectWindow proxies its properties from the client/deleted's
properties.
QObject::property(char*) is a slow string search. It's a loop
of string comparisons not a hash lookup!
QML's use of properties is different, there's a property cache.
It's fetched multiple times for every window in every paint of some
effects (such as blur). Hotspot shows this as a significant amount of
the render pass (X11) with nothing in kwin animating.
This patch replaces the macro that does
parent()->property("propertyName")
with a macro calling the relevant function directly without metaobjects.
This also improves type safety for future changes.
Test Plan:
Existing unit tests
Ran it for a bit
Reviewers: #kwin, graesslin
Subscribers: graesslin, zzag, broulik, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16602