Commit graph

996 commits

Author SHA1 Message Date
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
Thomas Lübking
179edc620e noborder depends on NET::Override presence
... not dominance - if checking all supported types
eg. a dialog would trump NET::Override as type, thus
get a border despite NET::Override (which Qt would set
for Qt::FramelessWindowHint, alongside the MWM hints)

REVIEW: 122465
2015-02-10 21:42:46 +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
dfa89cc050 Port reading Motif hints to XCB
A wrapper class for MotifHints is added to xcbutils. This class manages
the information about the read Motif hints, so that Client doesn't need
to have a copy of the read states.

The class is designed in a way that during Client::manage we get rid of
another roundtrip.

REVIEW: 122378
2015-02-06 13:43:57 +01:00
Martin Gräßlin
551b3a4c48 Switch to xcb for sync extension
Since XCB 1.10 the sync extension is working properly. At the time of
the 5.3 release 1.10 will have been out for ~15 months, enough time
for distros to catch up and should allow us to use it.

As our CI system only supports 1.9 at the moment we cannot hard depend
on the version, instead we use feature info. As soon as our CI system
supports it, we should update the required min version and kick out the
ifdef.

REVIEW: 122377
2015-02-06 13:43:15 +01:00
Kai Uwe Broulik
cbe925d535 Treat windows of Notification and OnScreenDisplay type as special windows
REVIEW: 122340
2015-01-31 19:45:10 +01:00
Martin Gräßlin
9144b03688 Remove XLib include from client.h
No longer needed in the header. Client is free of XLib data types.
2015-01-27 12:48:03 +01:00
Martin Gräßlin
7e4307b263 Use new KWindowSystem::icon overload taking a NETWinInfo*
Removes roundtrips to the X-server when reading the icons.

Requires kwindowsystem.git as of 6f941a5 (version 5.7).

CCBUG: 329979
2015-01-21 10:19:35 +01:00
Martin Gräßlin
14659a9907 Split Client::checkActivities into two parts
REVIEW: 122087
CCBUG: 329979
2015-01-21 09:25:18 +01:00
Martin Gräßlin
584bdbce71 Split Client::updateFirstInTabBox into two parts 2015-01-21 09:25:15 +01:00
Martin Gräßlin
327dd406e6 Split Client::updateColorScheme into two parts 2015-01-21 09:25:15 +01:00
Martin Gräßlin
a55c7ba0d5 Split Client::updateShowOnScreenEdge into two parts 2015-01-21 09:25:15 +01:00
Martin Gräßlin
24688f8dae Split Client::detectGtkFrameExtents into two parts 2015-01-21 09:25:14 +01:00
Martin Gräßlin
60ebdbe352 Improve reading the color scheme in Client
Only emit paletteChanged signal and repaint decoration if the palette
actually changed. Even more important: check for path.isEmpty() instead
of path.isNull(). ::isNull() returns false for "" causing a costly
creation for default color scheme.

REVIEW: 122083
2015-01-16 07:58:32 +01:00