Commit graph

17043 commits

Author SHA1 Message Date
Aleix Pol
cbd200d147 Merge branch 'Plasma/5.16' 2019-06-23 20:00:09 +02:00
Aleix Pol
22cbbca043 Make sure we don't resize clients before they've been set up
Summary:
On Placement=Maximized it becomes a problem because we end up sending an invalid size and when we try to recover from it, we recover from the wrong size.
This fixes setting the right size to Plasma Mobile applications.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D22054
2019-06-23 19:59:19 +02:00
David Edmundson
3604aaf74c Close screen grabbing effect when screensaver starts
Summary:
The screenlock fails on X11 if it can't grab the keyboard.

We can't nicely solve the generic case. We can solve the common case of
a kwin effect being active.

It's not critical, arguably not even desirable to have these effects
persist after the screen is locked through an external trigger. We can
just close the effect early.

Key grabs have to be relased early before the close animation completes
so that the locker doesn't have a race based on animation times.

It's not ideal, but no worse than the current state for not much work.

BUG: 234153

Test Plan:
locked screen on a timer
opened various effects

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: ngraham, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20890
2019-06-23 18:00:47 +02:00
David Edmundson
3e428d3388 Merge branch 'Plasma/5.16' 2019-06-23 17:59:10 +02:00
David Edmundson
515f3cbb4e Avoid crash without XWayland
Summary: readX11ShadowProperty fails without an X connection

Test Plan: Tested by Kai who didn't have xwayland

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21965
2019-06-23 17:58:49 +02:00
David Edmundson
9917aef95f Merge branch 'Plasma/5.16' 2019-06-22 17:28:12 +02:00
David Edmundson
bc97232dfd [wayland] Obey m_requestGeometryBlockCounter inside updateDecoration
Otherwise we can send our configure request too early

Reviewed-by: Bhushun Shah
2019-06-22 17:25:13 +02:00
Aleix Pol
bb9a5e57a1 Implement the keystate protocol
Summary: Depends on D20191

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20192
2019-06-22 12:34:06 +02:00
Roman Gilg
994fafa912 Move non-Compositor functions out of composite.cpp source file
Summary:
Compositing today is ubiquitous. There is no reason to keep compositing
specific functions of Toplevel, Client and Workspace classes in the
composite.cpp source file. Instead let these definitions be separated.

Test Plan: Compiles

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Maniphest Tasks: T11071

Differential Revision: https://phabricator.kde.org/D21654
2019-06-22 12:02:54 +02:00
Nate Graham
4dd4ca8f1c [effects/presentwindows] Allow closing windows on middle-click
Summary:
Plasma's Task manager exposes an optional  feature whereby the user
can middle-click on a window to close it, but the Present Windows effect
does not do the same.

The presence of a close button you can left-click does not replace the desirable
feature to be able to middle-click on a window to close it, because then the
whole window becomes a click target, so it can be much much faster than
having to aim for the little close button. Also it's off by default, so a user
who goes out of their way to turn it on is signaling that they want to accept the
risk of accidentally closing a window by accident.

Finally, the feature is not allowed for left-click, so people can never accidentally
wreck Present Windows for themselves by assigning it to left-click by accident
and then mistakenly closing their windows.

This reverts commit 55585514f9.

FEATURE: 321190
FIXED-IN: 5.17.0

Test Plan:
Set "Close window" in the Present windows effect, trigger effect, and middle-click on window

{F6815303}

Reviewers: #kwin, davidedmundson, broulik, zzag, #plasma, hein, mart

Reviewed By: #kwin, #plasma, mart

Subscribers: mart, abetts, apol, zzag, luebking, kossebau, graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21083
2019-06-21 10:25:32 -06:00
l10n daemon script
db12cb6742 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-06-21 05:35:42 +02:00
l10n daemon script
02babfa36e 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-06-20 08:54:54 +02:00
l10n daemon script
e8fe3f2fb7 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-06-20 05:27:25 +02:00
Kai Uwe Broulik
8a2f2b5fb9 [effects/login] Reduce animation time
On modern machines session startup takes a few seconds where the 2s might artificially slow down the process by like 50%.
This makes the animation quicker to make the system feel ready quicker.

Differential Revision: https://phabricator.kde.org/D21904
2019-06-19 18:24:55 +02:00
Erik Kurzinger
0124b1ef19 [platforms/X11] Disable VSync for QtQuick Windows
Summary:
QtQuick windows created by KWin currently use the default swap interval
of 1, meaning buffer swaps will block until vblank. However, this
results in a problematic interaction on hybrid graphics systems running
the proprietary NVIDIA driver.  VSync on such setups relies on a system
called "PRIME synchronization", where the xf86-video-modesetting driver
controlling the display will signal the NVIDIA driver when vblank has
occurred. The issue is that it will only do so if there has been damage
to the screen.

So, when KWin creates a QtQuick window, compositing will stop waiting on
the window to render, therefore no damage to the screen will occur. But
this means that no vblank notifications will be delivered to the NVIDIA
driver, so the glXSwapBuffers call by the QtQuick window will block
perpetually. The end result is a freeze of the desktop.

To get around this, we can simply disable vsync for QtQuick windows by
setting the swap interval for the default QSurfaceFormat to 0. Since
they are redirected, this shouldn't cause any tearing.

BUG: 406180
FIXED-IN: 5.16.2

Test Plan:
Using the proprietary NVIDIA driver on a hybrid graphics system, with
PRIME synchronization enabled (see
https://devtalk.nvidia.com/default/topic/957814/linux/prime-and-prime-synchronization/),
perform any action causing a QtQuick window to be created by KWin, for
example, triggering the application switcher dialogue with alt + tab.

Ensure the desktop does not temporarily freeze.

Note, this required a Qt build that includes commit
https://code.qt.io/cgit/qt/qtbase.git/commit/?id=0c1831178540462da31fd7a4b6d2e446bc84498b
resolving a bug that prevented the changing the swap interval.

Reviewers: #kwin, davidedmundson, zzag

Reviewed By: #kwin, davidedmundson, zzag

Subscribers: zzag, romangg, alexeymin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21808
2019-06-19 08:06:15 -07:00
Erik Kurzinger
56cd5f5557 [platforms/X11] Disable VSync for QtQuick Windows
Summary:
QtQuick windows created by KWin currently use the default swap interval
of 1, meaning buffer swaps will block until vblank. However, this
results in a problematic interaction on hybrid graphics systems running
the proprietary NVIDIA driver.  VSync on such setups relies on a system
called "PRIME synchronization", where the xf86-video-modesetting driver
controlling the display will signal the NVIDIA driver when vblank has
occurred. The issue is that it will only do so if there has been damage
to the screen.

So, when KWin creates a QtQuick window, compositing will stop waiting on
the window to render, therefore no damage to the screen will occur. But
this means that no vblank notifications will be delivered to the NVIDIA
driver, so the glXSwapBuffers call by the QtQuick window will block
perpetually. The end result is a freeze of the desktop.

To get around this, we can simply disable vsync for QtQuick windows by
setting the swap interval for the default QSurfaceFormat to 0. Since
they are redirected, this shouldn't cause any tearing.

BUG: 406180
FIXED-IN: 5.16.2

Test Plan:
Using the proprietary NVIDIA driver on a hybrid graphics system, with
PRIME synchronization enabled (see
https://devtalk.nvidia.com/default/topic/957814/linux/prime-and-prime-synchronization/),
perform any action causing a QtQuick window to be created by KWin, for
example, triggering the application switcher dialogue with alt + tab.

Ensure the desktop does not temporarily freeze.

Note, this required a Qt build that includes commit
https://code.qt.io/cgit/qt/qtbase.git/commit/?id=0c1831178540462da31fd7a4b6d2e446bc84498b
resolving a bug that prevented the changing the swap interval.

Reviewers: #kwin, davidedmundson, zzag

Reviewed By: #kwin, davidedmundson, zzag

Subscribers: zzag, romangg, alexeymin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21808
2019-06-19 07:56:42 -07:00
Jonathan Riddell
105ae7bb7f Update version number for 5.16.1
GIT_SILENT
2019-06-18 10:37:27 +01:00
Vlad Zagorodniy
8e88139fd6 Overhaul AbstractOutput
Summary:
There are several issues with code of AbstractOutput class:

(a) Some methods are documented, and some are not. In general, we tend
    to document all public methods in KWin core. It looks like a very
    minor issue, but there are methods that have very ambiguous return
    value. One such method is geometry(). It's not obvious whether the
    returned geometry is in device independent pixels or not;

(b) There's a mix of methods defined in the cpp file and in the header.
    This is not very good because reading such code becomes a bit harder
    if you don't use any fancy IDE;

(c) Missing Q_DISABLE_COPY, etc.

This change addresses these issues, so the code is a bit more readable
and easier to work with.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: broulik, cfeck, davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21874
2019-06-17 16:34:38 +03:00
Vlad Zagorodniy
0d381846f1 Backport Night Color feature to X11
Summary:
The color correction manager doesn't make any specific assumptions about
underlying platform, e.g. whether it's x11, etc. The platform just
has to be capable of setting gamma ramps. Given that, there are no any
significant technical blockers for making this feature work on x.

Reviewers: #kwin, davidedmundson, romangg

Reviewed By: #kwin, davidedmundson, romangg

Subscribers: romangg, neobrain, GB_2, filipf, davidedmundson, ngraham, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21345
2019-06-17 12:09:04 +03:00
Roman Gilg
a39c74059e Remove BasicScreens class
Summary:
After porting all platforms to using AbstractOutput the BasicScreens
class is not needed anymore.

Test Plan: Compiles

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T11098

Differential Revision: https://phabricator.kde.org/D21800
2019-06-14 14:22:29 +02:00
Roman Gilg
6ac1585e12 Fix xdg-output creation
In 1a11abc821 some function calls in the createXdgOutput function were
accidentally removed resulting in possibility of broken setup on startup.

Add these calls back again.
2019-06-14 12:10:28 +02:00
Laurent Montel
6df7b2e863 Use new logging category directory when ECM>=5.59 2019-06-13 13:31:51 +02:00
Roman Gilg
1a11abc821 [platforms/x11/standalone] Port to AbstractOutput
Summary:
Represent outputs in the X11 session via AbstractOutput. For that we
move all Wayland specific parts of AbstractOutput into a new subclass
AbstractWaylandOutput and let the outputs of our Wayland backends inherit
from there.

This should allow us to get rid of the Screens class later on.

Test Plan: Manually in X session.

Reviewers: #kwin, zzag, davidedmundson

Reviewed By: #kwin, zzag, davidedmundson

Subscribers: ngraham, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19208
2019-06-13 11:39:25 +02:00
Roman Gilg
8040c559cb [platforms/x11/windowed] Port to AbstractOutput
Summary:
To homogenize our backends and as another step to remove the Screens class
use the AbstractOutput class in the windowed X11 backend.

Test Plan: Manually in X session.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: davidedmundson, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19207
2019-06-13 11:27:59 +02:00
Alexander Potashev
29e4ca26a6 Merge branch 'Plasma/5.16' 2019-06-12 12:58:28 +03:00
Yuri Chornoivan
b24aa90af7 Really use the translations. Patch by Victor Ryzhykh <victorr2007@yandex.ru> 2019-06-12 12:57:29 +03:00
Gabriel Felipe Huwe
92d482b331 [effects/screenshot] Remove outdated reference to KSnapshot
Summary:
Since KSnapshot is no longer used, I modified the text in `effect_builtins.cpp` to reflect that, changing it to a generic "screenshot tools".

BUG: 408407
FIXED-IN: 5.17.0

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: filipf, davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21700
2019-06-10 08:48:19 -06:00
l10n daemon script
d3f1078c94 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-06-09 08:29:13 +02:00
l10n daemon script
e4ba37109f 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-06-09 05:13:32 +02:00
Roman Gilg
2c088894b4 [autotests] Fix decoration input test
Since d51b8dc093 the test fails on CI, apparently because we test with
Breeze default settings, which is no borders now and we can move a bit into
the window geometry and still be on the border if borders exist, otherwise
not.

For now fix it by checking if there are borders or not and then test
accordingly. But long-term we should test both cases and besides not rely on
external decorations for our test, instead use a fake specific for our
integration testing.
2019-06-07 14:48:45 +02:00
Roman Gilg
846961bfae Delayed focus updates for Toplevels without surface
Summary:
XWayland clients have a surface associated with them asynchronously. In this
case we don't directly want to set focus on this Toplevel, but wait until the
surface is set.

This patch aims in conjunction with an unrelated fix to SDL at improving Steam
Big Picture Mode in our Wayland session.

Test Plan: Steam BPM regains focus on game close.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: anthonyfieroni, davidedmundson, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19262
2019-06-06 23:34:49 +02:00
Roman Gilg
2e20cac5e2 [platforms/fbdev] Port to AbstractOutput
Summary:
To homogenize our backends and as another step to remove the Screens class
use the AbstractOutput class in the framebuffer backend.

Test Plan: Manually on VT enforcing the framebuffer backend.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19199
2019-06-06 22:36:40 +02:00
Roman Gilg
d3ad6bc0b9 kconfig_update for auto border size introduction
Summary:
If a user has set his border size explicitly in the past also respect this
selection with the new auto border size mode by setting auto borders to
false on update.

For this a kconf_update file and a sed based shell script is added.

Test Plan: Manually.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: zzag, davidedmundson, kwin

Tags: #kwin

Maniphest Tasks: T8707

Differential Revision: https://phabricator.kde.org/D13480
2019-06-06 22:27:00 +02:00
Roman Gilg
d51b8dc093 [decorations] Let KDecoration plugins recommend a border size per default
Summary:
This is an alternative solution to T8707 and in comparision to D13276 a less
drastic change to KWin's default behavior.

Instead of changing the border size default for all KDecoration plugins by
switching the default from border size Normal to None introduce new
functionality, which allows a KDecoration plugin to recommend a border size in
its metadata. By default KWin listens for these recommendations and sets the
border size accordingly.

If there is no metadata recommending a border size, KWin falls back to the
current setting of Normal sized borders.

A user is able to override the recommendations from the KCM, which has been
extended accordingly.

Test Plan: Manually with adjusted metadata of Breeze.

Reviewers: #kwin, #plasma, #vdg, ngraham

Reviewed By: #vdg, ngraham

Subscribers: hpereiradacosta, filipf, anemeth, davidedmundson, abetts, graesslin, ngraham, zzag, kwin

Tags: #kwin

Maniphest Tasks: T8707

Differential Revision: https://phabricator.kde.org/D13284
2019-06-06 22:24:45 +02:00
Jonathan Riddell
97532b3b1f Update version number for 5.16.0
GIT_SILENT
2019-06-06 12:03:01 +01:00
Roman Gilg
82b9d3b59e Merge branch 'Plasma/5.16' 2019-06-05 16:47:34 +02:00
Roman Gilg
7c7fb758ad Avoid again invalid geometry of internal clients
Summary:
This adds again the workaround from 1fb2eace3f, which got temporarily
removed by 9b922f8833.

BUG: 386304

Test Plan: Manually

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21601
2019-06-05 16:40:12 +02:00
l10n daemon script
1b8e5061ab 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-05-31 08:34:35 +02:00
l10n daemon script
c62650394f 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-05-31 05:14:47 +02:00
Aleix Pol
cd7fae95a4 Forward and log exit code of the nested process
Summary: Otherwise it's hard to tell if it failed.

Test Plan: Found out that my session was crashing.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21465
2019-05-29 17:00:44 +02:00
Yuri Chornoivan
835f3dfde9 Really use the translations. Patch by Victor Ryzhykh <victorr2007@yandex.ru> 2019-05-29 15:16:04 +03:00
Vlad Zagorodniy
fe27847025 Merge branch 'Plasma/5.16' 2019-05-27 17:31:47 +03:00
Vlad Zagorodniy
4ece0a9f40 Merge branch 'Plasma/5.12' into Plasma/5.16 2019-05-27 17:31:10 +03:00
Vlad Zagorodniy
67444e3659 [effects/screenshot] Upload data to xpixmap in chunks
Summary:
xcb_put_image doesn't handle big images well. Contrary to XPutImage, the
caller must manually split the data in such a way that each xcb_put_image
request doesn't exceed the maximum request length. Not doing so will result
in libxcb shutting down the connection.

CCBUG: 338489
CCBUG: 388182

Test Plan: Take a screenshot of an active fullscreen client on a 4K monitor.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21370
2019-05-27 17:30:21 +03:00
Vlad Zagorodniy
4bbef8d128 [scripting] Emit clientAdded for Wayland clients
Summary:
Currently, if a script relies on clientAdded to setup some required
connections, then it probably won't work with Wayland clients because
clientAdded is emitted only for X11 clients.

Test Plan:
* Installed sticky window snapping script, it works;
* Installed a couple of tiling scripts, with some small changes, they work.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: strobach, TomButler, davidedmundson, mart, graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D17097
2019-05-24 00:27:32 +03:00
Vlad Zagorodniy
689d89ae4e [scripting] Port the remaining bits of API to AbstractClient
Currently, clientArea(ClientAreaOption, const Client *) and clientList()
are quite X11-specific, which results in having some tiling scripts not
working with Wayland clients. This change is the first step towards working
tiling scripts in the Wayland session.
2019-05-24 00:27:11 +03:00
Nate Graham
1516595742 [kcmkwin/touchscreen+screenedges] Call KRunner KRunner
Summary:
In the context of the Touch Screen and Screen Edges KCM, using the term "Run Command" to
refer to KWin is inaccurate and misleading. By using a string that starts with an action
verb and no ellipses, it is suggested that the action is literally to run some command,
prompting the user to think "which command will it run? How do I choose what it is?"

This patch changes the action text to "Show KRunner" which is the proposed new standard.

See {T10966} for more information and reasons why to do this.

Test Plan:
{F6842531}

{F6842530}

Reviewers: #vdg, #kwin, ndavis

Reviewed By: #vdg, ndavis

Subscribers: ndavis, davidedmundson, kwin

Tags: #kwin

Maniphest Tasks: T10966

Differential Revision: https://phabricator.kde.org/D21342
2019-05-22 12:18:29 -06: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
Antonio Rojas
f59f8ffcf7 Merge branch 'Plasma/5.16' 2019-05-17 18:57:11 +02:00
Antonio Rojas
94d2fea23a Move knsrc files to the new location
Instead of the old legacy /etc/xdg location

Differential Revision: https://phabricator.kde.org/D21254
2019-05-17 18:56:27 +02:00