Commit Graph

436 Commits (730fd05f58f9bc71fa044aee5e22139b2e6bbded)

Author SHA1 Message Date
Martin Gräßlin 3041b871ea [libkwineffects] Delete EffectsHandler::deleteRootProperty
Summary:
The method is not used by any Effect and is X11 specific, thus better
remove it for good.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3298
2016-11-16 07:46:27 +01:00
Martin Gräßlin c0b2e5dc8b VirtualDesktopGrid operates on VirtualDesktop objects
Summary:
The VirtualDesktopGrid is ported to the new VirtualDesktop objects. The
grid consists now of QVector<VirtualDesktop*> rows and a QVector of
those rows.

This change requires to adjust the code using the VirtualDesktopGrid.
This mostly affects VirtualDesktopManger. The methods for toLeft, above,
next, etc are now all operating on VirtualDesktop with the uint variants
- if still present - only delegating to the new method. The Functor
objects are also adjusted, though mostly still providing the old API for
compatibility.

In KWin core only one now ambiguous call is adjusted (useractions) and
the desktop grid usage in EffectsHandlerImpl is adjusted. Other usages
are not yet adjusted and need porting to fully get rid of the old
uint-based API.

Test Plan: VD test still passes

Reviewers: #kwin, #plasma_on_wayland, hein

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3327
2016-11-15 07:20:23 +01:00
Martin Gräßlin 002d667436 Merge branch 'Plasma/5.8' 2016-11-07 13:46:13 +01:00
Martin Gräßlin de89176cd2 [libinput] Load/store device configuration
Summary:
Device gets a KConfigGroup injected and supports loading device-specific
settings. This is invoked from Libinput::Connection when adding a new
Device.

Whenever a Device option is changed successfully through the DBus
interface it gets synced into the KConfigGroup, thus on next loading of
the Device it gets restored.

The config group follows a pattern of:
[libinput][vendor][product][name]

Thus every device has a specific and persistent configuration.

Test Plan: So far only tested through autotests

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3264
2016-11-07 13:45:48 +01:00
Martin Gräßlin fb69b791a1 Ensure that all Effects honour the grab roles correctly
Summary:
When windows get added some effects grab the window and want to be the
only one animating this window. For this the grab roles exists. An
effect being notified later on evaluates the grab state and does not
start the animation.

This process failed due to being dependent on the order the effects are
loaded. Window Added/Closed are signals emitted by EffectsHandler, thus
first come, first serve. The requested effect order does not play into
it.

Due to that it could happen that an Effect which should not animate,
started to animate as the grab was still there.

This change adds the possibility to be notified whenever the window data
changes. A new signal is added to EffectsHandler which is emitted
whenever the windowData changes. The interested effects connect to it
and cancel their (just started) animation for the window.

Adjusted effects are:
* ScaleIn
* Fade
* WobblyWindows

In case of WobblyWindows an additional logical error was fixed that the
animations were only run when an effect grabbed instead of the other way
around.

BUG: 336866
FIXED-IN: 5.8.4

Reviewers: #kwin, #plasma, broulik

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3211
2016-11-07 11:45:09 +01:00
Martin Gräßlin d9612b327c Merge branch 'Plasma/5.8' 2016-11-07 11:41:30 +01:00
Martin Gräßlin ee7da425ce Unpolish QStyle on QApp prior to destroying internal Wayland connection
Summary:
The QStyle might interact with our internal Wayland connection. If the
cleanup happens after destroying our internal Wayland connection KWin
will crash at tear-down.

With this change the QStyle can perform cleanup already prior to the
deconstruction of the Wayland connection.

CCBUG: 372001

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3241
2016-11-07 11:28:06 +01:00
Martin Gräßlin 2a15592571 Simplify the window title passed in from the window system
Summary:
So far KWin used the window title provided from the window directly
without any sanitizing. This could result in broken window decorations
if the title included line breaks. Those were passed to the decoration
and depending on the way how the decoration renders the title, it could
result in visual breakage.

Having line breaks in a window title doesn't make sense. Given that KWin
now simplifies the title when copying it to it's own structure. This
also ensures that the title passed to e.g. task manager does not have
any line breaks on Wayland.

BUG: 323798
FIXED-IN: 5.8.4

Test Plan: Opened the web page in a nested KWin, properly rendered now.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3215
2016-11-07 11:26:48 +01:00
Martin Gräßlin f17d06ee7d Merge branch 'Plasma/5.8' 2016-11-04 10:03:10 +01:00
Martin Gräßlin db58c421eb Internal windows cannot be minimized
Summary:
This change ensures that the DebugConsole does not have a minimize
button.

BUG: 372000
FIXED-IN: 5.8.4

Reviewers: #kwin, #plasma_on_wayland, broulik

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3244
2016-11-04 08:59:43 +01:00
Martin Gräßlin fb4b0c40ef [autotests/libinput] Extend the Device test
Added tests for new functionality:
* scroll enabled by default properties
* scroll supported properties
* scroll on button down
2016-11-04 08:58:09 +01:00
Martin Gräßlin f1d17c1a56 [autotests/libinput] Extend device test for scrol methods
Covers the variants for scroll method.
2016-11-03 17:51:32 +01:00
Martin Gräßlin e9dfdbe6a8 [autotests/libinput] Extend Device test case
Tests the new functionality for:
* natural scroll
* middle emulation
2016-11-03 17:22:31 +01:00
David Strobach e4283543f6 [libinput] Add scroll method configuration support
Wraps libinput
libinput_device_config_scroll_get_methods
libinput_device_config_scroll_get_default_method
libinput_device_config_scroll_set_method
libinput_device_config_scroll_get_method
libinput_device_config_scroll_set_button
libinput_device_config_scroll_get_button
libinput_device_config_scroll_get_default_button

Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3194
BUG: 371803
FIXED-IN: 5.8.4
2016-11-03 14:03:17 +01:00
David Strobach b19341777a [libinput] Add natural scrolling support
Wraps libinput
libinput_device_config_has_natural_scroll
libinput_device_config_set_natural_scroll_enabled
libinput_device_config_get_natural_scroll_enabled
libinput_device_config_scroll_get_default_natural_scroll_enabled

Differential Revision: https://phabricator.kde.org/D3193
BUG: 371791
FIXED-IN: 5.8.4
2016-11-03 14:02:27 +01:00
David Strobach e00649d002 [libinput] Add middle mouse button emulation support
Wraps libinput
libinput_device_config_middle_emulation_is_available
libinput_device_config_middle_emulation_set_enabled
libinput_device_config_middle_emulation_get_enabled
libinput_device_config_middle_emulation_get_default_enabled

Differential Revision: https://phabricator.kde.org/D3187
BUG: 371756
FIXED-IN: 5.8.4
2016-11-03 14:00:03 +01:00
Martin Gräßlin 14b6ecf499 [autotests] Remove expected fail from snap to auto-hide Wayland
Same as on X11, it's fixed now.
2016-11-03 08:56:59 +01:00
Martin Gräßlin d1076fc5b9 Merge branch 'Plasma/5.8' 2016-11-03 08:51:49 +01:00
Martin Gräßlin 679e417808 Don't snap to auto-hidden panels
Summary:
When moving windows we don't want to snap against not visible windows
like auto-hidden panels.

BUG: 365892
FIXED-IN: 5.8.4

Test Plan: So far only auto-test, manual test will follow.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3225
2016-11-03 08:35:25 +01:00
Martin Gräßlin 33b583a419 [autotest] Test case for snap to Wayland auto-hiding panel
Like 3a179f32af but for a Wayland panel.
Added in master as auto-hide is new in master.

CCBUG: 365892
2016-11-02 11:51:01 +01:00
Martin Gräßlin 72b8653f4e Merge branch 'Plasma/5.8' 2016-11-02 11:49:46 +01:00
Martin Gräßlin 3a179f32af [autotests] Add test case for snap to auto-hiding panel
Workspace::adjustClientPosition incorrectly snaps against an auto hidden
panel as the test shows.

CCBUG: 365892
2016-11-02 11:28:54 +01:00
Martin Gräßlin 55a0afca97 [autotest] Add test case for window caption need to be simplified
The test illustrates that special characters like a line break are not
removed from the window caption, which results in a line break added in
the window decoration.

Test case uses a title from a web page triggering it in Firefox.

CCBUG: 323798
2016-10-31 15:54:16 +01:00
Martin Gräßlin 32306ec117 [autotests] Try fixing TestShellClient::testDesktopFileName on CI
It didn't find the icons, so let's try with specifying the breeze icon
theme.
2016-10-31 14:16:23 +01:00
Martin Gräßlin b7bd5f9a09 Add support for desktopFileName provided by NETWinInfo
Summary:
KWindowSystem provides a KDE specific property for the desktop file
name. This allows KWin to take the icon from the desktop file. The
advantage from the desktop file is that KWin normally gets higher
resolution icons than provided through the xproperty based icons used
previously. If the desktop file does not provide an icon name, KWin
falls back to the previous implementation.

As on Wayland the icon is taken from the desktop file name already the
code for X11 and Wayland is merged in AbstractClient. Also to the
PlasmaWindowInterface the appId is taken from the new desktop file
instead of the resourceName. Due to that for Xwayland windows where KWin
knows the desktop file name it can be passed to PlasmaWindowInterface.
This allows e.g. the task manager to better map the windows to
applications and provide better icons. Also it means that icons do not
need to be passed as bitmap data to the clients.

Test Plan:
Verified that icon is taking from desktop file if provided and
from X property if not provided and that Wayland windows still have icon.

Reviewers: #kwin, #plasma_on_wayland, hein

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3177
2016-10-31 13:19:46 +01:00
Martin Gräßlin 13f142b1bf Merge branch 'Plasma/5.8' 2016-10-31 11:52:43 +01:00
Martin Gräßlin 82054a406a Send a pointer leave when triggering a move resize
Summary:
When triggering a move resize all following pointer events are grabbed
by KWin itself. Thus the correct behavior is to informe the client about
it and send a pointer leave.

This ensures that after the move resize ended the pointer gets a new
enter. By sending anew pointer enter the position gets updated to the
new position which so far did not happen and the client generated events
on the wrong position.

BUG: 371573
FIXED-IN: 5.8.3

Reviewers: #kwin, #plasma_on_wayland, broulik

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3154
2016-10-31 11:51:15 +01:00
Martin Gräßlin bedc01b108 [kwineffects] Add hide/show cursor to EffectsHandler
Summary:
The implementation delegates to the Platform to perform the actual
show/hide of the cursor image.

This replaces the implementation in the zoom effect which so far
directly interacted with xfixes to show/hide the cursor. This is now
provided by the x11/standalone platform. And due to this change the zoom
effect can now properly hide the cursor on platform DRM (wayland) as
well.

Test Plan: Zoom effect on Wayland hides the cursor

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3120
2016-10-31 11:47:20 +01:00
Martin Gräßlin e90e596864 Add way to hide/show cursor in Platform
Summary:
Some platforms support to hide and show the cursor. This will be needed
by e.g. the zoom effect which currently only provides this functionality
on X11.

This change introduces a new method in the Platform to hide and show the
cursor. The methods need to be called balanced and the implementation
takes care of only showing again if all hide got matched by a show.

The actual hiding and showing is performed in the platform plugins. So
far the DRM and X11/Standalone platforms implement the required
functionality, though other platforms probably could implement as well.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3119
2016-10-31 11:46:50 +01:00
Martin Gräßlin e4930c0c41 [autotest] Make SlidingPopupsTest a little bit more robust
The first test case was sometimes failing due to the time value in the
first render pass being too high. So that the effect ended directly for
the window.

This change adds a small waiting time for the compositor to render prior
to the creation of the window. Ideally we would connect to frameRendered
signal, but the OpenGL compositor doesn't emit it yet.
2016-10-31 08:55:54 +01:00
Martin Gräßlin 3aeb7367bb [autotests] Extend SlidingPopupTests for Wayland windows
Same test case as for X11 windows added for Wayland windows.
2016-10-31 08:43:35 +01:00
Martin Gräßlin b84fd50319 [autotests] Extend SlidingPopupsTest::testWithOtherEffect
Test more combinations of other effects together with sliding popups.
The problem does not only exist for scale in but for pretty much any
effect that the ordering in which the effects get loaded makes the test
pass or fail.

Some effects require OpenGL, as build.kde.org does not support OpenGL
compositing (yet), the tests only do the OpenGL cases if an OpenGL
compositor could be created.

CCBUG: 336866
2016-10-31 07:48:59 +01:00
Martin Gräßlin 42e7ffa263 [autotests/effect] Add test case for Sliding Popups effect
The test case loads the sliding popups effect and the scale in effect
which also operates on added windows. As the test case shows depending
on the sequence how the effects are loaded, the window gets animated by
both effects (wrong) oor only sliding popups.

CCBUG: 336866
2016-10-30 11:27:38 +01:00
Martin Gräßlin 54ca4a9b55 Merge branch 'Plasma/5.8' 2016-10-28 16:43:04 +02:00
Martin Gräßlin 94c5704af7 [effects/translucency] Cancel existing animations before starting new
Summary:
It can happen that startAnimation is invoked multiple times for a
window. In case it was invoked a second time the previous animation was
not cancelled. This resulted in the set-animation to never end. When
closing a window, it would stay around as a translucent, non-interactive
window zombie.

This change ensures that existing animations get cancelled.

BUG: 342716
FIXED-IN: 5.8.3

Test Plan: Tested through autotest and manually.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3190
2016-10-28 16:24:49 +02:00
Martin Gräßlin eb88762e07 [autotests] Add test case for translucency effect of dialog window
This test case simulates a condition of the translucency effect
modifying windows of certain types (e.g. dialogs).

In case the effect got activated for a window it does not end after the
window gets closed and creates a non-interactive zombie window.

CCBUG: 342716
2016-10-28 14:37:10 +02:00
Martin Gräßlin ea52ef9e57 Add a PlatformCursorImage to Platform and EffectsHandler
Summary:
There are several effects (screenshot, zoom) which need access to the
cursor image and cursor hotspot. So far these effects used X11
unconditionally to get the cursor which obviously does not work on
Wayland.

This change adds a new class PlatformCursorImage to kwinglobals which
wraps what a cursor is (image and hotspot) and adds a new virtual method
to Platform to provide such a PlatformCursorImage. By default it's the
cursor image the Platform tracks. On X11/standalone platform this new
virtual method is overriden and provides a PlatformCursorImage from X11
using the code previously used in screenshot effect.

Screenshot effect and zoom are adjusted to use the new API instead of
X11.

Test Plan:
Zoom effect tested on Wayland, now gets the proper cursor icon.
X11 functionality not yet tested.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3093
2016-10-20 07:51:49 +02:00
Martin Gräßlin 03d706150a Support docks which take input
Summary:
On X11 one needs to force activate a panel to pass it focus. This change
implements something similar for Wayland but a little bit more stateful
by using a request on the PlasmaShellSurface. If set KWin will activate
the panel.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3037
2016-10-18 08:18:46 +02:00
Martin Gräßlin 359224a5dc Pass the current output geometry to ScreenPaintData
Summary:
On Wayland per output rendering is performed and paintScreen is invoked
for every output. Some effects need the information which output is
currently being rendered as otherwise e.g. FBO access could fail.

This change adds the current output geometry to ScreenPaintData. On X11
(all outputs one geometry) this information is not set and a null rect
is returned. That way the effects can also easily check which rendering
mode is used.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3058
2016-10-17 09:02:30 +02:00
Martin Gräßlin 9eede1c66b Merge branch 'Plasma/5.8' 2016-10-17 08:59:35 +02:00
Martin Gräßlin 78a2732a9a Fix shortcut triggering with shift+letter
Summary:
A shortcut with e.g. shift+w could not be triggered as shift is
considered as consumed. It transforms the keysym to an uppercase variant
thus it is consumed.

This change checks for the condition that shift is pressed and is the
only consumed modifier. If the current keysym is a letter the shift is
removed from the consumed modifier again to still support the shortcut.

BUG: 370341
FIXED-IN: 5.8.2

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3015
2016-10-17 08:13:20 +02:00
Martin Gräßlin cc2f4e3240 Support for relative pointer motion events
Summary:
If KWin interacts with Libinput the RelativePointerManager interface
gets created on the Wayland server. The ForwardInputEventFilter does
forward the relative motion events in addition to the normal motion
events.

In order to properly support the relative motion events as they are
expected by the Wayland protocol the handling of pointer motion events
got slightly adjusted:
* Libinput Pointer event extended by the additional data points
* Libinput Pointer event carries the delta as a QSizeF instead of
QPointF
* PointerInputRedirection adjusted to take a pointer motion event with
more arguments
* Custom QMouseEvent subclass adjusted to carry the additional members

The DebugConsole is adjusted to show the relative motion events in
addition to the global position.

Test Plan:
Verified the manager object is created and verified the
events in DebugConsole. Unfortunately not aware of any test application.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2979
2016-10-12 11:26:46 +02:00
Bhushan Shah 7843974a8a [wayland] Support for hideClient in ShellClient
Summary:
This implements the hideClient for ShellClient which was previously
not implmented. Also autotest for same is added.

Test Plan: ran autotest

Reviewers: graesslin, #plasma

Reviewed By: graesslin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3022
2016-10-11 20:01:49 +05:30
Martin Gräßlin e8d6008726 Test case for global shortcut Meta+Shift+w
The global shortcut meta+shift+w does not trigger as the test case
shows.

CCBUG: 370341
2016-10-11 09:26:37 +02:00
David Edmundson b32cdc5653 Add method unregisterScreenEdge to scripting
Test Plan: Used in a script. Works.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D2261
2016-10-07 13:29:29 +01:00
Martin Gräßlin 196ac5eb38 Merge branch 'Plasma/5.8' 2016-10-06 13:29:46 +02:00
Martin Gräßlin db2ff13d4f Only trigger mod-only-shortcuts if global shortcuts are enabled
Summary:
KWin supports blocking global shortcuts when a window is active through
window specific rules. This change ensures that the modifier only
shortcuts also honor the blocking of global shortcuts. If global
shortcuts are disabled, they won't trigger any more.

BUG: 370146
FIXED-IN: 5.8.1

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D2952
2016-10-06 13:28:31 +02:00
Martin Gräßlin 421824b654 Workaround xkbcommon behavior concerning consumed modifiers
Summary:
If a key could be turned into a keysym with a modifier xkbcommon
considers the modifier as consumed even if not pressed.
E.g. Alt+F3 considers alt as consumed as there is a keysym gnerated with
Ctrl+Alt+F3 (vt switching).

This change tries to workaround the problem by ignoring the consumed
modifiers if there are more modifiers consumed than active. It's
possible that this will create regressions for other shortcuts - we need
to test it in the wild. Although this might cause regressions I'm aiming
for Plasma/5.8 branch with the change. It only affects Wayland and fixes
quite important shortcuts from window manager perspective (desktop
switching (ctrl+f1 to ctrl+f4), desktop grid (ctrl+f8), present windows
(ctrl+f9, ctrl+10), cube (ctrl+f11), user actions (alt+f3), close window
(alt+f4)). If it causes regressions they need to be fixed as well in the
Plasma/5.8 branch.

A new API entry point for xkbcommon was proposed, but is not yet merged
and there is no release with it yet. Once that is available the
workaround should get removed and replaced by the new API call.

BUG: 368989
FIXED-IN: 5.8.1

Test Plan: Going to restart session now with the change

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2945
2016-10-06 13:28:02 +02:00
Martin Gräßlin 3bc6089394 Only repeat one key
Summary:
So far KWin tried to repeat all pressed keys which should repeat. But
this is not how X11 and e.g. QtWayland handle it. There only one key -
the last one which got pressed - repeats. And this makes sense as the
key is used to generate a keysym and that one KWin caches. Thus the
logic so far resulted in incorrect keysyms to be generated during the
repeat. E.g. pressing a, pressing b, releasing b would repeat b instead
of the hold a as b was the last generated keysym.

This change addresses this problem and let's only one key repeat at a
time. When the currently repeating key gets released the repeat timer is
stopped and other hold keys won't repeat any more. This also matches the
behavior of X11 and QtWayland.

BUG: 369091
FIXED-IN: 5.8.1

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2941
2016-10-06 13:26:45 +02:00
Martin Gräßlin 26ad65b1e9 Test case for mod only shortcut with global shortcuts disabled
KWin supports disabling global shortcuts while a specific window is
active through window rules. This blocks global shortcuts but does not
block the modifier-only-shortcuts as the new test case shows.

CCBUG: 370146
2016-10-06 07:36:12 +02:00