Commit Graph

14853 Commits (f5a43877a9ea6ddad9eaa8d7498c8ea518c29c81)

Author SHA1 Message Date
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 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
Marco Martin 892f398b10 move the view at the correct index at startup
Summary:
using the same trick as elsewhere, set the currentIndex
and move the view to currentIndex right at startup
the only way to be sure is onContentHeightChanged
as there are no signals for when "the view has been
populated and settled up"

Test Plan:
the view is at the right state since the first frame shown,
no more jumping around effect

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: davidedmundson, plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D4703
2017-02-24 15:51:53 +01:00
l10n daemon script 6a77b8a1eb 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-02-23 08:49:40 +01:00
Jonathan Riddell 9b84e56392 Update version number for 5.8.6
GIT_SILENT
2017-02-21 11:43:38 +00:00
Martin Gräßlin cb481b4922 Find minimum required Breeze version instead of current version
Summary:
So far KWin put a version requirement on Breeze which is the current
version number of KWin. This is technically correct, but distributions
seem to have problems with it. E.g. I noticed twice in Debian testing
that kwin defaults to Plastik which happens when Breeze is not found.
I reported it, it got fixed, now it's again broken.

Thus I think that distributions have problems with the requirement of
building Breeze prior to KWin. As KWin does not depend on the minor
version, let's depend only on the actual required version, which is
5.8 in the 5.8 branch, 5.9 in the 5.9 branch and master.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D4644
2017-02-17 07:12:57 +01:00
David Edmundson 70d2fb2378 Avoid a crash on Kwin decoration KCM teardown
Summary:
As described in https://bugreports.qt.io/browse/QTBUG-57714  exposing a
QWidget as a context item to QtQuick can crash. Especially as the
engine's context property gets deleted whilst deleting the parent item.

This patch reworks the code so that the models are exposed to QML
directly rather than going through a QWidget.

CCBUG: 373628

Test Plan:
Pressing back whilst in the decoration KCM used to crash every time, now it doesn't.
I still have the buttons.

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: graesslin, cfeck, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D4533
2017-02-10 14:01:09 +01:00
Martin Gräßlin 5a87fa3f92 Support modifier-only-shortcuts when capslock is on
Summary:
So far we didn't trigger modifier-only-shortcuts when capslock was
enabled. In fact we even ensured that the shortcuts did not trigger.
This seems not to be what our users expect. Meta should still trigger
if capslock is on.

This change modifies the logic to determine which modifier is currently
pressed by using the modifiersRelevantForGlobalShortcuts. The difference
to the "normal" modifiers is that this excludes capslock from modifiers
and excludes consumed modifiers. The latter is not really relevant as
modifier-only-shortcuts do not trigger if multiple keys are pressed,
which is required to have a modifier consumed.

BUG: 375355
FIXED-IN: 5.8.6

Test Plan: Only with adjusted autotest

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D4241
2017-01-25 13:39:04 +01:00
Martin Gräßlin a3be3e8e80 Translate the layout name when passing to layout change OSD
Summary:
Xkbcommon does not localize the layout names. We always get the US
English variant. KWin so far passed the strings from xkbcommon directly
to UI visible parts such as the Plasma OSD. This results in not
translated elements in our UI.

As I figured out today the translations exist in the domain
xkeyboard-config. Passing the strings from xkbcommon through this domain
gives us translated layouts.

Unfortunately the xkeyboard-config is not installed by default on all
distributions. E.g. on ubuntu/neon one needs to install xkb-data-i18n
to have the translations available.

Test Plan: Untested as I fail to start Plasma/5.8 KWin on my dev system

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D4243
2017-01-22 12:00:13 +01:00
Martin Gräßlin 0acfebd96b [autotests] Add test case for modifier only trigger when capslock enabled
This extends the testCapsLock to ensure that modifier only shortcut
trigger when capslock is enabled. So far the test only ensured that
capslock doesn't trigger the shift modifier only shortcut.

As the test shows currently when capslock is on, the meta key doesn't
trigger any more.

CCBUG: 375355
2017-01-22 09:42:00 +01:00
l10n daemon script c0be6a45f0 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-01-21 09:00:54 +01:00
Rafał Szalecki a43049f688 Fixed initial graying out options in Cube Effect settings
Typically after deselecting "Show caps" option, the associated options "Cap color" and "Display image on caps" are grayed out (triggered by signal). The bug was when Desktop Cube settings were closed and opened again then the options were not grayed out.

Succesfully compiled and tested by deselecting "Show caps" option in Desktop Cube settings, closing the settings window and opening it once again. The options "Cap color" and "Display image on caps" were then grayed out.

REVIEW: 129194
2017-01-21 00:16:30 +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
Jonathan Riddell 4d3809f8e3 Update version number for 5.8.5
GIT_SILENT
2016-12-27 09:27:02 +00:00
l10n daemon script 818ed8f4ad 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-12-13 05:42:59 +01:00
l10n daemon script 23e500a273 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-12-05 05:13:10 +01:00
l10n daemon script ae5df024b1 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-12-02 05:50:58 +01:00
David Edmundson d0e0f6c88c Align configure button consistently across delegates
Summary:
Currently the configure button is aligned to the win decoration in the
background. This is bound to 40 - the inactive decorations shadow.

This means the configure button ends up in different places across each
item,
looking a bit weird and potentially not even on top of the right
delegate.

This patch aligns the configure button relative to the overall delegate
so that it's in the same place on every item

Test Plan: Looked at KCM

Reviewers: #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

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

BUG: 372685
2016-11-28 09:24:55 +00:00
l10n daemon script 47a7f24ed5 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-11-25 06:39:44 +01:00
Jonathan Riddell 09dfba421b Update version number for 5.8.4
GIT_SILENT
2016-11-22 09:48:07 +00:00
Martin Gräßlin 16c7650d76 Fix AbstractClient::sizeForClientSize
Summary:
The method is supposed to return the AbstractClient's size for a given
client size. That is the size including the window decoration.

The default implementation returned the passed in client size without
adjusting for the decoration. This resulted in ShellClient getting a
wrong size especially when AbstractClient::adjustedClientSize (which
calls sizeForClientSize) was called.

The result of the incorrect size was for example a shrinking of the
window when starting to resize a window.

BUG: 370345
FIXED-IN: 5.8.4

Reviewers: #kwin, #plasma_on_wayland, broulik, subdiff

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3414
2016-11-18 12:36:08 +01:00
Martin Gräßlin fb69b791a1 Ensure that all Effects honour the grab roles correctly
Summary:
When windows get added some effects grab the window and want to be the
only one animating this window. For this the grab roles exists. An
effect being notified later on evaluates the grab state and does not
start the animation.

This process failed due to being dependent on the order the effects are
loaded. Window Added/Closed are signals emitted by EffectsHandler, thus
first come, first serve. The requested effect order does not play into
it.

Due to that it could happen that an Effect which should not animate,
started to animate as the grab was still there.

This change adds the possibility to be notified whenever the window data
changes. A new signal is added to EffectsHandler which is emitted
whenever the windowData changes. The interested effects connect to it
and cancel their (just started) animation for the window.

Adjusted effects are:
* ScaleIn
* Fade
* WobblyWindows

In case of WobblyWindows an additional logical error was fixed that the
animations were only run when an effect grabbed instead of the other way
around.

BUG: 336866
FIXED-IN: 5.8.4

Reviewers: #kwin, #plasma, broulik

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3211
2016-11-07 11:45:09 +01:00
Martin Gräßlin ee7da425ce Unpolish QStyle on QApp prior to destroying internal Wayland connection
Summary:
The QStyle might interact with our internal Wayland connection. If the
cleanup happens after destroying our internal Wayland connection KWin
will crash at tear-down.

With this change the QStyle can perform cleanup already prior to the
deconstruction of the Wayland connection.

CCBUG: 372001

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3241
2016-11-07 11:28:06 +01:00
Martin Gräßlin f3325a1cb8 [helpers/killer] Force to platform XCB
Summary:
The killer can only kill X11 windows. It is also only invoked for Client
and not for ShellClient. The tool interacts with QX11Info which means it
would crash if tried to use on Wayland.

Thus force platform xcb on the tool.

Test Plan: Killer shows for Xwayland windows.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3228
2016-11-07 11:27:32 +01:00
Martin Gräßlin 2a15592571 Simplify the window title passed in from the window system
Summary:
So far KWin used the window title provided from the window directly
without any sanitizing. This could result in broken window decorations
if the title included line breaks. Those were passed to the decoration
and depending on the way how the decoration renders the title, it could
result in visual breakage.

Having line breaks in a window title doesn't make sense. Given that KWin
now simplifies the title when copying it to it's own structure. This
also ensures that the title passed to e.g. task manager does not have
any line breaks on Wayland.

BUG: 323798
FIXED-IN: 5.8.4

Test Plan: Opened the web page in a nested KWin, properly rendered now.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3215
2016-11-07 11:26:48 +01:00
Martin Gräßlin 3c6371390d [desktopgrid] Don't manipulate virtual desktop of desktop window
Summary:
Desktop Grid has a feature that right or middle clicking a window toggles
the on all desktop state. If that is done for a desktop window, things
obviously start to fail.

KWin internally allows to change virtual desktop for all windows, even
for windows like the desktop or docks. Changing in KWin core is not a
solution.

Thus a special casing in desktop grid is added to disallow the selection
for desktop windows.

BUG: 372037
FIXED-IN: 5.8.4

Test Plan: Tried right clicking desktop window and other windows.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3253
2016-11-04 09:32:24 +01:00
Martin Gräßlin da0ba76324 Invert the scroll direction for wheel events on internal windows
Summary:
For whatever reason Qt scrolled the wrong way on internal windows. As a
new QWheelEvent is constructed anyway, just multiply by -1 to get the
direction fixed.

BUG: 371999
FIXED-IN: 5.8.4

Test Plan: Tried debug console in nested setup, scrolled correctly now.

Reviewers: #kwin, #plasma_on_wayland, broulik

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3247
2016-11-04 09:00:10 +01:00
Martin Gräßlin db58c421eb Internal windows cannot be minimized
Summary:
This change ensures that the DebugConsole does not have a minimize
button.

BUG: 372000
FIXED-IN: 5.8.4

Reviewers: #kwin, #plasma_on_wayland, broulik

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3244
2016-11-04 08:59:43 +01:00
Martin Gräßlin fb4b0c40ef [autotests/libinput] Extend the Device test
Added tests for new functionality:
* scroll enabled by default properties
* scroll supported properties
* scroll on button down
2016-11-04 08:58:09 +01:00
Martin Gräßlin f1d17c1a56 [autotests/libinput] Extend device test for scrol methods
Covers the variants for scroll method.
2016-11-03 17:51:32 +01:00
Martin Gräßlin e9dfdbe6a8 [autotests/libinput] Extend Device test case
Tests the new functionality for:
* natural scroll
* middle emulation
2016-11-03 17:22:31 +01:00
David Strobach e4283543f6 [libinput] Add scroll method configuration support
Wraps libinput
libinput_device_config_scroll_get_methods
libinput_device_config_scroll_get_default_method
libinput_device_config_scroll_set_method
libinput_device_config_scroll_get_method
libinput_device_config_scroll_set_button
libinput_device_config_scroll_get_button
libinput_device_config_scroll_get_default_button

Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D3194
BUG: 371803
FIXED-IN: 5.8.4
2016-11-03 14:03:17 +01:00
David Strobach b19341777a [libinput] Add natural scrolling support
Wraps libinput
libinput_device_config_has_natural_scroll
libinput_device_config_set_natural_scroll_enabled
libinput_device_config_get_natural_scroll_enabled
libinput_device_config_scroll_get_default_natural_scroll_enabled

Differential Revision: https://phabricator.kde.org/D3193
BUG: 371791
FIXED-IN: 5.8.4
2016-11-03 14:02:27 +01:00
David Strobach e00649d002 [libinput] Add middle mouse button emulation support
Wraps libinput
libinput_device_config_middle_emulation_is_available
libinput_device_config_middle_emulation_set_enabled
libinput_device_config_middle_emulation_get_enabled
libinput_device_config_middle_emulation_get_default_enabled

Differential Revision: https://phabricator.kde.org/D3187
BUG: 371756
FIXED-IN: 5.8.4
2016-11-03 14:00:03 +01:00
Martin Gräßlin 679e417808 Don't snap to auto-hidden panels
Summary:
When moving windows we don't want to snap against not visible windows
like auto-hidden panels.

BUG: 365892
FIXED-IN: 5.8.4

Test Plan: So far only auto-test, manual test will follow.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3225
2016-11-03 08:35:25 +01:00
Martin Gräßlin 6c121436e2 [scripting] Silence unused variable warnings
CCMAIL: github@chilon.net
2016-11-03 08:17:11 +01:00
Martin Gräßlin be9ee989b1 [scripting] Fix export of WorkspaceWrapper in QtScript
The export of the WorkspaceWrapper was changed to be a subclass with all
the elements still being in the parent class. But the "workspace" was
exported with QScriptEngine::ExcludeSuperClassContents. Thus all usages
of workspace were broken and our tests started to fail on build.kde.org.

This change removes the ExcludeSuperClassContents which means that also
the QObject properties and slots are now exposed which was previously
not the case.

CCMAIL: github@chilon.net
2016-11-03 08:13:25 +01:00
James Pike 4730be084c Support for workspace.clientList() in declarative script
Summary:
The version provided is only compatible with QtScript so it became
necessary to split WorkspaceWrapper into a base class and two child
classes, one for QtScript and one for QmlScript.

BUG: 340125
FIXED-IN: 5.8.4
REVIEW: D3185
2016-11-02 23:31:06 +00:00
David Edmundson 254690e899 Correctly set i18n suffix in mousemark spinbox.
Summary:
QSpinBox can't handle plural suffixes. Something previously done by
KIntSpinBox.

Using setSuffix(ki18np("pixel", "pixels")).toString() does nothing, as
at the time of conversion we don't know which one to use.

This patch uses KPluralHandlingSpinBox and correct ki18np.

Note, "new" dependency was already linked implicitly in other kwin, but
we need to add it for this KCM.

Test Plan:
Opened KCM (in English) set counter to 1 pixel and 2 pixels.
No longer had a big warning. Also appropriate number of s's appeared.

Reviewers: #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3222
2016-11-02 13:07:39 +00:00
Martin Gräßlin 3a179f32af [autotests] Add test case for snap to auto-hiding panel
Workspace::adjustClientPosition incorrectly snaps against an auto hidden
panel as the test shows.

CCBUG: 365892
2016-11-02 11:28:54 +01:00
Jonathan Riddell 241d8bfa27 Update version number for 5.8.3
GIT_SILENT
2016-11-01 11:35:59 +00:00
Martin Gräßlin 55a0afca97 [autotest] Add test case for window caption need to be simplified
The test illustrates that special characters like a line break are not
removed from the window caption, which results in a line break added in
the window decoration.

Test case uses a title from a web page triggering it in Firefox.

CCBUG: 323798
2016-10-31 15:54:16 +01:00
l10n daemon script 9e23d20f8f 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-10-31 12:00:16 +00:00
Martin Gräßlin 82054a406a Send a pointer leave when triggering a move resize
Summary:
When triggering a move resize all following pointer events are grabbed
by KWin itself. Thus the correct behavior is to informe the client about
it and send a pointer leave.

This ensures that after the move resize ended the pointer gets a new
enter. By sending anew pointer enter the position gets updated to the
new position which so far did not happen and the client generated events
on the wrong position.

BUG: 371573
FIXED-IN: 5.8.3

Reviewers: #kwin, #plasma_on_wayland, broulik

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3154
2016-10-31 11:51:15 +01:00
Martin Gräßlin e4930c0c41 [autotest] Make SlidingPopupsTest a little bit more robust
The first test case was sometimes failing due to the time value in the
first render pass being too high. So that the effect ended directly for
the window.

This change adds a small waiting time for the compositor to render prior
to the creation of the window. Ideally we would connect to frameRendered
signal, but the OpenGL compositor doesn't emit it yet.
2016-10-31 08:55:54 +01:00
Martin Gräßlin 3aeb7367bb [autotests] Extend SlidingPopupTests for Wayland windows
Same test case as for X11 windows added for Wayland windows.
2016-10-31 08:43:35 +01:00