Commit Graph

528 Commits (fa5242b3eefd02683d98b773f1c64da6c4379fbe)

Author SHA1 Message Date
l10n daemon script b6f22a98a7 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"
2018-06-18 07:51:12 +02:00
Kai Uwe Broulik 7ca8771d12 [TabBox] Don't show "Show desktop" window when cycling through application windows
When I'm explicitly cycling through the windows of an application it makes no sense to show the "global" desktop window.

BUG: 378662
FIXED-IN: 5.12.0

Differential Revision: https://phabricator.kde.org/D9661
2018-01-08 10:31:16 +01:00
Martin Flöser f0f4e494fe Merge branch 'Plasma/5.11' 2017-11-16 20:34:52 +01:00
Martin Flöser 1ae7990a95 Allow a cross-process check for same applications
Summary:
Commit 5d9027b110 introduced a regression in TabBox by using the generic
framework inside KWin to test for same application. What I did not
consider was that the code in TabBox was "broken by design". It didn't
use the generic check as that is too strict and considers windows from
different processes as not belonging to the same application. But this
is not wanted in the case of TabBox.

On the other hand the change itself is an improvement to also support
Wayland in a better way and not have special handling situations. Thus
just reverting would not help.

Instead this change addresses the problem by extending the internal API
and to allow more adjustements. So far there was already an
"active_hack" boolean flag. This is extended to proper flags with an
additional flag to allow cross application checks.

The checks in Client which would filter out different applications check
for this flag and are skipped if set. In addition ShellClient also adds
support for this flag and compares for the desktop file name.

Thus we get in TabBox the same behavior as before with the advantage of
having a better shared code base working on both X11 and Wayland.

BUG: 386043
FIXED-IN: 5.11.4

Test Plan:
Started two kwrite processes on X11, clicked new in one of them,
used Alt+` and verified that there are three windows shown.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8661
2017-11-16 20:33:54 +01:00
Martin Flöser 3ce9a4a179 [tabbox] Guard Xcb::sync with whether we have an X11 connection
Otherwise crash on WaylandOnly once you Alt+Tab. Credits go to our
integration tests for finding this issue!
2017-09-30 16:29:42 +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 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
Frederik Gladhorn 7c9b9ed288 Remove stray semicolon 2017-09-14 15:03:41 +02:00
Martin Flöser 5d9027b110 [tabbox] Properly check whether two windows belong to same application
Summary:
TabBox implemented a custom way to check whether two windows belong to
the same application. KWin internally has API for that which does it
better, in a standardized way and even across windowing system.

This change uses the internal API, resulting in the check working better
on X11 and starts to work on Wayland.

Test Plan: Verified Alt+` with Wayland windows

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7713
2017-09-07 19:08:04 +02:00
Martin Flöser 9c74be1256 [tabBox] Move X11 specific event filtering into a dedicated event filter
Summary:
This ensures that the X11 specific events are only read on X11 but not
on Wayland. Also moves quite some X11 specific code out of TabBox.

Test Plan: Compile checked, currently on Wayland, so no way to test.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7395
2017-09-01 16:58:14 +02:00
Martin Flöser 3b9ccc65a3 [tabbox] Fix casts to Client where it should be AbstractClient
Summary:
A few areas in TabBox perform casts from Toplevel to Client. By casting
to Client instead of AbstractClient the Wayland windows are excluded.

This change addresses the problem by changing the casts where possible.
The only remaining cast to Client is for shading which is not (yet)
supported for Wayland windows anyway.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6273
2017-06-20 07:07:44 +02:00
l10n daemon script 2a6048c885 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-05-25 05:40:47 +02:00
Martin Gräßlin c453eb696c Make WindowSwitching (Alt+Tab) the default left touch screen edge
Summary:
Based on the feedback from discussion on plasma-devel the currently only
default touch action on a screen edge should be window switching. Given
that our default window switcher is located on the left and works very
nicely for touch event it becomes the default action on the left screen.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5551
2017-05-02 20:33:21 +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
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
Roman Gilg 1f69c6ed6e Merge branch 'Plasma/5.8' into Plasma/5.9 2017-01-16 19:19:34 +01:00
Roman Gilg e019c9f61e [TabBox] Remember current model index on SwitcherItem model set
In case we need to set the SwitcherItem model in
`TabBoxHandlerPrivate::show()`, remember the current index row,
otherwise it gets reset to the first item.

Reviewers: #kwin, graesslin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D4162

BUG: 333511
2017-01-16 19:11:07 +01:00
Martin Gräßlin 58361213de Add the modifiers relevant for global shortcuts into the input Events
Summary:
Prior to this change various event filters performed deep calls into
Xkb class to figure out the modifiers relevant for global shortcuts (aka
consumed modifiers). This shows that this is a general useful
information which should be available to all input event filters
directly.

Thus it's now added to the input events and exposed directly in
InputRedirection so that the calls into Xkb are no longer needed.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3810
2016-12-27 18:19:15 +01:00
Martin Gräßlin e9d20b80e9 [tabbox] Intercept QWheelEvents on QQuickWindow for scrolling
Summary:
The TabBox performs the scrolling of the items by itself in order to
support wheel events even if the mouse is not on the TabBox. For that
KWin grabs pointer events on X11 (on Wayland an input filter is used)
and forwards them to the TabBox.

Qt uses Xinput2 for scrolling on the QQuickWindow. Due to that KWin
does not get any xcb core button press/release events when scrolling
inside the QQuickWindow and thus scrolling doesn't work.

There are three possible approaches to fix this:
1. Implement scrolling support in each of the QML switchers
2. Add an xinput2 filter to TabBox
3. Intercept the QWheelEvents on the QQuickWindow

The first approach has the disadvantage that all themes need
adjustment and that there might be behaviorial difference whether one
scrolls on the TabBox window or outside the window.

The second approach would be most in line with the other filters, but
is difficult due to the nature of xinput2 (no xcb bindings, etc).

Thus the third approach might be the best solution. Wheel events are
only delivered to the QQuickWindow if the native events were not already
intercepted, thus we know it won't have side effects for the case that
Wayland is used or xinput2 is not supported.

The implementation installs an event filter on the QQuickWindow which
gets created when showing the TabBox and inside the filter waits till
there is an angleDelta of +/-120 and scrolls by one per every 120 angle
delta as described in the QWheelEvent documentation.

BUG: 369661
FIXED-IN: 5.8.2

Test Plan: Scrolled with touchpad and mouse wheel.

Reviewers: #kwin, #plasma, broulik

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D2953
2016-10-17 08:23:39 +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
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
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
l10n daemon script 56e3b5b116 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-08-29 09:19:15 +00:00
Allen Winter 31f067ede2 pedantic fixes 2016-07-16 13:14:44 -04:00
Martin Gräßlin 50569a2580 Move tabbox/autotests to autotests/tabbox
Let's have all autotests in autotests subdirectory instead of spread
out over the source tree.
2016-06-29 10:38:17 +02:00
Martin Gräßlin 24bdfc6317 Make Toplevel::window() no longer virtual and introduce ::windowId()
Summary:
Toplevel::window() is the actual X11 window. This makes it difficult
to use as the generic identifier for both X11 and Wayland. The Wayland
ShellClient already had a windowId() which is now added to Toplevel as
a virtual method. On X11 (Toplevel default) it returns the window().

The method window() now returns XCB_WINDOW_NONE for classes without
the Toplevel::m_client, such as ShellClient. Thus it allows to properly
check whether we are on Wayland or X11.

The code is adjusted to use windowId where a generic id is needed and
to properly check whether the window is valid before using it where
a window() is used.

This also fixes at least one additional unknown issue in
Workspace::setActiveClient

where the windowId of a Wayland client was passed to X11.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1527
2016-05-17 14:13:24 +02:00
Martin Gräßlin d2716c834b Pass pointer and wheel events to TabBox from special event filter
The TabBox implements methods for those events and performs same
logic as on X11. Click outside of TabBox closes. If the event is on
the TabBox we don't filter the event out and let the internal filter
forward the event.
2016-03-04 14:18:32 +01:00
Martin Gräßlin aea4221575 [tabbox] Pass the tabbox window to elevate as a QWindow instead of winId
By using QWindow we can also find the TabBox window on Wayland where
the winId is not really helpful.

This also changes the elevation from Unamanged to Toplevel, so that
it is no longer X11 specific.

Result: TabBox stays on top of all windows also on Wayland.
2016-03-04 09:44:24 +01:00
Kevin Funk 8ea4f4dae7 Port to CMake AUTOMOC
Summary: Run convert-to-cmake-automoc.pl over all .cpp files

Differential Revision: https://phabricator.kde.org/D882
2016-02-01 21:05:36 +01:00
Martin Gräßlin 757523a324 Use kwinApp()->config() instead of KSharedConfig::openConfig()
That way all over kwin we can inject a custom config in the autotests.
2016-01-29 11:24:18 +01:00
Martin Gräßlin 1f7daa934d KWin::Application holdes a KSharedConfigPtr with the config
This allows the integration tests to provide their own configuration
as they need it. Setting the configuration should be done before
invoking start()
2016-01-29 09:48:02 +01:00
l10n daemon script aa0f2c88f0 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-01-10 11:46:53 +00:00
l10n daemon script aff81afd27 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"
2015-12-30 09:40:57 +00:00
l10n daemon script 56860e63f5 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"
2015-11-07 21:21:42 +00:00
Nick Shaforostoff 3a8d7d866a optimize string operations
-use qstringliteral only when necessary (i.e. not in concat or comparison)
-use qbytearray instead of qstring when dealing with latin1 input and output (glplatform)
-use qstringref to extract numbers from strings (glplatform)
-define qt_use_qstringbuilder to optimize all string concatenations
-anidata: use ctor init lists, add windowType member initialization

REVIEW: 125933
2015-11-05 14:14:06 +00:00
l10n daemon script c342be5961 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"
2015-10-03 11:20:49 +00:00
Thomas Lübking cb1005120a support changing tabbox mode
Allow to change from general window cruising to application specific
cruising w/ releasing the Alt key

BUG: 316544
FIXED-IN: 5.5
REVIEW: 125392
2015-09-29 23:02:41 +02:00
Martin Gräßlin f7925c586e [tabbox] Support wayland in establish/remove TabBoxGrab
We cannot grab keyboard/mouse through X means, so don't even try, but
mark as grabbed.

With this change the TabBox shows on Wayland.
2015-08-24 11:44:05 +02:00
Martin Gräßlin 304ac3ac84 [tabbox] Split areModKeysDepressed into X11 and Wayland variant 2015-08-24 11:43:39 +02:00
Thomas Lübking f96836b2df update SwitcherItem::screenGeometry when showing
not everytime the current screen changes.
a) that pollutes the geometry when the tabbox is invoked
b) it's insufficient for "Active Screen follows mouse" (the default)
c) less overhead (ok: "on multiscreen")

BUG: 337790
CCBUG: 341531
FIXED-IN: 5.4
REVIEW: 124814
2015-08-19 12:31:31 +02:00
Martin Gräßlin 910c49959a [tabbox] Add dedicated logging category for TabBox 2015-07-31 13:13:41 +02:00
Aleix Pol 6f345f4915 Clean debug output
Removes endl in the end of qDebug.
Removes the \n in the end of opengl output.

REVIEW: 124320
2015-07-20 13:36:27 +02:00
Martin Gräßlin 63bdc54b32 [tabbox] Fix loading of default layout
BUG: 350029
2015-07-09 19:34:18 +02:00
Martin Gräßlin a1a89d3d1e Disable Activities support on Wayland
This is a temporary workaround for bug 349992 which causes freezes
during startup as kwin and kamd dead lock each other on DBus.

To workaround we don't call Activities::create and check in every
usage of Activities::self() whether the pointer is valid.

As a result kwin_wayland now starts pretty fast.

CCBUG: 349992
2015-07-07 11:48:42 +02:00
Martin Gräßlin b01b03aa84 [scripting] Find scripts through KPackage
Another sycoca usage gone.
2015-07-07 08:48:24 +02:00
Martin Gräßlin 5b111cc467 [tabbox] Locate layouts through KPackage instead of KService
Another usage of ksycoca gone.
2015-07-07 08:28:38 +02:00
l10n daemon script 99237c9b3f 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"
2015-06-01 10:08:03 +00:00
Martin Gräßlin ab4e798837 Remove no longer needed casts from TabBox::establish/removeTabBoxGrab 2015-05-08 12:43:46 +02:00