Commit Graph

1051 Commits (cd293220bb9b2f794dae39b415613b2cb97ea896)

Author SHA1 Message Date
Martin Gräßlin 50ef02fa1b [wayland] Start Compositor and Scene before Workspace
For Xwayland we need to have the Scene (and EglDisplay) created prior
to starting Xwayland and having X11. This requires creating the
Compositor before creating Workspace and starting Xwayland.

To support this the startup of Compositor is split into two parts:
prior and after Workspace creation.

The change might also be interesting for the kwin_x11 case as it could
result in the compositor being up in a quicker way.
2015-03-17 10:20:19 +01:00
Martin Gräßlin 0f945f53fe Move creation of InputRedirection, Cursor and Screens out of Workspace
Do not depend on Workspace and do not depend on X11 thus can be started
earlier allowing to get more things started prior to depending on
Workspace.
2015-03-17 10:20:19 +01:00
Martin Gräßlin e463905f04 Add Workspace::findToplevel
Like findClient and findUnmanaged, just a little bit more generic.
Toplevel::findInList got adjusted to support it.
2015-03-17 10:08:27 +01:00
Martin Gräßlin 65007cd104 [xwayland] Add a dedicated --xwayland option to kwin_wayland
The --xwayland option starts a rootles Xwayland server. If a
rootless Xwayland server is used OperationModeXwayland is used
which is introduced with this change as well.
2015-03-17 10:03:05 +01:00
Martin Gräßlin caf99f83d5 Require Qt 5.4
REVIEW: 122617
2015-02-19 10:56:50 +01:00
Martin Gräßlin 859553b129 Drop needless creation of KWindowInfo instance in Workspace::addClient
Completely unused and got (probably accidentally) introduced with the
merge of the kwin scripting GSOC project.
2015-02-17 13:53:52 +01:00
Martin Gräßlin e96c86e045 Remove unused #include <KWindowSystem> 2015-02-17 13:35:30 +01:00
Martin Gräßlin 6bb339ff90 Add Qt and XCB compile version to supportInformation
Add QT_VERSION_STR in addition to qVersion(). This could be useful
to see whether the runtime version is different to the Qt version
used at compile time.

Also adds the XCB_VERSION_STRING which is used at compile time.
This is useful as for example XCB::SYNC was broken prior to 1.10.

REVIEW: 122375
2015-02-02 09:31:08 +01:00
Martin Gräßlin d319a286e7 Improving printing of supportInformation
Custom conversion to QString for a few property types.
2014-12-08 16:46:54 +01:00
Martin Gräßlin 468b5a32ff Add supportInformation for new Decorations
Following information is included:
* selected plugin
* selected theme
* all properties from KDecoration2::DecorationSettings
2014-12-08 16:14:05 +01:00
Daniel Pastushchak 0d997b1093 Introduce categorized logging for kwin core
Done by Daniel Pastushchak for KDE during GCI-2014.
2014-12-05 14:27:15 +01:00
Martin Gräßlin 63695e6fc3 Remove unused imports 2014-12-02 15:26:42 +01:00
Martin Gräßlin 3d9a035312 Move MaximizeMode from KDecorationDefines to utils.h
Unfortunately it cannot be a enum defined in Client as client.h
depends on rules.h and with it in Client rules.h would depend on
client.h.
2014-12-02 13:49:08 +01:00
Martin Gräßlin d4e2f19ef0 Workspace does not need to inherit from KDecorationDefines 2014-12-02 11:17:43 +01:00
Martin Gräßlin c2e53b9a2f Merge branch 'kdecorations2'
Conflicts:
	effects.cpp
	paintredirector.cpp
2014-12-02 08:38:10 +01:00
Martin Gräßlin b7a8bb4f52 Drop build option KWIN_BUILD_SCREENEDGES
The build option got introduced for Plasma Active back in a time
when we did not properly aim for convergence. In a Plasma 5 world
we want to have only one shell and one window manager which adjust
itself. This means we don't want a differently compiled kwin for
plasma active, but the same one. Thus the build option doesn't
make much sense any more. A KWin for touch interface needs to support
screenedges for the case that mouse is plugged in.

CCBUG: 340960
REVIEW: 121200
2014-11-24 10:48:49 +01:00
Martin Gräßlin fcec334b3c [kdecoration] Adjust to change that DecorationBridge is no longer a singleton
* Aurorae needs to pass QVariantList args to parent Decoration
* DecorationBridge implementation needs to be a KWIN_SINGLETON
* DecorationBridge needs to be passed with args to created Decoration
2014-10-30 09:01:06 +01:00
Martin Gräßlin 8f87e18b79 [decorations] Add support for runtime switching of decoration plugins 2014-10-28 11:53:56 +01:00
Martin Gräßlin e32da9d9e0 Merge branch 'master' into kdecorations2
Conflicts:
	CMakeLists.txt
	paintredirector.cpp
	scene_opengl.h
	scene_qpainter.h
	scene_xrender.h
2014-10-20 16:04:52 +02:00
Martin Gräßlin a918591fef Use Logind to open/close devices needed by libinput
With libinput we have the problem that we need to have privileges to
open the device files. In order to not need wrappers or suid bits, we
use logind. This means that kwin_wayland has to be the session controler.

A LogindIntegration is added to connect to logind and wrap the dbus
calls. This is based on the logind integration done for ksld in
ksmserver. The LogindIntegration is started by Workspace and the
InputRedirection tries to become the session controller and starts the
libinput integration only after this succeeded.
2014-10-20 14:51:24 +02:00
Martin Gräßlin 670973efdb Move creating WaylandBackend into ApplicationWayland
Early creation to ensure that we can abort if there is no Wayland
display to connect to.
2014-08-18 08:50:44 +02:00
Martin Gräßlin 0030eb7f84 Initial import of support for new KDecoration2 based decorations
NOTE: this is not working completely yet, lots of code is still ifdefed
other parts are still broken.

The main difference for the new decoration API is that it is neither
QWidget nor QWindow based. It's just a QObject which processes input
events and has a paint method to render the decoration. This means all
the workarounds for the QWidget interception are removed. Also the paint
redirector is removed. Instead each compositor has now its own renderer
which can be optimized for the specific case. E.g. the OpenGL compositor
renders to a scratch image which gets copied into the combined texture,
the XRender compositor copies into the XPixmaps.

Input events are also changed. The events are composed into QMouseEvents
and passed through the decoration, which might accept them. If they are
not accpted we assume that it's a press on the decoration area allowing
us to resize/move the window. Input events are not completely working
yet, e.g. wheel events are not yet processed and double click on deco
is not yet working.

Overall KDecoration2 is way more stateful and KWin core needs more
adjustments for it. E.g. borders are allowed to be disabled at any time.
2014-07-25 14:02:26 +02:00
Thomas Lübking c654dd4ff1 WORKAROUND bug #335926
QXcbScreen overrides the input eventmask when
adding a screen, so we claim our stuff back

BUG: 335926
REVIEW: 118765
2014-07-03 18:39:38 +02:00
Thomas Lübking c455087248 add selectWmInputEventMask function
It sets the mask required for a WM and in addition
preserves the eventmask present on the root window for
this client (as set by any lib etc.)
2014-07-03 18:39:38 +02:00
Ivan Čukić b995c9da23 KWin activities usage ported to the new library paradigm
Since the KActivities library now keeps an internal cache (and is
non-blocking), there is no point in thread-based information
fetching.

BUG: 335396
REVIEW: 118443
2014-06-01 18:58:36 +02:00
Martin Gräßlin 97726a4b1f [TabBox] Fix forcedGlobalMouseGrab
Was incompletely moved to TabBox after splitting out from Workspace.

REVIEW: 118259
2014-05-23 07:31:00 +02:00
Martin Gräßlin fbb62aed40 [supportInformation] Add missing line break 2014-05-15 09:14:46 +02:00
Martin Gräßlin 83ad1386dc Add used OpenGLPlatformInterface to supportInformation
Useful information when the platform interface becomes runtime
switchable.
2014-05-13 09:23:03 +02:00
Martin Gräßlin 160093a359 Port ObscuringWindows to xcb 2014-05-05 08:09:10 +02:00
Martin Gräßlin 93e5ebac63 Try to wait for DESTROY_NOTIFY before releasing an Unmanaged
So far the Unmanaged got released after an XCB_UNMAP_NOTIFY. This event
gets created after xcb_unmap_window or after xcb_destroy_window. In the
latter case the window is already distroyed and any of KWin's cleanup
calls will cause a BadWindow (or similar) error.

The idea to circumvent these errors is to try to wait for the
DESTROY_NOTIFY event. To do so the processing of the release is slightly
delayed. If KWin gets the destroy notify before the delay times out the
Unamanged gets released immediately but with a Destroy flag. For this a
new enum ReleaseToplevel is introduced and Unmanage::release takes this
as an argument instead of the bool which indicated OnShutdown. Also this
enum is added to Toplevel::finishCompositing so that it can ignore the
destroyed case and not generate an error.

REVIEW: 117422
2014-04-16 13:32:11 +02:00
Martin Gräßlin 1c0d0211ca Add const method variants to Xcb::Wrapper
Adding a const variant for ::data() to remove an unexpected copy.
To complete also the bool cast operator and isNull get a const
variant.

REVIEW: 117469
2014-04-11 07:36:18 +02:00
Martin Gräßlin 6c1bad551b [kwin] Remove dependency on kwinglobals in kwinxrenderutils
XRenderUtils used connection() and rootWindow() provided by kwinglobals.
Those are now kept as static variables in the implementation set through
an init() method from Workspace prior to the first possible usage of any
functionality provided by XRenderUtils.

In order to make the xcb_connection_t* and the root window completely
internal the inline methods which used those are moved to the
implementation.
2014-03-26 14:01:08 +01:00
Martin Gräßlin bc0a9cb53a [kwin] Use std::find_if and lambda functions for Workspace::findClient
Instead of passing the macro based Predicate to findClient it now
expects a function which can be passed to std::find_if.

Existing code like:
xcb_window_t window; // our test window
Client *c = findClient(WindowMatchPredicated(window));

becomes:
Client *c = findClient([window](const Client *c) {
    return c->window() == window;
});

The advantage is that it is way more flexible and has the logic what
to check for directly with the code and not hidden in the macro
definition.

In addition there is a simplified overload for the very common case of
matching a window id against one of Client's windows. This overloaded
method takes a Predicate and the window id.

Above example becomes:
Client *c = findClient(Predicate::WindowMatch, w);

Existing code is migrated to use the simplified method taking
MatchPredicate and window id. The very few cases where a more complex
condition is tested the lambda function is used. As these are very
local tests only used in one function it's not worthwhile to add further
overloads to the findClient method in Workspace.

With this change all the Predicate macro definitions are removed from
utils.h as they are now completely unused.

REVIEW: 116916
2014-03-25 15:17:11 +01:00
Martin Gräßlin fe5f7fb2f6 [kwin] Drop Predicate based Workspace::forEachClient
Migrates the last usage to the lambda based variant.
2014-03-25 15:17:11 +01:00
Martin Gräßlin 12a4923959 [kwin] Use std::find_if and lambda functions for Workspace::findUnmanaged
Instead of passing the macro based Predicate to findUnmanaged it now
expects a function which can be passed to std::find_if.

Existing code like:
xcb_window_t window; // our test window
Unmanaged *u = findUnmanaged(WindowMatchPredicated(window));

becomes:
Unmanaged *u = findUnmanaged([window](const Unmanaged *u) {
    return u->window() == window;
});

In addition an overload is added which takes the window id to cover
the common case to search for an Unmanaged by its ID. The above example
becomes:
Unmanaged *u = findUnmanaged(window);

The advantage is that it is way more flexible and has the logic what
to check for directly with the code and not hidden in the macro
definition.
2014-03-25 15:17:10 +01:00
Martin Gräßlin 970e8765f0 [kwin] Remove support for _NET_WM_TAKE_ACTIVITY protocol
As can be seen in [1] the patches to KWin were in CVS HEAD before the
protocol got standardized and it never got any adoption. It's neither in
the NETWM spec, nor implemented in Qt4 nor in Qt5. KWin did not even add
the protocol to the NET::Supported property.

Thus it doesn't make much sense to keep a protocol which nobody speaks.

Still the code around the protocol is kept and also the names are kept.
Only difference is that Client::takeActivity got removed and the code
moved to the only calling place in Workspace. Motivated by that change
the enum defined in utils.h is moved into Workspace, it's turned into
a proper QFlags class and used as a type in the method argument instead
of a generic long.

[1] https://mail.gnome.org/archives/wm-spec-list/2004-April/msg00013.html

REVIEW: 116922
2014-03-25 15:03:21 +01:00
Martin Gräßlin ca5f8cfe03 [kwin] Remove unused config-workspace.h includes 2014-03-18 09:23:25 +01:00
Martin Gräßlin 7d48b92e2b Redirect pointer events to the Toplevel
InputRedirection keeps track of the Toplevel which is currently the one
which should get pointer events. This is determined by checking whether
there is an Unmanaged or a Client at the pointer position. At the moment
this is still slightly incorrect, e.g. pointer grabs are ignored,
unmanaged are not checked whether they are output only and input shapes
are not yet tracked.

The pointer events are delivered to the Toplevel as:
* enter
* leave
* move
* button press
* axis event

Nevertheless move events are still generated in InputRedirection through
xcb test for simplicity. They are still send to the root window, so all
windows get mouse move.

Button press and axis are generated only in the implementations of the
event handlers and delivered directly to the window, so other windows
won't see it.
2014-03-18 09:00:50 +01:00
Martin Gräßlin 92761e9e30 [kwin] Fix ifdefs for Wayland
With the switch to FindWayland from ECM WAYLAND_FOUND was no longer set
thus the ifdef didn't work. Now we use HAVE_WAYLAND and HAVE_WAYLAND_EGL.
2014-03-18 09:00:49 +01:00
Martin Gräßlin 7523c1e7d7 Integrate KWin::Cursor with InputRedirection
New inheriting class which uses the InputRedirection to track the cursor
position. It doesn't support warping of cursor.

This introduces a slight dependency loop in the startup. Cursor needs to
be created after the WaylandBackend to ensure that the operation mode is
set correctly. But the WaylandBackend itself is accessing Cursor. It
should be safe as inside the WaylandBackend it's only accessed after
callbacks.
2014-03-18 09:00:49 +01:00
Martin Gräßlin 1617deabb8 Introduce the beginning of an InputRedirection class
So far this new class is not yet doing much. The WaylandBackend forwards
the received pointer events to this InputRedirection class. From there
signals are emitted to inform internal areas about the changes first.

The events are currently forwarded to X through the xtest extension. This
will be removed in future. Input will be forwarded directly to the
surface which wants it (no matter whether X11 or Wayland).
2014-03-18 09:00:49 +01:00
Aleix Pol c72e519d9c Remove KDE/ prefix in include directories
It's unneeded and deprecated since KF5.
2014-03-17 16:24:10 +01:00
Martin Gräßlin 89c2688f74 [kwin] Drop direct rendering detection from GLPlatform
It's no longer needed as the OpenGLBackend has a direct rendering
detection and the remaining OpenGL2 backend aborts if the backend
uses indirect rendering. Thus the GLPlatform must always have a
direct rendering context.

REVIEW: 116829
2014-03-17 10:58:59 +01:00
Martin Gräßlin c7d986c7fe [kwin] Remove the legacy OpenGL 1 compositing backend
KWin already has a de facto OpenGL 2 dependency through QML. Combined
with the fact that the OpenGL 1 backend is basically unmaintained and
also unused, it's better to remove it for the new major release.

This change includes:
 * Removal of cmake option KWIN_BUILD_OPENGL_1_COMPOSITING
 * Removal of KWIN_HAVE_OPENGL_1 compile option and all code
   ifdef'ed with it (partially removal of if-else constructs)
 * Removal of CompositingType::OpenGL1Compositing (flags are kept
   as a core flag should get introduced)
 * Driver recommendation for OpenGL1Compositing changed to XRender
   (should be evaluated whether the drivers can provide GL2)
 * Removal of configuration option "GLLegacy"
 * Removal of fooMatrix function in kwinglutils
 * Removal of ARBBlurShader
 * Removal of legacy code path in GLVertexBuffer
 * Removal of GLShaderManager::disable
 * if-blocks with ShaderManager::instance()->isValid() removed

REVIEW: 116042
2014-03-10 08:59:11 +01:00
Martin Gräßlin 4dff7888e3 [kwin] Drop build option to build without scripting
Scripting has proved it's point of being useful so it's time to turn it
into a mandatory part of KWin.

Also I start to use features provided by Scripting in more and more
parts of KWin core (e.g. sharing QQmlEngine) which makes it in the
long to complicated to have a build option and ifdefs for it.

REVIEW: 116587
2014-03-04 08:19:55 +01:00
Martin Gräßlin 836bfe11e9 Port away from KWindowSystem::windowInfo
Just using KWindowInfo ctor. In one case in appmenu two usages of
KWindowInfo are merged into one KWindowInfo. And in KWindowList a
usage of adding the KWindowInfos into a list got removed.
2014-02-12 18:23:29 +01:00
Martin Gräßlin 7c7f137832 [kwin] Drop handling for mouse motion event compression
Not needed as Qt does it for us in the xcb plugin - see
QXcbConnection::processXcbEvents().
2014-02-01 09:34:40 +01:00
Thomas Lübking 4bb88df714 Merge branch 'KDE/4.11' 2014-01-14 22:51:24 +01:00
Thomas Lübking 3d389961ff preserve offsets when sending client to screen
for that purpose, move sendToScreen and updateLayer
functions from Workspace to Client, keep wrappers

BUG: 327361
FIXED-IN: 4.11.6
REVIEW: 114078
2014-01-14 22:28:46 +01:00
Thomas Lübking c378bf4f7c emit desktopPresenceChanged from Client:setDesktop
and forward it to scripted effects

CCBUG: 326903
REVIEW: 114080
2014-01-14 22:23:49 +01:00