Commit graph

565 commits

Author SHA1 Message Date
Vlad Zahorodnii
23b53423c4 [tabbox] Drop TabBoxClient::window() method
Summary: TabBoxClient::window() method is no longer used by the tabbox.

Test Plan: Compiles, tests still pass.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25092
2019-11-18 10:43:41 +02:00
l10n daemon script
fe27d39b5c 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"
2019-10-17 05:41:38 +02:00
David Edmundson
96701c6702 Merge branch 'Plasma/5.17' 2019-10-15 12:41:39 +01:00
David Edmundson
82f4e03d7a Merge branch 'Plasma/5.12' into Plasma/5.17 2019-10-15 12:40:42 +01:00
David Edmundson
5d4be83de0 [tabbox] Correctly set global short on kwin tabbox
Summary:
We need to set both the current autoload shortcut and the default
shortcut. setGlobalShortcut is a convenience method for both.

Otherwise clicking defaults in the keys KCM will discard the shortcut
forever.

BUG: 407000

Test Plan:
wiped kglobalshortcutsrc to get a clean slate
restarted kwin
alt+tab
hit defauts in the kwin KCM
could still alt+tab

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24647
2019-10-15 12:39:57 +01:00
Vlad Zahorodnii
ffcbe24e2b Rename Client to X11Client
Summary:
Currently each managed X11 client is represented with an instance of
Client class, however the name of that class is very generic and the
only reason why it's called that way is because historically kwin
was created as an x11 window manager, so "Client" was a sensible choice.

With introduction of wayland support, things had changed and therefore
Client needs to be renamed to X11Client in order to better reflect what
that class stands for.

Renaming of Client to X11Client was agreed upon during the last KWin
sprint.

Test Plan: Compiles, the test suite is still green.

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: romangg, davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24184
2019-09-25 21:11:37 +03:00
Vlad Zagorodniy
bebe81209c Port QPA away from Wayland
Summary:
So far wayland was used by internal clients to submit raster buffers
and position themselves on the screen. While we didn't have issues with
submitting raster buffers, there were some problems with positioning
task switchers. Mostly, because we had effectively two paths that may
alter geometry.

A better approach to deal with internal clients is to let our QPA use
kwin core api directly. This way we can eliminate unnecessary roundtrips
as well make geometry handling much easier and comprehensible.

The last missing piece is shadows. Both Plasma::Dialog and Breeze widget
style use platform-specific APIs to set and unset shadows. We need to
add shadows API to KWindowSystem. Even though some internal clients lack
drop-shadows at the moment, I don't consider it to be a blocker. We can
add shadows back later on.

CCBUG: 386304

Reviewers: #kwin, davidedmundson, romangg

Reviewed By: #kwin, romangg

Subscribers: romangg, kwin

Tags: #kwin

Maniphest Tasks: T9600

Differential Revision: https://phabricator.kde.org/D22810
2019-09-23 17:28:56 +03:00
Vlad Zahorodnii
62a7db7028 Use nullptr everywhere
Summary:
Because KWin is a very old project, we use three kinds of null pointer
literals: 0, NULL, and nullptr. Since C++11, it's recommended to use
nullptr keyword.

This change converts all usages of 0 and NULL literal to nullptr. Even
though it breaks git history, we need to do it in order to have consistent
code as well to ease code reviews (it's very tempting for some people to
add unrelated changes to their patches, e.g. converting NULL to nullptr).

Test Plan: Compiles.

Reviewers: #kwin, davidedmundson, romangg

Reviewed By: #kwin, davidedmundson, romangg

Subscribers: romangg, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23618
2019-09-19 17:48:21 +03:00
Vlad Zahorodnii
5ad3c0ee13 Port away from deprecated qVariantFromValue
Summary:
qVariantFromValue is deprecated since Qt 5.14. It's advised to use
QVariant::fromValue instead.

Test Plan: Compiles.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24042
2019-09-18 16:20:06 +03:00
Vlad Zahorodnii
dcf91d4321 Cleanup style in CMakeLists.txt files
We have lots of inconsistency at the moment in CMakeLists.txt files. Most
of it is due to kwin being a very old project. This change hopefully fixes
all of it.
2019-09-17 16:03:05 +03:00
Vlad Zagorodniy
44aff0a087 [tabbox] Delete unused X11 includes
Test Plan: Compiles.

Reviewers: #kwin, apol

Reviewed By: apol

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23752
2019-09-07 12:45:28 +03:00
Vlad Zagorodniy
7a3722b4f5 Switch to Q_ASSERT
Summary:
Switch to Q_ASSERT in order to make code a bit more consistent. We have
places where both assert and Q_ASSERT are used next to each other. Also,
distributions like Ubuntu don't strip away assert(), let's hope that
things are a bit different with Q_ASSERT.

Test Plan: Compiles.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: romangg, davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23605
2019-08-31 20:07:05 +03:00
Vlad Zagorodniy
684b4b635e Use more traditional doxygen style
Summary:
So far we were following a bit unique and rare doxygen comment style:

    /**
     * Contents of the comment.
     **/

Doxygen comments with this style look balanced and neat, but many people
that contribute to KWin don't follow this style. Instead, they prefer
more traditional doxygen comment style, i.e.

    /**
     * Contents of the comment.
     */

Reviewing such changes has been a bit frustrating for me (so selfish!)
and for other contributors.

This change switches doxygen comment style in KWin to a more traditional
style. The main reason for doing this is to make code review process easier
for new contributors as well us.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D22812
2019-07-29 22:06:19 +03:00
l10n daemon script
4d41e877c3 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"
2019-07-23 05:20:30 +02:00
Vlad Zagorodniy
8af2fa73dc Run clang-tidy with modernize-use-override check
Summary:
Currently code base of kwin can be viewed as two pieces. One is very
ancient, and the other one is more modern, which uses new C++ features.

The main problem with the ancient code is that it was written before
C++11 era. So, no override or final keywords, lambdas, etc.

Quite recently, KDE compiler settings were changed to show a warning if
a virtual method has missing override keyword. As you might have already
guessed, this fired back at us because of that ancient code. We had
about 500 new compiler warnings.

A "solution" was proposed to that problem - disable -Wno-suggest-override
and the other similar warning for clang. It's hard to call a solution
because those warnings are disabled not only for the old code, but also
for new. This is not what we want!

The main argument for not actually fixing the problem was that git
history will be screwed as well because of human factor. While good git
history is a very important thing, we should not go crazy about it and
block every change that somehow alters git history. git blame allows to
specify starting revision for a reason.

The other argument (human factor) can be easily solved by using tools
such as clang-tidy. clang-tidy is a clang-based linter for C++. It can
be used for various things, e.g. fixing coding style(e.g. add missing
braces to if statements, readability-braces-around-statements check),
or in our case add missing override keywords.

Test Plan: Compiles.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, apol, romangg, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D22371
2019-07-22 20:03:22 +03:00
l10n daemon script
9c0a71c37f 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"
2019-07-13 05:18:09 +02:00
Vlad Zagorodniy
2b3e679b0f Don't use deprecated QAbstractItemModel::reset()
Summary:
QAbstractItemModel::reset() is deprecated since Qt 5.0. It is strongly
advised to use combination of QAbstractItemModel::beginResetModel() and
QAbstractItemModel::endResetModel() instead.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D22372
2019-07-10 22:49:19 +03:00
Vlad Zagorodniy
0be5bc45a7 Don't use deprecated QAbstractItemModel::setRoleNames
Summary:
setRoleNames() method is deprecated since Qt 5.0. It is strongly advised
to reimplement roleNames() method instead.

Reviewers: #kwin, apol

Reviewed By: apol

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D22358
2019-07-10 02:02:39 +03:00
Vlad Zagorodniy
e839c7067e Port away from deprecated Qt::escape
Summary: Qt::escape() is deprecated since Qt 5.0.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D22356
2019-07-10 00:59:48 +03:00
Vlad Zagorodniy
c7639fd7ed Port away from deprecated headers
Summary: Headers like stdio.h are deprecated in C++.

Test Plan:
Compiles.

clangd no longer spews these warnings

{F6997789, size=full}

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D22351
2019-07-09 23:59:07 +03:00
Vlad Zagorodniy
2cff5cb70a [tabbox] Properly determine depressed modifiers on X11
Summary:
A keysym can be assigned to several keycodes, so more proper way to
determine whether given modifier is depressed is to iterate over all
returned keycodes and see if any is pressed.

If we check only the first keycode, then alternative mappings may not
work, e.g. alt key mapped to win, etc.

BUG: 407720

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21302
2019-05-21 15:43:10 +03:00
Vlad Zagorodniy
7b20e1f66f Overhaul doxygen comments
Summary:
We have a mix of different doxygen comment styles, e.g.

    /*!
      Foo bar.
     */

    /**
     * Foo bar.
     */

    /** Foo bar.
     */

    /**
     * Foo bar.
     */

    /**
     * Foo bar.
     **/

To make the code more consistent, this change updates the style of all
doxygen comments to the last one.

Test Plan: Compiles.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18683
2019-02-12 19:29:33 +02:00
Martin Flöser
2608026b88 Silence warnings in TabBoxHandler
Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18406
2019-01-27 13:25:24 +01:00
Martin Flöser
932ccb2ac3 Switch ThumbnailItem to internal uuid instead of WId
Summary:
So far the ThumbnailItem in TabBox mode used the window id for finding
the window it should render a thumbnail on. In the Wayland world this is
not unique. The window id could be either an X11 window or a wayland
window. We don't guarantee that there are no conflicting ids.

With the internal id we have a way to properly identify the windows, so
this element should use them.

To support this the property changed the type to QUuid and the
clientmodel also provides the QUuid. As in TabBox the way to get the
window is through the model this should be compatible for all themes.
It's tested and verified with the Breeze switcher.

For declarative KWin scripts the ThumbnailItem also provides the
AbstractClient as a property, so there should not be any script which
uses wid. If it does, this could break, but well the script should use
the intended API.

Test Plan: ctest passes, manual testing of Breeze alt-tab switcher

Reviewers: #kwin

Differential Revision: https://phabricator.kde.org/D18405
2019-01-27 09:52:15 +01:00
l10n daemon script
64658c9d37 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"
2019-01-16 09:09:19 +01:00
Yuri Chornoivan
d17a3ff88f Fix minor Doxygen issues 2019-01-12 12:31:32 +02:00
l10n daemon script
ba0b34c755 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-11-22 06:02:11 +01:00
David Edmundson
c42d160742 [TabBox] Fix Arrow Key / Keyboard Events in QML Alt+Tab Skins
Summary:
KWin used to do a quirky trick to send key events to the topmost QQuickItem
rather than things going to the activeFocus item.

Sending it to the window previously would have failed as the window
didn't think it was active.

Since 66986d4afd we can just let the
window process the events in a normal QtQuick manner.

BUG: 370185
Fixed-in: 5.15.0

It will require tabboxes to set focus correctly.
The ones I tested did.

Most analysis for this patch was done by Chris Holland.

Test Plan:
Held+alt tab with the "Text" tabbox switcher
pressed up and down

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: graesslin, kwin, Zren

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16693
2018-11-07 16:22:59 +00:00
Frederik Gladhorn
66986d4afd Make QPA think the tabbox is the active window
Summary:
Without pretendingn to activate the Window, Qt will not send
the right signals for accessibility, thus screen readers not working.

Reviewers: kwin, davidedmundson

Reviewed By: davidedmundson

Subscribers: graesslin, davidedmundson

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16664
2018-11-05 18:21:57 +01:00
Frederik Gladhorn
abceccbb66 Remove unused captures from lambdas
Reviewers: davidedmundson

Reviewed By: davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16481
2018-10-31 09:40:43 +01:00
Frederik Gladhorn
04bbe10038 Remove dead default branches
Summary:
The switch statements iterated over all possible enum values.
When a new enum value is added, it will generate a compiler warning this way.

Reviewers: davidedmundson

Reviewed By: davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16480
2018-10-31 09:24:45 +01:00
Frederik Gladhorn
951dfd1036 Minor grammar fixup in comment 2018-10-28 12:52:26 +01:00
Frederik Gladhorn
7d1d28ea2c Remove extra semicolon 2018-10-28 12:52:19 +01:00
Yuri Chornoivan
bf58da3e9a Fix minor EBN issues 2018-08-29 21:02:16 +03:00
Roman Gilg
f0ba436c72 Explicitly disable pointer constraints on TabBox invocation
Summary:
Pointer constraints should become disabled when the TabBox is invoked. Since
the current client stays activated while TabBox is enabled and currently can
not be deactivated with the risk of regression as discussed in D13758, disable
all pointer constraining explicitly and enable it again when the TabBox is
closed.

Test Plan: Manually in Wayland session.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T8923

Differential Revision: https://phabricator.kde.org/D14142
2018-07-16 10:43:25 +02:00
l10n daemon script
1bd35abebb 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-29 05:22:38 +02:00
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
l10n daemon script
6b0d2fc027 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 05:35:02 +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