Commit graph

630 commits

Author SHA1 Message Date
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
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
Roman Gilg
929866b1a0 Merge branch 'Plasma/5.17' 2019-10-22 11:29:03 +02:00
Roman Gilg
0d67a0b48a Fix non-atomic output init
Summary:
The initial blank needs to happen after the output device has been
initialized to get the current mode size.

Also we can't assert in legacy mode on the page flip pending since
a page flip can also be the result of a CRTC blank using a different.

BUG: 412684
FIXED-IN: 5.17.1

Test Plan: Full Plasma session

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24829
2019-10-22 11:28:08 +02:00
Vlad Zahorodnii
6dd2d6f169 Merge branch 'Plasma/5.17' 2019-10-22 11:21:59 +03:00
Vlad Zahorodnii
982fefd389 [aurorae] Fix visibility of Context Help button
Summary:
providesContextHelp is a property of DecoratedClient, not Decoration.

BUG: 413145
FIXED-IN: 5.17.1

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24851
2019-10-22 11:21:52 +03:00
Vlad Zahorodnii
e06f83717c 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-21 22:18:30 +03: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
Fabian Vogt
f4c6de8ec4 Merge branch 'Plasma/5.17' 2019-10-15 16:08:36 +02:00
Fabian Vogt
4982dfd5f5 glx: Don't use sRGB configs on llvmpipe with depth 16
Summary:
This is necessary to keep openQA working, which uses LLVMpipe as a
renderer on a Cirrus device that operates in depth 16.

LLVMpipe advertises 24/32 bit sRGB configurations on this setup, but
they cannot be presented.

CCBUG: 408594

Test Plan: Compile tested only.

Reviewers: fvogt, #kwin, zzag

Reviewed By: fvogt, #kwin, zzag

Subscribers: romangg, sbergeron, fvogt, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D22203
2019-10-15 16:07:01 +02:00
David Edmundson
96701c6702 Merge branch 'Plasma/5.17' 2019-10-15 12:41:39 +01:00
David Edmundson
446e23af5a [aurorae] Fix crash on KCM teardown with Qt5.14
Summary:
Context behaviour subtly changed in Qt5.14 which has exposed some
questionable things in this KCM.

Auorae::Decoration is a context property of the loaded QML.

QObject::~QObject signals it's own deletion before deleting children.
This means the bindings of loaded QML update in particular

aurorae.qml
   DecorationOptions {
        id: options
        deco: decoration
    }

DecorationOptions has a pointer to the previously set decoration which
is now dangling, and we crash.

Rather than adding more guards and smart pointers in DecorationOptions,
this patch deletes the QQmlContext before deleting the context
properties that we expose.

It also moves unreferring the shared qmlcontext we inherit from till
after we've deleted the child context, because it didn't make sense.

Test Plan:
Opened KCM
Closed the KCM
didn't crash

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24594
2019-10-15 12:40:55 +01:00
Roman Gilg
4cd6f9428f Merge branch 'Plasma/5.17' 2019-10-13 15:54:26 -04:00
Roman Gilg
1bd2f8ba63 [platforms/drm] Disable transformations
Summary:
Rotation in the past was not working in the DRM backend reliable. Now on 5.17
it even freezes the KWin session, so for now we need to just disable it trying.

Test Plan:
Tried to change Rotation with KScreen. Nothing happened but session was still
usable afterwards.

Reviewers: #kwin

Subscribers: ngraham, jriddell, bshah, zzag, apol, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24112
2019-10-13 15:52:31 -04:00
David Edmundson
81c7330671 [scenes/opengl] Set correct blend mode for EffectQuickView buffers
Summary:
Everything is already multiplied in the buffer, we want to copy the
source directly.

Test Plan:
Looked at something with EffectQuickView and alpha
It now matched what it should be

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24368
2019-10-02 20:51:47 +01:00
David Edmundson
d2f37a73dd [plugins/scenes] match push/pop shaders in paintEffectQuickView 2019-10-02 20:33:34 +01:00
Vlad Zahorodnii
7d4471eba6 Rename geometry property to frameGeometry
Summary:
In order to properly implement xdg_surface.set_window_geometry we need
two kinds of geometry - frame and buffer. The frame geometry specifies
visible bounds of the client on the screen, excluding client-side drop
shadows. The buffer geometry specifies rectangle on the screen that the
attached buffer or x11 pixmap occupies on the screen.

This change renames the geometry property to frameGeometry in order to
reflect the new meaning assigned to it as well to make it easier to
differentiate between frame geometry and buffer geometry in the future.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24334
2019-10-02 11:46:37 +03:00
Alexey Min
493bbdc24a Merge branch 'Plasma/5.17' 2019-10-01 15:34:14 +03:00
Alexey Min
6ee6cc0293 [platforms/hwcomposer] Fix build failure after D23495
In file included from /build/src/kwin-5.16.90/plugins/platforms/hwcomposer/hwcomposer_backend.cpp:21:
    /build/src/kwin-5.16.90/plugins/platforms/hwcomposer/hwcomposer_backend.h:58:11: error:
    'QSize KWin::HwcomposerOutput::pixelSize() const' marked 'override', but does not override
       58 |     QSize pixelSize() const override;
          |           ^~~~~~~~~

Fixes dbb2cede08

Reviewed-by: Bhushan Shah <bshah@kde.org>
2019-10-01 14:31:16 +03:00
Vlad Zahorodnii
a03d70c9a6 Delete pointless discardShape method calls
Summary:
There's no point for calling discardShape from the destructor of a
Scene::Window subclass because window quads cache will be destroyed
automagically by QScopedPointer.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24317
2019-09-30 20:14:57 +03:00
Vlad Zahorodnii
f93875535c Update my last name 2019-09-29 17:03:25 +03:00
Vlad Zahorodnii
c1eafcbce1 Drop Toplevel::hasShadow() method
Summary: Use Toplevel::shadow() instead to check whether a Toplevel has a Shadow.

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24297
2019-09-29 15:26:39 +03:00
David Edmundson
40b0296d5c [libkwineffects] Introduce API to easily show a QtQuick scene in an effect
Summary:
EffectQuickView/Scene is a convenient class to render a QtQuick
scenegraph into an effect.

Current methods (such as present windows) involve creating an underlying
platform window which is expensive, causes a headache to filter out
again in the rest of the code, and only works as an overlay.

The new class exposes things more natively to an effect where we don't
mess with real windows, we can perform the painting anywhere in the view
and we don't have issues with hiding/closing.

QtQuick has both software and hardware accelerated modes, and kwin also
has 3 render backends. Every combination is supported.

* When used in OpenGL mode for both, we render into an FBO export the
texture ID then it's up to the effect to render that into a scene.

* When using software QtQuick rendering we blit into an image, upload
that into a KWinGLTexture which serves as an abstraction layer and
render that into the scene.

* When using GL for QtQuick and XRender/QPainter in kwin everything is
rendered into the internal FBO, blit and exported as an image.

* When using software rendering for both an image gets passed directly.

Mouse and keyboard events can be forwarded, only if the effect
intercepts them.

The class is meant to be generic enough that we can remove all the
QtQuick code from Aurorae.

The intention is also to replace EffectFrameImpl using this backend and
we can kill all of the EffectFrame code throughout the scenes.

The close button in present windows will also be ported to this,
simplifiying that code base.

Classes that handle the rendering and handling QML are intentionally
split so that in the future we can have a declarative effects API create
overlays from within the same context. Similar to how one can
instantiate windows from a typical QML scene.

Notes:
I don't like how I pass the kwin GL context from the backends into the
effect, but I need something that works with the library separation. It
also currently has wayland problem if I create a QOpenGLContext before
the QPA is set up with a scene - but I don't have anything better?

I know for the EffectFrame we need an API to push things through the
effects stack to handle blur/invert etc. Will deal with that when we
port the EffectFrame.

Test Plan: Used in an effect

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24215
2019-09-27 16:11:05 +01:00
David Edmundson
11502b7928 Merge branch 'Plasma/5.17' 2019-09-26 16:09:42 +01:00
David Edmundson
3ba33e4b58 Use lambdas for queued invocation of composition suspending
Summary:
Qt's metaobject is rather sensitive with scope resolution.

Foo::Bar and Bar don't always match to a Qt metaobject, even if they
refer to the same thing to a compiler. Here we register
X11Compositor::SuspendReason but Q_ARG uses SuspendReason and they don't
match. This leads to a runtime failure where the method isn't invoked.

Rather than fixing metaobject usage, port the whole thing to lambdas
which does better compile time checking and is generally nicer to read.

BUG: 412353

Test Plan:
Ran xprop to block compositing. Compositing was blocked.
Grepped source code for Q_ARG use

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24244
2019-09-26 16:09:16 +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
Bhushan Shah
ef5406990e [platforms/drm] Consider DSI connector type to be internal display
Summary:
Lot of mobile devices, as well as tablet devices use the DSI connector,
for internal screens. This is more common in ARM devices, so consider
them as internal display as well.

Test Plan: checked on the device with DSI screen, it was considered internal

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: romangg, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24209
2019-09-25 13:44:08 +05:30
Vlad Zagorodniy
168ea98845 Rename ShellClient to XdgShellClient
Summary:
Rename ShellClient to XdgShellClient in order to reflect that it
represents only xdg-shell clients.

Test Plan: Compiles, tests still pass.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23589
2019-09-23 17:28:56 +03:00
Vlad Zagorodniy
9dd7a1881b [platforms/wayland] Drop wl-shell support
Summary: wl-shell is deprecated and its support was dropped in kwin.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23563
2019-09-23 17:28:56 +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
Bhushan Shah
6b610927f4 [platforms/drm] introduce env var to select GPU
Summary:
In some environemnts it is possible that udev detection of primary GPU
fails and it picks the first available card (normally card0). But it is
not desired, and it would be required to use different card (card1).

Introduce environment variable, which when used, will make it possible
to use different card node then one selected by udev.

You can use it like KWIN_DRM_DEVICE_NODE=/dev/dri/card1 kwin_wayland

Test Plan: Tested on the device where card0 was not usable for kms, but card1

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24051
2019-09-19 15:01:15 +05:30
Vlad Zahorodnii
09b47b5250 Undo some recent cmake changes
Unfortunately linking can be very fragile so let's not break things.
2019-09-18 13:50:52 +03:00
Christophe Giboudeaux
265e6367f7 Fix a link error when building kwin. 2019-09-18 11:45:23 +02: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
l10n daemon script
fd702c3644 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-09-17 05:29:51 +02:00
Roman Gilg
5e1348c4b8 [plugins/scenes/opengl] Use linear filter on Wayland
Summary:
With nearest filter fractional scaling is blurry, always use linear filter
instead on Wayland.

Test Plan: Run Plasma session with patch and scale factor 1.9.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T10481

Differential Revision: https://phabricator.kde.org/D23986
2019-09-16 13:02:40 +02:00
Carl Schwan
0757a60858
Fix compile failure window variable doesn't exist
Summary:
Error was:
```
/home/carl/kdesrc/kde/workspace/kwin/plugins/platforms/x11/windowed/x11windowed_output.cpp: In member function ‘void KWin::X11WindowedOutput::initXInputForWindow()’:
/home/carl/kdesrc/kde/workspace/kwin/plugins/platforms/x11/windowed/x11windowed_output.cpp:134:14: error: invalid use of non-static member function ‘xcb_window_t KWin::X11WindowedOutput::window() const’
  134 |     Q_UNUSED(window)
      |              ^~~~~~
In file included from /home/carl/kdesrc/kde/workspace/kwin/plugins/platforms/x11/windowed/x11windowed_output.cpp:20:
/home/carl/kdesrc/kde/workspace/kwin/plugins/platforms/x11/windowed/x11windowed_output.h:50:18: note: declared here
   50 |     xcb_window_t window() const {
      |
```

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23957
2019-09-15 13:00:26 +02:00
Vlad Zahorodnii
02209aa8a4 [platforms/x11] Get rid of some code duplication in windowed backend
Summary:
We repeat quite a lot of code that finds an output by xcb_window_t and
translates global X11 screen coordinates to output coordinates.

Test Plan: Compiles.

Reviewers: #kwin, gladhorn

Reviewed By: #kwin, gladhorn

Subscribers: gladhorn, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23947
2019-09-15 00:16:33 +03:00
Laurent Montel
42326f6ded GIT_SILENT: QLatin1Literal->QLatin1String 2019-09-08 21:18:29 +02:00
Vlad Zagorodniy
630006e6f7 Delete unused includes
We don't use assert().
2019-09-06 16:07:55 +03:00
Roman Gilg
df3c1de848 [platforms/drm] Rework enablement and dpms switching
Summary:
This patch further refines output management.

We go now through AbstractWaylandOutput virtual functions to enable and
disable outputs.

Dpms changes and enablement switches use separate code paths at start in the
Drm backend code since they are similar but not the directly same. Common code
is shared though, functions are renamed accordingly.

Asserts have been put in place to better understand and check the control
flow. A seemingly unnecessary call to DrmOutput::pageFlipped on reactivation
after Vt switch has been removed to allow for that.

In future patches we need to look additionally at the legacy mode switching
code path which was and is still not working and better handling of the
current monitor Dpms state. For example a monitor being switched off is not
properly acted on and the workspace still expanded.

Test Plan:
With one and two monitors:
* Dpms off/on
* Vt switches
* Screen disable/enable

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T11459

Differential Revision: https://phabricator.kde.org/D23600
2019-09-05 17:36:21 +02:00
Roman Gilg
b3e7664d2c Replace Wayland/XDG outputs checks with enablement checks
Summary:
Make it more explicit what the relation is between Wayland and XDG objects
existing and enablement:

The ouput is enabled if and only if Wayland and XDG output objects exist.

We can simplify the code by replacing checks on the outputs with checking
the current enablement value.

Test Plan: Wayland nested and virtual backends.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23553
2019-09-05 17:29:08 +02:00
Roman Gilg
f7ff62e2e2 Lift output enablement into Platform
Summary:
This lifts the enablement code for outputs from the DRM backend to Platform
allowing other Wayland backends in the future to use this interface as well.

To do that we also create some helper functions on Platform level and have to
spill some KWayland classes into AbstractOutput what motivates a further split
of Platform into a Wayland child class like for AbstractOutput.

Test Plan: Disabled and enabled an output in DRM session.

Reviewers: #kwin

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23545
2019-09-05 17:22:44 +02:00
Roman Gilg
732610bd8f [platforms/drm] Early platform and outputs teardown
Summary:
Since we now use in the backends the OutputDeviceInterface for output data
all access must be complete before the Wayland server goes down. For that
introduce a new function to prepare shutdown in the backends.

While at it also remove the output deletion, since they get deleted through
Qt's object system leading to crashes on double free.

Test Plan: Shutdown works without seg faults in the Drm backend.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Maniphest Tasks: T11459

Differential Revision: https://phabricator.kde.org/D23602
2019-09-05 17:00:40 +02: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
l10n daemon script
082baf6662 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-08-30 05:26:49 +02:00
Roman Gilg
836f88495b [platforms/x11/windowed] Fix output scale access before output device creation 2019-08-28 22:27:22 +02:00
Vlad Zagorodniy
ffd4a3b390 [plugins/aurorae] Fix indentation in Decoration::updateBuffer
CCMAIL: kde@davidedmundson.co.uk
2019-08-28 19:39:31 +03:00
David Edmundson
af56a0ca0e [Aurorae] Remove effective triple buffering
Summary:
KWin blits contents into a QImage raster buffer. Because of this we
don't need our underlying GL surface to be double buffered as it
effectively makes the whole thing tripple buffered.

Test Plan: Ran Aurorae, looked the same, should save some memory

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23331
2019-08-28 17:34:56 +01:00