Commit Graph

13091 Commits (4f1c98773e1eccdcc7a23aede04571d576749e50)

Author SHA1 Message Date
Martin Gräßlin 4f1c98773e Workspace::showWindowMenu operates on AbstractClient 2015-05-08 12:43:45 +02:00
Martin Gräßlin c357ac01fe Workspace::restackClientUnderActive operates on AbstractClient 2015-05-08 12:43:45 +02:00
Martin Gräßlin ddcd4dab59 Workspace::slotWindowTo(Previous|Next)Desktop operates on AbstractClient 2015-05-08 12:43:45 +02:00
Martin Gräßlin 1d4701d67e Workspace::takeActivity operates on AbstractClient 2015-05-08 12:43:45 +02:00
Martin Gräßlin 484f9b6e65 Workspace::activateClient and ::requestFocus changed to AbstractClient
requestFocus delegates to takeActivity which is not yet adjusted but
performs a nullptr check, thus we pass a casted Client.
2015-05-08 12:43:45 +02:00
Martin Gräßlin 8cfe0a9316 Workspace::clientActivated signal changed to AbstractClient
connections changed to new connect syntax to ensure they are correct.
2015-05-08 12:43:45 +02:00
Martin Gräßlin 3ad117ac28 Workspace::activeClient returns an AbstractClient
Still a few casts in some areas as setting activeClient still takes
a Client.
2015-05-08 12:43:45 +02:00
Martin Gräßlin 4b41c33268 Workspace::movingClient changed to AbstractClient
In events.cpp it's casted to Client as it's X11 specific.
In InputRedirections it's kind of broken, but window movement is
anyway broken.
2015-05-08 12:43:45 +02:00
Martin Gräßlin d2cdd3de1d UserActionsMenu operates on AbstractClient
There are still a few areas where it's dynamic casting to Client,
e.g.:
* sendToDesktop
* window tabbing related
* activities related
2015-05-08 12:43:45 +02:00
Martin Gräßlin 4eb9a98f1a [scripting] actionsForUserActionMenu operates on AbstractClient 2015-05-08 12:43:45 +02:00
Martin Gräßlin 519006ffa4 Workspace::performWindowOperation operates on AbstractClient
Only exception is the call to ::takeActivity which still expects a
Client.
2015-05-08 12:43:45 +02:00
Martin Gräßlin bfb52b20c9 RuleBook::edit operates on AbstractClient 2015-05-08 12:43:45 +02:00
Martin Gräßlin bfa4e1cec1 Workspace::cascadeOffset operates on AbstractClient 2015-05-08 12:43:45 +02:00
Martin Gräßlin 942b49e2c4 Workspace::setupWindowShortcut operates on AbstractClient 2015-05-08 12:43:45 +02:00
Martin Gräßlin aa1e9161d5 Workspace::clientArea takes AbstractClient instead of Client 2015-05-08 12:43:44 +02:00
Martin Gräßlin 7c187359a7 Workspace::sendClientToScreen operates on AbstractClient 2015-05-08 12:43:44 +02:00
Martin Gräßlin c46c92e204 Screens changed to use AbstractClient in ::setCurrent 2015-05-08 12:43:44 +02:00
Martin Gräßlin 6e45901844 TabBoxClientImpl changed to using an AbstractClient
The change is mostly straight forward. Effects are straight forward
adjusted. Client::findModal is moved up, this causes still a few
dynamic_casts to Client. Mostly because Workspace::activateClient still
operates on Client.
2015-05-08 12:43:44 +02:00
Martin Gräßlin f800477be5 Use AbstractClient for raise/lowerClient
Not a 100 % port. Transient handling is still bound to Client and
does a static cast back to Client.
2015-05-08 12:43:44 +02:00
Martin Gräßlin 1b02837d0b Add overload Workspace::hasClient(const AbstractClient*)
Delegates to hasClient(const Client*) if the AbstractClient is a
Client. Needs to be extended for other AbstractClient subclasses.
2015-05-08 12:43:44 +02:00
Martin Gräßlin 792745c963 Change Workspace::restack to operate on AbstractClient 2015-05-08 12:43:44 +02:00
Martin Gräßlin fe7a6834b2 FocusChain operates on AbstractClient instead of Client
As external interface it still returns Client* to not force the casts
to be done at usages. This will be changed once the users are migrated
to AbstractClient*.
2015-05-08 12:43:44 +02:00
Martin Gräßlin 0f54da9dde Introduce an AbstractClient base class for Client (and ShellClient)
The idea for this base class is to provide access to all elements which
make up a managed "Client" being it X11 or Wayland. They share a lot,
like they have a caption, they can be minimized, etc. etc.

Of course it would have also been possible to derive a new class from
Client, but that looks like the more difficult task as Client is very
X11 specific.

So far only a very small interface is extracted with pure-virtual
methods. This is going to change by moving the functionality up into
the AbstractClient.

The interface extracted so far is inspired by the usage of FocusChain
and users of FocusChain.
2015-05-08 12:43:44 +02:00
Martin Gräßlin d60c377890 [wayland] Introduce a ShellClient
The ShellClient is a Toplevel subclass for a
KWayland::Server::ShellSurfaceInterface. It gets created when a new
ShellSurfaceInterface is created and destoryed when it gets unmapped.

So far the usage is still rather limited. The ShellClient is opened
at position (0/0). While it's possible to pass pointer events to it,
it's not yet possible to activate it, so no keyboard focus.
2015-05-08 12:43:44 +02:00
Martin Gräßlin 8fad5830f1 Toplevel::windowRole becomes virtual and is copied to Deleted
Toplevel::windowRole accesses WinInfo unconditionally causing crashes
if we have a Toplevel subclass which doesn't use WinInfo. So let's
make it virtual and copy to Deleted.
2015-05-08 12:43:44 +02:00
Martin Gräßlin fec2b63102 Copy NET::WindowType to Deleted
This was suggested to be done in a comment. The existing code might
have returned incorrect results for Client. So let's get the primary
window type and use that one.
2015-05-08 12:43:44 +02:00
Martin Gräßlin e8b14cd587 [input] Add safety checks before accessing Cursor of focused pointer
There might be no focused pointer and there might be no cursor.
2015-05-08 12:43:44 +02:00
Martin Gräßlin 92d06a8c4b Make Toplevel::opacity virtual and copy it to Deleted
Toplevel::opacity() accesses the WinInfo, but for a Wayland client
we won't have the opacity through the WinInfo, so let's have it as
a virtual method that a subclass can override. Also it needs to be
copied to Deleted to not have a Deleted of a Wayland client crash
because it accesses the not existing WinInfo.
2015-05-08 12:43:44 +02:00
Martin Gräßlin cfba4bacdf [wayland] Reference BufferInterface in WindowPixmap
As long as our WindowPixmap uses the buffer we should have it referenced.
2015-05-08 12:43:44 +02:00
Martin Gräßlin 209b62d522 [wayland] Pass EGLDisplay to KWayland::Server::Display
This allows the Server to calculate the size of a Buffer and we don't
need to use the queryBuffer for the size.
2015-05-08 12:43:44 +02:00
Martin Graesslin e12400a675 Add a hwcomposer backend based on libhybris
This backend interacts with libhybris to create a hwcomposer which is
used for creating the egl context and surface. The initial version of
this backend is based on test_hwcomposer.cpp provided by libhybris.

Please note that using the hwcomposer backend requires a newer libepoxy,
the latest stable release is not able to bring up OpenGLES, so one needs
a master build of libepoxy.

Notes on licensing:
libhybris is Apache 2.0 licensed, which is not compatile with GPLv2.
But it is compatible with GPLv3. Thus the source files in the hwcomposer
backend are licensed GPLv3+ and not GPLv2+ as the rest of KWin. If one
uses KWin without the hwcomposer backend (which is obviously the default)
the licence doesn't change. But if the hwcomposer backend is used the
overall license of KWin changes to GPLv3+.
2015-05-08 10:28:52 +02:00
Martin Gräßlin 713c6b25dc [kwinglutils] Init glVersion on gles
The glVersion was not set at all for gles causing any code doing a
hasGLVersion check to fail which means that the compositor doesn't
start at all, because it has a hasGLVersion(2, 0) check.

The complete ifdef is no longer needed. The used additional glGetStringi
is also available in gles 3.0, thus epoxy can handle it quite well
without a need for ifdef.

Unfortunately the version string can be "strange" on GLES. On desktop
it looks like: "3.0 some driver foo", on GLES it could also be:
"OpenGL ES 3.0 some driver bar". Thus to make the logic work we are
first removing any leading "OpenGL ES " and hope that then the version
is encoded just like on GL.
2015-05-08 08:53:34 +02:00
Martin Gräßlin 2a8d7664b3 Properly add define for gles
Otherwise some parts still include epoxy/glx.h.
2015-05-07 14:11:30 +02:00
Martin Gräßlin 2220ae44c4 Create a plugin for each of the wayland backends
Each of the backends becomes a plugin. This allows kwin_wayland to load
the requested plugin and kwin itself doesn't need to link all the
libraries needed. E.g. libdrm is no longer linked if running kwin_x11.
Also this allows to create backends for the non-standard EGL platforms
(examples could be raspberrypi or Android devices).
2015-05-06 10:31:39 +02:00
Martin Gräßlin 33fb763e37 [wayland] Introduce a deviceIdentifier in AbstractBackend
To be used by the concrete backends for e.g. framebuffer device name,
DISPLAY or WAYLAND_DISPLAY variable.
2015-05-06 09:38:18 +02:00
Martin Gräßlin d45cf6ee8d [wayland] Add an initialWindowSize to AbstractBackend
Useful for windowed backends like X11 and Wayland.
2015-05-06 09:26:51 +02:00
Martin Gräßlin 17d5839580 [wayland] AbstractBackend can emit an initFailed signal
Replaces the custom handling for Wayland and X11 Backend. Now they can
just emit the initFailed signal.
2015-05-06 09:26:51 +02:00
Martin Gräßlin 0782252f72 [wayland] AbstractBackend provides signal screensQueried
With this change all backends need to emit the screensQueried signal
at some point. So far only x11 backend did not provide the signal,
wayland had a comparable delayed init mechanism. Now all backends use
the same mechanism.
2015-05-06 09:05:37 +02:00
Martin Gräßlin b2f5873a28 [wayland] X11WindowedBackend anounces input support by itself
It's the one knowing what it supports, no need to do it outside.
2015-05-06 09:05:37 +02:00
Martin Gräßlin c4f8bed815 [wayland] Use a pure virtual AbstractBackend::init method
Two backends already used an init method, let's make that the same
in all backends to be able to have shared startup code.
2015-05-06 08:34:26 +02:00
Martin Gräßlin 2afaa60dc5 [wayland] A backend can mark whether it is ready
Replaces the functionality of the WaylandBackend and makes it available
to all backends by providing the functionality directly in
AbstractBackend. By default a backend is not ready and the implementation
must call setReady(true) to indicate that setup has finished
successfully. The compositor won't start till the backend indicates that
it is ready.
2015-05-05 19:05:31 +02:00
Martin Gräßlin 8ff394a020 [wayland] Dedicate logging category for each of the backends 2015-05-05 17:47:03 +02:00
Martin Gräßlin 767ca8d357 [wayland] Don't call into X11WindowedBackend from EglOnXBackend
Instead of having a ctor which takes the backend, it's a ctor which
takes all the information needed from the backend.
2015-05-05 15:35:12 +02:00
Martin Gräßlin d80984beab [wayland] Move X11WindowedQPainterBackend into backends/x11 2015-05-05 15:23:53 +02:00
Martin Gräßlin f7bf7cb7ba [wayland] Move WaylandQPainterBackend into backends/wayland 2015-05-05 15:13:36 +02:00
Martin Gräßlin df6221ae4a [wayland] Move FramebufferQPainterBackend into backends/fbdev 2015-05-05 15:07:01 +02:00
Martin Gräßlin 06d8206192 [wayland] Move DrmQPainterBackend into backends/drm 2015-05-05 13:32:33 +02:00
Martin Gräßlin 72db1e63a3 [wayland] Move backend implementations into a backends/<name> directory
The aim is to be able to create a plugin for each of the backends.
The following directories are created:
* backends/drm
* backends/fbdev
* backends/wayland
* backends/x11
2015-05-05 13:05:37 +02:00
Martin Gräßlin 300a576d32 [wayland] Split out WaylandCursorTheme into own header/implementation
It's used by both the WaylandBackend and AbstractBackend. By splitting
it out the AbstractBackend doesn't need to depend on an implementation.
2015-05-05 13:05:04 +02:00
Martin Gräßlin 79b5685b7a [wayland] Add protected AbstractBackend::repaint(const QRect&)
Allows to trigger a repaint in the Compositor. This way the
implementation does not need to call into Compositor.
2015-05-05 11:39:18 +02:00