Commit Graph

291 Commits (31b5b7f9f981ccaca001423c1a2183157bb53356)

Author SHA1 Message Date
David Edmundson bc92745f07 Restore cursors across multiple screens
Summary:
4238218b76 accidentally removed factoring
in m_globalPos.

BUG: 385003

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7970
2017-09-24 17:11:12 +01:00
David Edmundson 4238218b76 Don't scale cursor hotspot differently to cursor
Summary:
In the DRM plugin the cursor is currently is drawn at the native size
given.
Therefore we don't want to scale the icon offset as that leads to it
being drawn every so slightly off-sync.

BUG: 384769
Fixed-in: 5.11.0

Test Plan:
Kate now selects lines based on the middle of the cursor, not the top left.
I'd previously gotten so used to it, I hadn't realised it was actually a bug  :/

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7868
2017-09-18 16:40:21 +01:00
l10n daemon script 6a676d6fab 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"
2017-09-16 06:53:13 +02:00
Martin Flöser a9270f4232 Try fixing build failure on CI
No idea why the code compiles on my system. This change is based on the
output on build.kde.org.

CMakeFiles/testXRandRScreens.dir/__/plugins/platforms/x11/standalone/screens_xrandr.cpp.o:
In function `KWin::XRandRScreens::event(xcb_generic_event_t*)':
/home/jenkins/workspace/Plasma kwin kf5-qt5 SUSEQt5.9/plugins/platforms/x11/standalone/screens_xrandr.cpp:210:
undefined reference to `KWin::Options::currentRefreshRate()'
...
2017-09-12 21:20:18 +02:00
Martin Flöser 4fa41165d1 Move XRandR event filter into XRandRScreens
Summary:
The code in events.cpp was problematic as it was called in a Wayland
session. So KWin changed outputs, this gets mirrored to XWayland and
then KWin reacted on the XRandR event and might have even changed the
refresh rate due to that - bad idea.

This change moves the code into the already existing X11EventFilter for
XRandR events in XRandRScreens.

Test Plan: Run kwin_x11 in gdb on Xephyr, breakpoint in new code and triggered XRandR event

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7654
2017-09-12 18:53:08 +02:00
l10n daemon script 23eaed2f83 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"
2017-09-12 04:56:04 +02:00
l10n daemon script 875c00d64e 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"
2017-09-11 05:00:00 +02:00
l10n daemon script 95ae8dad1b 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"
2017-09-10 04:56:20 +02:00
l10n daemon script 45f98f694c 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"
2017-09-09 04:39:26 +02:00
Martin Flöser 01ddbe7d75 Make AbstractEglBackend a QObject
Summary:
Several of the subclasses are already derived from QObject.

The main reason is that the class should be moved out of KWin core in
order to move the OpenGL scene into a plugin. As Compositor calls into
the AbstractEglBackend to unbind the wayland display this creates a
problem which is easily solved by turning the AbstractEglBackend into a
QObject and connect to the signal emitted by the Compositor.

Test Plan: Compiles

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7669
2017-09-07 19:25:28 +02:00
Bhushan Shah d1e0c6f9d7 [platforms/hwcomposer] Include the android-config.h in the hwcomposer_backend
Summary:
This special file[1] can contain the defines like QTI_BSP and QCOM_BSP
which then modifies the API/ABI of the hwcomposer[2].

This defines are required in order to make kwin_wayland work on !nexus
QCOM devices and also possibly other special devices.

[1] https://github.com/Halium/android-headers/blob/master/android-config.h
[2] https://github.com/Halium/android-headers/blob/halium-7.1/hardware/hwcomposer.h#L290

Test Plan: built kwin locally on such device

Reviewers: #kwin, davidedmundson

Reviewed By: davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7719
2017-09-07 16:35:45 +05:30
l10n daemon script 5c20e5c049 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"
2017-09-05 04:33:17 +02:00
l10n daemon script 62c6e1399b 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"
2017-09-04 04:47:09 +02:00
l10n daemon script 6681f1c0df 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"
2017-09-03 04:47:03 +02:00
l10n daemon script bc45ff1458 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"
2017-09-02 04:55:23 +02:00
Martin Flöser 51561052ec Move screen inversion through XRandr into X11 standalone platform
Summary:
By moving the functionality into the Platform API we can also implement
support on other platforms which support this in general (e.g. DRM once
Roman's color adjustment patches landed).

Reviewers: #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D7447
2017-09-01 18:04:28 +02:00
Martin Flöser 23ef40e638 Move the X11 Decoration Renderer into the X11 standalone platform
Summary:
Not needed except for X11/non-composited usage, so should be in the
plugin instead of core.

Platform API is extended to create a decoration renderer.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7444
2017-09-01 17:49:32 +02:00
Martin Flöser 535b107969 Move QPainter compositor into plugin
This change is similar to D7232 and moves the scene_qpainter into a
dedicated plugin. Compared to the XRender case it's more complicated as
the platform plugins need to implement a platform specific backend.

The base implementation for this part used to be in scene_qpainter. As
the idea is to completly move it away from KWin core it would be point
less to still have the backend definition in KWin core, but it cannot
be in the scene plugin as otherwise all platforms need to link the
plugin.

To solve this a new platformsupport subdirectory is added which contains
the scene platform backend as a static library. For the OpenGL scene such
a static library will also be required.

Test Plan: SceneQPainter test still passes, nested compositor still works

Reviewers: #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D7259
2017-09-01 17:44:49 +02:00
Martin Flöser 054d923411 Move SceneXRender into a plugin
Summary:
First step for loading the compositor Scenes through plugins. The general
idea is that we currently needlessly pull in all the Scenes although only
one will be used.

E.g. on X11 we pull in QPainter, although they are not compatible. On
Wayland we pull in XRender although they are not compatible.

Furthermore our current Scene creation strategy is not really fault
tolerant and can create situations where we don't get a compositor. E.g
on fbdev backend the default settings won't work as it does not support
OpenGL.

Long term I want to tackle those conceptional problems together:
we try to load all plugins supported by the current platform till we have
a scene which works. Thus on Wayland we don't end up in a situation where
we don't have a working compositor because the configuration is bad.

To make this possible the switch statement in the Scene needs to go and
needs to be replaced by a for loop iterating over all the available
scenes on the platform. If we go there it makes sense to replace it
directly with a plugin based approach.

So this is a change which tackles the problem by first introducing the
plugin loading. The xrender based scene (as it's the most simple one)
is moved into a plugin. It is first tried to find a scene plugin and only
if there is none the existing code is used.

Test Plan: Tested all scenes

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7232
2017-09-01 17:42:28 +02:00
Martin Gräßlin 1e13deaa1d Port some displayWidth/displayHeight usages to Screens::size()
Summary:
KWin::displayWidth and KWin::displayHeight are bound to X11 which
doesn't make much sense on X11. In addition KWin internally knows
the overall display dimensions through the Screens singleton class.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D1798
2017-09-01 17:11:10 +02:00
Martin Flöser a3dc2ad5a2 Move NonComposited Outline into the X11 standalone platform
Summary:
Creating the OutlineVisual is moved into the Platform API. The default
implementation creates the composited OutlineVisual. The X11 standalone
platform overrides it and creates the non composited outline in case no
compositing is used.

Test Plan:
Run kwin_x11 with KWIN_COMPOSE=N and KWIN_COMPOSE=X,
non composited outline and composited outline loaded

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7450
2017-09-01 17:07:23 +02:00
Martin Flöser 833f933c5c Move X11 specific event filtering for ScreenEdges into x11 standalone platform
Summary:
This change splits out the X11 specific event filtering into a dedicated
X11EventFilter. It is created in the x11 standalone platform plugin when
the first Edge is being created.

Some of the X11 specific code is removed from ScreenEdges, though more
refactoring is possible in ScreenEdges to share more code between X11
specific and generic implementation.

Test Plan: Run KWin on Xephyr, screen edge approach effect still shows

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7406
2017-09-01 17:01:01 +02:00
l10n daemon script afc80b580a 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"
2017-08-30 08:05:15 +02:00
l10n daemon script 5a7d6d3df9 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"
2017-08-28 04:30:46 +02:00
Martin Flöser 1cc38c929a Move updateXTime into the X11 standalone platform
Summary:
KWin::updateXTime only delegates into the platform API where the method
is a no-op. The actual implementation is moved into the X11 standalone
platform as it uses QX11Info which is non functional except on the X11
standalone platform.

This change exposes a problem with timestamp handling: on Wayland the
X11 timestamp does not get updated at all, causing e.g. window sync not
work correctly (c.f. bug 374881). We cannot implement the updating in the
same way as QX11Info/Qt xcb platform does it as that would introduce a
blocking roundtrip to XWayland which is dangerous.

As a side-effect this change removes linking to Qt5::X11Extras in kwin
core as it's no longer needed.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7515
2017-08-24 20:49:49 +02:00
Martin Flöser f88c322a3b [platforms/x11] Use a GlxContextAttributeBuilder
Summary:
Based on the work of 3f4995fb9b this change
introduces a GlxContextAttributeBuilder to make the requesting of context
attributes cleaner, more verbose and less error prone copy and paste.

Test Plan:
Switched between Core and legacy and verified the output;
extended auto test

Reviewers: #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D6411
2017-08-19 11:34:51 +02:00
Martin Flöser a65b2c062c Move event filtering for overlay window into an X11EventFilter
Summary:
The OverlayWindowX11 also inherits from X11EventFilter and performs
the filtering itself.

Test Plan: Compiles, not yet tested as I'm on Wayland

Reviewers: #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D7197
2017-08-12 11:32:53 +02:00
Martin Flöser b4a79d30e6 Move the X11 specific OverlayWindow into the platform/x11
Summary:
The overlay window is only needed for the X11 based compositors. Given
that it is better suited in the X11 platform. Unfortunately it is not
possible to completely move it into the platform plugin as it is still
referenced in KWin core (e.g. SceneXRender). Due to that the
OverlayWindow in KWin core is turned into a pure virtual class with the
implementation being moved into the plugin.

The platform API gains a new virtual factory method which is only
implemented in the X11 platform.

Test Plan: Compiles

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7193
2017-08-12 11:32:29 +02:00
l10n daemon script 004a9aa6ea 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"
2017-08-07 04:53:10 +02:00
Martin Gräßlin e713df1886 [plugins/qpa] Drop unused variable AbstractPlatformContext::m_integration
Credits to clang for finding unused private variable. This allowed to
similify the ctor and remove a const_cast.
2017-07-31 18:09:15 +02:00
Martin Gräßlin f5845fec02 [plugins/qpa] Properly ifdef everything with HAVE_WAYLAND_EGL
Hide variables which are only used with wayland egl and mark attributes
as unused if they are not used without having wayland egl.
2017-07-31 18:04:53 +02:00
Martin Flöser acedee21a5 [qpa] Fix overloaded-virtual warning 2017-07-30 08:22:32 +02:00
Martin Flöser 31e4387852 [platforms/x11] Silence warning caused by eglCreateImageKHR taking an xpixmap for a pointer
Nothing we can do, the API sucks. So just silence warning.
2017-07-29 20:01:11 +02:00
Martin Flöser 3eb3e64d91 [platforms/x11] Fix int-in-bool-context warning
The intention is to prevent division by zero, so make this explicit by
comparing the values against 0.
2017-07-29 19:09:14 +02:00
Martin Flöser f47cc62180 Fix unuxed-but-set-variable warning 2017-07-29 19:01:55 +02:00
Martin Flöser 349618c214 Move bitCount from utils to GlxBackend
Only used in GlxBackend.

Differential Revision: https://phabricator.kde.org/D6784
2017-07-29 17:52:44 +02:00
David Edmundson 777f7009ed Merge branch 'Plasma/5.10' 2017-07-28 12:52:31 +01:00
David Edmundson 308ab76428 Update KNS providers to https
CCBUG: 382820
2017-07-28 12:51:41 +01:00
Martin Flöser eee2ace6a1 Make Q_FALLTHROUGH code compile with Qt < 5.8
sorry for breaking FreeBSD CI build. I didn't expect Q_FALLTHROUGH being
newer.
2017-07-27 21:51:47 +02:00
Martin Flöser 4b89011099 Fix (incorrect) implicit-fallthrough warnings in gcc7
All cases are annotated that it's an explicit fallthrough, so add
Q_FALLTHROUGH to silence the warning.
2017-07-27 20:46:44 +02:00
l10n daemon script ccc69e8105 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"
2017-07-26 08:52:42 +02:00
Tobias C. Berner a512f54924 Hide the Linux specific parts behind check for headers
Summary:
Only build
  * `virtual_terminal.cpp` in the presence of `linux/vt.h`
  * `fbdev`-backend in the precense of `linux/fb.h`

Test Plan:

Reviewers: #kwin, #freebsd, graesslin, bcooksley

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6847
2017-07-24 16:19:27 +02:00
Martin Flöser 73fa7b21a1 [qpa] Use the new OpenGLContextAttributeBuilder to create Qt's OpenGL context
Summary:
Introduces a few more attributes needed for creating the OpenGL context
used by the QPA.

Test Plan:
Extended test and run KWin/Wayland and verified that OpenGL context
gets created correctly.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6734
2017-07-17 16:53:37 +02:00
Martin Flöser ea5d611de1 Require C++14
Summary:
KWin already used C++14 constructs in a conditional way. This doesn't
make much sense today, it's better to just require C++14.

For KWin only gcc and clang are currently compilers of relevance. Gcc
supports C++14 since version 5 and defaults to C++14 since 6.1 [1].
Clang supports C++14 since version 3.4 [2].

An overview of compiler support in various distributions:
* Debian stable (stretch): gcc 6.3, clang 3.8
* Debian oldstable (jessie): 4.9, clang 3.5
* Ubuntu 17.04: gcc 6.1, clang 3.8
* Ubuntu 16.04: gcc 5.3, clang 3.8
* openSUSE Tumbleweed: gcc 7.1, clang 4.0
* openSUSE Leap 42.3: gcc ?, clang ? [3]
* FreeBSD: clang >= 34 in ports
* Slackware 14.2: gcc 5.3

This overview shows that every distro out there has at least one
supported compiler which can still compile KWin with this change.

[1] https://gcc.gnu.org/projects/cxx-status.html#cxx14
[2] https://clang.llvm.org/cxx_status
[3] Sorry I fail to understand openSUSE's package repository.
    It seems that there is gcc 7 available, but gcc package is 4.8

Test Plan: Compiles on my neon system

Reviewers: #plasma

Subscribers: plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6634
2017-07-17 16:53:18 +02:00
Martin Flöser 8e2805ce9d Merge branch 'Plasma/5.10' 2017-07-17 16:53:08 +02:00
Martin Flöser bf0e0f071c [aurorae] Add support for shaded windows
Summary:
Aurorae did not render correctly. This change addresses the problem for
both maximized and restored windows.

BUG: 373319
FIXED-IN: 5.10.4

Test Plan: shaded windows with Plastik and SVG based theme

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6719
2017-07-17 16:51:57 +02:00
Martin Flöser 5cb91762be [aurorae] Mark the render QQuickWindow as frameless
Summary:
On Wayland aurorae was creating a lot of stress for the system and
basically turning the system unusable in a short time. This was due to
a recursion starting to create OpenGL contexts. The window created a
decoration (aurorae) which created a QQuickWindow. For that KWin creates
an internal window which in turn triggers the creation of a window
decoration and so on and on.

By simply setting the render QQuickWindow as frameless we can prevent
this recursion.

Test Plan: Tested on Wayland and X11. On Wayland the recursion is gone.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6726
2017-07-17 16:51:04 +02:00
Martin Flöser 06a558e3de [platforms/x11] Quit the OpenGL Freeze protection thread on shutdown
Summary:
Weird NVIDIA behavior fixup part 2. Now that we do no longer freeze when
NVIDIA decides to create an OpenGL error on startup
(aefb5f4dd9), we experience a new issue.
KWin is terminating (no idea why, [1]) and at the same time the OpenGL freeze
protection thread is still running. So far we did not terminate the
thread on shutdown and thus we hit an abort in Qt.

This change ensures that we properly terminate the thread on shutdown.

[1] My current theory is that games terminate KWin, common pattern of
bug reports is "steam".

BUG: 382283
FIXED-IN: 5.10.4

Test Plan:
Tortured KWin by making sure I go through the code path,
saw the abort without the patch, no more abort with the patch

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6735
2017-07-16 18:04:17 +02:00
Roman Gilg d4423186b9 [platforms/drm] Delete buffer on all errors in present
Summary:
When returning early in DrmOutput::present() because of some error KWin
didn't delete the proposed buffer, therefore not releasing the surface
lock of the GBM buffer to the EGL surface.

This patch makes sure that on any error in present we cleanup the proposed
DrmBuffer.

Reviewers: #kwin

Subscribers: #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6660
2017-07-14 13:42:52 +02:00
Martin Flöser 0d941c6e27 Merge branch 'Plasma/5.10' 2017-07-06 21:18:18 +02:00