Commit Graph

193 Commits (9919627106c47d07ea3c974a8b3076b5edca8820)

Author SHA1 Message Date
Martin Gräßlin 000954c508 Allow transients to go over dock windows under certain conditions
For Wayland transients are popups relative to a parent surface. This
means for a dock window we obviously want them above the dock, otherwise
the context menu would be below the dock.

To not break the existing functionality (which makes sense) we bind
it to whether the transient has a positioning hint - that's only set
for ShellClients.
2015-09-17 14:33:54 +02:00
Martin Gräßlin d25c465211 Move layer functionality to AbstractClient
Merges together the code from ShellClient and Client and removes the
starting differences. Long term it's better to have only one
implementation to prevent diversions in the implementation.

As it doesn't match exactly protected virtual methods are called
which allow more specific implementations for a certain aspect of the
layer resolving.
2015-09-17 11:06:59 +02:00
Marco Martin 49e5e81970 support raise and lower windows on wayland
connect raise/lowerRequested to workspace()->raiseClientRequest
/workspace()->lowerClientRequest
REVIEWED-BY:Martin Graesslin
2015-09-16 16:36:26 +02:00
Martin Gräßlin fc5b303c5f Workspace::raiseClientWithinApplication opertes on AbstractClient 2015-09-16 13:54:48 +02:00
Martin Gräßlin e46bf87311 Workspace::lowerClientWithinApplication operates on AbstractClient 2015-09-16 13:54:48 +02:00
Martin Gräßlin f84b4758f2 Fix incorrect static_casts to Client
Replace by better dynamic_casts to AbstractClient.
2015-09-16 13:54:48 +02:00
Martin Gräßlin 5f429625f0 Workspace::topClientOnDesktop returns AbstractClient 2015-09-16 13:54:48 +02:00
Martin Gräßlin a9d8926d3c Workspace::findDesktop returns AbstractClient 2015-09-16 13:54:48 +02:00
Martin Gräßlin a421f546cd Move functionality of Client::updateLayer to AbstractClient
With transient support in AbstractClient we can provide the
functionality in AbstractClient.
2015-09-16 13:54:48 +02:00
Martin Gräßlin 4e6ea0808a Workspace::constrainedStackingOrder supports transients on AbstractClient 2015-09-16 13:54:47 +02:00
Martin Gräßlin 2f7597e522 Move transients from Client to AbstractClient
Unfortunately introduces a few casts to Client again.
2015-09-16 13:54:47 +02:00
Martin Gräßlin 4ad749e560 Workspace::ensureStackingOrder can operate on QList<Client*> or QList<AbstractClient*>
Preparation for getting Client::transients() to be AbstractClient as
ensureStackingOrder is called on the transients.
2015-09-16 13:54:47 +02:00
Martin Gräßlin a5d3317645 Use auto for iterator over transients()
Preparation for changing transients to QList<AbstractClient>.
2015-09-16 13:52:25 +02:00
Martin Gräßlin df98e3883f Move hasTransient from Client to AbstractClient 2015-09-16 13:52:25 +02:00
Martin Gräßlin 1e00e1597a Workspace::keepTransientAbove operates on AbstractClient 2015-09-16 13:52:25 +02:00
Martin Gräßlin c4c3dfc73f Move transientFor from Client to AbstractClient
Right now this caused a few dynamic_casts. On the other hand existing
dynamic_casts from AbstractClient to Client can be removed again.
2015-09-16 13:52:25 +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 36fa88893e [wayland] Track the internal ShellClients in WaylandServer
Adds all internal ShellClients into a dedicated list. This ensures that
we don't perform "normal" window management on them.

In addition we add them to the top of the stacking order. This restores
behavior as it is on X11: internal windows are using BypassWindowManagerHint
and thus on top of everything.
2015-05-21 13:34:26 +02:00
Thomas Lübking 75bd798ad9 Merge branch 'Plasma/5.3' 2015-05-19 22:52:52 +02:00
Thomas Lübking a16a489a43 Show Desktop: keep desktop group visible
Windows that "belong" to the desktop are
kept visible and do no break the state on
activation/mapping

REVIEW: 123783
CCBUG: 346837
CCBUG: 346933
CCBUG: 347212
2015-05-19 22:06:48 +02:00
Thomas Lübking f3b69b0ed0 Showing Desktop: keep docks visible
REVIEW: 123783
BUG: 346933
BUG: 347212
CCBUG: 346837
FIXED-IN: 5.3.1
2015-05-19 22:01:02 +02:00
Martin Gräßlin 25e3af5988 Implement keepAbove and keepBelow in AbstractClient
Moves the properties and the base implementation into AbstractClient.
Methods invoke a new protected virtual method which is implemented in
Client to update the TabGroup.
2015-05-08 12:43:46 +02:00
Martin Gräßlin b84118a51b Workspace::updateClientLayer operates on AbstractClient
Requires a virtual updateLayer in AbstractClient. Default implementation
does nothing.
2015-05-08 12:43:46 +02:00
Martin Gräßlin 94ce47ef7b Workspace::mostRecentlyActivatedClient returns an AbstractClient
Implementation temporarily moved to cpp. Needs to be moved back once
should_get_focus and active_client are AbstractClient.
2015-05-08 12:43:46 +02:00
Martin Gräßlin c357ac01fe Workspace::restackClientUnderActive operates on AbstractClient 2015-05-08 12:43:45 +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 792745c963 Change Workspace::restack to operate on AbstractClient 2015-05-08 12:43:44 +02:00
Thomas Lübking cbfcd3b096 implement showingDesktop by raising desktop window
This is an alternative approach suggested by the
NETWM spec.
The advantage is, that windows are not minimized
at all what apparently lead to some confusion
about the nature of the mode (which was abused
to tidy up) and a secret config key to allow for
that unrelated behavior.
Instead the ShowDesktopIsMinimizeAll key is removed
and replaced by a dedicated script + shortcut.

Bonus: less code to remember "minimized" windows =)
2015-04-07 23:59:17 +02:00
Martin Gräßlin 7d797387d7 Add safety check for QueryTree
xcb_qeuery_tree should fail and we should not just assume that the
call succeeds.

Crash reported by Harald Sitter.
2015-03-20 12:39:33 +01:00
Martin Gräßlin d66a804bbb Drop not needed includes of QX11Info 2015-03-17 09:44:53 +01:00
Thomas Lübking ea5a5f196d allow forcefull restacking
when restacking for shaded windows and uncomposited tabboxes
the group check should not be applied since we know better
eg. to restore a former order

CCBUG: 186206
REVIEW: 122469
2015-02-10 21:40:55 +01:00
Martin Gräßlin f7d7c246b8 Slightly optimize Workspace::xStackingOrder
Callgrind analysis showed that this method has room for improvement.
The bottle neck is mapping the Unmanaged against the list of windows
retreived from xcb_query_tree. The number of windows in that list is
rather large (>1000), which turns the loop into an expensive path.
Workspace::findUnmanaged seems to be too expensive for that due to the
overhead of using a functor and multiple method calls. The Inl. cost
before the optimization for checking ~55,000 windows is 2.46.

The change uses a good old const-iterator based loop over the unmanaged
list to check for the window. This reduces the Incl. cost for checking
~55,000 windows to 0.28.

REVIEW: 122067
2015-01-16 12:28:44 +01:00
Kai Uwe Broulik 2153174dc0 Add OnScreenDisplayLayer which is placed even ontop of the active fullscreen window
It is to be used for volume change feedback and similar confirmation popups

REVIEW: 121300
2015-01-02 12:11:54 +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 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 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 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 fdee4ea8c8 Adjust kde-workspace to introduction of flags in NET classes 2014-02-05 17:40:19 +01:00
Martin Gräßlin 1576c55cd2 [kwin] Add better support for Notification windows
KWin starts to support the Notification window type and has an own
layer for all notification windows. They are kept above the above
layer but do not go over active fullscreen windows.

REVIEW: 115298
2014-01-28 07:40:34 +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
Martin Gräßlin ce674ed509 [kwin] Window -> xcb_window_t or WId 2013-11-18 13:57:46 +01:00
Thomas Lübking feafbca941 Merge branch 'KDE/4.11' 2013-09-24 21:33:46 +02:00
Thomas Lübking 79d6c47a46 group aware restack accounts layer compatibility
the restack code stacks under all members of an application
this is a problem if the group contains a keep below or desktop
etc. (while the other window is a normal one) what resulted in
restacking the client "invalidly" above the window of the other
layer but below all other memberso of its own group for no reason

REVIEW: 112627
CCBUG: 110543
2013-09-24 21:29:54 +02:00
Martin Gräßlin 57905c0cc2 And we got rid of KDebug
Usages of kBacktrace got dropped.
2013-09-02 13:14:39 +02:00
Martin Gräßlin 4193b2406f Use XCB to query the window tree in xStackingOrder 2013-08-02 10:30:25 +02:00
Martin Gräßlin 1b7d2e5ca4 Client::restackWindow() accepts xcb_(window|timestamp)_t as argument
At the same time X define usage is changed to XCB enums.
2013-05-28 11:55:39 +02:00
Martin Gräßlin 4022de7075 Use signal/slots instead of deep function calls into decoration
For all the decoration updates called from Client into the decoration we
also have a signal being emitted. So turning the pure virtual public
functions into slots means we can just connect our existing signals and
get rid off the deep function calls.

The keepAbove/Below signals are changed to take a boolean argument as
needed by KDecoration and a few emitted signals are moved to a better
fitting location.

REVIEW: 110335
2013-05-07 16:53:58 +02:00
Martin Gräßlin b6681ddc3a Turn RootInfo into a KWIN_SINGLETON
It's not a typical singleton as the ctor is not taking a Workspace* and
needs addtional data to be passed to NETRootInfo.

All the initialization code is moved to RootInfo::create() and the tear-
down code is moved to RootInfo::destroyed(). This includes the support
window which used to be a member of Workspace. It's only needed by
RootInfo, so there is no need to have the ownership inside Workspace.

Instead of using a QWidget we just create a normal window through xcb.
It gets destroyed again in the tear-down code after the RootInfo got
destroyed.

REVIEW: 110238
2013-05-01 19:14:38 +02:00