Commit Graph

15840 Commits (8510f31340ac78d76df69a3bccb001f610613913)

Author SHA1 Message Date
Martin Flöser d56b75f636 Remove Keyboard modifiers from Qt::Key created in Xkb::toQtKey
The KWindowSystem change 32526718eae99ccb594360627586eebdf793372b caused
a regression in KWin as Qt::Enter on keypad is no longer enter, but enter
with modifier mask. For all other modifiers it was never a problem that
the KKeyServer method also returned modifiers as it could not read the
X modifiers anyway.

As KWin has full knowledge about the modifiers through Xkb it does not
need the modifier mapped into the Qt::Key.

This fixes the failing TestWindowSelection autotest which started to fail
due to the change in KWindowSystem.
2017-08-12 15:04:23 +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
Martin Flöser bbca8c6677 Implement the shortcut caption suffix for Wayland windows
Summary:
The generation of the shortcut caption part is moved from Client to
AbstractClient. The ShellClient also has a captionSuffix and implements
the full part in caption.

Overall this needs more refactoring to support more sharing between the
two implementations. But one step at a time.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D7093
2017-08-12 11:31:33 +02:00
l10n daemon script bbad15f661 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-10 04:56:42 +02:00
Martin Gräßlin 5118d9470c [autotests] Try making QuickTilingTest::testShortcut more robust
It failed on CI. A possibility is that the wait for the quick tile
changed took to long, so that the next wait already passed and thus
failed. Instead of wait a QTRY_COMPARE on the size of the signalspy.
2017-08-09 19:22:36 +02:00
Martin Gräßlin 5ff9aa7cf5 [autotests] Try making StrutsTest::testWindowMoveWithPanelBetweenScreens more robust
Flaky on build.kde.org. Let's add some more time between the movements.
2017-08-09 17:54:42 +02:00
Martin Flöser ad4a3107d5 Add virtual Scene::scenePainter method
Summary:
So far EffectsHandlerImpl directly accessed SceneQPainter::painter
through a dynamic cast. If in future the QPainter based compositor should
be moved into a plugin we cannot access it through a dynamic cast.

To solve this problem the painter method is moved into Scene as
a virtual method returning a sane default value.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D7214
2017-08-09 07:08:28 +02:00
Martin Flöser c1892e6c0f Add virtual Scene::xrenderBufferPicture method
Summary:
So far EffectsHandlerImpl directly accessed SceneXrender::bufferPicture
through a dynamic cast. If in future the XRender based compositor should
be moved into a plugin we cannot access it through a dynamic cast.

To solve this problem the bufferPicture method is moved into Scene as
a virtual method returning a sane default value.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7207
2017-08-09 07:07:31 +02:00
Martin Flöser 8379030633 [autotests] Try to make translucencyTest more robust for CI
Changing a QVERIFY into QTRY_VERIFY in hope to make it more robust
on the highly flaky build.kde.org servers.
2017-08-08 20:48:40 +02:00
Martin Flöser af9f833a1d [autotests] Disable Outline in StrutsTest
The StrutsTest is constantly aborting on build.kde.org and lots of
OpenGL stuff in output. This could indicate a problem with the Outline
as the failing test could trigger the Outline. So let's try to disable
it.
2017-08-08 19:56:24 +02:00
Martin Flöser 8794fe548a Guard every remaining access to rootInfo
Summary:
For a future XFree KWin. Only remaining not guarded usages are in
Workspace::init, but that one needs to be refactored anyway for
becoming X free.

Test Plan: Compiles

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7173
2017-08-07 21:19:04 +02:00
Martin Flöser ddf3536f19 Drop Client::cap_deco as it's nowhere used
Summary:
cap_deco was only used in the caption with stripped arg case which was
unused and thus removed. Now cap_deco is completely unused.

Due to that we can also remove the stripped client script which only
manipulated the cap_deco.

Test Plan: Compiles

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7077
2017-08-07 21:18:40 +02:00
Martin Flöser 00281711d9 Handle processId being 0 in ShellClient::killWindow
Summary:
If ClientConnection fails to get the process id (which happens at least
on FreeBSD) the process id is 0. We should not try to terminate this pid
as it terminates all processes is KWin's process group which is the whole
session.

Test Plan: Only compile test

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7168
2017-08-07 07:14:20 +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 Flöser 20e314d151 Properly render XWayland windows in SceneQPainter
Summary:
The buffer for a XWayland window is larger than the actual size. Thus
we need to use the clientSize as reference, not the buffer size.

BUG: 382748

Test Plan: Test passes

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6952
2017-08-02 19:30:29 +02:00
Martin Flöser afd52c188a Drop the stripped parameter from AbstractClient::caption
Summary:
The parameter is not used anywhere in KWin. Only the default value was
used. So let's drop this.

Test Plan: Compiles

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7059
2017-08-02 17:09:49 +02:00
Martin Flöser 4a0787c058 Process all clients when updating fullscreen for active client
Summary:
Currently only done for X11 clients, should also be done for Wayland
client.s

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6892
2017-08-02 17:09:24 +02:00
Martin Gräßlin 9bdc7b7d4b Do not move temporary objects
It prevents copy elision according to Clang and of course clang is
right.
2017-07-31 18:24:05 +02:00
Martin Gräßlin f15ceaffe6 Drop unused variable UdevMonitor::m_udev
Credits to clang for finding unused private fields.
2017-07-31 18:22:14 +02:00
Martin Gräßlin bca8777acd Drop unused SceneXrender::Window::alpha_cached_opacity
Credits to clang for finding unused private field.
2017-07-31 18:20:07 +02:00
Martin Gräßlin 2858e30882 Drop unused static variables in client.cpp
Credits to clang for finding those.
2017-07-31 18:14:32 +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 Gräßlin b3a52e3999 [autotests] Drop PlasmaSurfaceTest::m_connection
Credits to clang for finding unused private variable.
2017-07-31 18:02:00 +02:00
Martin Gräßlin 063e796b18 [effects/backgroundcontrast] Remove ContrastShader::pixelSizeLocation
Credits to clang for finding an unused private variable.
2017-07-31 18:00:17 +02:00
Martin Gräßlin 3f238470c8 [effects/wobblywindows] Move computeVectorBounds into ifdef section
Fixes unused function warning with clang.
2017-07-31 17:58:57 +02:00
Martin Gräßlin 8b2b11196b [kcmkwin/desktop] Use KAboutData::programLogo instead of programIconName
ProgramIconName is deprecated and what we want to achieve is actually
provided by programLogo.
2017-07-31 17:48:59 +02:00
Martin Gräßlin ca84a81e0d Check for include file before configuring config-kwin.h 2017-07-31 17:34:37 +02:00
David Edmundson 0809a357c1 Improve testWindowScaled test
Summary:
Comparing a pure blue square isn't a very effective test as someone
cropping the image will still pass.

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6982
2017-07-31 15:12:37 +01:00
Martin Gräßlin bc003c0228 Add cmake check whether sys/sysmacros.h exists
Unfortunately 9ada8baca6 failed to compile
on FreeBSD due to the header not existing. So we need to check the
existance and properly guard with ifdef.
2017-07-30 21:30:33 +02:00
Martin Gräßlin 9ada8baca6 Turn around include order for major/minor
Although we made KWin compile with newer include requirement for major
and minor in gnu libc, we still get the warning that it's deprecated.
So let's try to turn the include order around. That should fix the
warning and hopefully still compile on non gnu libc (e.g. FreeBsd). If
it fails, we need to add a cmakedefine for the header.
2017-07-30 21:20:36 +02:00
Martin Flöser acedee21a5 [qpa] Fix overloaded-virtual warning 2017-07-30 08:22:32 +02:00
l10n daemon script ec11cfd04f 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-30 04:57:22 +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 859709f10a [libinput] Fix enumeral and non-enumeral type in conditional expression warning 2017-07-29 19:30:59 +02:00
Martin Flöser 656b3c2db5 [libinput] Fix reorder warnings 2017-07-29 19:29:08 +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 1447f4641c [autotests] Fix unused function warnings
The functions are defined in a common header but not used in all tests.
This creates needless warning noise, so hide them through an ifdef.
2017-07-29 18:47:58 +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
Martin Flöser da036098cf Nullptr check for rootInfo when setting active client
Summary:
Preparation for X free KWin. Code is called for both X11 and Wayland
windows. So make it not crash if we would not have an X server.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6908
2017-07-29 17:44:11 +02:00
Martin Flöser 150a0357b4 Replace delegate slots for window shortcut by std::bind expressions
Summary:
Client had a slot to delay a call when setting up a global shortcut for
the Client. This can be simplified by using a std::bind expression.
Similar the action was connected to a one line lambda which can be
expressed through a std::bind expression as well.

Test Plan: New added auto test still passes

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6801
2017-07-29 17:43:38 +02:00
Martin Flöser c8c15f0057 Use std::bind expression for Workspace::slotWindowtoDesktop
Summary:
This way we don't need the sender() hack to get the value set on the
QAction.

Test Plan: New autotest in master still passes

Reviewers: #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D6811
2017-07-29 17:41:33 +02:00
Martin Flöser 7d3517060f Drop the Workspace::slotSwitchWindowFoo methods
Summary:
They were only delegating into switchWindow(Direction), so let's do the
same through std::bind in kwinbindings and delegate to it directly in
scripting's WorkspaceWrapper.

Test Plan: Not yet, want to add test case for Workspace::switchWindow

Reviewers: #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D6791
2017-07-29 17:40:55 +02:00
Martin Flöser 64da6c8d1e Replace Workspace::slotWindowQuickTileFoo by a quickTileWindow with argument
Summary:
Thanks to std::bind we don't need that many different slots to setup the
global shortcut connections. Instead we can have one shared
implementation which takes the argument and passes it to the window.

To support std::bind arguments in kwinbindings the initShortcut method
and dependencies are adjusted as well as a new macro is added.

As I don't want to include abstract_client.h in workspace.h a new enum
is created for the quick tiling flags used in Workspace. This caused a
larger refactoring as the change to an enum class also caused quite some
changes.

Test Plan: Affected test cases still pass

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6783
2017-07-29 17:40:03 +02:00
l10n daemon script f14540485f 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-29 04:45:55 +02:00
Martin Flöser 8527ac30dc Fix unused-parameter warnings as reported by GCC 2017-07-28 21:31:09 +02:00
Martin Flöser e8a92361ae [autotests] Perform complete QImage comparison in SceneQPainterTest::testX11Window
As pixel comparison is failing, let's just compare the image against a
reference image.
2017-07-28 21:17:59 +02:00
Martin Flöser 06433997e8 Emit connectionDied on all Wayland connections of plugins on teardown
Summary:
Some libraries loaded into KWin (e.g. breeze) also have a Wayland
connection. If KWin destroyes it's own Wayland connection before the
libraries destroy theirs, KWin might crash on tear down when the
libraries call into libwayland with an invalid connection.

This change requires D6569 in KWayland.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6571
2017-07-28 20:30:54 +02:00