Commit graph

13475 commits

Author SHA1 Message Date
Martin Gräßlin
26b3569a0b [wayland] Add a QPA plugin for kwin_wayland
This introduces an own QPA plugin for KWin. QtWayland's plugin is not
a good solution for KWin as QtWayland is meant for Wayland clients and
not for a Wayland server. Given that it makes more sense to have a very
minimal QPA plugin which supports the use cases we actually have.

With our own QPA plugin we should be able to improve the following
areas:
* no need to create Wayland server before QApplication
* Qt::BypassWindowManagerHint can be supported
* no workaround for creating OpenGL context in main thread
* sharing OpenGL context with Qt
* OpenGL context for Qt on libhybris backend

The plugin supports so far the following features:
* creating a QPlatformWindow using KWayland::Client (ShellSurface)
* creating a QPlatformBackingStore using a ShmPool
* creating a QPlatformOpenGLContext with Wayland::EGL
* or creating a QPlatformOpenGLContext which shares with KWin's scene
* creating a QPlatformScreen for each KWayland::Client::Output
* QPlatformNativeInterface compatible to QtWayland
2015-08-25 14:33:50 +02:00
Martin Gräßlin
79317717c8 [wayland] Export ShellClient
Need to access it from our QPA plugin.
2015-08-25 14:33:50 +02:00
Martin Gräßlin
c56bbc0ddf Composite windows from a QOpenGLFramebufferObject
This change introduces a mechanism for internal windows to be rendered
to a QOpenGLFramebufferObject to be composited using the texture bound
to the FBO. This is useful for in-process rendering (e.g. QtQuick) and
at the same time bypassing the windowing system.

The OpenGL context of the QOpenGLFramebufferObject needs to be sharing
with the compositing OpenGL context.
2015-08-25 14:33:50 +02:00
Martin Gräßlin
d837830661 [wayland] AbstractBackend announces whether a surface less context is possible
In an own QPA plugin we want to make the OpenGL context sharing with
our compositing context and bypass the windowing system for OpenGL
windows. In order to achieve this we need a surfaceless context.

The AbstractBackend now forwards whether such a context can be created on
the EGLDisplay used by the Compositor.
2015-08-25 14:33:50 +02:00
Martin Gräßlin
b9d7726f7a [wayland] Forward EGLDisplay and EGLContext from Scene to Backend
AbstractBackend can forward the egl display and context, so that
it can be used from other parts.
2015-08-25 14:33:50 +02:00
Martin Gräßlin
9272d01a2d Add a WaylandServer::findClient which takes a QWindow
Of course only works with internal clients.
2015-08-25 14:33:50 +02:00
Martin Gräßlin
f76c18bfb8 Add SceneOpenGL::backend() const -> OpenGLBackend*
A way to get to the actual backend used by the compositing scene.
2015-08-25 14:33:50 +02:00
Martin Gräßlin
a9e5343eb6 [wayland] Use an event thread for the internal Wayland connection 2015-08-25 14:33:50 +02:00
Martin Gräßlin
6294961ba4 [wayland] Keep Registry for internal connection around
Allows to interact with the Registry for the internal connection in
other parts of KWin and makes it possible to create more than just the
ShmPool for this Registry.
2015-08-25 14:33:50 +02:00
Thomas Lübking
7b1000385c Merge branch 'Plasma/5.4' 2015-08-24 21:59:16 +02:00
Thomas Lübking
a97b6e0fd6 delete the quit process, not UserActinsMenu
BUG: 351643
FIXED-IN: 5.4.1
REVIEW: 124895
2015-08-24 21:58:49 +02:00
Martin Gräßlin
f7925c586e [tabbox] Support wayland in establish/remove TabBoxGrab
We cannot grab keyboard/mouse through X means, so don't even try, but
mark as grabbed.

With this change the TabBox shows on Wayland.
2015-08-24 11:44:05 +02:00
Martin Gräßlin
304ac3ac84 [tabbox] Split areModKeysDepressed into X11 and Wayland variant 2015-08-24 11:43:39 +02:00
Martin Gräßlin
6b95705f24 [libinput] Don't change default log level
With this change libinput is less noisy and only prints errors to stderr.

In addition one could install a dedicated log handler and forward to
qCDebug and friends.
2015-08-21 14:38:57 +02:00
Martin Gräßlin
f183c6f9df Merge branch 'Plasma/5.4' 2015-08-21 12:18:56 +02:00
Martin Gräßlin
abc3c633f3 Fix regression in unit-test introduced with 62b6401175
I don't understand why, but this fixes the TestXcbWrapper::testTransientFor().

Failing code fragment in question:

Window transientWindow(createWindow());
transientWindow.changeProperty(XCB_ATOM_WM_TRANSIENT_FOR, XCB_ATOM_WINDOW, 32, 1, &m_testWindow);
// let's get another transient object
TransientFor realTransient(transientWindow);
QVERIFY(realTransient.getTransientFor(&compareWindow));
QCOMPARE(compareWindow, (xcb_window_t)m_testWindow);

the QCOMPARE failed with one compareWindow being 0. It looks like the
cast from Xcb::Window to xcb_window_t in the changeProperty failed.

REVIEW: 124864
2015-08-21 11:14:20 +02:00
Martin Gräßlin
73b8b3ec7b Fix moving windows in InputRedirection
* Need to pass modifiers to Client::keyPressEvent
* Need to check whether move/resize ended before updating position,
  otherwise it keeps stuck in move/resize after ending
2015-08-21 10:49:06 +02:00
Martin Gräßlin
cfddaed6df Do not try to open VirtualTerminal through logind
Logind doesn't support it and we normally can open the /dev/tty without
being root.
2015-08-21 08:47:21 +02:00
Jonathan Riddell
9c91f64bc0 Update version number for 5.4.0
GIT_SILENT
2015-08-20 13:19:54 +01:00
Thomas Lübking
8e11729ff6 Merge branch 'Plasma/5.4' 2015-08-19 12:40:10 +02:00
Thomas Lübking
b7bb7222f4 do not call showOnScreenEdge for *all* clients
when managing them or they change their geometry
what will (aside the overehad) randomly show them
on screen

REVIEW: 124814
2015-08-19 12:31:49 +02:00
Thomas Lübking
f96836b2df update SwitcherItem::screenGeometry when showing
not everytime the current screen changes.
a) that pollutes the geometry when the tabbox is invoked
b) it's insufficient for "Active Screen follows mouse" (the default)
c) less overhead (ok: "on multiscreen")

BUG: 337790
CCBUG: 341531
FIXED-IN: 5.4
REVIEW: 124814
2015-08-19 12:31:31 +02:00
Thomas Lübking
ede337ff22 udpate _NET_FRAME_EXTENTS with border updates
BUG: 351157
FIXED-IN: 5.4
REVIEW: 124741
2015-08-19 12:31:13 +02:00
Thomas Lübking
266edb123d Merge branch 'Plasma/5.4' 2015-08-15 01:58:07 +02:00
Thomas Lübking
c240f7a012 do the hide-is-move dance w/ desktopgrid buttons
the (old) button effect windows used to be unreferenced
with the re-invocation of the effect. because we stopped
deleting/recreating the window, this approach failed and
the effect window was never deleted.

Unreferencing the window at proper occasion (see new hide
location) coked up - guess what - the exact same "texture is
junk" issue as for the QtQuick close button in present windows...

So we resort to the exact same stupid "hide by moving" solution
as we have there.

BUG: 348577
FIXED-IN: 5.4
REVIEW: 124136
2015-08-15 01:35:24 +02:00
Thomas Lübking
269e275cb0 smart placement of unregularily max'd clients
1. if a client has oversize, ensure to keep the titlebar in
sight

2. if a maximized client *almost* covers the entire maximization
area, users can easily be trapped to click into the missing
pixels, thus the client below.

Therfore the clients is then stuffed into one corner, with
preference to the titlebar edge and the screen area (ie.
*away* from panels and towards actual screen borders because
of fitt's law)

BUG: 349935
REVIEW: 124286
FIXED-IN: 5.4
2015-08-15 01:34:41 +02:00
Thomas Lübking
eb71b47db4 only discard pixmaps when the XCB Window resized
Causes invalid textures on the nvidia blob
when referencing textures for crossfading
eg. during maximization

BUG: 324823
REVIEW: 124591
FIXED-IN: 5.4
2015-08-15 01:34:41 +02:00
Thomas Lübking
62b6401175 store logic (what we think) geometry of XCB Window
This allows us to check and compare geometry of
system windows, no matter what the interim logic
client geometry (eg. shaded etc.) is

REVIEW: 124591
2015-08-15 01:34:41 +02:00
Martin Gräßlin
5d946e3762 Make X11_XCB a build dependency of X11 windowed backend
Let's rather not build the plugin if we don't have the dependency
then building it without OpenGL support. Simplifies the code a bit
and makes the backend overall more useful and goes along with e.g.
the Wayland one which has EGL also as a hard dependency for the
plugin.

REVIEW: 124697
2015-08-12 11:39:20 +02:00
Martin Gräßlin
06aacf4f65 Drop cmakedefine HAVE_WAYLAND_EGL
Now a required build dependency.
2015-08-12 11:39:20 +02:00
Martin Gräßlin
3139dcd3b9 Drop cmakedefine HAVE_WAYLAND
Now a required build dependency.
2015-08-12 11:39:20 +02:00
Martin Gräßlin
a6c6408f54 Drop cmakedefine HAVE_WAYLAND_CURSOR
Now a required build-dep.
2015-08-12 11:39:20 +02:00
Martin Gräßlin
da1e063a37 Drop cmakedefine HAVE_XKB
No longer needed, we always depend on xkbcommon now.
2015-08-12 11:39:19 +02:00
Martin Gräßlin
0b8f2d4a34 Make Wayland a hard build time dependency
As discussed on release-team ml [1] the following dependencies are
mandatory:
* KF5Wayland
* Wayland::Cursor
* Wayland::Egl
* xkbcommon

[1] https://mail.kde.org/pipermail/release-team/2015-July/008725.html
2015-08-12 11:39:19 +02:00
Martin Gräßlin
a002442224 [decorations] Bring back option NoPlugin
The option NoPlugin allows to disable window decoration plugins. It
used to exist with the old decoration library but got unfortunately
lost during the switch.

This change brings back the option and also allows runtime changes
of the option.

REVIEW: 124708
2015-08-12 10:52:46 +02:00
Martin Gräßlin
1274740f51 Merge branch 'Plasma/5.4' 2015-08-12 09:42:05 +02:00
Martin Gräßlin
b8e433d0a9 [effects] Properly set the componentDisplayName on the KActionCollection
Without the componentDisplayName the shortcut dialog takes the name of
the application e.g. Systemsettings or "KDE Control Module", but we want
it to be KWin.

REVIEW: 124706
2015-08-12 09:40:55 +02:00
Martin Gräßlin
2635243650 Drop build option KWIN_PLASMA_ACTIVE
The build option wasn't used for 5.x at all and in this way doesn't make
any sense nowadays. We want to have a converged desktop which also means
that the window manager should be able to switch to a different form
factor with a full feature set (plug in external screen to smartphone and
it should be full desktop). A trimmed down KWin with compiled out
functionality cannot do that. Also the need for trimmed down KWin becomes
less and less important given the improved hardware we target nowadays.

This change got triggered by the announcement to close down the Plasma
Active mailinglist [1], which shows that having a build option called
Plasma Active is no longer needed.

[1] http://permalink.gmane.org/gmane.comp.kde.devel.active/4343

REVIEW: 124694
2015-08-11 11:19:39 +02:00
Martin Gräßlin
c24e315a9b Drop build option KWIN_BUILD_EGL
It doesn't make much sense any more as we do no longer link EGL since the
switch to epoxy. And epoxy pulls it in at runtime if needed.
Even more on Wayland it's just plain stupid to have EGL disabled. So
removing the option just simplifies our code base without any
disadvantages.

REVIEW: 124695
2015-08-11 11:15:25 +02:00
Martin Gräßlin
a596ff556e Merge branch 'Plasma/5.4' 2015-08-11 10:32:36 +02:00
Martin Gräßlin
8c884d92b3 Delete the rules process, not the Rulebook
Fixes crash when editing window rules.

BUG: 351177
REVIEW: 124693
2015-08-11 08:38:30 +02:00
Jonathan Riddell
5e8729c05d GIT_SILENT
Update version number for 5.4.90
2015-08-06 16:04:04 +02:00
Jonathan Riddell
252a3ca682 GIT_SILENT
Update version number for 5.3.95
2015-08-06 13:21:39 +02:00
Martin Gräßlin
125cc5082f Change default logging category to QtCriticalMsg
Less noisy KWin by default.
2015-07-31 13:29:58 +02:00
Martin Gräßlin
53004b95ff Port left over qDebug to qCDebug 2015-07-31 13:25:51 +02:00
Martin Gräßlin
bffbbce172 [scripting] Add dedicated logging category 2015-07-31 13:25:51 +02:00
Martin Gräßlin
09880d1267 [decorations] Introduce logging category for decorations 2015-07-31 13:13:46 +02:00
Martin Gräßlin
910c49959a [tabbox] Add dedicated logging category for TabBox 2015-07-31 13:13:41 +02:00
Martin Gräßlin
fe28ca1d8a [libinput] Add dedicated logging category for libinput 2015-07-31 12:43:35 +02:00
Martin Gräßlin
57c521c214 [libkwineffects] Introduce logging categories for libkwineffects 2015-07-31 12:16:15 +02:00