Commit Graph

390 Commits (9655c7b3cb603c4000bfe9346d5d146be1e8150b)

Author SHA1 Message Date
Thomas Lübking 694d1a83b3 Permit maximization of windows with fixed position
A window can be "maximized" despite it's position is fixed.
Most obvioulsy for a corresponding of "0", but also in other
cases. The window can still be resized, some size is the
maximum one and there's no reason to prevent the shortcut of
this state.

BUG: 314392
REVIEW: 108789
FIXED-IN: 4.11
2013-02-18 21:55:14 +01:00
Martin Gräßlin 74097e7d29 Port Client's decoration resize extend input window to XCB
Using Xcb::Window to manage the xcb_window_t and simplify the code - no
longer need to check whether the input_window is valid before calling e.g.
map, as that's handled in Xcb::Window.

One XLib usage for setting cursor is still present. This will be ported
once all the QCursor::handle() get removed.

REVIEW: 108771
2013-02-18 09:44:50 +01:00
Martin Gräßlin a8539ff54e Turn ScreenEdges into a Singleton
In fact it already used to be a Singleton as there is just one object
hold by the Singleton Workspace. So let's make it a proper Singleton
following our kind of standard approach of having a ::create factory
method called from Workspace ctor and a ::self to get to the singleton
instance.
2013-02-07 09:46:52 +01:00
Martin Gräßlin d9aedf620b Rewrite of KWin's Screen Edge Handling
This rewrite is mostly motivated by the need to handle multi screen
setups correctly. That is have edges per screen and not for the combined
geometry. Also porting from XLib to XCB has been a motivation for the
rewrite.

The design of the new ScreenEdge handling is described in the
documentation of ScreenEdges in screenedge.h.

In addition the following changes have been performed:
* move configuration from Options to ScreenEdge
* add screen edge information to Workspace::supportInformation (obviously
  replaces what had been read from Options)
* have Workspace hold a pointer to ScreenEdges instead of an object
* forward declaration of ScreenEdges in workspaces.h, this explains the
  seemingly unrelated changes of just another include in some files

BUG: 290887
FIXED-IN: 4.11
2013-02-07 09:46:52 +01:00
Martin Gräßlin 4c0f9f8bbd Remove interaction of quick tiling with ScreenEdges
Quick tiling/maximizing of Clients is completely independent of the
screen edges functionality. That is it determines the borders itself.
Nevertheless there has been some code still around which interacted with
the screen edges each time a window was moved. This code is completely
useless.
2013-02-07 09:46:51 +01:00
Thomas Lübking 5404c7f9b4 update max. constrains with the aspect setting
complements ff1e4e72efed8ec44abe877ac00bbdede48902d5

REVIEW: 108704
2013-02-05 19:15:40 +01:00
Thomas Lübking 092c80a537 constrain maximization/restorage for fixed ratio
when eg. vertically maximizing a cinemascope video in mplayer
it would horizontally exceed the (16:9) screen, so this
case is translated to a full maximization (effectively binding
the window into screen dimensions)

also, when restoring such video from a horizontal maximization
the restore would usually keep the height (thus breaking the
window aspect) so pass geom_restore -> restore through adjustedSize()

REVIEW: 108702
2013-02-05 19:15:40 +01:00
Martin Gräßlin 334b4bf622 Move handling of Virtual Desktops into a VirtualDesktopManager
The ownership for virtual desktops is moved from Workspace into a new
VirtualDesktopManager. The manager is responsible for providing the count
of virtual desktops and keeping track of the currently used virtual
desktop.

All methods related to moving between desktops are also moved from
Workspace to the new manager, though all methods related to Clients on
Virtual Desktops remain in Workspace for the time being. This is to have
the new manager as independent from KWin core as possible.

An rather important change for the handling of virtual desktops is that
the count and the id of a desktop is now an unsinged integer instead of
an integer. The reason for that is that we cannot have a negative count
of desktops as well as it is not possible to be on a desktop with a
negative identifier.

In that regard it is important to remember that a Client can be on a
desktop with a negative identifier. The special value for a Client being
on all desktops is handled by using -1 as a desktop. For the time being
this is not adjusted but instead of comparing the virtual desktop ids one
should prefer to use the convenient methods like isOnDesktop and
isOnAllDesktops. This would allow in future to internally change the
representation for on all desktops.
2013-01-07 09:47:51 +01:00
Thomas Lübking 6fa52007ee use synthetic configure notifies when needed
the patch omit them while the user just moves around a window
and adds one that got lost with the deferred XMoveResize patch, causing

BUG: 312346
FIXED-IN: 4.10
REVIEW: 108013
2013-01-02 19:05:11 +01:00
Martin Gräßlin 47ddf1384c Fix non-const ref iterator issues reported by Krazy2 checker foreach 2013-01-02 18:35:46 +01:00
Martin Gräßlin f689df14d5 Remove Placement wrappers from Workspace
The two methods:
* place
* placeSmart
have only forwarded the call to the Placement object. Now that Placement
is a singleton there is no need to have them. Every user can call them
directly without going over Workspace.
2012-12-20 07:19:53 +01:00
Martin Gräßlin 835648bc20 Move cascadeDesktop and unclutterDesktop to Placement
It is more Placement related and does not really fit into geometry given
that it only calls methods on Placement. It probably only was inside
Workspace due to being part of the DBus interface. The DBus methods are
used by external components so it needs to stay.

The DBus Wrapper is now calling the methods on the singleton Placement
directly, so no need in Workspace anymore.
2012-12-20 07:19:53 +01:00
Martin Gräßlin b28a663f21 Fix C++11 narrowing conversation warning
SVN_SILENT
2012-11-26 11:04:30 +01:00
Thomas Lübking d4f2740ce3 don't leave quick tiling for FS windows
REVIEW: 107317
BUG: 309170
2012-11-14 21:15:48 +01:00
Brian Nguyen a04e9cbc6f Optimize away XMoveWindow() calls in the common click-and-drag case
This implements an optimization similar to one in compiz which defers updating
the backing X window during a window move until the move is terminated. This
helps alleviate some choppiness when using composite + vsync.

REVIEW: 107256
2012-11-10 11:29:49 +01:00
Thomas Lübking cd368384f4 Clock unsynced resizes
For clients w/o XSYNC support, limit resizes to 30Hz
to take pointless load from client and X11

REVIEW: 107087
2012-11-09 00:37:33 +01:00
Fredrik Höglund c679ec6508 kwin: Port most of Workspace::init() to xcb 2012-11-07 22:13:13 +01:00
Thomas Lübking dbf2623e87 respect screen rule in configure requests
REVIEW: 106960
2012-10-25 19:17:22 +02:00
Thomas Lübking 850c1e6f0d add screen rule 2012-09-19 20:21:43 +02:00
Martin Gräßlin 7497ef9148 Make the Compositor a proper Singleton
The Compositor class actually behaves like a Singleton so it should be
one. Therefore four static methods are added:
* self() to access the Singleton
* createCompositor() to be used by Workspace to create the instance
* isCreated() to have a simple check whether the Singleton is already
  created
* compositing() as a shortcut to test whether the compositor has been
  created and is active

The isCreated() check is actually required as especially Clients might
be created and trying to access the Compositor before it is setup.
2012-09-06 09:55:22 +02:00
Martin Gräßlin 62c4d449f5 Use signals'n'slots instead of deep function call into Compositor
For most actions where the compositor needs to perform an action
(e.g. scheduling another repaint) signals were already emitted.
So it's easier to just connect the signals to the Compositor
which in turn makes the code much more readable.

All signals are connected from the Workspace when either the
Compositor gets constructed or a Toplevel gets created.
2012-08-26 20:44:46 +02:00
Arthur Arlt f3739469a2 Move Workspace's compositing functions to own class Compositor
All Workspace functions which were implemented in the file composite.cpp
were moved to an own class Compositor. The header entries were moved as well.
All functions calls are updated.
2012-08-26 20:43:56 +02:00
Thomas Lübking 53534f7966 Merge branch 'KDE/4.9'
Conflicts:
	plasma/generic/applets/batterymonitor/metadata.desktop
	plasma/generic/applets/lock_logout/metadata.desktop
2012-08-11 22:13:59 +02:00
Thomas Lübking b47098dd30 use virtual screen size when desktop is resized
QDesktopWidget::screenGeometry() fails if there's a panning or overlapping screen setup

REVIEW: 105974
BUG: 302783
FIXED-IN: 4.9.1
2012-08-11 21:42:33 +02:00
Thomas Lübking db14a11ffd Merge branch 'KDE/4.9' 2012-07-25 20:30:45 +02:00
Thomas Lübking b0576b1f08 un-Q'tile partially max'd clients on startMoveResize
BUG: 303937
REVIEW: 105699
2012-07-25 20:25:26 +02:00
Martin Gräßlin a394fade64 Remove Tiling support from KWin
As discussed on the mailinglist [1] the tiling support is
removed from KWin. The main reasons for this step are:
* it is unmaintained
* it is a mode not used by any of the core KWin team
* original developer said at Akademy 2012 that he is not
  interested in picking up the work again
* tiling has quite some bugs, e.g. multi screen not supported
* is conflicting with other concepts in KWin, e.g. activities

There is ongoing work to get tiling supported through a KWin
script, which is a preferred way as it does not influence the
existing C++ code base.

[1] http://lists.kde.org/?l=kwin&m=133149673110558&w=2
BUG: 303090
FIXED-IN: 4.10
REVIEW: 105546
2012-07-14 11:18:06 +02:00
Thomas Lübking 4c1c919d78 re-fix bug #283302
broke by accident with 33ffe90128df6ae038b27bd9c9371acacaeee098

BUG: 283302
REVIEW: 105360
FIXED-IN: 4.9rc1
2012-06-25 21:57:19 +02:00
Thomas Lübking f9d681a3ba fix window postition on varying screen struts better
BUG: 301805
CCBUG: 274466
FIXED-IN: 4.9
2012-06-18 22:10:57 +02:00
Thomas Lübking 5ae8b7efe6 only conditionally break partial maximization on resizes and (by this) only partially adjust the restore size
BUG: 299647
FIXED-IN: 4.9
REVIEW: 104899
2012-06-01 16:46:49 +02:00
Thomas Lübking 4f458d2fe9 fix preproc branching (lacked checkWorkspacePosition) 2012-06-01 16:46:49 +02:00
Thomas Lübking 4643b59b0f updateFocusMousePosition when exiting fullscreen mode
REVIEW: 104985
BUG: 300245
FIXED-IN: 4.9
2012-05-18 19:07:28 +02:00
Thomas Lübking 3a6095726e Only reserve required electric borders for ElectricAlways
CCBUG: 293011
REVIEW: 104073
2012-05-03 19:48:20 +02:00
Thomas Lübking 766bc27940 tag window being moved before dropping out of QuickTile/Max and omit wobble if window being moved during maximization change
BUG: 222102
REVIEW: 104841
FIXED-IN: 4.9
2012-05-03 18:54:30 +02:00
Thomas Lübking d6209471e8 sync maximization and quick tiling state in tabs
BUG: 296097
REVIEW: 104293
FIXED-IN: 4.9
2012-04-30 22:37:40 +02:00
Thomas Lübking 49fff98f04 sanitize geom_restore if the window gets quickly untiled after initially being maximized
BUG: 298646
REVIEW: 104715
FIXED-IN: 4.9
2012-04-30 22:37:40 +02:00
Thomas Lübking ae769906de fix quick unmaximization position
CCBUG: 298646
REVIEW: 104702
2012-04-24 20:40:53 +02:00
Thomas Lübking 93729709e6 merge geom_pretile & geom_restore
remove some patch bodies
checkWorkspacePosition on geom_restore

CCBUG: 80265
reviewed-by: graesslin
2012-04-20 23:59:25 +02:00
Martin Gräßlin f0c6f06241 Stacking Order becomes a list of Toplevel Windows
The common usage of stacking order is to loop through
the list and find a specific Client. All these usages
still need to find a Client. For that the loops are
adjusted to first cast the Toplevel into a Client and
continue if the current item is no Client.

At the moment all entries in the stacking order should
still be Clients as the Deleted are not yet added.
2012-04-20 08:36:24 +02:00
Thomas Lübking 1d00436ea4 fix off-by-one on checkUnrestrictedMoveResize
BUG:  210926
FIXED-IN: 4.9
REVIEW: 104632
2012-04-17 21:10:19 +02:00
Martin Gräßlin 84a6891d79 Add notifications for Window goes to/fro Fullscreen
FEATURE: 124612
FIXED-IN: 4.9.0
REVIEW: 104457
2012-04-07 11:10:19 +02:00
Martin Gräßlin 27643f5a9e Drop kephal dependency from KWin
Kephal has turned into not being more than a wrapper around
QDesktopWidget and does not even provide syntax sugar.

REVIEW: 104427
2012-04-01 08:11:57 +02:00
Thomas Lübking 7b3ee21cd3 [Janitorial] Remove unused function
resetMaximize is done in changeMaximize since ages
2012-03-22 19:35:48 +01:00
Thomas Lübking e8bc821848 fake a move event when dropping out of quick tiling
BUG: 228815
REVIEW: 104347
2012-03-21 22:32:33 +01:00
Thomas Lübking 1070bf895b split decorationRect / visibleRect usage
REVIEW: 104215

cherry-picked from 0f3380f3b10e57416f81a1288dc10b8dfe11d87e
Conflicts:

	kwin/geometry.cpp
	kwin/scene.cpp
2012-03-21 00:36:50 +01:00
Thomas Lübking 218baa9dbe swap strictGeometry for isFullScreen case in sizeForClientSize
ratio:
it's the same preference in isFullScreenable, allows clients which do not withdraw their
restrictions (like aspect etc.) or get fullscreen artificially (like through kstart) to start in
"real" fullscreen mode.

BUG: 146741
REVIEW: 104331
2012-03-18 22:23:27 +01:00
Thomas Lübking bd99dccc2b Sanitize position on screen changes with different struts
BUG: 274466
REVIEW: 104233
2012-03-14 02:29:56 +01:00
Thomas Lübking b0f5e4ac29 remove overzealous maxmode_restore
there's no point in changing the behavior of the maximize button

BUG: 195576
2012-03-14 02:29:56 +01:00
Thomas Lübking 03e18bc88b Merge branch 'KDE/4.8' 2012-03-14 00:18:11 +01:00
Thomas Lübking d791b6e421 fix restore size for shaded windows
BUG: 243423
REVIEW: 104236
2012-03-13 21:38:55 +01:00