Commit Graph

15309 Commits (802b0de36a039b587a02d0445f05db322f484ab0)

Author SHA1 Message Date
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
Martin Gräßlin 489e6954c5 Support the emergency show property on ksld's lock screen window
Summary:
The emergency show window should be considered as a lock screen window
and be shown while the screen is locked. This is the KWin part to D5157.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5158
2017-04-06 16:49:53 +02:00
Kai Uwe Broulik 2cbada20a1 [KWin Killer] Send short caption to it
Use caption(false) otherwise it includes the "(Not Responding)" part.
Unfortunately we also lose the <1> and <2> suffix.

Differential Revision: https://phabricator.kde.org/D5307
2017-04-05 15:31:35 +02:00
Kai Uwe Broulik 1eb950a985 Desaturate non-responsive windows
When an application is not responding, its window is desaturated to communicate this.
Also "(Not Responding)" is added to the title bar.

Differential Revision: https://phabricator.kde.org/D5245
2017-04-05 11:16:23 +02:00
Martin Gräßlin 5d044331fc Merge branch 'Plasma/5.9' 2017-04-04 19:38:58 +02:00
Martin Gräßlin a936516107 [kcmkwin/compositing] Do not write GLPlatformInterface config
Summary:
The gui element to select the platform interface is dropped. Thus we
should not store the config for it. This is rather important as changing
compositor settings on Wayland would result in egl being written into the
config which potentially breaks an X11 session.

BUG: 378114

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5285
2017-04-04 19:38:02 +02:00
l10n daemon script 8d0939f7fc 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-03 05:14:56 +02:00
Martin Gräßlin 67295336e5 Add support for interactive selection through touch events
Summary:
This was forgotten during implementing the interactive window/point
selection. With this change it is also possible to perform the
interaction through touch events. In that case KWin takes over any
existing touch sequence.

This implements T5315.

Test Plan: Added auto test and took a screenshot through touch events

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5203
2017-03-31 07:44:38 +02:00
Martin Gräßlin a405a2ac1a Merge branch 'Plasma/5.9' 2017-03-31 07:44:21 +02:00
Martin Gräßlin 49fc310594 [slidingpopups] Only remove WindowClosedGrabRole if the effect owns the grab
Summary:
The effect unset the WindowClosedGrabRole unconditionally if it does not
manage the window. This results in any grab set by other effects to break.

BUG: 376609
FIXED-IN: 5.9.5

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5225
2017-03-31 07:42:11 +02:00
David Edmundson 61bb907bb4 Scale openGL sub surfaces
Test Plan: Opened a module in system settings that uses QtQuick, confirmed it's the right size

Reviewers: #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3503
2017-03-29 20:53:22 +01:00
David Edmundson ebebc6ca82 Provide scale offset to WindowVertex calculation
Summary:
WindowVertex contains the x position and also the relative texture x position

Our textures are scaled bigger than kwin's resolution, so this makes sure we set the right
texture position.

Otherwise our final array ends up using 0 to 0.5 of the texture, not 0 to 1.

Test Plan:
Opened some 2x windows, on a 1x output.
It looked how it should do, instead of it being double the size and cropped

Tested some things that use quads, like wobbly windows

Reviewers: #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3502
2017-03-29 20:53:22 +01:00
David Edmundson e2e2c86f37 Scale surface damage events
Damage events come in global compositor space, not relative to the
surface.
For a glTex2D we need the events relatvie to the surface, so they need
scaling up

Reviewers: #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3501
2017-03-29 20:53:22 +01:00
David Edmundson bd1d88359f Scale xwindowed EGL output
Reviewers: #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3500
2017-03-29 20:53:22 +01:00
David Edmundson add93b3e36 drm cursor scaling
Summary:
Cursors are drawn low level, so need to go from global compositor space
to device space
(multiplied by the out scale)

Test Plan: Elements interacted underneath where the mouse was

Reviewers: #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3499
2017-03-29 20:53:22 +01:00