Commit graph

17479 commits

Author SHA1 Message Date
David Edmundson
20a202b11a [libkwineffects] Construct correct mouse event when forwarding to QtQuickView
Summary:
Original code (copied from Aurorae) created a QMouseEvent for
QHoverEvents. Whilst it apparently worked, it's technically wrong.

It's safer to have an explicit type check given we come from a downcast
QEvent* and then build the correct event.

Test Plan: Hovered some icons

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25207
2019-11-14 12:50:29 +00:00
David Edmundson
6dfb7ba1ce [aurorae] Use shared implementation of QtQuick rendering
Summary:
Removes a tonne of complex code, means any future improvements to our
QtQuick integration only need to be in one place.

QML logic remains in Aurorae as it does complex things. All other
aurorae specialties remain.

Only functional difference is that we now use a shared GL context
between window frames, which Plasma::FrameSVG will make use of.

Test Plan:
kcmshell5 kwindecoration
ran some aurorrae themes on my kwin. Look the same as master

Reviewers: #kwin, mart

Reviewed By: mart

Subscribers: mart, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25206
2019-11-14 12:50:24 +00:00
Roman Gilg
8d13729031 [platforms/x11] Never block on retrace, always present after paint
Summary:
Compositing in X11 was done time shifted, meaning that we paint first, then
wait one vblank interval length and present on prepareRenderingFrame the
previous paint result. This is supposed to make sure we don't miss the vblank
and in case of block till retrace be able to continue issuing commands and
only shortly before next vblank present.

This is counter-intuitiv, not how we do it on Wayland or even on MESA with X.
The reason seems to be that the GLX backend was in the beginning written
against Nvidia proprietary driver which needed this but nowadays even this
driver defaults to non-blocking behavior on buffer swap.

Therefore remove this legacy anomaly fully and directly present after paint.
We then wait one refresh cycle and in the future can optimize this by delaying
the paint and present till shortly before vsync.

Test Plan: kwin_x11 tested on i915 and Nvidia proprietary driver.

Reviewers: #kwin

Subscribers: zzag, alexeymin, kwin

Tags: #kwin

Maniphest Tasks: T11071

Differential Revision: https://phabricator.kde.org/D23514
2019-11-14 09:03:44 +01:00
Roman Gilg
b3a19f9e5b Remove vsync detection and configurability
Summary:
Selecting not to vsync does not make sense for an X11 compositor. In the end
we want clients to be able to present async if they want to but the compositor
is supposed to send swaps with vsync to the XServer in order to not generate
tearing artifacts.

There was also a detection logic which did some questionable things in case
vsync was not available. I don't think this is necessary at all since we can
just always run a timer to present with or without vsync.

Test Plan: kwin_x11 tested on i915.

Reviewers: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Maniphest Tasks: T11071

Differential Revision: https://phabricator.kde.org/D23511
2019-11-14 08:55:08 +01:00
Roman Gilg
285adc1950 [platforms/x11/standalone] Remove SGI swap control and video sync
Summary:
Current hardware should suppport either GLX_EXT_swap_control or
GLX_MESA_swap_control. To simplify code remove the usage of SGI extensions.

Test Plan: kwin_x11 tested on i915.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: davidedmundson, kwin

Tags: #kwin

Maniphest Tasks: T11071

Differential Revision: https://phabricator.kde.org/D23510
2019-11-14 08:48:11 +01:00
Roman Gilg
ad892ce3a6 [platforms/x11] Remove triple buffering detection
Summary:
It is not clear what the advantage of triple buffering is for KWin. An X11
compositor is meant to swap buffers once every monitor cycle. For that triple
buffering is not necessary.

The functionality is not maintained, does not reliably work as displayed by
the existence of an environment variable to force some behavior, pollutes
our code and every compositing-related problem that might be mitigated with
triple buffering should find a simpler and more fitting solution with other
means.

There is one caveat which is if we shall block for retrace. We set it
currently according to the result of the swap profiler and in the most common
case with double buffering it is set to true. But on Nvidia systems this might
be actual the wrong behavior. Instead of trying to work around this ignore
the issue for now and move the overall architecture to something less complex
by presenting after paint how we do it in the Wayland DRM backend and with
double buffering on GLX (although this is at the moment also borken because
we actually present then twice).

Test Plan: kwin_x11 tested on i915.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, fredrik, kwin

Tags: #kwin

Maniphest Tasks: T11071

Differential Revision: https://phabricator.kde.org/D23504
2019-11-14 08:38:36 +01:00
l10n daemon script
48c253355b 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-11-12 05:44:06 +01:00
l10n daemon script
a6b705bb75 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-11-11 05:31:05 +01:00
Nicolas Fella
0789539a9b Remove some unused includes
Test Plan: Builds

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25243
2019-11-10 20:26:35 +01:00
l10n daemon script
148168dc47 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-11-09 05:38:53 +01:00
l10n daemon script
aa3a16845b 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-11-06 05:43:12 +01:00
David Edmundson
0a7aa75870 Update tests to include newly added session quit effect 2019-11-05 15:02:59 +00:00
David Edmundson
34bfc49189 adjust cmake include order 2019-11-05 10:53:13 +00:00
l10n daemon script
cd04a6c901 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-11-05 05:34:25 +01:00
David Edmundson
0369011c23 Add KDEClangFormat cmake support
Summary:
This allows devs to run: "make clang-format" and format all files easily
using the preset KDE clang format style

This patch adds support so devs can easily test the intended formatting
now, it doesn't change the code yet.

Doing an initial run to commit everything will happen later.

Test Plan:
Ran script
git diff was full of amazingly cleaned code

See D25134
2019-11-04 23:44:34 +00:00
l10n daemon script
a0d98a61c5 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-11-04 05:27:01 +01:00
Roman Gilg
b89b1d8166 [platforms/wayland] Use xdg-shell stable protocol
Summary:
We support the stable xdg-shell protocol nowadays. So use this one instead of
version 6 unstable.

Test Plan:
Runs with other recent patches in KWin nested. In Weston nested session still
not yet working.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25129
2019-11-03 19:30:08 +01:00
Roman Gilg
9c0501eb8f [platforms/wayland] Always ack configure
Summary:
Per protocol a zero-size can be sent indicating that the client should resize
its surface to its liking. For now change the code such that it at least sends
the ack-configure back and leaves the current size untouched.

Test Plan: Compiles.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25128
2019-11-03 19:28:44 +01:00
Roman Gilg
932a1160f5 [platforms/wayland] Do an initial xdg-surface commit
Summary:
After setting the xdg-surface role an initial commit must be sent per
protocol description.

This fixes Wayland nested session after commit 84de8d135d made this
requirement explicit.

Test Plan: Launched Wayland nested session.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25127
2019-11-03 19:27:13 +01:00
l10n daemon script
f0a021eae5 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-11-03 05:21:29 +01:00
l10n daemon script
2bb025cbdb 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-11-02 05:41:14 +01:00
Kai Uwe Broulik
66f2e2b158 Merge branch 'Plasma/5.17' 2019-11-01 22:43:50 +01:00
Kai Uwe Broulik
87f36f53b3 [effects/startupfeedback] Fallback to small icon size when no cursor size is configured
As appears to be the case with the default setup...

BUG: 413605
FIXED-IN: 5.17.3

Differential Revision: https://phabricator.kde.org/D25065
2019-11-01 22:40:35 +01:00
David Edmundson
e4ac215fcb [effects] Add effect to hold the desktop window static after plasmashell quits
Summary:
When a plasma session quits, the order of plasmashell and clients quitting is undetermined.

This looks bad as our desktop background disappears quite early. Rather than changing the real order, we can have kwin reference the last pixmap of any desktop and hold on to it.

Lasting till the compositor quits means it stays on the X frontbuffer till X quits and the experience is seamless.

Test Plan: Logged out (with relevant other ksmserver patches)

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24864
2019-11-01 17:14:55 +00:00
David Edmundson
ec610fd7ed Port one of session management connections state to a custom API
Summary:
Currently kwin opens a second ICE connection to ksmserver in order to
tell the state of kwin's whether we're logging out and saving clients or
not.

This requires that kwin launches after ksmserver to have the connection
which is a dependency I want to break.

Practically this code is already ksmserver specific as it relies on some
custom code that sends the first saveState request to kwin first.

Instead we can replace it with a bespoke IPC over DBus and siplify the
code both end. This will allow several other future enhancements that we
want with regards to handling the session state, as well as make an
effort platform agnostic session management, as well as cleaning up some
complex code.

Ksmserver calls into kwin, rather than having kwin watch ksmserver state
to allow us make sure it's race free.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: romangg, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24862
2019-11-01 17:14:42 +00:00
l10n daemon script
cf2791803f 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-31 05:34:18 +01:00
Albert Astals Cid
e144748c7a Add some const &
Summary:
Won't make things go much faster since everything that was
being passed by value is refcounted but still const & is a bit faster
than refcounting

For shared pointers instead of adding const & we move them into the
destination variable saving some cpu usage but at the same time making
clear the pointer is being stored by not being const &

Reviewers: zzag

Reviewed By: zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25022
2019-10-30 19:23:01 +01:00
Martin Flöser
92197242ce Add support for virgl in GLPlatform
Summary:
This change adds detection support for virgl (Mesa gallium virtio guest driver).
Results in proper detection in supportInformation and debug console.

Test Plan: Modified test passes, run KWin_Wayland in kvm with virgl and verified supportInformation

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25056
2019-10-29 20:57:02 +01:00
Jonathan Riddell
c42a4234aa Update version number for 5.17.2
GIT_SILENT
2019-10-29 17:57:26 +00:00
Roman Gilg
affd444507 Merge branch 'Plasma/5.17' 2019-10-29 12:12:02 +01:00
Roman Gilg
7459aabcac Dmabuf recovery on EGL reset
Summary:
The EGL platform might go away at any time through reconfiguration or because
of a graphic error. KWin then resets the graphics. The dmabuf implementation
must respect that and recover from a graphics reset by recreating all EGL
images for existing buffer.

This assumes that we won't change our graphics API mid-session and that
supported plane and modifier configuration stays constant.

In practise we remember all current dmabufs in a single map and only remove
them if the client did destroy the resource.

BUG: 411980
CCBUG: 413403
FIXED-IN: 5.17.2

Test Plan: Applied screenedge configuration without crash.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: fvogt, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24954
2019-10-29 12:10:15 +01:00
Nate Graham
9e9c9a68bd Merge branch 'Plasma/5.17' 2019-10-28 12:46:04 -06:00
Nate Graham
a151edd29b [kcmkwin/kwindecoration] Fix default window size in KCMShell
This also fixes a binding loop.

BUG: 413557
FIXED-IN: 5.17.2
2019-10-28 12:43:33 -06:00
Nate Graham
de4cf76859 Merge branch 'Plasma/5.17' 2019-10-28 07:57:34 -06:00
Nate Graham
105976a42a [kcmkwin/desktop] Elide "Show animation when switching" checkbox text
Summary:
Otherwise the combobox containing the switching effects escapes from the page. Same fix
as D24885.

BUG: 403151
FIXED-IN: 5.17.2

Test Plan:
Checkbox text now elides when the window is made very narrow, and combobox no longer gets
cut off.

Reviewers: #kwin, zzag, davidedmundson

Reviewed By: #kwin, zzag, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24988
2019-10-28 07:57:18 -06:00
Vlad Zahorodnii
df614e218d Delete some redundant checks
Summary: sizeForClientSize checks the minimum and the maximum size.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24473
2019-10-28 14:08:01 +02:00
Vlad Zahorodnii
2e453c31dc Delete some commented code
Summary:
This code has been commented for more than a decade. Given that no any
useful comment is provided along the commented code, it's difficult to
say what exactly we need to fix. From the other side, the commented
code does nothing.

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24472
2019-10-28 14:06:56 +02:00
Nate Graham
e4d470e08b Merge branch 'Plasma/5.17' 2019-10-27 13:12:57 -06:00
Nate Graham
ee2507129b [kcmkwin/kwinvirtualdesktops] Improve default window size when opened in kcmshell 2019-10-27 13:11:45 -06:00
Vlad Zahorodnii
69a3517e02 Merge branch 'Plasma/5.17' 2019-10-25 17:50:13 +03:00
Vlad Zahorodnii
a738ecce85 [scripting] Provide conversion functions for AbstractClient
Summary:
If no conversion functions are provided for a QObject-subclass, then
QScriptEngine will use QScriptEngine::newQObject() method without any
special options to convert an instance of that QObject-subclass to a
QScriptValue. However, it's very important that every client object is
wrapped with PreferExistingWrapperObject option. We need that option
because a script may set a property on a client object and that property
must remain until it's deleted by the script.

BUG: 413044
FIXED-IN: 5.17.2

Test Plan: New test.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24944
2019-10-25 17:39:45 +03:00
Vlad Zahorodnii
54ca0dfe12 Merge branch 'Plasma/5.17' 2019-10-24 18:57:37 +03:00
Vlad Zahorodnii
8e176c8b0d Don't use MESA_EGL_NO_X11_HEADERS
Summary:
With recent Mesa updates (19.2.1), MESA_EGL_NO_X11_HEADERS doesn't have
any effect. So, let's include fixx11h.h instead.

Test Plan: I am able to build kwin once again.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24840
2019-10-24 18:57:30 +03:00
Sian Cao
1177ef3720 [x11] Check pending release when mapping
Summary:
 when unmap notify is followed by a map, the old Unmanaged will get released and never be managed again. by checking if there is a pending release operation, we can safely re-manage the window again.

BUG: 413350

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin, scao

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24878
2019-10-24 18:20:24 +08:00
l10n daemon script
48bb38d11c 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-24 05:37:04 +02:00
Kai Uwe Broulik
95385e81da Merge branch 'Plasma/5.17' 2019-10-23 13:49:08 +02:00
Kai Uwe Broulik
2ce1d99221 [kcmkwin/kwindecoration] Elide "theme default border size" CheckBox
Otherwise the layout explodes.
Unfortunately it seems Layouts don't shrink the items within even if there's not enough room at all, so I need this fillWidth + maximumWidth workaround.

Differential Revision: https://phabricator.kde.org/D24885
2019-10-23 13:48:21 +02:00
l10n daemon script
71c3f063bb 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-23 09:01:14 +02:00
l10n daemon script
cfd296326b 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-23 05:33:32 +02:00
David Edmundson
e8fe59323d [xwl] Return c++ version of true in method
Test Plan: Compiles

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24850
2019-10-22 22:37:11 +01:00