Commit graph

15614 commits

Author SHA1 Message Date
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
Martin Flöser
ab7b6757bf Properly update the visible (icon) name when the caption changes
Summary:
It was possible that we performed an early exit when the caption changes
and this results in the visible name being wrong. E.g if we have two
windows called foo, the second one has the visible name "foo <2>". After
changing that to "bar" the bug resulted in it still being the foo
variant instead of getting cleared.

BUG: 384760
FIXED-IN: 5.11.0

Test Plan: Created new test case exposing the problem

Reviewers: #kwin, #plasma, hein

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7871
2017-09-23 11:50:48 +02:00
Martin Flöser
537b36d1cb Only try creating X11 shadow if we have an X11 connection
Summary:
Otherwise it crashes for the first window being created in a
KWin/Wayland without XWayland support.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7894
2017-09-23 11:49:01 +02:00
Martin Flöser
8aa7bb28c8 Drop useless XCB_DESTROY_NOTIFY from big event switch statement
Summary: It just returned false, but that's also the default handling.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7938
2017-09-22 17:20:55 +02:00
Martin Flöser
27d06a1d4c Fix position where removeEffectsOverrideCursor is called
Summary:
Should be when there is no more an effect which overrides the cursor,
not unconditionally.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7845
2017-09-22 15:21:18 +02:00
Martin Flöser
551a6246a8 Move XRenderUtils init/cleanup into X11 standalone platform
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
2017-09-22 15:20:55 +02:00
l10n daemon script
0a6bd71f0e 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-22 05:01:54 +02:00
Martin Flöser
e8664f83b9 Only call xcb_flush in performCompositing if we have an X11 connection
Summary: Otherwise KWin crashes when operating without XWayland support.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7892
2017-09-21 18:11:19 +02:00
Sebastian Kügler
d16f63b6e6 inform outputconfiguration clients that a change has been applied
Summary:
After changing the output configuration, the client expects that it is informed
whether or not a new configuration has been applied (or failed). This was ommitted
so far, meaning that clients wouldn't know what happened in kwin.

Since we don't track if a setting failed yet, send the applied() signal regardless.

CCBUG:384733

Test Plan: Verified that the signal arrived in libkscreen after changing scale of an output

Reviewers: graesslin, davidedmundson

Reviewed By: davidedmundson

Subscribers: kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7910
2017-09-21 16:15:53 +02:00
l10n daemon script
41e55956ad 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-21 04:56:35 +02:00
David Edmundson
e284febe24 Merge branch 'Plasma/5.11' 2017-09-20 17:48:29 +01:00
David Edmundson
1783fda30e Make sure OpenGL Context is valid before deleting shader
Summary:
Deleting the lanczos filter deletes it's GLShader, this calls
glDeleteProgram

glFooBar always needs to have an openGL context, we don't know we have
this on a screen changed event as it is called from outside the normal
render methods.

BUG: 384884

Test Plan:
Ran on my wayland session. Switched geometry a lot, couldn't reproduce the crash.
Ran on my desktop session, seemed the same as before

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

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

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D7888
2017-09-20 17:46:27 +01:00
l10n daemon script
8cf01bb021 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-20 10:25:04 +02:00
Martin Flöser
a17c85a9ea Support mapping QKeyEvent to xkb_keysym_t
Summary:
This is needed in virtual keyboard and also used KKeyServer so far. With
this change it is moved to new API provided in Xkb. The new translation
map is now also used for the direction from Qt::Key +
Qt::KeyboardModifier to xkb_keysym_t.

New implementation is supported by a new test case covering the same
combinations as in the existing direction.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7356
2017-09-19 19:09:17 +02:00
Jesse Pullinen
0eba3f3c18 Fix TouchEvent::id() returning -1, fixes a crash
Summary:
Libinput returns -1 when calling libinput_event_touch_get_slot on an event
from a single-touch touchscreen. The returned value is used in
DecorationEventFilter to determine the touch which is acting on it. The value -1
is used to signify that the decoration is not being acted on. Thus when
releasing the touch, it checks whether it was being dragged, and as it thinks
it isn't, it doesn't handle it and the decoration is still being dragged.
Clicking on the decoration then crashes kwin.

Test Plan: Move a window by dragging the decoration with a single-touch touchscreen.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: graesslin, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7854
2017-09-19 07:11:40 +03:00
l10n daemon script
a5e523caf0 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-19 05:08:17 +02:00
Martin Flöser
5256338772 [autotests] Force more tests to use evdev as XKB_DEFAULT_RULES
Should help fixing the tests on FreeBSD.
2017-09-18 21:05:34 +02:00
David Edmundson
d59f5997fd Merge branch 'Plasma/5.11' 2017-09-18 16:40:57 +01:00
David Edmundson
4238218b76 Don't scale cursor hotspot differently to cursor
Summary:
In the DRM plugin the cursor is currently is drawn at the native size
given.
Therefore we don't want to scale the icon offset as that leads to it
being drawn every so slightly off-sync.

BUG: 384769
Fixed-in: 5.11.0

Test Plan:
Kate now selects lines based on the middle of the cursor, not the top left.
I'd previously gotten so used to it, I hadn't realised it was actually a bug  :/

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7868
2017-09-18 16:40:21 +01:00
Martin Flöser
e55e437d86 [autotests] Force XKB_DEFAULT_RULES to evdev in ModifierOnlyShortcutsTest
This is an idea to fix the failing test on FreeBSD (see T6624). For
Linux this does not change anything.
2017-09-17 20:54:32 +02:00