Commit Graph

1009 Commits (78e9a56cd1513de8ecf864354c2d9f82348009a2)

Author SHA1 Message Date
Martin Gräßlin 53b87dbbd9 Move (is|set)ElectricBorderMaximizing from Client to AbstractClient 2015-10-12 10:26:00 +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 b199356774 Move functionality from Client::doSetDesktop to AbstractClient::setDesktop
Functionality related to transient handling can now be provided by
AbstractClient.
2015-09-16 13:54:47 +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
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 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
Thomas Lübking 1ab663436d Merge branch 'Plasma/5.4' 2015-09-14 21:02:41 +02:00
Thomas Lübking 3a1f11d213 delay QuickTiling indication on inner screenborder
The user might just want to move the window from
one screen to another, no point in wasting time to
show the indicator

BUG: 352050
REVIEW: 125024
FIXED-IN: 5.5
2015-09-14 21:02:02 +02:00
Thomas Lübking cc6886d7dd fetch motif hints when get them for managed client
notably *after* storing the old values.
Otherwise the old value is polluted because of
m_hints being nullptr, thus a default value is
returned (instead of the actual old value)

BUG: 347818
FIXED-IN: 5.4.2
REVIEW: 125007
2015-09-14 21:01:22 +02:00
Thomas Lübking ede337ff22 udpate _NET_FRAME_EXTENTS with border updates
BUG: 351157
FIXED-IN: 5.4
REVIEW: 124741
2015-08-19 12:31:13 +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 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
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 42f53eccbd update geom_restore on unshading
REVIEW: 123882
BUG: 348064
2015-06-10 08:50:17 +02:00
Thomas Lübking 1eae9f4baf improve geometry handling on bordersChanged
a) calculateGravitation on the same borders forth and back is idempotent
b) do not checkWorkspacePosition for shaded windows
   may falsely constrain the unshaded geometry into screen bounds

REVIEW: 123882
BUG: 348064
2015-06-10 08:50:17 +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 1edd689293 Handle interaction with window decoration directly in InputRedirection
So far input events were sent through Xwayland which is not needed as
we have all information available. Even more it had the pointer surface
on the wrong window when interacting with decorations as it was on the
window and not on the decoration.
2015-06-06 17:43:12 +02:00
Martin Gräßlin eac99d5df6 Clenup: Drop QPoint argument from Client::mousePosition
Unused variable is unused.
2015-06-04 19:26:35 +02:00
Martin Gräßlin 6c0c513874 Require XCB 1.10
We need XCB 1.10 for sync to work. Sync was optional with a version check
to make it work on build.kde.org. The CI system supports XCB 1.10 now, so
it's better to have it as a mandatory requirement.
2015-06-04 18:39:04 +02:00
Thomas Lübking 75bd798ad9 Merge branch 'Plasma/5.3' 2015-05-19 22:52:52 +02:00
Thomas Lübking 43e3b7db28 Show Desktop: break state with activation (only)
... not them becoming visible.
Latter doesn't work for most cases (unminimizing)
for obvious reasons (they're not minimized) and
when a new window is mapped, the focus stealing
prevention seems a good filter
(if it's not good enough to gain the focus,
it's not good enough to break the state either)

REVIEW: 123783
CCBUG: 346837
CCBUG: 346933
CCBUG: 347212
2015-05-19 22:07:58 +02:00
Thomas Lübking 77047aa555 updateXTime before sending a takeFocus message
old timestamps confuse clients

BUG: 347153
REVIEW: 123639
2015-05-15 23:55:26 +02:00
Thomas Lübking c2ba765820 updateXTime before sending a takeFocus message
old timestamps confuse clients

BUG: 347153
REVIEW: 123639
2015-05-15 21:58:48 +02:00
Martin Gräßlin 23862e512d Move implementation of ::palette to AbstractClient
Includes moving of the colorscheme and DecorationPalette related
functionality.
2015-05-08 12:43:47 +02:00
Martin Gräßlin 38b418887a Move minimize implementation to AbstractClient 2015-05-08 12:43:47 +02:00
Martin Gräßlin d2884484bc Move ::titlebarPosition to AbstractClient 2015-05-08 12:43:47 +02:00
Martin Gräßlin a4d16debfc Partly move shade implementation to AbstractClient
* properties defined in AbstractClient
* implementation of isShade moved to AbstractClient
* implementation of setShade(bool) moved to AbstractClient
* default implementation for isShadeable added to AbstractClient
* default implementation for shadeMode returning ShadeNone
* default implementation fo setShade which does nothing
2015-05-08 12:43:47 +02:00
Martin Gräßlin 254887155c Implement virtual desktop handling in AbstractClient 2015-05-08 12:43:47 +02:00
Martin Gräßlin e672a53721 Move implementation of demanding attention to AbstractClient 2015-05-08 12:43:47 +02:00
Martin Gräßlin 986308f938 Move implementation of isSpecialWindow to AbstractClient 2015-05-08 12:43:46 +02:00
Martin Gräßlin 4b27abd76b Move implementation of wantsTabFocus to AbstractClient 2015-05-08 12:43:46 +02:00
Martin Gräßlin 1fcd1120d9 Move auto-raise handling to AbstractClient
Adds QTimer to AbstractClient and introduces new protected method to
start the timer.
2015-05-08 12:43:46 +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 7d51838efc Implement AbstractClient::isActive and ::setActive
Moves the implmentation to AbstractClient. Methods are no longer virtual,
setActive calls a virtual protected method which is implemented in Client
for Client specific activation code.
2015-05-08 12:43:46 +02:00
Martin Gräßlin 3527f1d4b8 Implement AbstractClient::icon
Moves implementation, adds a protected setter and provides the property.
2015-05-08 12:43:46 +02:00
Martin Gräßlin 4d466f9ab3 Implement AbstractClient::skipSwitcher
Moves implementation from Client to AbstractClient.
2015-05-08 12:43:46 +02:00
Martin Gräßlin 3182c8f3e5 Implement AbstractClient::isFirstInTabBox
Moves implementation from Client to AbstractClient. Setter is protected,
getter is no longer virtual.
2015-05-08 12:43:46 +02:00
Martin Gräßlin 4ac4a97c20 Implement AbstractClient::tabBoxClient
Moves the implementation from Client to AbstractClient.
2015-05-08 12:43:46 +02:00
Martin Gräßlin 0f54da9dde Introduce an AbstractClient base class for Client (and ShellClient)
The idea for this base class is to provide access to all elements which
make up a managed "Client" being it X11 or Wayland. They share a lot,
like they have a caption, they can be minimized, etc. etc.

Of course it would have also been possible to derive a new class from
Client, but that looks like the more difficult task as Client is very
X11 specific.

So far only a very small interface is extracted with pure-virtual
methods. This is going to change by moving the functionality up into
the AbstractClient.

The interface extracted so far is inspired by the usage of FocusChain
and users of FocusChain.
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
Mika Allan Rauhala 3389c7569f Adapt to KDecoration API changes
Adapt to API changes introduced by b62e8888cd39301e00ad98dfe791fa66676408fb.
It adds DecoratedClient::color(group, role) for getting colors that are
not included in QPalette. Breeze used to read these colors from
kdeglobals, breaking per window color schemes. KWin now handles reading
these colors along with QPalette loading with DecorationPalette.

REVIEW: 122883
2015-03-31 15:26:55 +02:00
Martin Gräßlin b405fda213 Drop support for KAppmenu
We released three versions with it being disabled and it doesn't look
like it will come back any time soon. Also the build was broken at least
since the repo splitting due to incorrect path to dbus xml.

In addition the connection to decorations got dropped already with the
change to kdecoration2. Which means it anyway needs large adjustements
to get the code working again.

Overall it doesn't look like it makes lots of sense to keep the code
around for someone working on it in future. If that happens this change
can be reverted.
2015-03-23 15:56:50 +01:00
Martin Gräßlin 9ca992a329 [wayland] Drop methods on Toplevel to send input events
No longer needed as InputRedirection sends input events directly
through the SeatInterface. In addition this drops the dependency on
xtest.
2015-03-17 10:20:20 +01:00
Martin Gräßlin 659c416879 [wayland] Handle damage events from SurfaceInterface
On Wayland we get the damage from the SurfaceInterface instead of
using a damage handle. This change ensures that the damage handle
interaction is only used on platform X11, while on Wayland we get
the damage from the SurfaceInterface directly.
2015-03-17 10:20:19 +01:00
Hrvoje Senjan 3b1f345f4d Merge remote-tracking branch 'origin/Plasma/5.2' 2015-03-13 15:52:24 +01:00
Thomas Lübking b37d88a29f calc undecorated offset *before* removing deco
point of the calculation is to know how much
the window must be moved to de-compensate for
the deco but calculateGravitation() w/o a
deco (thus now w/o borderTop() etc.) is NOOP.

BUG: 344234
FIXED-IN: 5.2.2
2015-03-09 00:41:12 +01:00
Ivan Čukić 362a0d3efb Windows retain their assigned activities on kwin restart
The issue is essentially this - KActivities are now an asynchonous
library, while KWin tries to use them in the old manner.

When kwin restarts, it tries to validate the activity list of a window
against an invalid list of activities it thinks it gets from KAMD
because it does not check for the service status.

This patch disables the validation in the case of kwin restart/crash.
When starting kwin will see KActivities::Consumer::serviceStatus return
Unknown (before the class actually receives a response from the service
and starts syncing the data).

After kwin has started, the response will arrive and the service status
will change either to Running or NotRunning. The patch changes nothing
for this case.

BUG: 335967
REVIEW: 122577
2015-02-16 00:01:04 +01:00