Commit Graph

591 Commits (b64e67ce7c0c0e65f4450eefb2b680e2c5933413)

Author SHA1 Message Date
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
Yuri Chornoivan b24aa90af7 Really use the translations. Patch by Victor Ryzhykh <victorr2007@yandex.ru> 2019-06-12 12:57:29 +03: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 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
Yuri Chornoivan 835f3dfde9 Really use the translations. Patch by Victor Ryzhykh <victorr2007@yandex.ru> 2019-05-29 15:16:04 +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
Vlad Zagorodniy 7f593a67ad Send axis_source, axis_discrete, and axis_stop
Summary:
So far KWin didn't send axis_source, axis_discrete, and axis_stop. Even
though most of those events are optional, clients need them to work as
expected. For example, one needs axis_source and axis_stop to implement
kinetic scrolling; Xwayland needs axis_discrete to prevent multiple
scroll events when the compositor sends axis deltas greater than 10, etc.

BUG: 404152
FIXED-IN: 5.17.0

Test Plan:
* Content of a webpage in Firefox is moved by one line per each mouse
  wheel "click";
* Scrolled gedit using 2 fingers on GNOME Shell, sway, and KDE Plasma;
  in all three cases wayland debug looked the same (except diagonal scroll
  motions).

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19000
2019-05-17 12:06:10 +03:00
Fabian Vogt 7804eb41d9 Fix crash due to dangling reference
Summary:
Returning a reference to a value on the stack is broken.
This caused kwin_wayland to crash in openQA with a nullptr deref.

BUG: 407199

Test Plan: Only build tested.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21085
2019-05-08 19:15:05 +02:00
l10n daemon script ee60653640 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-08 05:51:51 +02:00
Aleix Pol 559c2e68d3 Improve behavior of rotated displays
Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20255
2019-04-26 13:10:41 +02:00
Aleix Pol d3275784a8 Don't rescale every output every time outputs change
Summary:
Every time a display gets connected/disconnected, every output will be
reinitialized. We don't really need to reset the scaling to 1 every time
we don't know, especially since the setting has been set voluntarily.

Test Plan: When I disconnect the external display, my laptop doesn't fallback to scale=1.

Reviewers: #plasma, apol

Reviewed By: apol

Subscribers: davidedmundson, ngraham, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20521
2019-04-25 00:45:14 +01:00
Vlad Zagorodniy b617613bf7 [scenes/opengl] Ensure there is current OpenGL context when destroying EffectFrame unstyled texture
Summary: BUG: 406671

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20723
2019-04-23 23:59:27 +03:00
Vlad Zagorodniy af862a9caf Remove redundant AbstractOutput::internal() method
Summary: We already have AbstractOutput::isInternal() method.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20587
2019-04-16 10:13:38 +03:00
Erik Kurzinger c898f96df3 [platforms/drm] EGLStream DRM Backend Initial Implementation
Summary:
This is the initial implementation of a DRM backend based on the EGLDevice,
EGLOutput, and EGLStream extensions, supporting NVIDIA graphics hardware using
their proprietary driver. The new backend will be used if the environment
variable KWIN_DRM_USE_EGL_STREAMS is set. On initialization, it will attempt to
create an EGLDevice based on the DRM device currently in use and create
EGLOutputs and EGLStreams for any attached displays. These are used to control
presentation of the final composited frame. Additionally, it will register the
wl_eglstream_controller Wayland interface so that native EGL windows created by
clients can be attached to an EGLStream allowing buffer contents to be shared
with the compositor as a GL texture.

At this time there are two known bugs in the NVIDIA driver's EGL implementation
affecting desktop functionality. The first can result in tooltip windows drawn
by plasmashell to contain incorrect contents. The second prevents KWayland from
being able to query the format of EGLStream-backed buffers which interferes
with the blur effect. Fixes for both of these are currently in development and
should appear in an upcoming NVIDIA driver release.

Additionally, hardware cursors are currently not supported with this backend.
Enabling them causes the desktop to intermittently hang for several seconds.
This is also likely a bug in the NVIDIA DRM-KMS implementation but the root
cause is still under investigation.

Test Plan:
On a system with an NVIDIA graphics card running a recent release of their
proprietary driver

    * Ensure the nvidia_drm kernel module is loaded with the option "modeset=1"
      ("# cat /sys/module/nvidia_drm/parameters/modeset" should print "Y")
    * Ensure EGL external platform support is installed
      https://github.com/NVIDIA/eglexternalplatform
    * Ensure KWin was build with the CMake option
      KWIN_BUILD_EGL_STREAM_BACKEND=ON (this is the default)
    * Start a plasma wayland session with the environment variable
      KWIN_DRM_USE_EGL_STREAMS set
    * Ensure output from KWin OpenGL initialization indicates the NVIDIA EGL
      driver is in use (as opposed to Mesa / llvmpipe).
    * Desktop should be fully functional and perform smoothly.

Reviewers: #kwin, romangg, davidedmundson

Reviewed By: #kwin, romangg, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18570
2019-04-15 07:26:22 -07:00
l10n daemon script ef3f1e57ba 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-04-12 05:58:07 +02:00
Erik Kurzinger a1e8541b49 [qpa] Don't specify EGL_SURFACE_TYPE when choosing EGLConfig
Summary:
Since QPA only performs off-screen rendering, it does not require an EGLConfig
that supports any particular surface type.  Currently it requests a config
supporting window surfaces, however the EGLDeviceEXT platform, which is the
basis of the EGLStream back-end used with the proprietary NVIDIA driver, does
not support such surfaces resulting in eglChooseConfig not returning any valid
configs when that back-end is in use. Since QPA doesn't actually create any
window surfaces, it should be fine to remove this restriction to allow it to
initialize properly with the EGLStream back-end.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin, davidedmundson

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20455
2019-04-11 07:43:31 -07:00
Vlad Zagorodniy 02a5a08a6c [platforms/drm] Rework ScopedDrmPointer
Summary:
Currently there is no any good reason for keeping ScopedDrmPointer;
providing our own deleter for QScopedPointer would make more sense.

Given that we already have type that acts as a scoped pointer for drm
objects we can improve it a bit and make simpler, e.g.

    DrmScopedPointer<drmModeConnector> connector;

is much simpler than

    ScopedDrmPointer<_drmModeConnector, &drmModeFreeConnector> connector;

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: apol, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19905
2019-04-09 14:09:19 +03:00
Jimi Huotari 3cc39ba35e Fix plugins/qpa build with Qt 5.13
Summary:
Upstream moved screen maintenance functions from
QPlatformIntegration to QWSI.

BUG: 406056
See also: https://code.qt.io/cgit/qt/qtbase.git/commit/?h=5.13&id=01e1df90

Test Plan: Built fine with Qt 5.12.2 and Qt 5.13 stable branch.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, arojas, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20239
2019-04-04 01:17:59 +02:00
Aleix Pol 2e1880b85a Fix crash when using kwin on windowed mode
Summary:
Used to get:
`kwin_wayland: kwin/composite.cpp:646: void KWin::Compositor::aboutToSwapBuffers(): Assertion "!m_bufferSwapPending' failed."`

Test Plan: Ran `kwin_wayland --socket dave --output-count 2 konsole`

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20056
2019-03-29 18:43:47 +01:00
Volker Krause 008143c9db Update URLs to use https
Summary: Largely done automatically using the tools from D19996.

Reviewers: yurchor, zzag

Reviewed By: yurchor, zzag

Subscribers: zzag, yurchor, kwin, kde-doc-english

Tags: #kwin, #documentation

Differential Revision: https://phabricator.kde.org/D20017
2019-03-25 19:26:23 +01:00
Aleix Pol 6d37ce7f36 RFC: Fix wayland backend initialisation
Summary:
Otherwise it thinks outputs couldn't be created and it leaves.
Problem is that after this fix it crashes when it actually does things with:
kwin_wayland: /home/apol/devel/frameworks/kwin/composite.cpp:646: void KWin::Compositor::aboutToSwapBuffers(): Assertion `!m_bufferSwapPending' failed.

Test Plan: As said, it proceeds correctly and crashes elsewhere

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19921
2019-03-20 18:24:57 +01:00
Erik Kurzinger 22a441e071 [platforms/x11] Force glXSwapBuffers to block with NVIDIA driver
Summary:
The NVIDIA implementation of glXSwapBuffers will, by default, queue up
to two frames for presentation before blocking. KWin's compositor,
however, assumes that calls to glXSwapBuffers will always block until
the next vblank when rendering double buffered. This assumption isn't
valid, as glXSwapBuffers is specified as being an implicit glFlush,
not an implicit glFinish, and so it isn't required to block. When this
assumption is violated, KWin's frame timing logic will
break. Specifically, there will be extraneous calls to
setCompositeTimer with a waitTime of 0 after the non-blocking buffer
swaps, dramatically reducing desktop responsiveness. To remedy this,
a call to glXWaitGL was added by Thomas Luebking after glXSwapBuffers
in 2015 (see bug 346275, commit
8bea96d701). That glXWaitGL call is
equivalent to a glFinish call in direct rendering, so it was a good
way to make glXSwapBuffers behave as though it implied a glFinish
call.

However, the NVIDIA driver will by default do a busy wait in glFinish,
for reduced latency. Therefore that change dramatically increased CPU
usage. GL_YIELD can be set to USLEEP (case insensitive) to change
the behavior and use usleep instead. When using the NVIDIA driver,
KWin will disable vsync entirely if GL_YIELD isn't set to USLEEP
(case sensitive, a bug in KWin).

However, the NVIDIA driver supports another environment variable,
__GL_MaxFramesAllowed, which can be used to control how many frames
may be queued by glXSwapBuffers. If this is set to 1 the function
will always block until retrace, in line with KWin's expectations.
This allows the now-unnecessary call to glXWaitGL to be removed along
with the logic to conditionally disable vsync, providing a better
experience on NVIDIA hardware.

Reviewers: #kwin, davidedmundson, zzag

Reviewed By: #kwin, davidedmundson, zzag

Subscribers: kwin, davidedmundson, zzag

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19867
2019-03-20 09:56:05 -07:00
Roman Gilg 7b13393b64 [platforms/wayland] Multi output support
Summary:
This patch rewrites large parts of the Wayland platform plugin, in order to
facilitate the testing of multi output behavior in nested KWin sessions.

For that a new class WaylandOutput is introduced, which is based on
AbstractOutput and by that shares functionality with our virtual and DRM
platform plugins.

The EGL/GBM and QPainter backends have been remodelled after the DRM one,
sharing similiarities there as well now.

Pointer grabbing has been rewritten to support multiple outputs, now using
pointer locking instead of confining and drawing in this case onto a sub-
surface, which get dynamically recreated in between the different output
surfaces while the cursor is being moved.

Window resizing is possible if host supports xdg-shell, but currently the
mode size does not yet fill the new window size.

The number of outputs can be set by command line argument `--output-count`,
scaling is also supported by setting the argument `--scale`.

Further steps could be:
* Enabling automatic fill of resized windows via Wayland mode change
* Multiple diverging initial sizes and scale factors for mulitple outputs

**Watch it in action:** https://youtu.be/FYItn1jvkbI

Test Plan: Tested it in live session.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18465
2019-03-20 14:43:03 +01:00
Erik Kurzinger d9c79e3627 [platforms/drm] Fix software cursors with drm backend
Summary:
If hardware cursor support is not available when using the drm backend for
Wayland compositing, the software cursor texture will not be updated when the
cursor image changes, and it will still be drawn when no cursor image is set
(such as when running a full-screen game). Furthermore, the drmModeSetCursor
and drmModeMoveCursor functions will still be unnecessarily called when the
cursor is moved or hidden.

To correct this, SceneOpenGL should connect Platform::cursorChanged as opposed
to Cursor::cursorChanged to its texture update function, as only the former
will be emitted when the cursor is updated and the compositor should check if
the cursor is hidden and the software cursor image is not null before rendering
it. DrmBackend::moveCursor and DrmBackend::hideCursor should also return
immediately if using a software cursor.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18376
2019-03-19 12:46:16 -07:00
Vlad Zagorodniy 380c93ac19 [platforms/drm] Add DPI connector type
Reviewers: #kwin, apol, davidedmundson

Reviewed By: #kwin, apol, davidedmundson

Subscribers: apol, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19781
2019-03-19 18:05:15 +02:00
Aleix Pol d8af2ee566 Rotate cursors also on portrait mode
Summary: Like we do on inverted mode

Test Plan: Not much, because we don't support portrait mode on intel hardware just yet. I can see the cursor properly rotated before drm tells us to fall back to the previous configuration.

Reviewers: #kwin, #plasma, graesslin

Reviewed By: #kwin, #plasma, graesslin

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19710
2019-03-19 16:33:05 +01:00
Vlad Zagorodniy 99f7be6ddd Merge branch 'Plasma/5.15' 2019-03-13 10:54:51 +02:00
Nerdopolis Turfwalker 93b7eea67d [platforms/fbdev] Use a better way to correct activating framebuffer devices
Summary:
My change in 304528e80b has been reported to
cause issues for PostMarketOS https://gitlab.com/postmarketOS/pmaports/issues/204
I originally submitted the change to activate Framebuffer devices
as secondary framebuffer devices are not on by default, (such as a
secondary DisplayLink device). Changing attributes usually forced
some framebuffer devices to turn on, however I have found a more
accurate way to turn on framebuffer devices, without messing with
the color layout.

Reviewers: #kwin, davidedmundson, graesslin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19663
2019-03-13 10:49:49 +02:00
Vlad Zagorodniy b106579d0f Move package structure plugins to plugins dir
Summary:
Package structure plugins are not that special so move them to
the corresponding directory.

Test Plan: Compiles.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18685
2019-03-11 10:57:13 +02:00
Vlad Zagorodniy db1035fa47 Merge branch 'Plasma/5.15' 2019-03-11 09:23:51 +02:00
Vlad Zagorodniy 38e22ce6d1 [platforms/x11] Properly unload effects on X11
Summary:
When Compositor finishes compositing, it destroys EffectsHandlerImpl,
which in its turn tries to unload all effects. But there is a problem...

EffectsHandlerImpl has platform-specific hooks to ungrab keyboard and
also stop mouse interception. Given that any call made to a virtual function
in the destructor of a base class(EffectsHandlerImpl) won't go to a derived
class(EffectsHandlerImplX11), keyboard won't be ungrabbed even if effect
that grabbed it is already gone.

BUG: 399572

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19178
2019-03-11 09:23:24 +02:00
Vlad Zagorodniy 10fdf2a220 Discard Deleted before Scene is destroyed
Summary:
Deleted has lifetime bounded to effects and scene.

We can't discard Deleted before EffectsHandler is destroyed because
effects that referenced it may call unrefWindow.

On the other hand, the fact that Deleted may outlive scene doesn't
make sense because Deleted exist purely for animation purposes and
nothing more.

This change arranges lifetime of Deleted so it's more reasonable.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18914
2019-03-04 23:24:42 +02:00
Laurent Montel 7b4ef76de6 Remove deprecated method 2019-03-01 08:15:31 +01:00
Martin Flöser cbbe94d769 Restrict available supported compositors based on first initialized one
Summary:
On Wayland we cannot switch from OpenGL to QPainter compositor as this
would break any running OpenGL application. KWin registers it's
EGLDisplay to Wayland and without OpenGL this doesn't make sense any
more. We are not able to render OpenGL buffers in the QPainter
compositor.

While it's theoretically possible to switch from QPainter to OpenGL it
doesn't make any sense for the same reason. Any running OpenGL
application would be using llvmpipe and could not be switched to proper
OpenGL.

This change stores the selected compositing type in Platform and the
implementations can use it to restrict the supported compositors. On X11
we don't need this, all other Platforms implement the restriction. Thus
it's no longer possible to switch the backends at runtime.

Test Plan:
Adjusted tests run, no runtime test as gui doesn't support
switching to QPainter anyway.

Reviewers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19084
2019-02-22 16:59:08 +01:00
Martin Flöser e48d9df14f [qpa] Drop PlatformContextWayland which uses wayland egl for OpenGL
Summary:
Using the Wayland protocol for OpenGL is no longer used or useful. KWin
internal windows only use OpenGL through QtQuick. We either have the
sharing context (KWin uses OpenGL for compositing) or we have the
QPainter compositor which also turns QtQuick to use software renderer.

Thus a situation where the Wayland platform context is useful doesn't
exist any more. Removing it helps getting the QPA plugin Wayland free.

Test Plan:
Run nested KWin triggering Outline once with OpenGL and once
with QPainter compositor.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19012
2019-02-22 16:57:29 +01:00
David Edmundson 3dc22d7d88 [platforms/hwcomposer] Add scaling support
Summary:
Despite plasma frameworks doing it's own scaling with fonts, it's been
requested to use kwin/wayland scaling.

Like DRM, when kscreen is not used, scale value is loaded from a config
file.

Config format is
[HWComposerOutputs][0]
Scale=N

The 0 is to map similarly to DRM and support multi-screen, but with a
screen index
rather than a UUID based on EDID.

Because we don't support multi screen this is always 0 for now.

Test Plan: Ran with the config value unset and with the config value at
Scale=3.

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: bshah, romangg, nicolasfella, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18810
2019-02-22 00:47:08 +00:00
Roman Gilg 1e6f6700f8 [platform/virtual] Swap buffers in EGL GBM backend
Summary:
The virtual platform did not actually present content and spin the
compositor. Let's do this from now on , first for the EGL GBM backend.

Test Plan: All tests pass according to Vlad

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: graesslin, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18436
2019-02-21 23:30:11 +01:00
David Edmundson 062dfefafe [platforms/hwcomposer] Port to AbstractOutput
Summary:
This gives us XdgOutput support a requirement now that wayland server
reports that we support it and Qt5.12 then expects it to be sent.

It also provides an easy starting point for supporting wayland scaling
and a slight step towards multi-output.

Test Plan:
Ran on phone. Got output. Turning screen on and off works.
The double tap doesn't work great, but that was true before
(via bshah's hack to build on the current state)

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: romangg, nicolasfella, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18808
2019-02-20 13:20:02 +00:00
Martin Flöser 1d8d7bd9f7 [qpa] Set binary output path for QPA plugin
Summary: Required for kwin_wayland to find it's own plugin.

Test Plan: My kwin_wayland was crashing and gdb showed wrong plugin being loaded

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19010
2019-02-17 20:09:23 +01: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
Vlad Zagorodniy 5047449a55 [platforms/drm] Use more ScopedDrmPointer
Test Plan: Standalone KWin/Wayland still works.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18863
2019-02-10 20:26:02 +02:00
Vlad Zagorodniy be8729105f Move lanczos filter away from KWin core
Summary:
Lanczos filter shouldn't be in KWin core because it's quite specific about
rendering backend.

Test Plan: Windows in the desktop grid look normal.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: mart, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18774
2019-02-07 18:03:34 +02:00
Vlad Zagorodniy 0a9b8a49ee Merge branch 'Plasma/5.15' 2019-02-05 13:57:28 +02:00
Vlad Zagorodniy 582966db52 Merge branch 'Plasma/5.12' into Plasma/5.15 2019-02-05 13:57:09 +02:00
Martin Flöser 02a0561016 Add windowsystem plugin for KWin's qpa
Summary:
KWindowSystem provides a plugin interface to have platform specific
implementations. So far KWin relied on the implementation in
KWayland-integration repository.

This is something I find unsuited, for the following reasons:
 * any test in KWin for functionality set through the plugin would fail
 * it's not clear what's going on where
 * in worst case some code could deadlock
 * KWin shouldn't use KWindowSystem and only a small subset is allowed
to be used

The last point needs some further explanation. KWin internally does not
and cannot use KWindowSystem. KWindowSystem (especially KWindowInfo) is
exposing information which KWin sets. It's more than weird if KWin asks
KWindowSystem for the state of a window it set itself. On X11 it's just
slow, on Wayland it can result in roundtrips to KWin itself which is
dangerous.

But due to using Plasma components we have a few areas where we use
KWindowSystem. E.g. a Plasma::Dialog sets a window type, the slide in
direction, blur and background contrast. This we want to support and
need to support. Other API elements we do not want, like for examples
the available windows. KWin internal windows either have direct access
to KWin or a scripting interface exposed providing (limited) access -
there is just no need to have this in KWindowSystem.

To make it more clear what KWin supports as API of KWindowSystem for
internal windows this change implements a stripped down version of the
kwayland-integration plugin. The main difference is that it does not use
KWayland at all, but a QWindow internal side channel.

To support this EffectWindow provides an accessor for internalWindow and
the three already mentioned effects are adjusted to read from the
internal QWindow and it's dynamic properties.

This change is a first step for a further refactoring. I plan to split
the internal window out of ShellClient into a dedicated class. I think
there are nowadays too many special cases. If it moves out there is the
question whether we really want to use Wayland for the internal windows
or whether this is just historic ballast (after all we used to use
qwayland for that in the beginning).

As the change could introduce regressions I'm targetting 5.16.

Test Plan:
new test case for window type, manual testing using Alt+Tab
for the effects integration. Sliding popups, blur and contrast worked fine.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18228
2019-01-27 08:59:58 +01:00
Alexander Volkov 5d63b9c05b Fix flickering with Qt 5.12
Summary:
Mesa requires XESetWireToEvent xlib callbacks to be called
when DRI2 is used. This is done by the GLX integration in
the Qt's xcb plugin, but Qt 5.12 initializes the GLX integration
only when required, e.g. when a window with OpenGL support is
created or when availability of OpenGL is checked.

So force initialization of the GLX integration by calling
QOpenGLContext::supportsThreadedOpenGL().

https://codereview.qt-project.org/#/c/6557/
https://bugzilla.opensuse.org/show_bug.cgi?id=1120090

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: davidedmundson, graesslin, fvogt, filipf, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18366
2019-01-22 22:37:53 +03:00
Vlad Zagorodniy 253f954e31 [scenes/opengl] Destroy the lanczos filter when the backend is still alive
Summary:
Currently, when the lanczos filter attempts to release acquired resources,
the backend is already gone. To fix that we have to destroy the filter
together with SceneOpenGL2. At that moment the backend is still alive.

BUG: 403370
FIXED-IN: 5.15.0

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18367
2019-01-18 21:41:48 +02:00
Vlad Zagorodniy 204a05fef8 Compile the virtual backend with older Mesa
Summary:
BUG: 403326
FIXED-IN: 5.15.0

Test Plan: N/A

Reviewers: #kwin, fvogt, davidedmundson

Reviewed By: #kwin, fvogt, davidedmundson

Subscribers: kwin, fvogt

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18353
2019-01-18 15:45:13 +02: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
David Edmundson 2df9d22a08 Add high DPI support to internal KWin windows
Summary:
So far we didn't try to do high DPI on kwin internal windows, such as
the user context menu and tab bars and whatever.

Due to wayland scaling they were the correct phyiscal size but upscaled.
This patch fixes our QPA to enable Qt's high-dpi support.

BUG: 402853

Note icons are still low res. This is because the global
QGuiApplication::devicePixelRatio which is the max of all connected
screens is static for the duration of the app. QIcon uses this when
determining the DPR to use. This will require a Qt change.

Test Plan:
Ran at 2x on my normal DPI screen (as that's easier to see anything)
* User action menu is high DPI
* Window deco tooltips are still fine
* Tab switcher is high DPI
* Overlay in present windows Desktop grid are still ok

Reviewers: #kwin

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18042
2019-01-14 13:59:05 +00:00
Martin Flöser 825aa4ac38 [platform/virtual] Drop support for vgem and rendernode
Summary:
Instead we depend on the surfaceless platform for which we recently
added support. Thus the plugin does not need to use gbm and udev
anymore. So simplifies a lot.

Test Plan: ctest (prior to breaking change) passes

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18160
2019-01-12 07:37:25 +01:00
David Edmundson bbb67f2675 [plugins/qpa] Commit wl_surface when flipping FBOs
Summary:
Even though the buffer is passed through a side channel some properties
we might use are double-buffered on the surface commit.

Test Plan: Used by unit test InternalWindowTest::testScale in linked commit

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18085
2019-01-08 15:51:47 +00:00
David Edmundson 03f79868f5 [platforms/virtual] Add API to set scale in virtual backend
Summary: For unit test purposes

Test Plan: Used by unit test InternalWindowTest::testScale in linked commit

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18086
2019-01-08 15:51:33 +00:00
l10n daemon script 90306f5c08 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-06 05:42:41 +01:00
Martin Flöser bedd85821f [platforms/virtual] Add support for EGL_MESA_platform_surfaceless
Summary:
Thus we don't require vgem any more which fails with latest mesa.
Kepping the vgem variant as fallback for older systems. See T10245

Test Plan:
SceneOpenGL Test passes without init vgem, not tested with
latest mesa

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D17980
2019-01-05 10:48:08 +01:00
Martin Flöser a3bebb2fb8 Merge branch 'Plasma/5.14' 2019-01-05 09:02:11 +01:00
Martin Flöser 0f489c3521 [platforms/x11/standalone] Pass kxkbconfig to Xkb prior to reconfigure
Summary:
This ensures that KWin gets the same keyboard layout config as is
configured in the session and not a default config.

BUG: 402764
FIXED-IN: 5.14.5

Test Plan:
Xephyr to verify the config is applied, otherwise completely
untested. I don't have an X session.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D17967
2019-01-05 08:57:29 +01:00
Martin Flöser d49642ca15 Add touch support to x11 windowed platform
Summary:
This change inits XInput extension, listens for touch events and
forwards them to our platform API. Thus touch events are forwarded on a
nested wayland session on X11.

Please note that I only tested this change on Xwayland.

Test Plan: Run nested kwin_wayland with two outputs and looked into debug console

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D17369
2018-12-31 07:57:09 +01:00
l10n daemon script 91f5938a7f 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-12-24 05:25:01 +01:00
Volker Krause 3bb07ef12d Bring FindFontconfig.cmake up to ECM standards
Summary:
This is a preparation step to move this to ECM (or possibly CMake),
which makes sense now that qtbase is using this too (for Qt6).

Reviewers: #build_system, cgiboudeaux

Reviewed By: cgiboudeaux

Subscribers: cgiboudeaux, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D17547
2018-12-18 18:11:11 +01:00
Martin Flöser c8ede9a5ff Build platform plugins in correct sub directory of build dir
Summary:
This brings KWin a step closer to be run from build dir without having
to install at all. The integration tests are adjusted so that the
virtual platform is still found which makes the code be closer to what
is used in normal kwin_wayland.

Test Plan: ctest passes, manually verified correct plugin is loaded

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D17388
2018-12-13 19:36:28 +01:00
Vlad Zagorodniy 3ad5604580 [scenes/opengl] Cleanup cached decoration shadow textures when suspending compositing
Summary:
When suspending compositing, SceneOpenGLShadow cannot cleanup cached
decoration shadow textures because the effects handler is already gone.

This sometimes can result in a crash when running kwin_x11 --replace
(we're hitting an assert statement).

To fix that, let's use the scene instead of the effects handler for
making the OpenGL context current.

Test Plan:
No longer hit the assert statement:

    ASSERT: "m_cache.isEmpty()" in file /home/vlad/Workspace/KDE/src/kde/workspace/kwin/plugins/scenes/opengl/scene_opengl.cpp, line 2025
    Application::crashHandler() called with signal 6; recent crashes: 1
    QCoreApplication::applicationFilePath: Please instantiate the QApplication object first
    KCrash: crashing... crashRecursionCounter = 2
    KCrash: Application Name = kwin_x11 path = /home/vlad/Workspace/KDE/usr/bin pid = 5407
    KCrash: Arguments: /home/vlad/Workspace/KDE/usr/bin/kwin_x11 --replace

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D17306
2018-12-02 19:59:07 +02:00
Martin Flöser 46eceef299 [opengl] Drop functionality to start kcmshell compositing
Summary:
The idea of opening the compositing kcm was to show a warning. But that
broke quite some time ago without noticing. We had two ways:
 * pass through --args command line argument
 * use dbus call to already open kcm

Neither of the two ways is working. The kwincompositing doesn't parse
the arguments and the dbus interface doesn't exist any more.

Following the advice to remove functionality nobody noticed that it is
broken, this is removed with this change. This probably broke with
introducing the new KCM which happened IIRC for Plasma 5.0.

BUG: 393845
FIXED-IN: 5.14.0

Reviewers: #kwin, #plasma

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13235
2018-12-01 11:42:33 +01: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
Roman Gilg 6857fe5477 Add output orientation size helper
Summary:
In order to reduce code duplication add this helper
to AbstractOutput.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16794
2018-11-14 20:05:39 +01:00
Roman Gilg 6295d1e6a2 Move output refresh rate getter into AbstractOutput
Summary:
The current refresh rate is stored in OutputInterface. Move the getter
therefore in the AbstractOutput class.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16793
2018-11-14 20:04:29 +01:00
Roman Gilg 0af57d6366 [drm] Code cleanup in DrmOutput class
Summary: Removes unneeded includes and reorders the code in a sensible way.

Reviewers: #kwin

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16792
2018-11-14 20:03:25 +01:00
Roman Gilg 93f78c2d23 Set outputs enabled in AbstractOutput
Summary:
Nothing hardware specific anymore in setEnabled method,
therefore put it in AbstractOutput.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T10016

Differential Revision: https://phabricator.kde.org/D16790
2018-11-14 20:00:28 +01:00
Roman Gilg 32a9a61889 Abstract OutputDevice initialization
Summary:
Move generic Wayland parts of OutputDevice initialization into
AbstractOutput class.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Maniphest Tasks: T10016

Differential Revision: https://phabricator.kde.org/D16789
2018-11-14 19:59:09 +01:00
Roman Gilg 27946199b6 Abstract output dpms handling
Summary:
Move init and Wayland side changes of dpms modes into
AbstractOutput.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Maniphest Tasks: T10016

Differential Revision: https://phabricator.kde.org/D16787
2018-11-14 19:57:25 +01:00
Roman Gilg e2b1bcea1b Set mode in AbstractOutput
Summary:
Set the mode in AbstractOutput and call into the plugin
for final change on hardware.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Maniphest Tasks: T10016

Differential Revision: https://phabricator.kde.org/D16786
2018-11-14 19:56:07 +01:00
Roman Gilg 254a807374 Handle Wayland change sets in AbstractOutput
Summary:
Move Wayland change set handling to AbstractOutput and create
virtual functions to call into the hardware implementation

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T10016

Differential Revision: https://phabricator.kde.org/D16785
2018-11-14 19:54:29 +01:00
Roman Gilg 21aee588af Initialize Wayland output in AbstractOutput
Summary:
Wayland output is on protocol level and not dependent on the hardware
platform. Next steps are to do the same for output device and then let
the virtual output call into these initializing functions as well.

Test Plan: Manually and auto test.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16783
2018-11-09 19:47:23 +01:00
Martin Flöser c003db22c6 Build KF5IdleTimeKWinWaylandPrivatePlugin in correct directory
Summary: Ensures that we can load the plugin when running only from build dir.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16762
2018-11-09 17:39:29 +01:00
Martin Flöser 54eb3bf137 Copy the aurorae decoration qml plugin to bin dir in build directory
Summary:
Look there, another plugin I didn't remember. The other qml files are
not needed for the aurorae autotest as it's for the svg based themes
instead of qml themes like Plastik.

Test Plan: Further destroyed my system, test failed, with this change passed.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16761
2018-11-09 09:27:34 +01:00
Martin Flöser 80d0915cf8 [aurorae] Print qml errors during instantiation of qml based deco
Summary:
So far we didn't know why plastik wasn't loaded. Now we get the error
messages.

Test Plan: Saw error messages while investigating failing KWin test

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16753
2018-11-08 10:38:35 +01:00
Martin Flöser ee68994419 Build plastik plugin at correct location in build tree
Summary: The tests running Aurorae need to be able to pick up the plastik plugin.

Test Plan: Removed system install of plastik plugin, now test passes

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16752
2018-11-08 09:52:54 +01:00
Martin Flöser c19627b492 Copy plastik window decoration to build directory
Summary:
This ensures that DontCrashAuroraeDestroyDecoTest can load the plastik
window decoration when run from build directory as it happens on
build.kde.org.

Test Plan: Test passes now when manipulating XDG_DATA_DIRS to hide system install

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16745
2018-11-08 08:31:17 +01:00
Frederik Gladhorn 456cbb9bf7 Remove unused private Qt include
Summary:
Ideally KWin would not depend on private headers... but at least we can
remove unused ones.

Test Plan: still builds, I don't see anything requiring the header.

Reviewers: zzag

Reviewed By: zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16655
2018-11-04 17:02:19 +01:00
Frederik Gladhorn 503661579f Remove unused FindQt5PlatformSupport.cmake
Summary: This file was required for Qt 5.8. We require 5.11 as minimum version.

Test Plan: Grepped for the file being used in other cmake code, rebuilt KWin without it.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin, zzag

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16654
2018-11-04 17:01:49 +01:00
l10n daemon script f03b2a4baa 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-10-27 05:56:01 +02:00
Vlad Zagorodniy d9eb0e7707 Merge branch 'Plasma/5.14' 2018-10-26 11:20:33 +03:00
Laurent Montel 2043161889 Remove unused check 2018-10-25 08:05:13 +02:00
l10n daemon script c7aa721273 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-10-24 08:42:22 +02:00
l10n daemon script 26a8892d9d 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-10-24 08:15:36 +02:00
l10n daemon script 9ba26510d0 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-10-24 06:05:03 +02:00
Vlad Zagorodniy 8971af19e3 Merge branch 'Plasma/5.14' 2018-10-11 17:52:47 +03:00
David Edmundson 6724955a76 [qpa] Always keep a at least one screen
Summary:
Qt does not like having no screens. Both Qt XCB and Wayland QPAs have
systems pretend there's always at least 1 screen
present.

Kwin already uses a dummy screen on startup, this patch reinserts the
dummy screen if the platform states that all real screens are removed.

BUG: 399564

Test Plan:
Logged in, everything still worked
Did not reproduce the original bug

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16096
2018-10-10 11:14:13 +01:00
David Edmundson 413bd53aac Merge branch 'Plasma/5.14' 2018-10-05 14:40:46 +01:00
David Edmundson 0b7778f964 [plugins/qpa] Add explanatory comment 2018-10-05 14:38:55 +01:00
David Edmundson 6ebfa59331 [plugins/qpa] Don't crash on Qt5.12 OpengGL::makeCurrent
Summary:
QOpenGLContext was changed to call platform->makeCurrent before it
called setCurrentContext.

Because we bind window FBO and ultimately that calls
QOpenGlContext::format we need Qt to know which context is current so it
can tell us the format.

This matches the QtWayland EGL code.

BUG: 399392

Test Plan:
Switched virtual desktop with the OSD (previously reliably crashed)
Now it doesn't

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D15957
2018-10-05 14:04:09 +01:00
l10n daemon script 85bc931d72 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-10-05 05:58:38 +02:00
l10n daemon script 53ba323f76 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-09-22 08:04:02 +02:00
Vlad Zagorodniy dadcd51135 [scenes/opengl] Fix overlaps in shadow texture atlas
Summary:
If the corner shadow tiles(top-left, top-right, and so on) tiles are missing,
then the left/top/right/bottom shadow tiles will overlap.

This diff addresses that problem by changing how the shadow texture
atlas is rendered:
* corner tiles will be drawn in the corners of the atlas(buildQuads
  method expects them to be at the corners);
* top, right, bottom, and left tile will be aligned to the top-left
  corner of the inner shadow rect.

For majority of desktop themes, the shadow texture atlas looks the same.
For example, here's for Aether:

Before:
{F6190484, layout=center, size=full}

After:
{F6190488, layout=center, size=full}

Depends on D14783

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, abetts, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14784
2018-08-31 17:33:19 +03:00
Vlad Zagorodniy 5e55664de8 [scenes/opengl] Correctly draw shadows when corner tiles are missing
Summary:
Current implementation of buildQuads assumes that corner shadow tiles
are always present:

    const QRectF leftRect(
        topLeftRect.bottomLeft(),
        bottomLeftRect.topRight());

but that assumption is wrong. For example, if the default panel is on
the bottom screen edge, then the calendar popup won't have the
bottom-left shadow tile(at least on Wayland). Which means that the left
shadow tile won't be visible because
topLeftRect.left() == bottomLeftRect.right().

Corner rectangles only have to influence height of the left/right tile
and width of the top/bottom tile. Width of the left/right tile and
height of the top/bottom tile should not be controlled by corner tiles.

Overall, this is how shadow quads are computed:

* Compute the outer rectangle;
* Compute target rectangle for each corner tile. If some corner tile is
  missing, move the target rectangle to the corresponding corner of the
  inner shadow rect and set its width and height to 0. We need to do
  that to prevent top/right/bottom/left tiles from spanning over
  corners:

{F6190219, layout=center, size=full}

We would rather prefer something like this if the top-left tile is
missing:
{F6190233, layout=center, size=full}

* Fix overlaps between corner tiles;
* Compute target rectangles for top, right, bottom, and left tiles;
* Fix overlaps between left/right and top/bottom shadow tiles.

Test Plan:
* Ran tests;
* Resized Konsole to its minimimum size(on X11 and Wayland);
* Opened the calendar popup(on X11 and Wayland):

Before:
{F6190344, layout=center, size=full}

After:
{F6190346, layout=center, size=full}

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: abetts, davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14783
2018-08-31 17:33:19 +03:00
Roman Gilg 95cb47cae2 [platforms/virtual] Set raw physical size of outputs
Summary: At least one test requires the physical size to be set.

Test Plan:
Lock screen screen edges test is passing again. Without the change the corner
offset in the ScreenEdges class is not calculated correctly via the
physicalDpiX() and physicalDpiY() values of an auxilliary QWidget.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D15183
2018-08-31 13:22:55 +02:00
Roman Gilg 9cf2730f8d [colorcorrection] Set gamma through Output class
Summary:
With the new Output class we can set the gamma directly here. This is also
a stepping stone to adjust individual output gamma adjustment later on.

This means any future backend, which aims to support the color correction
frontend needs to use the Output class.

Test Plan: Night Color test still passes.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D11803
2018-08-31 11:58:21 +02:00
Roman Gilg b22c362bd5 [platforms/virtual] Let VirtualOutput inherit Output
Summary:
Let VirtualOutput be a child class of the new generic class Output.
This allows code sharing and a very similar behavior of the Virtual backend
in comparision to the Drm backend.

Test Plan:
Autotests succesful with two exceptions: The decoration input test fails on
testDoubleTap, row topLeft. This is to be expected because now the
ScreenEdgeInputFilter captures the event at position (0,0) before the
DecorationEventFilter can capture it. The autotest was adapted to take this
special case into account.

Also the lockscreen test fails, because the virtual output is currently missing
the physical size yet.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D11789
2018-08-31 11:56:39 +02:00