Commit Graph

15840 Commits (8510f31340ac78d76df69a3bccb001f610613913)

Author SHA1 Message Date
David Edmundson 269ec5bbce Merge branch 'Plasma/5.11' 2017-10-04 10:13:37 +01:00
Hartmut Goebel 5e7b3c6c73 Fix: Missing dependencies for kwin autotests
guix (like nix) used a separate prefix for each package. Thus the header
files for
qtdeclarative are in /gnu/store/…-qtdeclarative-5.9.1/include/qt5/ while
the ones for
qtbase are in /gnu/store/…-base-5.9.1/include/qt5/. This means that
*each* dependency's include directory must be specified. This is in
contrast to a "normal" Unix-system, where all includes end up in
/usr/include/qt5 and missing to defined some include-dependencies does
often not raise an error.

Differential Revision: https://phabricator.kde.org/D8112
2017-10-04 10:12:06 +01:00
Martin Flöser c359fc076d [platforms/virtual] Always link SceneOpenGLBackend
Egl support is not optional in virtual platform, so always compile it in.

BUG: 385301
2017-10-03 19:19:35 +02:00
David Edmundson b2f1e538d5 Merge branch 'Plasma/5.11' 2017-10-02 09:14:43 +01:00
David Edmundson 7c538207f4 remove xdgv6 use from 5.11 branch 2017-10-02 08:49:37 +01:00
l10n daemon script e1e9f9cf72 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-10-02 05:07:43 +02:00
Martin Flöser f988a5f654 Reload VirtualDesktop settings after passing RootInfo on VirtualDesktopManager
Summary:
The load method and updateLayout ensure the virtual desktop information
is synced to RootInfo and thus to other X11 applications. Thus we need
to call it again when initing X11.

BUG: 385260

Test Plan: Not tested as I'm on Wayland, but given the changes it's obvious.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8086
2017-10-01 21:56:39 +02:00
Martin Flöser 371ad57abd Drop ifdef'ed debug code from layers.cpp
It's confusing to search for usages of ClientList::Iterator and then
discover it's all just commented out. Before falling another time over
it: let's remove it.
2017-10-01 21:52:56 +02:00
Martin Flöser 252980390d Merge branch 'Plasma/5.11' 2017-10-01 15:26:40 +02:00
Martin Flöser 0d96e60b79 Also send Wayland clients to a new desktop if their desktop was removed
Summary:
So far the method only operated on X11 clients. So when the last desktop
got removed Wayland clients were still on it. As the auto test showed:
this results in a crash.

Credits go to code coverage as it showed that area as red, which made me
look on it and realize this must be broken.

Test Plan: New test case added

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8082
2017-10-01 11:04:05 +02:00
Martin Flöser f31e183605 [libkwineffects] Try fixing compile error with clang
The FreeBSD build is currently failing with:

kwingltexture_p.h:83:23: error: no function named 'cleanupGL' with type
'void ()' was found in the specified scope
friend void KWin::cleanupGL();

This change hopefully addresses the problem.
2017-10-01 09:54:12 +02:00
Martin Flöser 793eecc826 Fix compile warnings after removing ObscurringWindows 2017-10-01 09:51:09 +02:00
Martin Flöser d75e5c63d4 Ensure Workspace is only started once in Wayland-only mode
The connect to Compositor::sceneCreated must be disconnected again,
otherwise a restart of the Compositor results in Workspace being created
again.

Thanks to our autotests for finding this problem!
2017-10-01 09:06:51 +02:00
l10n daemon script f0445b20e2 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-10-01 05:17:39 +02:00
Martin Flöser 2fb5a5fb9f [autotests] Support Wayland Only in addition to XWayland
The integrationTest function takes a new optional argument whether the
test supports a Wayland Only mode. If that's the case the test is
compiled twice, once (as always) as "foo" with XWayland support and
once as "foo_waylandonly" without XWayland support.

This way we can ensure that our code always supports both modes. The
tests found multiple issues. At the moment fast running tests are
sporadically crashing on tear down. This needs further investigation.
2017-09-30 16:35:52 +02:00
Martin Flöser 4c334098f3 Ensure internal Wayland connection is properly setup before creating LockScreen integration
With the new Wayland only mode we start too fast and it can happen that
the initWithWorkspace is called before the client connection is fully
setup. This would result in a crash in the idletime plugin once it tries
to create a seat.

To prevent this problem the code is split out into a dedicated method
and only invoked if all interfaces have been announced on the internal
connection.
2017-09-30 16:33:45 +02:00
Martin Flöser 3ce9a4a179 [tabbox] Guard Xcb::sync with whether we have an X11 connection
Otherwise crash on WaylandOnly once you Alt+Tab. Credits go to our
integration tests for finding this issue!
2017-09-30 16:29:42 +02:00
Martin Flöser a74f8766c3 Drop OperationModeX11AndWayland and introduce OperationModeWaylandOnly instead
The operation mode X11 and Wayland is no longer supported and probably
hasn't been supported for the last few years. But now there is the
possibility to run Wayland only, so introduce this as a dedicated new
OperationMode.
2017-09-30 15:09:06 +02:00
Martin Flöser 0c8c047d78 Don't crash on tear-down of Workspace if run without X11 support
Much easier than expected.
2017-09-30 13:31:14 +02:00
Martin Flöser 8ae37c420b Move SceneOpenGL into a dedicated plugin
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
2017-09-30 13:12:10 +02:00
Martin Flöser 343d8c9b62 Support starting kwin_wayland without XWayland support
Summary:
Just continues with the steps without starting XWayland.

This does not yet fully support kwin_wayland without X11, it currently
still crashes on teardown.

Test Plan: kwin_wayland --socket=wayland-1 kwrite (note the missing --xwayland)

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7924
2017-09-30 13:04:08 +02:00
Martin Flöser 5cbd28f9a0 Move X11 specific Workspace initialization code into dedicated method
Summary:
This is required to start KWin/Wayland without XWayland support or
delayed XWayland support.

Test Plan: Run kwin_x11 in a nested Xephyr

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7897
2017-09-30 13:03:52 +02:00
Martin Flöser ec7fe44190 Make xstacking order dirty handling work without X11
Summary:
The xStackingOrder unlike indicated by it's name is relevant for both
X11 and Wayland and contains the stacking order of the windows used for
compositing.

So far it was determined whether it needs to be recreated based on
whether an xcb query is pending. This change introduces a boolean
variable to check whether the stacking order is dirty and guards the X11
specific code to only be run if we have an X11 connection.

This is to my current knowledge the last remaining issue where X11 was
used during the normal Wayland operation mode. Now it should be possible
to re-order the Workspace startup [1] and try to run kwin_wayland without
Wayland support.

[1] Workspace::Workspace and Workspace::init is still highly X11
specific and needs to be split into X11 only and general parts.

Test Plan: Compiles

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7856
2017-09-30 12:59:20 +02:00
Martin Flöser f7d6e4affd [tabbox] Drop the passing to Effects in X11 Filter
Summary:
If an Effect has replaced the TabBox and wants to react on mouse events
the EffectsHandlerImpl also has an X11Filter, so we only need to make
sure the events go to that filter.

Motion: TabBox did not filter out, so events will go to the Effects
filter.
Press/Release: TabBox should not operate if Effects take the events.
The events are filtered out by Effects if there is a grab, so just
check for that and go out. Effects will take care.

Test Plan: Compiles

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7846
2017-09-30 12:58:45 +02:00
Martin Flöser 6f99b57736 Move XFixes cursor change tracking into the x11 standalone platform
Summary:
A dedicated X11EventFilter is added and created from the X11Cursor in
case we have XFixes. This means some more X11 specific code is now only
on X11.

Test Plan: Only compile tested.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7843
2017-09-30 12:58:17 +02:00
Martin Flöser cea7a189c8 Create a dedicated X11EventFilter for the events used by RootInfo
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
2017-09-30 12:57:21 +02:00
Martin Flöser d29d181e7c [platform/virtual] Prefer vgem device over render node
If the system has a virtual device and KWin is run on virtual platform
we can assume the user intended that KWin should use the virtual device
and not a render node of the system.

This might fix the random test failures on build.kde.org (T6546).
2017-09-29 21:20:12 +02:00
Martin Flöser 7c8003f7f6 Use real-time scheduling policy for kwin_wayland
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
2017-09-29 20:23:57 +02:00
David Edmundson 2a34fdde4c Merge branch 'Plasma/5.11' 2017-09-29 13:31:48 +01:00
David Edmundson b3020d6f5a Don't recreate kwayland blurmanager on screen size changes
Summary:
Instead of calling reconfigure() on screen size changes, which deletes
and recreates the effect, we can just update the one texture that's mapped to
the screen size.

---

From the wayland commit.

>What surprises me is that BlurManager recreates for Output changes.
>That sounds like a bug in KWin (or an area which could be improved).

I had thought the same and wrote this (though wanted to have kwayland fixed first)

Test Plan:
Logged in and out (my screen resizes on startup due to scaling)
Tested on my X machine by turning a screen off. Nothing broke, plasma
panels looked the same.

Note: Eike tried this patch last week and claimed kwin still crashed.
We don't have a backtrace so it could have been something unrelated,
applied wrong or that he was deliberately lying to wind me up.

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: graesslin, plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7877
2017-09-29 13:30:54 +01:00
David Edmundson 55d219429a Don't reload background contrast effect on screen resize
Summary:
Similar to the Blur patch. Arguably rven less reason as this doesn't
have a texture the size of the workspace.

We don't need to delete and recreate the entire effect every time the
screen changes; This deletes the wayland global which causes quite a bit
of extra work for the clients.

Test Plan:
Changed resolution under X, and scale under wayland
Panel looked the same and nothing exploded

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: graesslin, plasma-devel, kwin, #kwin

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D7937
2017-09-29 13:30:42 +01:00
Kai Uwe Broulik a7c396caeb [ScreenEdgeEffect] Create glow Svg on demand
Keeps it from loading the Svg and all the Plasma stuff (Theme etc) that comes with it on startup.

Differential Revision: https://phabricator.kde.org/D8011
2017-09-28 10:18:36 +02:00
Martin Flöser 38ce05eaff Drop the ObscurringWindow functionality on desktop switching
Summary:
The ObscurringWindows are a hack to make it more unlikely that the
desktop wallpaper becomes visible while switching desktops. This was
introduced in 2001 with SVN revision 90111
(git d194f74314).

In 2001 desktop switching was probably a costly action where it was not
possible to just reorder the desktop in one frame. Nowadays we use
mostly compositing and with compositing the ObscurringWindows are
already disabled. But even in the case that no compositing is used I
consider it as very unlikely that the desktop becomes visible during the
switching. Given that I think it's time to remove this legacy solution.

Test Plan: Compiles

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7965
2017-09-27 17:17:03 +02:00
l10n daemon script 475af42e37 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-09-27 09:13:10 +02:00
Martin Flöser b437a6cbda Merge branch 'Plasma/5.11' 2017-09-26 21:09:38 +02:00
Martin Flöser bc88f84777 [tabbox] Create X11Filter on establishKeyboardGrab
Summary:
Creating the X11Filter directly on startup caused a regression as the
filter got too early in the chain and stole events from the
XInputIntegrationFilter. We don't need the filter all the time, but only
when we have established the TabBox grab. Likewise we can destroy the
filter again when releasing the TabBox grab. So it's much more
encapsulated now.

BUG: 385032

Test Plan: Only compile tested, I'm on Wayland

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7997
2017-09-26 20:44:00 +02:00
Martin Flöser cd97c049b5 Fix regression concerning popup handling for wl_shell_surface
Regression introduced due to making popup a member variable and this
is not ready in the init method. So connect to the rescue.

Fixes failing PointerInputTest.
2017-09-25 21:10:41 +02:00
Martin Flöser a264c2b5cf Change default argument of grabXKeyboard to XCB_WINDOW_NONE
Summary:
The implementation of grabXKeyboard checks whether the passed in arg
is XCB_WINDOW_NONE and sets the arg to rootWindow. Thus we don't need
to have rootWindow as the default argument, but can have none as the
default arg.

Test Plan: Compiles, test which uses the default arg still passes

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7857
2017-09-25 20:37:56 +02:00
Martin Flöser 0ed609590b Add a dedicated X11EventFilter for forwarding property events to the effect system
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
2017-09-25 20:36:45 +02:00
David Edmundson e492f9e298 XdgV6 - Kwin side
Summary:
Adds XDGV6 support for the kwin side.

Popup placement support is limited to the stuff v5 had,
a simple offset, rather than the awesome new positioner.

But Qt doesn't make use of it yet either.
Also ideally we should do all the positioning before sending the first
configure, but again Qt doesn't actually do anything with that anyway.

Also integrate pinging clients

Test Plan: gtk3-demo  works nicely.

Reviewers: #plasma, graesslin, mart

Reviewed By: #plasma, graesslin

Subscribers: mart, graesslin, kwin, plasma-devel, #kwin

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D6591
2017-09-25 16:47:30 +01:00
David Edmundson 9b69dab638 Merge branch 'Plasma/5.11' 2017-09-24 17:14:27 +01:00
David Edmundson bc92745f07 Restore cursors across multiple screens
Summary:
4238218b76 accidentally removed factoring
in m_globalPos.

BUG: 385003

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7970
2017-09-24 17:11:12 +01:00
Martin Flöser 8f0f84d2b3 [autotests] Try to detect whether distro calls cursor theme DMZ-White or Vanilla-DMZ
Some distributions (e.g. Arch, FreeBSD) call the DMZ-White cursor theme
Vanilla-DMZ. Due to that our tests are failing even if the correct theme
is installed (see also T6623). This change tries to detect whether
DMZ-White is installed by looking into the GenericDataLocation. If not
found we set to Vanilla-DMZ. No guarantee that the check works for all
setups, but it's only tests...
2017-09-24 14:53:55 +02:00
Martin Flöser 42fd77b836 Drop unused method Workspace::waitForCompositingSetup
Seems to have been used in old compositing kcm, documented as DBus API.
But Workspace doesn't expose a DBus interface anymore and our new DBus
interface does not call this method -> it is dead.
2017-09-24 10:28:47 +02:00
Martin Flöser 4cef894e87 Drop delegating Workspace::slotToggleCompositing
Instead connect global shortcut directly to method in Compositor.
2017-09-24 10:15:13 +02:00
Martin Flöser 9b1827803f Drop delegating Workspace::slotInvertScreen
Instead directly connect global shortcut to the method in Platform.
2017-09-24 10:10:52 +02:00
Martin Flöser e6ca321317 Drop ENABLE_TRANSIENCY_CHECK related code as it doesn't compile
Summary:
The code ifdefed by ENABLE_TRANSIENCY_CHECK does no longer compile and
has not compiled since the switch to Qt 5 and KF5 as it still uses
kDebug and (worse) kDBacktrace. There are several other changes which
broke the code and I failed trying to get it to compile again. It's a
classic example of bitrot happening to code which is never getting
compiled.

As this has not been in a state which could compile for at least several
years, I think it's best to completely remove it.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7958
2017-09-24 08:17:30 +02:00
Martin Flöser 9ce651fc30 Drop unused functions from utils
Summary: Not used anywhere in KWin -> can go.

Test Plan: Still compiles

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7956
2017-09-23 21:15:00 +02:00
Martin Flöser e74eacd279 [autotests] Try making StartTest more robust on FreeBSD
Use QTRY_COMPARE instead of QCOMPARE to wait longer.
2017-09-23 15:17:19 +02:00
Martin Flöser af20f1aa35 Merge branch 'Plasma/5.11' 2017-09-23 11:51:24 +02:00