Commit graph

295 commits

Author SHA1 Message Date
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
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
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
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
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
582966db52 Merge branch 'Plasma/5.12' into Plasma/5.15 2019-02-05 13:57:09 +02: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
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
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
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
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
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
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
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
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
Roman Gilg
3482378278 Introduce OutputScreens class
Summary:
Lift high-level properties into new Screens child class for platform plugins
using the Output class.

Directly make DrmScreens a child class of OutputScreens.

Test Plan: Manually and auto tests with 94%.

Reviewers: #kwin

Differential Revision: https://phabricator.kde.org/D11782
2018-08-31 11:53:23 +02:00
Roman Gilg
fe63e21f80 Introduce generic Output class
Summary:
In order to separate high-level properties of individual outputs from
hardware-specific ones and access these, introduce a new generic class Output.

Also make the DrmOutput class directly a child class of this generic class.

The long-term goal is to get rid of the Screens global object on Wayland and
instead directly work with Output objects on compositing level.

This should enable us long-term to do direct scanout to hardware planes, what
I predict needs this generic output representation at one point.

Test Plan: Manually.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D11781
2018-08-31 11:53:12 +02:00
Yuri Chornoivan
bf58da3e9a Fix minor EBN issues 2018-08-29 21:02:16 +03:00
Nerdopolis Turfwalker
304528e80b [platforms/fbdev] Attempt to set the framebuffer color layout on the framebuffer device
Summary:
Weston does something similar
https://cgit.freedesktop.org/wayland/weston/tree/libweston/compositor-fbdev.c#n315
 ...and it seems that the non-primary framebuffer devices start completely off. (the screen is off on my Displayport device, and the window for the second vga card in qemu is much smaller than the primary one, and all black for my qemu vm) .

In my testing, sending the ioctl FBIOPUT_VSCREENINFO with a *changed* &varinfo allows it to wake up, and turns on the screen.
doing FBIOGET_VSCREENINFO and then FBIOPUT_VSCREENINFO in my testing does not work.

I think really the values that end up getting changed are varinfo.transp.offset and varinfo.transp.length. at least on the qemu system, but in this patch I am aligning all of them for completeness, because the drivers might do it differently for qemu

Test Plan: This causes the window for /dev/fb1 (remote-viewer, and a qemu vm with two "VGA" (bochsdrm) cards) to resize from the smaller size when specifying it as the --fb-device on seat0, and kwin draws on the device.

Reviewers: #kwin, davidedmundson, graesslin

Reviewed By: #kwin, graesslin

Subscribers: zzag, davidedmundson, rkflx, graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D9572
2018-08-13 17:37:24 +03:00
David Edmundson
7aedacd89e Fractional scaling in DRM kscreen integration
Summary:
The kwin code was written to treat scale as non integers, we just need
to switch to the relevant float version of methods.

Test Plan:
Used kscreen-doctor to change this
Konsole resized as appropriate
Plasmashell was all broken, but that's expected until QScreen::size is based on the
xdg-output virtual size

Reviewers: #kwin, mart, graesslin, romangg

Reviewed By: #kwin, mart, graesslin

Subscribers: romangg, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13616
2018-08-06 10:50:47 +01:00
l10n daemon script
3b3aa82f58 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-07-23 05:24:40 +02:00
l10n daemon script
3eaf1a9972 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-07-22 07:44:41 +02:00
David Edmundson
9f2f6d9657 Don't remove outputs during page flip
Summary:
To do so leaves a dangling pointer on our pageFlipHandler

BUG: 396272

Test Plan: Wobbled a window whilst plugging a monitor in and out

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14210
2018-07-18 16:05:59 +01:00
David Edmundson
2cc42ecc12 DRM cursor scaling
Summary:
We pass the buffer scale of the cursor through QImage::devicePixelRatio.

When copying the cursor with QPainter use Qt's in-built functionality to
handle resizing the cursor pixmap as necessary to match the screen.

As we're now resizing the cursor, the hotspot needs translating from
logical to device co-ordinates.

Test Plan: Used with associated patches

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13605
2018-06-23 18:15:41 +01:00
David Edmundson
9ff1f77e8e Support cursor scaling in X windowed backend
Test Plan:
Ran kwin_wayland --windowed  --scale2

Hovered over deco. Got massive and detailed cursor
Hovered over a wayland client (Qt 5.11 not dev)
Got a massive, but slightly blocky cursor

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13642
2018-06-23 18:15:41 +01:00