Commit Graph

15262 Commits (eec6afe6f5fef80f519c7afb33e4fd568d74aab0)

Author SHA1 Message Date
Martin Gräßlin eec6afe6f5 Don't map screenedge approach window if edge is only used for touch
Summary:
Another regression from enabling touch support on X11.
The approach window for pointer input gets unmapped as soon as the mouse
enters the window. This ensures that mouse motion events are not stolen
from other applications. But with the touch events we did not even react
on the enter event if it's not activated for pointer. The result was an
area around the screenedge being blocked for pointer input.

This change only creates and maps the approach window if the edge is
activated for pointer input.

BUG: 378951

Test Plan:
Activated edges through pointer and touch, reconfigured and tested
motion events

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5528
2017-04-22 08:17:59 +02:00
Martin Gräßlin ac08c5ac9d [plugins/qpa] Do not replace a valid FBO with an invalid one
Summary:
With the TabBox I observed the following issue:
 1: trigger TabBox through screen edge
 2: exit TabBox
 3: trigger TabBox again through screen edge

Actual behavior: in step 3 the GUI does not show. If now using Alt+Tab
to show the TabBox the gui shows, but through screen edge it stays
broken.

Investigation showed that the difference is a direct show in screen edge
case and a delayed show in Alt+Tab case. Futher investigation shows that
an invalid geometry gets requested in the broken case. While this might
indicate an issue in another area it makes sense to protect KWin
internally against it and not to break rendering.

Thus this change ensures that a valid FBO does not get replaced by an
invalid sized FBO.

Test Plan:
Tested that Alt+Tab works correctly when triggered through
edge

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5438
2017-04-22 08:17:33 +02:00
Martin Gräßlin e9a44a275e Support blocking of screen edges on active fullscreen windows also for touch
Summary:
This change ensures that the blocking condition of screen edges is also
honored for touch screen swipe gestures.

Test Plan: Only the added test case

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5403
2017-04-22 08:16:31 +02:00
Martin Gräßlin b132fe7c24 Add support for keyboard layout switching policy "winclass"
Summary:
This is quite similar to the policy "window" - the main difference is
that windows from the same application share the layout. So only
switching to a window from another application changes the layout.

This change is the last policy to add for support of all the policies we
have on X11.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D5365
2017-04-22 08:15:59 +02:00
Martin Gräßlin c8274dbe57 Add support for keyboard layout switching policy "window"
Summary:
This policy stores the layout for each window which becomes active
and restores the layout once it gets activated again.

Test Plan: Added test case

Reviewers: #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D5315
2017-04-22 08:15:45 +02:00
Martin Gräßlin bf99d9ffdd Introduce support for keyboard layout switching policies
Summary:
This change introduces the initial support for keyboard layout switching
policies like in the X11 session. This first change only adds support for
Global and Virtual Desktop policy. This means the current layout is
stored in context to the current virtual desktop. Whenever one changes
the virtual desktop the previous layout is restored. If the user has not
yet navigated to this virtual desktop a switch to default layout is
performed.

This is the first code interacting with the new Virtual Desktop API which
is not based on integer ids. To fully support this the API is slightly
extended.

Test Plan: Added test case

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5301
2017-04-22 08:15:25 +02:00
Martin Gräßlin a5735e19b9 [platforms/x11] Do not grab touch events
Summary:
Grabbing the touch events seems to cause issues. It seems to also grab
pointer events from touchpad and breaks touch input on other events.

Also testing shows that we don't need it and get touch ownership events
for our screenedge windows reported.

BUG: 378951

Test Plan: Triggered touch screen edge, normal system usage on X11

Reviewers: #plasma, #kwin

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5520
2017-04-20 17:03:38 +02:00
Martin Gräßlin 919b497f90 [effects/slideback] Consider windows which do have painting disabled as not usable
Summary:
On Wayland it can happen that a window is still in the stacking order
although it is not visible. This is mostly the case for Plasma windows.
So far the slideback effect did not ignore those windows and as they are
higher in the stacking order than most other windows it blocked the
effect from working once a Plasma panel element got closed.

This change considers a window which has painting disabled in the
stacking order as not usable and thus filters out all those windows.

BUG: 364483

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5462
2017-04-20 17:03:12 +02:00
Martin Gräßlin 9a13743c49 Don't update the focused pointer Surface if a button is pressed
Summary:
During pointer motion we already had the condition that an update of
focused pointer surface can only happen when no button is pressed. But
there are more conditions where we try to update the focused pointer even
if a button is pressed. E.g. if the stacking order changes.

This happens when trying to move one of Qt's dock widgets:
 1. Press inside a dock widget
 2. Qt opens another window, which is underneath the cursor
 3. KWin sends pointer leave to parent window
 4. dock widget movement breaks

This change ensures that also this sequence works as expected and the
pointer gets only updated when there are no buttons pressed, no matter
from where we go into the update code path.

BUG: 372876

Test Plan: Dock widgets in Dolphin can be moved now.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5461
2017-04-20 17:02:42 +02:00
Martin Gräßlin c3ecf55bf8 Do not handle ScreenEdges::check for Edges which don't activate for Pointer
Summary:
On X11 the edges reserved only for pointer started to show the approach
geometry. This problem is addressed by this change.

Touch screen events do not go through this method, neither is it used on
Wayland.

Test Plan: Tested on X11, problem fixed

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5421
2017-04-20 17:02:16 +02:00
l10n daemon script 873a51cc62 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-04-20 04:17:52 +02:00
Luboš Luňák 1427dbad9b remove executable bit from a .cpp file 2017-04-19 12:39:42 +02:00
l10n daemon script 4a5734c3c4 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-04-17 04:05:09 +02:00
l10n daemon script 4c3404e150 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-04-16 04:05:25 +02:00
Martin Gräßlin 2132b1e0c8 [effects] Use arg="true" in the kcfg files
Summary:
By changing all kcfg to have arg="true" we can pass in the same
KSharedConfigPtr into all effects. This allows to have fake config in
the tests and in the planned effect demo mode.

Also it means that we don't have to hardcode the name kwinrc into the
files. In the configs - where we cannot access the effectshandler - we
use the define KWIN_CONFIG which gets generated based on the compile
time arguments.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3571
2017-04-15 10:03:34 +02:00
Luboš Luňák af9f81700f fix uninitialized variable
Accessed later if e.g. compositing is suspended or not possible at startup.
2017-04-14 15:03:27 +02:00
David Edmundson 440bca8b45 Merge branch 'Plasma/5.9' 2017-04-13 11:59:36 +01:00
David Edmundson 55f2e72ce7 Merge branch 'Plasma/5.8' into Plasma/5.9 2017-04-13 11:55:52 +01:00
David Edmundson f5a43877a9 Sort the themes in decoration KCM
Summary:
Even though we're using a QSortFilterProxy model, by default it doesn't
actually sort anything until instructed to.

This patch turns sorting on.

Test Plan:
Opened the KCM
Looked at it

Reviewers: #plasma, mart

Reviewed By: mart

Subscribers: plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5407
2017-04-13 11:54:44 +01:00
David Edmundson 3709996f8a Fix KWin decoration KCM showing correct index at startup
Summary:
The KCM has a context property of the currently set theme index. This is
set before the decorations model is populated, so it is currently always
-1.

This model is populated after the constructor but before
KCModule::load().

KCModule::load is called from KCModule::showEvent so before
QQuickGridView will start doing anything with delegates.

This fixes the problem simply and also avoid parsing the config file
multiple times.

This bug was introduced in 5.9.4:

Someone made a (tested) change to make sure the view scrolled to the
right place on startup.
I then made a (tested) commit fixing the crash on exit
The author then updated his patch to my changes, but now in a way that
didn't work.

Test Plan:
Opened system settings module with a million decorations.
The correct entry was visible and highlighted.

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5401
2017-04-13 11:54:39 +01:00
l10n daemon script 819c645863 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-04-13 05:26:57 +02:00
Martin Gräßlin 259e373bfc [tabbox] Expose noModifierGrab to QtQuick
Summary:
There is a special mode in TabBox which is the noModifierGrab mode. This
is Alt+Tab active without a modifier being hold. This mode is entered
when being activated through screen edges (either pointer or touch). So
far this was not exposed to QtQuick and thus one could not end the mode
using pointer or touch. It is possible to select another window, but not
to activate it. That required the press of a keyboard key.

This setup is rather unfortunate. By exposing the mode to QtQuick we can
react from QtQuick side to it and invoke already exposed functionality to
select and item and directly activate it - existing left-over from the
Plasma Active window switcher.

Test Plan:
Tested on X11 and Wayland with an adjusted lnf package. It kind
of works, but there are additional issues on both X11 and Wayland.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5414
2017-04-12 19:46:48 +02:00
David Edmundson 5cf05361ac Merge branch 'Plasma/5.9' 2017-04-12 18:23:30 +01:00
David Edmundson 944e723400 Merge branch 'Plasma/5.8' into Plasma/5.9 2017-04-12 18:18:33 +01:00
Martin Gräßlin 4ca3d0d943 [platforms/drm] Explicitly request event context version 2
Summary:
Libdrm 2.4.78 introduces a version 2 and if KWin gets built against it
our code would break. Given that this change is for Plasma/5.8 branch.

Closes T5839

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Maniphest Tasks: T5839

Differential Revision: https://phabricator.kde.org/D5380
2017-04-12 18:16:58 +01:00
Vladyslav Tronko 1bfe1164f4 Fix crash on dragging titlebar buttons in System Settings
Summary:
Currently, if user tries to move one of buttons to the left, ending up
dragging one button onto another, crash occurs.

In addition, this patch replaces verbose replacement(remove/insert) with
more elegant QVector<T>::move(int, int)

BUG: 374153
FIXED-IN: 5.8.7

Reviewers: graesslin, #kwin

Reviewed By: graesslin, #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5117
2017-04-12 18:16:52 +01:00
Anthony Fieroni c3362fe866 [kcm_kwindecoration] Respect theme colors in buttons
https://phabricator.kde.org/D5116

Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
2017-04-12 18:16:41 +01:00
Martin Gräßlin 3259d5e113 Cancel popup if the user clicked window decoration of parent window
Summary:
So far the window decoration was not considered and e.g. right clicking
the window decoration resulted in two open popups - one by KWin and one
by the application. This change addresses the problem by ensuring the
popup gets cancelled if the decoration is clicked. It's considered not
being part of the window.

Test Plan: Added test case which fails without the change

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5388
2017-04-11 20:22:32 +02:00
l10n daemon script d966302de7 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-04-11 09:44:49 +02:00
Martin Gräßlin fea1986ed9 Merge branch 'Plasma/5.9' 2017-04-10 21:22:09 +02:00
Martin Gräßlin 1d9e7c120f Merge branch 'Plasma/5.8' into Plasma/5.9 2017-04-10 21:20:42 +02:00
Martin Gräßlin c8cd474acd [platforms/drm] Explicitly request event context version 2
Summary:
Libdrm 2.4.78 introduces a version 2 and if KWin gets built against it
our code would break. Given that this change is for Plasma/5.8 branch.

Closes T5839

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Maniphest Tasks: T5839

Differential Revision: https://phabricator.kde.org/D5380
2017-04-10 21:18:41 +02:00
l10n daemon script 3e6f042dc2 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-04-10 04:01:17 +02:00
l10n daemon script b62c8fb401 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-04-09 05:32:55 +02:00
l10n daemon script 9ede845556 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-04-09 05:14:36 +02:00
l10n daemon script c6b32908bf 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-04-09 04:07:54 +02:00
Martin Gräßlin 5ad6452ddd [kcmkwin] Fix saving of TouchScreen actions
It stored to the wrong config group.
2017-04-08 10:56:37 +02:00
l10n daemon script 91002a6386 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-04-08 06:02:43 +02:00
l10n daemon script 25e6f46153 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-04-08 04:20:31 +02:00
Andreas Hartmetz 90a33a4bc2 Fix two more const / non-const iterator mismatches.
I did some research with the result that such comparisons are indeed
not standardized to be legal before C++14. In C++14 they are.
These microoptimizations can thus be re-enabled when C++14 becomes
the required version.
2017-04-07 20:38:19 +02:00
Andreas Hartmetz 0fa4c27c66 Fix build: Compare non-const iterator with non-const iterator
...maybe this is not an error with all compiler / Qt configurations
2017-04-07 19:38:29 +02:00
Martin Gräßlin 1648844005 [kcmkwin] Add a new config module for touch screen gestures
Summary:
This is basically a copy of the screen edges config module with
everything removed which does not matter. This is lazy and could
be done with more code sharing. But it would be better to redesign
both kcms in a modern way instead of investing lots of time on
sharing code.

Test Plan:
Installed, opened it and verified it had the config selected
I had manually set.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5282
2017-04-07 16:18:46 +02:00
Martin Gräßlin 2be1625822 Add support for new touch screen callbacks to KWin scripts and scripted effects
Summary:
Exposes two new global JS functions to register and unregister touch
screen edges.

Test Plan: Added test case

Reviewers: #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D5277
2017-04-07 16:18:09 +02:00
Martin Gräßlin 63b1138307 Add support for new touch screen edge actions to declarative KWin scripts
Summary:
This change introduces a new property mode in ScreenEdgeItem to switch
between Pointer and Touch mode. The touch mode interacts with the new
touch screen edge gestures through a QAction.

Test Plan: New test case added

Reviewers: #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D5272
2017-04-07 16:17:48 +02:00
Martin Gräßlin c080dca8ec Register touch screen edges in effects
Summary:
All effects which use a (pointer) screen edge now also support the touch
screen edges. These are:
 * Cube (cylinder, sphere)
 * DesktopGrid
 * PresentWindows (current, all, class)

Reviewers: #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D5269
2017-04-07 16:17:17 +02:00
Martin Gräßlin e1a46976e6 Support new touch screen edge swipe callbacks in TabBox
Summary: Last but not least the TabBox gets adjusted for the new touch callbacks.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D5281
2017-04-07 16:16:57 +02:00
Martin Gräßlin e6aabf5b9f Add callback functionality for touch screen swipe gestures
Summary:
This is implemented through QActions following the general approach
inside KWin and not the older approach used by ScreenEdges for pointer
callback activation.

Test Plan: Extended auto test

Reviewers: #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D5263
2017-04-07 16:16:34 +02:00
Martin Gräßlin 64ce6259a9 Introduce dedicated actions for touch screen swipe gestures
Summary:
The new touch gestures activated for the same actions as configured for
mouse pointer actions. This has disadvantages as the only configured
default screen edge action cannot be triggered (corner) on touch. On the
other hand setting a default touch gesture would be rather annoying with
pointer as a default.

So overall it makes sense to split the actions and have dedicated pointer
and dedicated touch actions.

This change introduces the first part of it and splits the handling in
general. We now have:

Activates for pointer and touch:
 * client (auto-hiding panels)

Activates for pointer only:
 * the configured action
 * virtual desktop switching
 * callbacks

Activates for touch only:
 * the new touch action

The touch actions are implemented similar to the pointer actions which
slight improvements in the code which will be backported to the pointer
actions.

Introducing callbacks will be the next step. I plan to do it a little bit
different by using QActions as that's what KWin internally uses for
everything except screen edges.

Test Plan: Manual testing and improved auto tests

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5252
2017-04-07 16:16:18 +02:00
Martin Gräßlin 1193b0da77 Initial support for popup window handling
Summary:
So far KWin did not properly handle popup windows. That is when a popup
surface got created and a click outside the surface happened KWin did not
send out the popupDone Wayland event.

This change makes KWin aware of whether a surface is a popup and tracks
through a new PopupInputFilter whether there are popup windows. In case
there are popups the new filter waits for mouse press events and cancels
the popups if the press does not happen on any surface belonging to the
same client. To quote the relevant section of the Wayland documentation:

    The popup grab continues until the window is destroyed or a mouse
    button is pressed in any other client's window. A click in any of the
    client's surfaces is reported as normal, however, clicks in other
    clients' surfaces will be discarded and trigger the callback.

So far the support is still incomplete. Not yet implemented are:
 * support xdg_shell popup windows
 * verifying whether the popup is allowed to be a popup
 * cancel the popup on more global interactions like screen lock or
   kwin effect

BUG: 366609
FIXED-IN: 5.10

Test Plan: Auto test and manual testing with QtWayland client

Reviewers: #plasma, #kwin

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5177
2017-04-07 16:14:50 +02:00
l10n daemon script 1e81a12b99 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-04-07 04:09:53 +02:00