Commit Graph

89 Commits (3619d58044f9412a20a4051696bab024f342e27b)

Author SHA1 Message Date
Martin Gräßlin 8cdfb0e88f Merge back implementation of Client::move and ShellClient::move
Implementation goes to AbstractClient, method is no longer virtual.
The X11 specific code is moved to a new virtual protected doMove
method implemented in Client.
2015-10-15 15:29:09 +02:00
Martin Gräßlin c578720615 Add virtual AbstractClient::updateTabGroupStates(TabGroup::States)
Method added so that we can call into TabGroup::updateStates from code
in AbstractClient. Default implementation does nothing, implementation
in Client performs the actuall call.

As a first case added to Client::move in order to be able to move the
implementation to AbstractClient.
2015-10-15 15:29:09 +02:00
Martin Gräßlin d7b4d8fe82 Move functionality for geom_before_block to AbstractClient
Semantically it belongs together with geometry update blocking which
is already in AbstractClient.
2015-10-15 15:29:09 +02:00
Martin Gräßlin a186e407bf Move handling around deco_rect_before_block to AbstractClient
The usage was always to trigger repaints on the old and the new
visibleRect. And store the new visibleRect as the future old one.

This is now encapsulated in a dedicated method called
addRepaintDuringGeometryUpdates().
2015-10-15 15:29:09 +02:00
Martin Gräßlin 6049b9ff3c Move implementation of sendToScreen from Client to AbstractClient
Method is no longer virtual, stub in ShellClient removed.
2015-10-14 16:38:17 +02:00
Martin Gräßlin 996c828da3 [autotest/wayland] Add a test for quick tiling Wayland clients
Base test verifies the quick tile positions. No maximization or direct
state changes tested yet.

Required to have Toplevel and AbstractClient exported. Otherwise we
cannot use the SignalSpy.
2015-10-14 09:58:16 +02:00
Martin Gräßlin 9f91431e8c Move quick tiling from Client to AbstractClient
In order to make it possible to quick tile also ShellClients.
2015-10-14 08:36:29 +02:00
Martin Gräßlin 9f2b4c7d14 Introduce a virtual AbstractClient::updateQuickTileMode(QuickTileMode)
New method is used to modify the quick tile mode state directly.
Preparation step for moving the quick tile handling to AbstractClient.
2015-10-14 08:36:29 +02:00
Martin Gräßlin 15f5886426 Add a pure virtual AbstractClient::setGeometryRestore(const QRect &) 2015-10-14 08:36:29 +02:00
Martin Gräßlin 9ef42ae3c7 Move blocking geometry updates functionality to AbstractClient 2015-10-14 08:36:29 +02:00
Martin Gräßlin 646eeb8bbb Provide isDecorated() as virtual method on AbstractClient
Default implementation returns false.
2015-10-14 08:36:29 +02:00
Martin Gräßlin ec6c778df7 Move implementation of checkWorkspacePosition to AbstractClient
No longer a virtual method, the implementation of Client is turned into
AbstractClient. The stub removed from ShellClient.
2015-10-14 08:36:29 +02:00
Martin Gräßlin 696cdb9e39 Add setGeometry to AbstractClient as pure virtual method
In Client existing method is marked as override, in ShellClient a new
override is added which delegates to requestGeometry. Existing method
is renamed to doSetGeometry and all internal calls delegat to it.
Needs better merging with the implementation of Client.
2015-10-14 08:36:29 +02:00
Martin Gräßlin eacaf25acf Improve sharing of maximize between Client and ShellClient
The changeMaximize method is added as a pure virtual protected method
to AbstractClient. This replaces the previous pure virtual maximize
method. Which is now directly implemented in AbstractClient (reusing
the implementation previously in Client).
2015-10-14 08:36:29 +02:00
Martin Gräßlin 60342d44e3 Move adjustedSize from Client to AbstractClient 2015-10-14 08:36:29 +02:00
Martin Gräßlin 7c49b1ca42 Add sizeForClientSize as virtual method to AbstractClient
Base implementation returns the passed in size.

Required for moving adjustedSize to AbstractClient.
2015-10-14 08:36:29 +02:00
Martin Gräßlin 37fc20d3c0 Move enum Sizemode from Client to AbstractClient
Required to add e.g. sizeForClientSize and adjustedSize to
AbstractClient.
2015-10-14 08:36:29 +02:00
Martin Gräßlin acb3a14200 Add border(Left|Top|Right|Bottom)() const as virtual methods in AbstractClient
At some future point we will also need it in ShellClient and it allows us
to better share geometry related implementations.

Base implementation returns 0, that is no border.
2015-10-14 08:36:29 +02:00
Martin Gräßlin ee47ce613d Provide quickTileMode() as virtual method in AbstractClient
Base implementation always returns QuickTileNone. Implementation in
Client overrides. Long term solution: provide functionality directly
in AbstractClient.
2015-10-14 08:36:29 +02:00
Martin Gräßlin 78e9a56cd1 Move checkOffscreenPosition from Client to AbstractClient 2015-10-12 10:50:20 +02:00
Martin Gräßlin 53b87dbbd9 Move (is|set)ElectricBorderMaximizing from Client to AbstractClient 2015-10-12 10:26:00 +02:00
Martin Gräßlin 226a099366 Move electricBorderMaximizeGeometry from Client to AbstractClient
As it's not used outside of Client the method is turned from public
to protected.
2015-10-12 10:24:49 +02:00
Martin Gräßlin 32fbbc90bc Make geometryRestore() pure virtual in AbstractClient
Provides an implementation in ShellClient and method in Client gets
marked as override.
2015-10-12 10:23:06 +02:00
Martin Gräßlin 9b8836b455 Move (set)electricBorderMode() from Client to AbstractClient
While it was public in Client, it was not used anywhere outside of
Client, because of that it's only protected in AbstractClient.
2015-10-12 09:56:54 +02:00
Martin Gräßlin b489ebabdc Move signal quickTileModeChanged from Client to AbstractClient 2015-10-12 09:38:42 +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
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 0003008668 Fixup with removeTransietn 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 305699be8e Move modal from Client to AbstractClient 2015-09-16 13:54:47 +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
Martin Gräßlin df98e3883f Move hasTransient from Client to AbstractClient 2015-09-16 13:52:25 +02:00
Martin Gräßlin a86a7e7b3c Add a placement strategy for transient ShellClients
A transient ShellClient has an offset position to the parent surface.
Use this to position the ShellClient properly.

This fixes the random placement of menus.
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 07dd743412 Move transient property from Client to AbstractClient 2015-09-16 13:52:25 +02:00
Martin Gräßlin a0adf3507a Move Q_PROPERTY wantsInput from Client to AbstractClient
This fixes the EffectWindow::acceptsFocus property which failed to
properly delegate to wantsInput for ShellClients.
2015-07-22 08:42:48 +02:00
Martin Gräßlin c3b7ed907b Move logic to handle mouse buttons on windows to AbstractClient
Part of the logic is split out in a generic way so that the code
can be shared with activating of Wayland clients.
2015-07-09 16:34:19 +02:00
Martin Gräßlin 8d407157c4 Provide a base implementation for performMouseCommand in AbstractClient
Most commands can be operated directly in AbstractClient already which
means less code duplication to make the commands work for wayland
clients.
2015-07-09 16:34:19 +02:00
Martin Gräßlin 72635101f0 [wayland] Improve creation of KWayland::Server::PlasmaWindowInterface
The creation of PlasmaWindowInterface is moved from WaylandServer into
AbstractClient. This allows the sub classes to better control when to
create/destroy the Client.

For creation it's bound to becoming visible - that is Windows which are
only created but never shown are not announced at all.

For Client it's destroyed with the normal tear-down of a Client, for
ShellClient it's destroyed on unmapped (which also means a new one
will be created again in case of another mapping of the surface).

As a side effect, this works around the problem that ShellClients do not
yet get destroyed for QtWayland's menus (needs further investigation).
2015-07-09 09:10:33 +02:00
Martin Gräßlin 1ccd608121 Move hasStrut from Client to AbstractClient
Base implementation returns false.
2015-06-20 00:14:15 +02:00
Thomas Lübking 39c35f8f48 fix sendToScreen/checkWorkspaceGeometry
Prime target is to preserve the in-screen
condition of client AND window.i[1]
Atm. when the client is fully in sight
(but the window is not) - regardless of snapping
or screen change - a workspace update (screen change,
resolution change, adding/removing a strutting panel)
would allow the client to partiall escape screen bounds.

This is changed so that if the client is fully in sight,
it's kept fully in sight (but not the decoration)
If the entire window was fully in sight, it's also kept
(as is right now)
The code handles inner screen edges (if the client was in sight,
the entire window will be if we'd bleed to the other screen)

[1] I'd say that handling the client is more relevant,
but foresee more complaints if the window wasn't handled anymore ;-)

During that, i stumbled across some other issues.
- when a window centered on one screen is moved to a screen smaller
  than the window, the window is shrinked to the dimensions of that
  screen and now randomly touches eg. left AND right edge. When
  moved back, the right and bottom edge were preferred
  (to the window was "moved" into the lower right corner).
  It's now kept centered.
- geom_restore was saved before keeping the window in the new
  screen area (causing accidental drops on screen changes)

BUG: 330968
REVIEW: 122517
FIXED-IN: 5.4

Prime target is to preserve the in-screen condition
of client AND window.[1]
Atm. when the client is fully in sight (but the window is not) -
regardless of snapping or screen change - a workspace update
(screen change, resolution change, adding/removing a strutting
panel) would allow the client to partiall escape screen bounds.

This is changed so that if the client is fully in sight,
it's kept fully in sight (but not the decoration)
If the entire window was fully in sight, it's also kept
(as is right now)
The code handles inner screen edges (if the client was in sight,
the entire window will be if we'd bleed to the other screen)

[1] I'd say that handling the client is more relevant,
but foresee more complaints if the window wasn't handled anymore ;-)

During that, i stumbled across some other issues.
- when a window centered on one screen is moved to a screen
smaller than the window, the window is shrinked to the dimensions
of that screen and now randomly touches eg. left AND right edge.
When moved back, the right and bottom edge were preferred
(to the window was "moved" into the lower right corner).
It's now kept centered.
- geom_restore was saved before keeping the window in the new
screen area (causing accidental drops on screen changes)

BUG: 330968
REVIEW: 116029
FIXED-IN: 5.3
2015-06-19 19:48:39 +02:00
Thomas Lübking 41be18e317 Robust modal activation; ensure showing activated
...window

REVIEW: 123875
BUG: 348083
2015-06-10 08:50:16 +02:00
Martin Gräßlin 034276af36 Move clientMaximizedStateChanged signal from Client to AbstractClient 2015-06-07 03:17:34 +02:00
Martin Gräßlin 1d9769af1f Move skipTaskbar from Client to AbstractClient
At the same time the functionality for the "original_skip_taskbar" is
splitted out. This removes the weird API with two boolean arguments to
the set method. Instead there is a dedicated method for the orignal
skip taskbar state which delegates to regular skipTaksbar.
2015-06-06 22:11:10 +02:00
Martin Gräßlin 11a3eac070 Move skipPager from Client to AbstractClient 2015-06-06 22:11:10 +02:00
Martin Gräßlin 4ca3734d12 [wayland] Support move/resize mode in pointer move handling 2015-06-06 17:43:12 +02:00
Martin Gräßlin f16644ac2e Move maxSize and minSize to AbstractClient
With a default implementation returning either a INT_MAX size or 0.
2015-05-27 14:20:12 +02:00
Martin Gräßlin 737ad0b664 Move keepInArea to AbstractClient 2015-05-27 14:20:12 +02:00
Martin Gräßlin 007e1253c6 Add resizeWithChecks to AbstractClient
The virtual method does not take the xcb_gravity_t - that's only added
in a variant in Client.
2015-05-27 14:20:11 +02:00
Martin Gräßlin da2731be51 Move Client::move to AbstractClient and add implementation in ShellClient 2015-05-27 10:16:46 +02:00