Commit Graph

436 Commits (bd8f6d78f073328aa8f208b08f513a73b0079942)

Author SHA1 Message Date
Martin Gräßlin d31e9e88b4 Rename abstract_backend.(h|cpp) to platform.(h|cpp)
Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1340
2016-04-07 16:18:12 +02:00
Martin Gräßlin 6c0ed26c65 Add bool checkInputWindowEvent(QWheelEvent *e) to EffectsHandlerImpl
Allows to also pass through some QWheelEvents.
2016-03-04 14:18:32 +01:00
Martin Gräßlin a029300ce5 Rework cursor image handling for Wayland
So far updating the cursor image was not really defined. It was possible
to use the cursor image from the wayland seat or have a custom set cursor
image. But there are no rules in place to decide which one to use when.

With this change a dedicated CursorImage class is introduced which tracks
the cursor image changes on the seat, on the decoration, in the effects
and so on. In addition it tracks which is the current source for the
image, that is whether e.g. the cursor from the seat or from effects
override should be used. Whenever the cursor image changes a signal is
emitted, which is connected to the signal in AbstractBackend.

Based on that the backends can directly show the image. The existing
code in the backends to install a cursor shape or to install the cursor
from the server is completely dropped. For the backend it's irrelevant
from where the image comes from.

A new feature added is that the cursor image is marked as rendered. This
is then passed on to the frame rendered in the Surface and thus animated
cursors are finally working. Unfortunately animated cursors are broken in
Qt (see https://bugreports.qt.io/browse/QTBUG-48181 ).
2016-02-25 08:14:48 +01:00
Martin Gräßlin 757523a324 Use kwinApp()->config() instead of KSharedConfig::openConfig()
That way all over kwin we can inject a custom config in the autotests.
2016-01-29 11:24:18 +01:00
Martin Gräßlin 2e7bc0df87 [kwineffects] Pass screen projection matrix to EffectFrame
Exposes the current screen projection matrix in the render pass of
the EffectFrame, so that effects can make use of it.
2016-01-25 14:11:54 +01:00
Martin Gräßlin deb63fa344 Cancel loading in EffectsLoader on tear down
When unloading all effects we should make sure that also the ones
scheduled for loading are canceled. For this a new method clear()
is added to the AbstractEffectLoader and all inheriting classes which
clears the current load queue. For the scripted and plugin effect loader
it should also cancel the future, but that's not yet implemented.
2015-11-16 14:06:23 +01:00
Martin Gräßlin c1e9280efa [wayland] Unload all effects prior to destroying Xwayland connection
Some effects do X11 calls in their cleanup code through external
libraries (e.g. KSelectionOwner). As we cannot control that we need
to ensure the effects are unloaded prior to destroying the Xwayland
connection.
2015-11-12 11:33:00 +01:00
Martin Gräßlin c09f4039d1 Only emit EffectsHandler::windowClosed if Deleted got created
Ensures that Effects cannot ref a window during tear down and then
abort because there is no Deleted for the EffectWindow.
2015-11-10 08:56:32 +01:00
Martin Gräßlin 936c52e263 Check whether Cursor is valid before using from EffectsHandler mousePolling
During tear down Compositor and Effect system might be destroyed after
Cursor. Thus we need to ensure that we don't call into Cursor
unconditonally.
2015-11-10 08:56:32 +01:00
Nick Shaforostoff 3a8d7d866a optimize string operations
-use qstringliteral only when necessary (i.e. not in concat or comparison)
-use qbytearray instead of qstring when dealing with latin1 input and output (glplatform)
-use qstringref to extract numbers from strings (glplatform)
-define qt_use_qstringbuilder to optimize all string concatenations
-anidata: use ctor init lists, add windowType member initialization

REVIEW: 125933
2015-11-05 14:14:06 +00:00
Martin Gräßlin 1a66472494 Merge setting up client and shell client connections in EffectsHandlerImpl
The signals operate on AbstractClient nowadays, so we can have one
implementation for both Client and ShellClient.

Only X specific connections are only done for Client.
2015-10-26 10:43:36 +01:00
Martin Gräßlin 88e097ec16 Move signals clientFooUserMovedResized to AbstractClient
This also changes the argument to carry the sending AbstractClient
instead of Client.
2015-10-26 09:21:36 +01:00
Martin Gräßlin 03074c925c Use AbstractClient where possible in EffectsHandlerImpl
That magically makes things working like moving windows in desktop grid
to another desktop.
2015-10-14 17:35:10 +02:00
Martin Gräßlin c4f02a6677 Pass through mainClients for AbstractClient in EffectWindowImpl 2015-09-16 13:54:48 +02:00
Martin Gräßlin 1d242d9daf Move mainClients() and allMainClients from Client to AbstractClient
AbstractClient::mainClients is virtual and overriden in Client,
allMainClients has only a common implementation in AbstractClient.

In activation.cpp we still need one case where a temporary ClientList
needs to be constructed. Once transients are fully migrated that should
be removable again.
2015-09-16 13:54:47 +02:00
Marco Martin 5a55727056 support the slide protocol
take and apply thhe informations from the wayland slide
protocol in the sliding popups effect

REVIEW:125120
2015-09-14 16:39:39 +02:00
Marco Martin 3f5bf65a9e Use the kwayland blur protocol in the blur effect
use the new blur protocol to fetch information about the
region of blur behind to apply to windows like Plasma::Dialog
REVIEW:125017
2015-09-02 14:43:44 +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 377988eae9 EffectsHandlerImpl::activateWindow operates on AbstractClient
And now PresentWindows finally activates and raises windows.
2015-07-07 16:12:27 +02:00
Martin Gräßlin a1a89d3d1e Disable Activities support on Wayland
This is a temporary workaround for bug 349992 which causes freezes
during startup as kwin and kamd dead lock each other on DBus.

To workaround we don't call Activities::create and check in every
usage of Activities::self() whether the pointer is valid.

As a result kwin_wayland now starts pretty fast.

CCBUG: 349992
2015-07-07 11:48:42 +02:00
Martin Gräßlin 7cded49145 [wayland] Implement maximizing of ShellClient 2015-06-07 03:28:38 +02:00
Martin Gräßlin 034276af36 Move clientMaximizedStateChanged signal from Client to AbstractClient 2015-06-07 03:17:34 +02:00
Martin Gräßlin 7d152991c7 [wayland] ShellClient can reference an internal QWindow
If the ShellClient got created for a Qt internal window, we try to
find the QWindow and if we get one, we use the geometry directly as
it got set by KWin in the first place.

Also a windowId() is added to ShellClient which can be used by the
effect system to find an EffectWindow. If it's an internal QWindow
we just use that window id. For other clients we still need some
smart solution.
2015-05-18 15:31:41 +02:00
Martin Gräßlin 30e6ae34d7 Delay desktopPresenceChanged in EffectsHandlerImpl instead of Workspace
The signal might be emited by Workspace just before a Client gets
destroyed. In that case the argument carried by the queued event is no
longer valid and causes problems. In EffectsHandlerImpl we can queue
it without problems as the EffectWindow also stays valid if the Client
gets destroyed. The referenced Deleted gets destroyed with a deleteLater,
thus will be after the signal is emitted.

BUG: 347490
REVIEW: 123729
2015-05-18 08:01:33 +02:00
Martin Gräßlin 38b418887a Move minimize implementation to AbstractClient 2015-05-08 12:43:47 +02:00
Martin Gräßlin 1bfba1765c Signal desktopPresenceChanged carries AbstractClient as argument 2015-05-08 12:43:47 +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 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 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 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
Thomas Lübking c5bb84469d make window elevation scriptable 2015-04-07 23:59:17 +02:00
Thomas Lübking 4a9b56d950 forward showingDesktop signal to effects 2015-04-07 23:59:17 +02:00
Martin Gräßlin 9a0fd94013 Introduce AbstractBackend as base class for Wayland and X11Windowed backend
The AbstractBackend registers itself in the WaylandServer allowing
external users to easily get to the backend and not needing to test
manually which backend is used.
2015-03-20 14:41:03 +01:00
Martin Gräßlin e2c422dcb5 Woraround possible broken cursor when creating mouse interception window
The xcb_cursor_t returned by xcb-cursor library might be broken. If we
set such a broken cursor directly in the create window call it will fail
with a BadCursor value causing effects to break.

This change works around this problem by creating just the window and
moving the possible breaking call into a change window call. That will
still fail, but the window is working.

In addition it performs a safety check by only installing the cursor
if it's not XCB_CURSOR_NONE.

BUG: 344006
REVIEW: 123025
2015-03-20 10:39:11 +01:00
Thomas Lübking 31cfd02756 forward cursorshape changes to effectshandler
CCBUG: 322088
REVIEW: 122468
2015-02-10 21:41:39 +01:00
Martin Gräßlin 7b5cf8bcdc [effects] Ensure the correct cursor shape is set for mouse interception
When starting mouse interception the window might already be created
in which case the cursor wasn't defined. So let's always set it.

REVIEW: 12232
2015-02-06 09:40:30 +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 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 1747fde18b Toplevel does not inherit from KDecorationDefines any more
As an intermediate step Client inherits from KDecorationDefines.
2014-12-02 11:31:07 +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 bf4ba54647 Remove displayWidth and displayHeight from the compositor
Instead of getting size from displayWidth() and displayHeight() use
the information we have from Screens. This means there is only one
place to have the information and by that we can ensure that all
components use the same data to rely on. displayWidth/displayHeight
seem to provide the wrong information when unplugging an output
without disabling the output. This results in rendering artefacts.
But KWin::Screens has the correct information available.
2014-11-27 09:00:19 +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 a7bcb70980 [kdecoration2] Adjust to DecortionSettings no longer being a singleton 2014-10-29 16:11:20 +01:00
Martin Gräßlin a9587dd19d Bring back CloseButtonCorner in EffectsHandlerImpl
The setting should be per window and all button positions should just
get exported. This would be way more precise than checking the default
values.
2014-07-25 14:02:27 +02:00
Martin Gräßlin a019fa259c Load decoration plugin settings from meta data
This brings back the value whether the decoration requires blur behind.
2014-07-25 14:02:26 +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
Martin Gräßlin 6e1df6ba62 Do not register dbus service org.kde.kwin.Effects
Let's use org.kde.KWin, we have Object and interface to differentiate.
2014-05-15 10:55:29 +02:00
Martin Gräßlin 7fcecc616c Drop "kwin4_effect_" prefix for BuiltIn Effects
This removes all the hacks to add kwin4_effect_ to the name of the Effect
and adjusts the desktop files of the effect configuration's parent
component.

Note: the scripted effects still start with kwin4_effect_ prefix.

REVIEW: 117367
2014-04-28 13:52:50 +02:00
Martin Gräßlin b45eeae352 [Xcb::Wrapper] Introduce a Property and StringProperty Wrapper subclass
The Xcb::Property can wrap the xcb_get_property call and provides
convenient access methods to read the value of the reply with checks
applied. For this it provides a templated ::value method for reading a
single value or reading an array. There's also a ::toBool and
::toByteArray which performs the conversion directly with default values
for the type and format checks.

Xcb::TransientFor is changed to be derived from Property instead of
Wrapper directly, so that the reading of the property value can be
shared.

Xcb::StringProperty is a convenient wrapper derived from Property to
handle the reading of a string property providing a cast to QByteArray
operator. This replaces the ::getStringProperty from utils. Though the
separator functionality from ::getStringProperty is not provided as that
is only used in one function and handled there.

All the custom usages of xcb_get_property or getStringProperty are
replaced to use this new wrapper. That simplifies the code and ensures
that all properties are read in the same way.

REVIEW: 117574
2014-04-17 07:41:33 +02:00
Martin Gräßlin 2d2e1976cb Fix EffectsHandlerImpl::getProxy
Internal name of effects no longer starts with kwin4_effect.
2014-04-03 11:00:25 +02:00