Commit Graph

560 Commits (03231942bb65e56e0e04727b11dbda75f47993d9)

Author SHA1 Message Date
Martin Gräßlin f5848d9405 Move implementation of updateMoveResize to AbstractClient
No longer virtual.
2015-10-26 09:21:36 +01:00
Martin Gräßlin f4b02d5a8c Move handleMoveResize to AbstractClient
Sync related code is split out into dedicated virtual methods so that
Client can provide the X11 specific implementation. General handling,
though is completely in AbstractClient.
2015-10-26 09:21:36 +01:00
Martin Gräßlin 7e23860957 Move performMoveResize to AbstractClient
As there is X11 specific code, this is moved into a virtual
doPerformMoveResize method.
2015-10-26 09:21:36 +01:00
Martin Gräßlin c83f041005 Move startMoveResize() to AbstractClient
The implementation calls a virtual doStartMoveResize() which allows
Client to do it's X11 specific tasks (creating moveResizeWindow, grabbing
input).

The base implementation is no longer virtual.
2015-10-26 09:21:36 +01:00
Martin Gräßlin 9e323227a1 Move (start|stop)DelayedMoveResize to AbstractClient
Also requires to add startMoveResized() as a virtual method. Not
yet implemented in AbstractClient.
2015-10-26 09:21:36 +01:00
Martin Gräßlin 95a99d337a Move s_haveResizeEffect from Client to AbstractClient 2015-10-26 09:21:36 +01:00
Martin Gräßlin ba53407b52 Move finishMoveResize(bool) to AbstractClient 2015-10-26 09:21:36 +01:00
Martin Gräßlin 1c40e809ea Provide leaveMoveResize() as virtual method in AbstractClient
The non X11 specific code is split out into a base implementation
which is called from the Client.
2015-10-26 09:21:36 +01:00
Martin Gräßlin dc04cdef64 Move moveResizeStartScreen from Client to AbstractClient
Initialized in updateInitialMoveResizeGeometry().
2015-10-26 09:21:36 +01:00
Martin Gräßlin dcb5e29316 Move updateCursor() functionality to AbstractClient
Includes moving the m_cursor and Qt::CursorShape cursor() method to
AbstractClient. In addition AbstractClient now emits a signal whenever
the shape changes allowing Client to react on it (update the low level
cursor) and also hopefully the Wayland Backends to react to it, so that
we have the cursor.
2015-10-26 09:21:36 +01:00
Martin Gräßlin b8e68307bb Move buttonDown from Client to AbstractClient
Bundled together with other moveResize functionality. We might need
to investigate whether this variable is needed at all.
2015-10-26 09:21:36 +01:00
Martin Gräßlin 605acaf60e Move checkUnrestrictedMoveResize() from Client to AbstractClient 2015-10-26 09:21:36 +01:00
Martin Gräßlin 8a3be2bacd Move the Position mode from Client to AbstractClient 2015-10-26 09:21:36 +01:00
Martin Gräßlin c3f14521c1 Move moveResizeGeom to AbstractClient
Biggest impact on Client::handleMoveResize which directly manipulated
the variable in various parts. I tried to keep the impact low.
2015-10-26 09:21:36 +01:00
Martin Gräßlin b4fc4d7235 Move initialMoveResizeGeometry to AbstractClient 2015-10-26 09:21:36 +01:00
Martin Gräßlin 84c7575cbf Move (inverted)MoveOffset to AbstractClient 2015-10-26 09:21:36 +01:00
Martin Gräßlin 3514b4d691 Track whehter moveResize is unrestricted in AbstractClient 2015-10-26 09:21:36 +01:00
Martin Gräßlin b5e8e3511e Track whether Client is in moveResizeMode in AbstractClient
Variable moveResizeMode replaced by protected methods isMoveResize()
and setMoveResize().
2015-10-26 09:21:36 +01:00
Martin Gräßlin 226c9a0367 Call checkWorkspacePosition also for Wayland clients in ::updateClientArea 2015-10-16 08:34:25 +02:00
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 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 fa18d60e9e Use quickTileMode() instead of quick_tile_mode
Preparation step to have quick tile handled inside AbstractClient.
2015-10-14 08:36:29 +02:00
Martin Gräßlin 61caf788e3 Use (set)GeometryRestore() instead of geom_restore in Client::setQuickTileMode
Preparation step to move the implementation to AbstractClient.
2015-10-14 08:36:29 +02:00
Martin Gräßlin 94b5ca0d2b TabSynchronizer operates on AbstractClient
Change required to get methods using TabSynchronizer moved to
AbstractClient. Unfortunately we need to cast to Client when calling
updateStates. It's save as if it's not a Client we
a) don't have a tabGroup in the first place
b) the check if (main == only) will hit and the method returns
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 727929db8a Use isDecorated() instead of m_decoration in Client::setQuickTileMode
A preparation step to move the implementation to AbstractClient.
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 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 e121d4a107 Use quickTileMode() instead of quick_tile_mode in Client::checkWorkspacePosition
Preparation step for moving implementation of checkWorkspacePosition
to AbstractClient.
2015-10-14 08:36:29 +02:00
Martin Gräßlin d1baa4d283 Use geometryRestore() instead of geom_restory in Client::checkWorkspacePosition
Preparation for moving the implementation to 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 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
Thomas Lübking d61e6cd445 improve restricted moveresize
* skip all overhead on unrestricted moveResizes
* the titlebar is not guaranteed to be the top border (anymore)
* don't block vertical resize when resizing on a top corner
* reduce QRegion operations by knowledge about the degenerated titlebarregion (rect)
* rename int (sic!) "titleArea" to "requiredPixels"

REVIEW: 125428
2015-09-29 23:02:41 +02:00
Martin Gräßlin 6dc211dfaf Workspace::adjustClientSize operates on AbstractClient
And now also during resizing clients snap to ShellClients.
2015-09-18 14:05:19 +02:00
Martin Gräßlin 47d2b4cb49 Workspace::adjustClientPosition operates on AbstractClient
With that moving clients snap also against ShellClients and not just
Clients.
2015-09-18 13:46:42 +02:00
Martin Gräßlin 2da04aa26b Use auto where we call ensureStackingOrder(client->transients())
Preparation step for switching transients from Client to AbstractClient.
2015-09-16 13:54:47 +02:00
Thomas Lübking 266edb123d Merge branch 'Plasma/5.4' 2015-08-15 01:58:07 +02:00
Thomas Lübking 269e275cb0 smart placement of unregularily max'd clients
1. if a client has oversize, ensure to keep the titlebar in
sight

2. if a maximized client *almost* covers the entire maximization
area, users can easily be trapped to click into the missing
pixels, thus the client below.

Therfore the clients is then stuffed into one corner, with
preference to the titlebar edge and the screen area (ie.
*away* from panels and towards actual screen borders because
of fitt's law)

BUG: 349935
REVIEW: 124286
FIXED-IN: 5.4
2015-08-15 01:34:41 +02:00
Thomas Lübking eb71b47db4 only discard pixmaps when the XCB Window resized
Causes invalid textures on the nvidia blob
when referencing textures for crossfading
eg. during maximization

BUG: 324823
REVIEW: 124591
FIXED-IN: 5.4
2015-08-15 01:34:41 +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 2192bd69e0 [wayland] Add support for PanelBehavior in ShellClient
The PanelBehavior determines the stacking of panel surfaces and whether
they "have a strut".
2015-06-20 00:14:49 +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