Commit graph

14813 commits

Author SHA1 Message Date
Jonathan Riddell
5216afadc8 Update version number for 5.8.90
GIT_SILENT
2016-09-15 13:16:39 +01:00
Sebastian Kügler
1d37b92d85 parent qaction in test
Summary:
My compiler doesn't seem to like this constructor, it bails out with the
following error:

/home/sebas/kf5/src/kde/workspace/kwin/autotests/integration/globalshortcuts_test.cpp:
In member function ‘void GlobalShortcutsTest::testConsumedShift()’:
/home/sebas/kf5/src/kde/workspace/kwin/autotests/integration/globalshortcuts_test.cpp:79:40:
error: no matching function for call to ‘QAction::QAction()’
     QScopedPointer<QAction> action(new QAction);
                                        ^~~~~~~

Using this as first argument fixes the build on my machine.

Test Plan: screenedges test fails, others pass. (this screenedges test failure seems unrelated)

Reviewers: graesslin

Reviewed By: graesslin

Subscribers: luebking, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D2782
2016-09-15 13:59:39 +02:00
l10n daemon script
38a5933249 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"
2016-09-15 09:48:16 +00:00
Jonathan Riddell
1cb2bd99a0 Update version number for 5.7.95
GIT_SILENT
2016-09-15 10:14:54 +01:00
Martin Gräßlin
7dfe408506 Pass Qt::Key to GlobalShortcutsManager::processKey
So far this method translated the keysym to Qt::Key. This is no longer
needed as the only method which invokes processKey has access to the
translated key. Thus saving one translation for every key press.

Reviewed-By: bshah
2016-09-15 09:02:38 +02:00
Martin Gräßlin
8fdcc24b05 Better handling for forwarding key events to Wayland Server
A new protected method is added to InputEventFilter to forward a
QKeyEvent to the Wayland server. Several input filters need to forward
the event to have a proper state of the events. E.g. the TabBox filter,
but also the internal window filter and effects filter. It's important
to update all events even if the events are not forwarded to a surface.

This new method takes care of the general handling like ignoring key
repeats, etc.

Reviewed-By: bshah
2016-09-15 08:47:01 +02:00
Martin Gräßlin
c70df62ce5 Pass all key events during Alt+Tab to the Wayland Seat
When Alt+(Shift)+Tab is grabbed we have the modifier press key being
passed to the Wayland server as key events are not yet grabbed. As KWin
grabbed the release event the Wayland server considered the key still as
pressed when going into the next application.

This change ensures that all events are also passed to the wayland
server. As no surface has focus we can be sure that it won't be passed
to the application, but it ensures that the events are processed
correctly.

Reviewed-By: bshah
2016-09-15 08:31:05 +02:00
Martin Gräßlin
cd053bf864 Require frameworks 5.26 2016-09-14 15:08:44 +02:00
Martin Gräßlin
e1bcda92a2 [autotests/integration] Test case for window larger than screen
If a window gets opened which will be too large with decorations it
should get a configure event with a smaller size. This currently
doesn't happen as the test highlights.

CCBUG: 366632
2016-09-14 14:08:47 +02:00
Martin Gräßlin
c71b002b24 [wayland] Fix release of TabBox on Wayland
Summary:
The interaction is changed to trigger the check for release from the
TabBoxInputFilter instead of reacting on modifier changes. That way
it's possible to check for the relevant modifiers getting released
instead of getting all modifiers in. Also this means that the checks
are only performed when relevant.

BUG: 368590

Reviewers: #kwin, #plasma_on_wayland, bshah

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2773
2016-09-14 13:26:58 +02:00
l10n daemon script
b56a28e19c 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"
2016-09-14 09:23:44 +00:00
Martin Gräßlin
ded90756fb Fix interaction between decoration and fullscreen ShellClient
Summary:
A fullscreen ShellClient still had a decoration which was caused by
a combination of several bugs:
* when going to/from fullscreen the decoration was not update
* noBorder did not return true for a fullscreen window
* wl_shell emits fullscreen changed and maximized changed

Comparing to X11 Client both is done. So ShellClient needs to do the
same. This ensures that the correct geometry is requested when going
to fullscreen.

BUG: 366764

Reviewers: #kwin, #plasma_on_wayland, bshah

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2751
2016-09-14 10:53:12 +02:00
Martin Gräßlin
d910217bb9 [effects] Repaint expandedGeometry in HighlightWindowsEffect
Summary:
The highlight windows effect tried to trigger repaints with the shadow
included by having an hardcoded pixel offset. This of course breaks if
the shadow is larger than the hardcoded value.

The reason presented on why it was done like that is no longer true and
in the effects the actual visible area including decorations and shadows
is available through the expandedGeometry.

BUG: 368495

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D2748
2016-09-14 10:44:07 +02:00
Martin Gräßlin
4235871667 Remove not-wanted modifiers prior to evaluating global shortcuts
Summary:
When triggering global shortcuts we are more interested in the hold
keys than the currently active modifiers. E.g. capslock should not
be seen as "shift is hold". Similar we need to remove consumed
modifiers. Shift+5 is % and not Shift+% - the shift modifier is
consumed and needs to be removed from shortcut evaluation.

To support this we need to have the actual state directly from
xkbcommon. Thus a new method is added which exposes the modifiers
relevant for global shortcut matching. In addition on every key press
all consumed modifiers are calculated and kept so that they can be
used for shortcut matching.

In addition a workaround is added for Backtab. Similar workaround
exists in kglobalaccel for X11. The problem is that our shortcuts are
stored incorrectly: Shift+Tab instead of Backtab. Thus a mapping back
is required. To make everything worse KWin registers the wrong key
sequence "Alt+Shift+Backtab" which doesn't make any sense and is
broken on X11 at least.

The workaround supports both special cases. The one for Backtab should
be turned into Shift+Tab and also KWin's special case of adding shift
to backtab.

CCBUG: 368581

Reviewers: #kwin, #plasma_on_wayland, bshah

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2768
2016-09-14 10:25:13 +02:00
Martin Gräßlin
64126a9717 Fix updating layer when setting a ShellClient to fullscreen
Summary:
The call to update the layer was performed before adjusting to
fullscreen. Thus the layer didn't get updated at all as it still
evaluated to "not fullscreen".

Reviewers: #kwin, #plasma_on_wayland, bshah

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2758
2016-09-14 10:24:46 +02:00
Martin Gräßlin
0bb1f2e7bf Make WindowPixmap::isValid virtual and override in concrete implementation
Summary:
If a buffer gets destroyed the texture created from it is still valid.
In such a situation the OpenGLWindowPixmap should return true for isValid
and not false as it did. Similar in QPainter compositor the pixmap is
valid if there is an image copied from the buffer.

This change ensures that for example minimizing an XWayland window
still has a texture during the minimize animation.

BUG: 368440

Test Plan:
Minimize animation plays for X windows and minimized windows
are shown in present windows.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2724
2016-09-14 10:23:35 +02:00
Martin Gräßlin
cdcee88b48 [autotests/integration] Add a global shortcuts test
New test case to verify that global shortcut triggering works correctly.
First test case is to verify that consumed modifiers do not break the
shortcut. E.g. a shortcut registered for % should trigger on Shift+5 on
us layout. For that the modifier needs to be consumed, otherwise it's
Shift+% and doesn't trigger. As the test shows this is currently the
case.
2016-09-14 09:13:36 +02:00
Martin Gräßlin
bf7c670444 [autotests] Wrap integration tests in dbus-session-run
Each test needs a dedicated dbus session as the test needs to register
services (e.g. kglobalaccel) and might fail if that cannot be registered.

Due to the wrapping in another command the test need to make sure that
any process they start terminates before them. E.g. the activities test
must stop kactivitymanagerd in cleanupTestCase, otherwise the test times
out.
2016-09-14 07:59:14 +02:00
Martin Gräßlin
a69300f762 [autotests/integration] Test basic working of Alt+Tab and Alt+Shift+Tab
Dedicated test methods for Alt+Tab and Alt+Shift+Tab. Both open three
windows and simulate one press with opening the TabBox. Alt+Tab should
move to the previous window in the chain, Alt+Shift+tab to the last
window in the chain.
2016-09-13 16:11:58 +02:00
Martin Gräßlin
e8e6e31a87 [kcmkwin/compositing] Hide config options which don't make sense if Compositing is required
Summary:
On Wayland compositing is required. It doesn't make any sense to offer
the user to disable the compositor or to allow windows to block
compositing.

The Compositor DBus interface gains a new property whether the platform
requires compositing. This is queried by the compositing kcm and based
on that the two mentioned options get hidden and not stored to config
file.

Test Plan: Opened the KCM on Wayland

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2586
2016-09-13 15:47:42 +02:00
Martin Gräßlin
853020336f Introduce a config option whether applications are allowed to block compositing
Summary:
From feedback we got it seems that not all users agree to games and
other applications blocking compositing. Some users prefer to have
compositing always on even if this gives a small performance penelity.

This change introduces a dedicated config option to specify whether games
are allowed to block compositing. By default this option is enabled.

The setting can be overwritten with a window specific rule. So usecases
like all windows except this very specific one are supported.

In the user interface the config option is shown where previously the
unredirect fullscreen option was shown.

Test Plan:
Run a game which should block compositing, verified it blocks.
Changed the setting, run the game again, verified it doesn't block. And
once more for with allowing to block.

Reviewers: #kwin, #plasma_on_wayland, #vdg

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2584
2016-09-13 15:47:05 +02:00
Martin Gräßlin
c6a840413a [autotest/integration] Extend the TabBox caps lock test to verify correct shortcut is triggered
Capslock currently modifies the shortcut which is triggered from
Alt+Tab to Alt+Shift+Tab. This shouldn't be and is not the case on X11.
2016-09-13 15:20:46 +02:00
Martin Gräßlin
ca6505e84c [autotests/integration] Add new test for triggering TabBox
First test case highlight a problem that tabbox doesn't close if
capslock is on.

CCBUG: 368590
2016-09-13 13:04:27 +02:00
Martin Gräßlin
cb7f922222 Set componentName to KWIN_NAME on QActions for KGlobalAccel
By setting the componentName we ensure that test don't grab the shortcut.

CCBUG: 368675
2016-09-13 13:02:20 +02:00
l10n daemon script
6ae917d7f8 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"
2016-09-13 10:27:05 +00:00
Martin Gräßlin
95f506ad7d [autotests/integration] Extend fullscreen shell client test to verify layers
As the test shows the layer does not get updated correctly.
2016-09-13 10:30:52 +02:00
Martin Gräßlin
97b594501a Match window role in Rules in a case insensitive manner
Summary:
We used to have a toLower when reading the rule. This was removed with
4f7edb8 which turned it into a case sensitive matching to fix a
regression.

But this created another regression: existing rules written lower case
are no longer matched.

This change makes the role matching case insensitive again.

BUG: 367554

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D2574
2016-09-13 08:37:26 +02:00
Martin Gräßlin
2545162f87 Support highlighting windows through EffectsHandlerImpl
Summary:
So far TabBox used highlight windows by passing window ids around through
an X property. This doesn't work on Wayland where we don't have window
ids for our TabBox and the Wayland windows.

This change introduces a new Effect::Feature for HighlightWindows which
the HighlightWindowsEffect provides. The EffectsHandlerImpl has a new
method to highlightWindows which it delegates to that effect if it is
loaded by invoking a new performFeature method.

The TabBoxHandler now passes the highlighting to the effects system
instead of updating the x11 property. Thus this works on Wayland and
at the same time improves the X11 side by no longer having to go through
the property protocol.

Test Plan: Verified that Alt+Tab highlights the windows on Wayland correctly.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2630
2016-09-13 08:36:12 +02:00
Martin Gräßlin
405702b1a2 [autotest/integration] Extend TestShellClient::testFullscreen with deco
In addition to normal client to fullscreen two more cases are added
which also go from a server side decorated window to fullscreen.
This highlights an issue that an incorrect geometry is requested.

CCBUG: 366764
2016-09-12 14:14:20 +02:00
Martin Gräßlin
3a3d1b6b0d DebugConsole window does not take keyboard input
Summary:
In order to add more tabs which can further help monitoring how KWin
handles some aspects the DebugConsole is changed to not take keyboard
input. This means it can only be navigated using pointer device or touch
screen.

This is needed for adding a new tab to monitor clipboard changes. On
Wayland sometimes windows don't get the clipboard, so it would be
helpful to have a debug monitor to see when the clipboard changes. But
for that debug console window may not take keyboard events.

To support this DebugConsole sets the WA_ShowWithoutActivating attribute
which gets honored by the InternalWindowEventFilter and does not forward
key events to such windows.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2620
2016-09-12 13:24:33 +02:00
Martin Gräßlin
9b32615ab4 Don't bind ShellClient::acceptsFocus to whether the window is shown
Summary:
A not shown window may accept focus (e.g. when minimized). Given that
the condition was wrong and broke when making minimized windows not
shown.

This change takes the idea of not passing focus to a closing or unmapped
window directly into acceptsFocus. Which also means that this condition
now works for xdg_shell windows.

BUG: 368673

Reviewers: #kwin, #plasma_on_wayland, bshah

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2745
2016-09-12 13:14:59 +02:00
Martin Gräßlin
156bf258e9 Merge branch 'Plasma/5.7' 2016-09-12 13:14:15 +02:00
Martin Gräßlin
e9e936b6c1 [kwinglutils] Skip ShaderManager::selfTest for NVIDIA Quadro hardware
Summary:
The self test fails with NVDIDA 370.23 or newer on Quadro hardware.
Most likely there is a bug in our code as the same things work later on.
But without the hardware we are not able to reproduce and investigate
properly. Given that all we currently can do is to skip the self test.

We encourage users to investigate this properly and to help us to
identify the root issue, so that we can fix it.

CCBUG: 367766

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D2744
2016-09-12 13:13:17 +02:00
Martin Gräßlin
e25be65800 [autotests/integration] Add test case for fullscreen to ShellClientTest
There are issues with setting ShellClients to fullscreen, so adding an
autotest to reproduce it. Basic test does not show any issues yet.
2016-09-12 12:03:18 +02:00
Martin Gräßlin
ab68697fe5 [autotests/integration] Extend TestShellClient::tetsMinimizeActiveWindow
Adds QEXPECT_FAIL cases for wantsInput and wantsTabFocus of a minimized
window.
CCBUG: 368673
2016-09-12 10:01:02 +02:00
Martin Gräßlin
8d4204ac0d Remove non visible internal windows from the x stacking order
Summary:
KWin always has a few internal windows around which are not visible.
A QWindow created somewhere, but not shown. Such windows should not
be part of the stacking order.

If they are it breaks code which looks at the top most window in the
stacking order like e.g. SlidebackEffect.

This change ensures that the stacking order gets updated whenever a
ShellClient gets hidden and that internal windows with isShown being
false are excluded from the stacking order.

BUG: 364483

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2636
2016-09-09 07:41:12 +02:00
Martin Gräßlin
e922c79897 [autotests] Add missing add_test() 2016-09-08 15:24:21 +02:00
Martin Gräßlin
d345878b52 [autotests] Add Q_CONSTRUCTOR_FUNCTION to X11 specific tests to force xcb
The X11 specific tests need to run on QT_QPA_PLATFORM xcb otherwise
they will crash. To enforce this without having to replace QTEST_MAIN
a Q_CONSTRUCTOR_FUNCTION is used to invoke a function which does nothing
except setting the env variable.
2016-09-08 15:22:48 +02:00
Martin Gräßlin
66c61adb6d [autotests] Drop KWIN_TEST_MAIN macro
It was not doing anything in addition and the documentation was
completely wrong as it does the same thing as QTEST_MAIN.
2016-09-08 15:17:17 +02:00
Sebastian Kügler
9f35544940 [libinput] Don't set the parent on the Device
This causes an assert with debug build of Qt due to threading issues.
We don't need the setParent call as we use deleteLater when a device
gets removed.

Reviewed-by: Martin Gräßlin
2016-09-07 10:58:37 +02:00
andreas kainz
c08d26b644 grid layout for windowdecoration KCM
RR 128819
2016-09-06 16:22:56 +02:00
l10n daemon script
2befb1f81c 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"
2016-09-05 09:38:26 +00:00
l10n daemon script
7e77a49757 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"
2016-09-01 10:04:17 +00:00
Martin Gräßlin
d3741bd530 Set the restore geometry after placing a ShellClient for the first time
Summary:
The restore geometry gets initially set to 0/0xsize before the placement
is done. When going into updateClientArea and then afterwards into
AbstractClient::checkWorkspacePosition the geometry restory is used for
calculating the new position. This results in windows getting moved to
0/0 when e.g. plugging in a new screen or a panel changes, etc.

This change ensures that the restore geometry is set correctly after the
first placement.

BUG: 366696

Reviewers: #kwin, #plasma_on_wayland, bshah

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2627
2016-08-31 15:12:53 +02:00
Roman Gilg
997cf97c9f Atomic Mode Setting / Universal Plane preliminary support
This is Milestone 1 of full support of Atomic Mode Setting (AMS) and
Universal Planes in the KWin DRM backend.

With Milestone 1 we can use the primary plane of a DRM output and do an
AMS commit (this means mode setting aswell as page flipping), if the
driver supports it. Until now the functionality is only tested on Intel
graphics. You need the drm-next kernel for most recent DRM kernel
developments. As boot option set "i915.nuclear_pageflip". Additionally
at the moment AMS is still hidden behind the environment variable
KWIN_DRM_AMS. Set it, if you want to try out AMS.

What needs to be done next: Make it possible to transfer EGL buffers
directly to planes and implement logic for deciding about using a plane
or not for a specific buffer.

You can read more about it on LWN:
https://lwn.net/Articles/653071
And on Martin's blog:
https://blog.martin-graesslin.com/blog/2015/08/layered-compositing/
I used as model previous work by Daniel Stone for Weston:
https://git.collabora.com/cgit/user/daniels/weston.git

Reviewed-by: mgraesslin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D2370
2016-08-31 14:06:31 +02:00
Martin Gräßlin
4c0e33a94c Add a Workspace::findToplevel(QWindow*) method
This allows finding the Toplevel for a QWindow which is on Wayland a
ShellClient and on X11 an Unmanaged. This can be used to simplify
code when a Toplevel is needed for an internal QWindow without having
to do platform specific checks.
2016-08-30 15:47:59 +02:00
David Edmundson
8db4a6ff39 authorizeKAction -> authorizeAction 2016-08-30 12:52:41 +01:00
Martin Gräßlin
f99a456f33 [autotests] Extend PlasmaSurface to verify position of OSD windows
This adds a new test case which maps an OSD window and verifies that it's
positioned correctly. Then an additional screen is added which should not
affect the position, but as the test case shows: it does affect the
position.

CCBUG: 366696
2016-08-30 13:04:10 +02:00
Martin Gräßlin
a98a1b1376 Support compose key in xkbcommon integration
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
2016-08-30 08:06:54 +02:00
Martin Gräßlin
5702c3f1bf Fix Xkb::shouldKeyRepeat
Was missing the magic +8 offset.
2016-08-29 17:14:08 +02:00