Commit Graph

513 Commits (66e92347a823ce0a99a5ba33ec93f35974786dbe)

Author SHA1 Message Date
Martin Gräßlin 4022de7075 Use signal/slots instead of deep function calls into decoration
For all the decoration updates called from Client into the decoration we
also have a signal being emitted. So turning the pure virtual public
functions into slots means we can just connect our existing signals and
get rid off the deep function calls.

The keepAbove/Below signals are changed to take a boolean argument as
needed by KDecoration and a few emitted signals are moved to a better
fitting location.

REVIEW: 110335
2013-05-07 16:53:58 +02:00
Martin Gräßlin db18c08dd0 Move RootInfo and WinInfo into an own header and impl file
Main motivation for this change is that it's unhandy to have the class
definition in workspace.h and client.h while the implementation is in
events.cpp although nothing in events.cpp uses it directly.

By getting it out of workspace.h we get the header a little bit smaller
which should improve compile time given that it's included almost
everywhere.

In events.cpp the enum usage is changed to NETWinInfo as that's the class
where they are defined.

RootInfo does no longer hold a workspace pointer. Where it's needed it
uses the singleton accessor of Workspace.

REVIEW: 110199
2013-04-30 08:06:12 +02:00
Martin Gräßlin 4a48325de5 Cleanup and reorder includes in client.h
Removing the workspace include required to include it in many other
places.
2013-04-29 08:42:36 +02:00
Thomas Lübking d2f9d8feee validate screen and max'd state on packing windows
REVIEW: 110054
BUG: 304506
FIXED-IN: 4.11
2013-04-28 17:39:16 +02:00
Martin Gräßlin eb6ce2b7c4 Remove XDamageNotifyEvent* argument from Toplevel::damageNotifyEvent
It's not used...

REVIEW: 110201
2013-04-26 12:31:07 +02:00
Martin Gräßlin 89c2fd5598 Remove YesIKnowWhatImDoing from internal API
No need to have Allowed everywhere.

REVIEW: 110197
2013-04-26 12:29:42 +02:00
Martin Gräßlin 5b56cff520 Remove demands attention notification 2013-04-23 16:21:30 +02:00
Thomas Lübking 16998db274 Merge branch 'KDE/4.10'
Conflicts:
	kwin/useractions.cpp
2013-03-24 22:29:50 +01:00
Thomas Lübking 6fb5353cab remove moveResizeMaximized option
REVIEW: 103948
BUG: 91703
BUG: 299245
FIXED-IN: 4.11

- The setting is ignored, the decoration always gets a "true" for it
- moving a maximized window requires breaking a "strong" snap (1/16 of screen height - unless you use quick maximization)
- all snapping is done towards the client, not the frame
- QuickTileMode is exported to the decoration (just as the maximizeMode) so that it can fix the bordersize alongside that.
2013-03-24 22:26:48 +01:00
Thomas Lübking f6bad91b17 use QWidgetAction for activity setting in alt+f3
not that i really like using QWidgetAction, but it'll
prevent the popup from autoclosing.
Introduce activityUpdateBlocking to prevent users from
removing the popup under their fingertips

BUG: 283309
FIXED-IN: 4.10.2
REVIEW: 107762
2013-03-24 21:57:26 +01:00
Martin Gräßlin be4c76ede1 Port Client::updateCursor to XCB and new Cursor class
The Client::cursor property is changed from QCursor to Qt::CursorShape
and renamed to m_cursor (as all usages are adjusted).

This property is mostly used to define the cursor on e.g. the extended
deco border window. To make this easier a XDefineCursor replacement is
added to xcbutils.h both as a static method and as a member function to
Xcb::Window.
2013-02-25 13:35:15 +01:00
Martin Gräßlin 0348a14a7d Port Client's shape handling to XCB
REVIEW: 108772
2013-02-21 18:04:40 +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 3389d68c50 Print useful information for a Client in scripting
Reusing the debug information already specified for QDebug.

FEATURE: 314402
FIXED-IN: 4.11
REVIEW: 108959
2013-02-18 09:16:31 +01:00
Thomas Lübking fb356a8bef capture condensedTitle config change 2013-01-30 13:07:03 +01:00
Martin Gräßlin 5cd223f051 Improved resolving whether a window is on local machine
Most windows use the hostname in WM_CLIENT_MACHINE, but there are windows
using the FQDN (for example libreoffice). So instead of "foo" it is
"foo.local.net" or similar. The logic so far has been unable to properly
determine whether windows with FQDN are on the local system.

In order to solve this problem the handling is split out into an own
class which stores the information of hostname and whether it is a local
machine. This is to not query multiple times. To determine whether the
Client is on the local system getaddrinfo is used for the own hostname
and the FQDN provided in WM_CLIENT_MACHINE. If one of the queried
names matches, we know that it is on the local machine. The old logic to
compare the hostname is still used and getaddrinfo is only a fallback in
case hostname does not match.

The problem with getaddrinfo is, that it accesses the network and by that
could block. To circumvent this problem the calls are moved into threads
by using QtConcurrent::run.

Obviously this brings disadvantages. When trying to resolve whether a
Client is on the local machine and a FQDN is used, the information is
initially wrong. The new ClientMachine class emits a signal when the
information that the system is local becomes available, but for some
things this is just too late:
* window rules are already gathered
* Session Management has already taken place

In both cases this is an acceptable loss. For window rules it just needs
a proper matching of the machine in case of localhost (remote hosts are
not affected). And the case of session management is very academic as it
is unlikely that a restoring session contains remote windows.

BUG: 308391
FIXED-IN: 4.11
REVIEW: 108235
2013-01-21 16:00:49 +01:00
Thomas Lübking 62c62e4336 skip reset states if client untabbed for release
BUG: 310142
FIXED-IN: 4.10
REVIEW: 108003
2013-01-02 19:04:52 +01:00
Martin Gräßlin 533d57da60 Mark most ctors as explicit as reported by Krazy2 checker 2013-01-02 18:35:46 +01:00
Thomas Lübking 1727ab1211 skip reset states if client untabbed for release
BUG: 299333
FIXED-IN: 4.10
REVIEW: 108003
2013-01-02 18:24:42 +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
Cedric Bellegarde 53ae2b91e2 GUI: Kwin appmenu support:
- Add support for application menu button in Kwin
- Add kded appmenu configuration in kcm_style
2012-11-09 13:44:50 +01:00
Martin Gräßlin 9308028fa4 Decoration can announce whether it currently requires an alpha channel
A decoration can provide the AbilityAnnounceAlphaChannel in addition to
AbilityUsesAlphaChannel. If this ability is provided the decoration can
enable/disable the use of the alpha channel through setAlphaEnabled().

The base idea behind this mechanism is to be able to tell the compositor
that currently alpha is not needed. An example is the maximized state in
which the decoration is fully opaque so that there is no need to use the
translucency code path which would render all windows behind the deco.

In addition also the blur effect honors this setting so that behind a
known opaque decoration no blurring is performed.

Oxygen is adjusted to disable translucency in maximized state and Aurorae
is adjusted to allow themes to enable/disable translucency. For Plastik
translucency and with that also blurring is disabled.

REVIEW: 106810
2012-11-09 10:36:43 +01:00
Thomas Lübking 03d782fa73 scripted title manipulation / stripping
REVIEW: 106896
BUG: 308995
2012-11-09 00:37:34 +01:00
Martin Gräßlin 0d81d1d7c0 Move decoration pixmap handling from Client to PaintRedirector
The only task of the PaintRedirector is to redirect the painting of the
window decorations into Pixmaps. So it should actually do this by also
handling the four pixmaps for the decoration. This simplifies the code
as all the logic concerning redirecting the painting is now grouped
together.

Furthermore the PaintRedirector is now a child of the decoration widget,
which means it gets automatically destroyed whenever the decoration is
destroyed - the Client does not have to care about it.

Also the PaintRedirector gets only created if the Compositor is active as
it is not needed in the non-compositing case.

REVIEW: 106620
2012-10-12 07:45:31 +02:00
Thomas Lübking 24cf0e75f3 Merge branch 'KDE/4.9'
Conflicts:
	kwin/scene.cpp
	plasma/generic/applets/batterymonitor/metadata.desktop
	plasma/generic/applets/lock_logout/metadata.desktop
2012-09-19 20:21:18 +02:00
Thomas Lübking 5d80537b2c Do not add extra padding to Client::visibleRect()
REVIEW: 106376
2012-09-19 20:16:33 +02:00
Martin Gräßlin 62d5e8124c Toplevel::windowType becomes a pure virtual function
The method windowType needs actually two implementations:
* one for Clients
* one for Unmanaged

as for Clients also the window rules are checked and hacks are applied
which is both not needed for Unmanaged windows.

To have the Client specific behavior in windowType the function used to
perform two dynamic_casts which made this method one of the most
expensive during compositing, e.g. for ~1000 frames
* called ~43000 times
* ~85000 dynamic casts
* incl. cost of method: 0.24
* self cost of method: 0.05
* incl. cost of the casts: 0.12

After the change to remove the dynamic casts we have for ~1500 frames
in Client::windowType:
* called ~31000 times
* incl. cost of 0.06
* self cost of 0.02

Calls on Unmanaged and Deleted are so low that we do not need to consider
them.

BUG: 306384
FIXED-IN: 4.10
REVIEW: 106349
2012-09-07 08:03:05 +02:00
Thomas Lübking f18230fe99 ignore dockers for showingDesktop state
also use a common funciton to decide whether or
not to break the state

BUG: 305874
FIXED-IN: 4.9.1
2012-08-28 21:08:28 +02:00
Thomas Lübking 7d2e62b487 ignore dockers for showingDesktop state
also use a common funciton to decide whether or
not to break the state

BUG: 305874
FIXED-IN: 4.9.1
2012-08-28 15:35:34 +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
Thomas Lübking 9390b270f8 substitute mapping_state == Withdrawn by m_managed
as the flamewar pointed out, resetShowingDesktop invalidly keeps hidden windows
the reason is that there're several updateVisiblity calls (notably one from the compositor)
which  break the showingDesktop state as a side effect (before ::manage() does it's thing)

Since they also invalidate the Withdrawn mapping state, that will fail as isManaged() test
(it's also invalidly used by the compositor to set up the decoration, isManaged() used to be
true because of the updateVisibility() call before) since the result is never Withdrawn

CCBUG: 299655
REVIEW: 105303
2012-07-10 01:00:00 +02:00
Martin Gräßlin 0c6945ba17 Add property onAllDesktops to Toplevel and Client 2012-06-24 18:32:40 +02:00
Martin Gräßlin d75e7a6d60 Use smart pointers to protect access to TabBoxClient
Client holds a SharedPointer to the TabBoxClient and only
provides access to a WeakPointer which is passed to TabBox.
ClientModel is adjusted to hold a list of WeakPointers instead
of the direct pointers.

This fixes the following reproducable crash:
1. Configure both primary and secondary TabBox with different
   layouts
2. Use primary TabBox
3. Close a window, best the one which used to be active
4. Use secondary TabBox
-> Crash

The reason is that the ClientModel still contains the pointer
to the deleted TabBoxClient in step 3 and while creating the
layout access to the TabBoxClient is needed to get the Client's
icon.

By using the weak pointer it can be ensured that we don't try
to dereference the deleted pointer and prevent the crash.

CCBUG: 290482
CCBUG: 285747
CCBUG: 237345
REVIEW: 105000
2012-05-22 18:37:41 +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
Martin Gräßlin b49356bc33 Do not perform setupCompositing on Client if Toplevel is not setup
Toplevel::setupCompositing returns a boolean value and returns
false in the cases where it has not setup compositing.

This is used by the specialization on Client to not perform the
Client specific setup if Toplevel has not setup.

REVIEW: 104767
2012-04-28 09:42:26 +02:00
Thomas Lübking 2fce451be5 allow to sync dynamic Qt props on tabgroups
REVIEW: 104695
2012-04-24 20:41:06 +02:00
Martin Gräßlin 175668f2b3 Unexport TabGroup property on Client for scripts
TabGroup is not (and should not be) a QObject which
makes it rather useless in scripting. In order to use
window tabs in KWin scripts the methods to interact
with tabs from Client should be used.

REVIEW: 104685
2012-04-21 12:19:52 +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 f8fd648a61 Move Client::layer() to Toplevel
This allows to copy the layer to the deleted window in order to
keep the deleted window in the same layer.

Additionally a new layer is added for unmanaged windows.
2012-04-20 08:36:23 +02:00
Thomas Lübking 92939b13d7 detach killHelper process from KWin
BUG: 295940
FIXED-IN: 4.9
REVIEW: 104627
2012-04-17 21:09:44 +02:00
Martin Gräßlin cdc1af7df1 Export blocking compositing as a Client's Q_PROPERTY
Allows to block compositing on Client's from scripts.

Usecase: window rule cannot properly identify buggy
clients and scripting allows to just act on fullscreen
windows.

BUG: 297146
FIXED-IN: 4.9.0
REVIEW: 104448
2012-04-01 08:18:55 +02:00
Thomas Lübking a9478564d8 raise window during shade hover
BUG: 281435
REVIEW: 104280
2012-03-30 15:27:14 +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 eb83686d56 [Janitorial] Remove legacy "rules" to ignore position request and focus stealing prevention
REVIEW: 104274
2012-03-21 22:32:33 +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
Martin Gräßlin d4a919a9bf Demands Attention support for KWin Scripting
Client has a property for demands attention and Workspace
is emitting a signal whenever the demands attention state
of any Client changes.

REVIEW: 104204
2012-03-12 21:25:45 +01:00
Martin Gräßlin e46f81ec73 Make skipPager and skipTaskbar available to scripts 2012-02-29 18:57:17 +01:00
Thomas Lübking 85635dd485 fix tabbing
BUG: 290959
BUG: 265160
BUG: 229292
BUG: 238279
BUG: 290758
BUG: 222831
BUG: 278275
BUG: 245747
BUG: 230000

BUG: 253697
BUG: 230570
BUG: 265977
BUG: 225337
BUG: 225339

REVIEW: 103855
2012-02-11 16:30:22 +01:00
Thomas Lübking bf88ec09ac Revert "fix tabbing"
pushed out of branch, not master - leading to absent revision, found hash collision??

This reverts commit 94b2ad7b85801e37e2df4671cdc4f26b6d7e5506.
2012-02-11 16:29:14 +01:00
Thomas Lübking d245035a17 fix tabbing
BUG: 290959
BUG: 265160
BUG: 229292
BUG: 238279
BUG: 290758
BUG: 222831
BUG: 278275
BUG: 245747
BUG: 230000

BUG: 253697
BUG: 230570
BUG: 265977
BUG: 225337
BUG: 225339

REVIEW: 103855
2012-02-11 16:01:41 +01:00
Thomas Lübking 033ae96f89 selective rule remembering
REVIEW: 103875
2012-02-09 17:34:08 +01:00
Martin Gräßlin a38faa4329 Add visibleInClientGroup property 2012-01-27 08:25:21 +01:00
Martin Gräßlin bfdcbe60f5 Turn isManaged and isDeleted into properties on Toplevel
Property invokes virtual methods returning false by default. Deleted
reimplements the isDeleted and returns true. Client returns true for
isClient. Method is not called isManaged as this is already used
inside Client.
2012-01-27 08:21:53 +01:00
Martin Gräßlin 70828a3ee4 Some more properties on Client
* Read-only: minSize/maxSize
* Read-write: noBorder
2012-01-27 08:08:00 +01:00
Martin Gräßlin 507ff411d6 Drop the WorkspaceProxy in Scripting
Unlike stated at several places in the code it is not difficult to
setup the connections to all Clients.

It would have been nice if the failed attempts to connect the Clients
would not have made it into the code as emitted signals which are
nowhere used. Not to mention that like in all places the signals to
inform that a state changed were emitted before the state changed was
performed.
2012-01-21 10:51:22 +01:00
Martin Gräßlin 66ca8c7c72 Make closeWindow() a public slot
For JavaScript bindings.
2012-01-03 18:32:05 +01:00
Martin Gräßlin 197658475b Make List of Clients in ClientGroup accessable in scripts
For that ClientList is exported as a sequence meta type and
property is added to ClientGroup.
2012-01-01 15:01:54 +01:00
Martin Gräßlin 698eb631cd ClientGroup becomes scriptable (again)
For this properties are defined in ClientGroup and several methods
are changed to be slots (to be invokable from scripts). On Client
the clientGroup is exported as a property.

The existing wrapper around ClientGroup is dropped as it is no
longer needed. Interestingly it was wrong anyway as it allowed to
construct a new ClientGroup, which has to be done internally.

At the same time the meta declarations get cleaned up a little bit.
2012-01-01 14:43:32 +01:00
Martin Gräßlin 3bc12489ac Declare Metatype for KWin::Client*
Allows to use it in property definitions.
2012-01-01 14:16:07 +01:00
Martin Gräßlin 00993ab566 More properties on Toplevel and Client
Mostly exporting the getters used by EffectWindow as Properties.
In client some have got a notify signal.

REVIEW: 103510
2011-12-31 09:19:57 +01:00
Martin Gräßlin 716a38cdb4 Making the geometry mapping work 2011-12-31 08:58:43 +01:00
Martin Gräßlin 445687ed2b The geometry property starts to work
The signal is still emitted too often, but it works.
2011-12-31 08:58:43 +01:00
Martin Gräßlin f953ed64d4 Minimized property
Adding a convenient method to minimize/unminize the Client.
2011-12-31 08:58:43 +01:00
Martin Gräßlin 85c72f3323 Maximizeable and Minimizable also have no change signal 2011-12-31 08:58:42 +01:00
Martin Gräßlin 53461d01ea Keep Above/Below properties 2011-12-31 08:58:42 +01:00
Martin Gräßlin da26ecb8ef Documentation for properties without change signal 2011-12-31 08:58:42 +01:00
Martin Gräßlin 20284fb7bb Shade related properties
Adding a convenient method to set a client to shade ignoring the
hover state.
2011-12-31 08:58:42 +01:00
Martin Gräßlin 938c94d7cc Provides Context Help property 2011-12-31 08:58:42 +01:00
Martin Gräßlin 60f1c75ffb Modal property 2011-12-31 08:58:42 +01:00
Martin Gräßlin 7061ab7d24 Remove unused scripting signal 2011-12-31 08:58:41 +01:00
Martin Gräßlin 0976bdfb17 Adding transient (for) properties
TransientFor is a QObject property as we cannot declare Client as
a metatype.
2011-12-31 08:58:41 +01:00
Martin Gräßlin 138ff0a77b Documentation for fullScreenable property 2011-12-31 08:58:41 +01:00
Martin Gräßlin 7678667b5a FullScreen Property
Setter and notify signal.
2011-12-31 08:58:40 +01:00
Martin Gräßlin 141acf7131 Adding a desktopChanged signal 2011-12-31 08:58:40 +01:00
Martin Gräßlin 96a51f8634 Closeable does not have a notify signal 2011-12-31 08:58:40 +01:00
Martin Gräßlin 01633be601 Add captionChanged signal
Emitted during setCaption. The Q_PROPERTY has no setter as caption
is provided through WM_NAME.
2011-12-31 08:58:40 +01:00
Martin Gräßlin 08ad6c953f Active Property
Emit proper signal when the Client's active status changes.
2011-12-31 08:58:40 +01:00
Martin Gräßlin f47e7bb5ef KWin scripting goes properties
Dropping the wrapper around Client and just exporting the Client's
properties. This breaks all existing scripts as it's now e.g.:
client.caption
instead of
client.caption()

But the first one is the more natural one for JavaScript and also
for everyone writing QML as well.

Setters and signals are mostly still missing in client. Other parts
like ClientGroup must be converted to properties, too.
2011-12-31 08:58:40 +01:00
Martin Gräßlin 8beb8af8ff Adding properties to Client and Toplevel class
This will make it possible to access Clients in scripting, deco and
effects without the wrapper classes through the property system.
2011-12-31 08:58:39 +01:00
Martin Gräßlin 6f9f736973 Merge branch 'kwin/tabbox-window-strip' into integration 2011-12-21 07:45:52 +01:00
Martin Gräßlin 6c62fcd400 Make use of resize effect when resizing windows
Fixes a regression. When resize effect is available we can do a
fast resizing by only perform the resizing after the user ended
resizing the window.

REVIEW: 103363
2011-12-09 20:48:46 +01:00
Martin Gräßlin f644c28180 Support for sticky items in TabBox list
This is needed for Plasma Active's home screen which should always
be the first element in the list.
2011-12-01 13:15:11 +01:00
Thomas Lübking a3e268e737 checkWorspacePosition on screen changes only
REVIEW: 103029
BUG: 283302
2011-11-12 19:29:17 +01:00
Fredrik Höglund 9fa2feabc8 kwin: Insert an input-only window above each decorated client
This input-only window is used to capture events above the
client window and preventing them from reaching the client.

It is currently used to enlarge the borders by an invisible
amount, using the ExtendedBorderRegion provided by the
decoration.
2011-11-11 03:02:10 +01:00
Anton Kreuzkamp 98c89bcfd0 Make the window-tabbing group of a window public via an XProperty. 2011-11-07 20:52:21 +01:00
Thomas Lübking d3331eed9c export the baseincrement size to the effectwindow and utilize it in the windowgeometry effect
BUG: 283518
REVIEW: 103033
FIXED-IN: 4.8
2011-11-03 21:49:20 +01:00
Luboš Luňák 191b03be1b gee, is this come-up-with-the-most-useless-variable-name competition or what?
And they are both pointless anyway, simplify code.
2011-09-29 18:30:20 +02:00
Luboš Luňák 07e3dff871 make checkWorkspacePosition() work also on desktop/screen change
It previously worked only when struts changed, this makes it work
e.g. when moving a window between desktops that have different
struts, or when sending a windows between differently sized screens.
2011-09-29 18:30:20 +02:00
Luboš Luňák 8edf542bb7 remove a function that should have been removed in d105478abf33474fa18e6bb1e80d09a1911f42e4 2011-09-29 18:30:20 +02:00
Luboš Luňák ede01e1702 the Qt idiom is that out parameters are pointers 2011-09-29 16:22:24 +02:00
Thomas Lübking 12b9b1c79e fix xsync protocol
BUG: 160393
REVIEW: 102311
2011-08-24 01:39:34 +02:00
Thomas Lübking 123e259441 check workspace position after screen change of any max'd client
also only unset max'd state when resizing, but not when moving a max'd client
BUG: 279051
CCBUG: 279529
REVIEW: 102414
(cherry picked from commit ea91e9dea63cf58fcf0d45d7e2f4783d0b70b8bb)

Conflicts:

	kwin/geometry.cpp
2011-08-23 23:11:59 +02:00
Matthias Fuchs 7d67380205 Fixes disabling fullscreen for windows using two displays.
Dragging a fullscreen window to another screen and then disabling
fullscreen keeps the window at the new screen.

BUG:261704
FIXED-IN:4.7.1
REVIEW:102103
(cherry picked from commit d35ec6d18377fd872207b88dd39f560a483bcc14)
2011-08-15 19:13:49 +02:00
Martin Gräßlin 0c47ca5e97 Remove defines for X extensions
The following dependencies have become mandatory build deps:
* XRandR
* XRender
* XFixes
* XDamage
* XComposite
2011-08-13 16:46:43 +02:00
Alex Fiestas c0b89870b9 Move the "noOffscreensWindow" into a method so we can reuse it 2011-07-28 22:19:38 +02:00
Thomas Lübking f0492f9b02 fix shadow fix
(cherry picked from commit 55986b32de9e5f5f66ac0c3448b26863cfc2dee0)
2011-07-13 23:08:03 +02:00
Martin Gräßlin 32a82141f0 Adding a build option for KWin Scripting
It is possible that adding this build option broke the Scripting
component. This is something that should not happen. Unfortunately
by just ifdefing everything scripting related with scripting enabled
we have build errors. These are caused by the fact that the scripting
code includes e.g. client.h through "./../client.h". At one offending
place I changed that to "client.h", but there is also a client.h in
the scripting directory.

The includes and naming of the scripting files clearly have to be fixed!
2011-07-10 10:48:25 +02:00
Thomas Lübking 05cbf3f1ca correct workspace position in case of quicktiling or touching the border when the decoration padding changes 2011-07-10 02:24:54 +02:00
Arthur Arlt 02e08be5bd Merge signals clientClosed() and unmanagedClosed() to windowClosed()
This commit merges the two signals clientClosed() and unmanagedClosed() to windowClosed() which
is now provided by Toplevel.
The approriate slots in effects.h and effects.cpp were merges as well, since they did the
same.
The direct method calls of the method windowClosed() in SceneOpenGL and SceneXRender were
removed and are now connected to the appropriate signal in windowAdded().
2011-07-05 11:46:13 +02:00
Arthur Arlt b63c9c1af8 Make mothod windowGeometryShapeChanged() a slot
The method windowGeometryShapeChanged() from the class Scene is now a slot. It is now connected to the signal geometryShapeChanged() which is sent from Toplevel instances Client and Unmanaged.
All direct method calls were deleted.
2011-07-05 11:34:12 +02:00
Martin Gräßlin 12d3b354fc Remove drawbound move/resize functionality
Drawbound was nowadays only used when compositing is disabled.
For the composited case, the drawbound was replaced by the resize
effect and in fact we should always just use the resize effect.

REVIEW: 101411
2011-06-23 12:15:54 +02:00
Philipp Knechtges 2c0b0e9f18 Performance bugfix.
In case we use OpenGL compositing and KWin is started with the raster graphicssystem,
the decoration gets painted with the raster backend.
REVIEW: 101370
2011-05-18 21:27:11 +02:00
Martin Gräßlin 2d066a710c Fix repainting of Shadows for torn-off toolbars
Toolbars and Dock Widgets are clients which did not yet have
proper Shadow support. Especially the visibleRect and decorationRect
which is incorrectly used to refer to the complete window geometry
had to be updated.
2011-04-10 21:26:46 +02:00
Thomas Lübking 31278d570e add rule/property based composite blocking 2011-04-04 01:59:52 +02:00
Martin Gräßlin b52975a57e Merge branch 'libkwineffects'
The branch contains the first step in reworking the kwineffects
library. This includes:
* replacing virtuals by signals and slots
* dropping some unused methods
* remove KWin::TimeLine

More to come.

Conflicts:
	kwin/workspace.cpp
2011-03-16 19:46:59 +01:00
Martin Gräßlin 32c903b05b Rework signals for move/resize windows
First a signal is emitted when the user starts a move/resize operation.
During the move/resize operation each geometry change emits an update signal.
Last but not least a finish signal is emitted.

This eliminates the specific method for geometry updates in drawbound resize
mode.
2011-03-13 12:41:30 +01:00
Martin Gräßlin 911098ee76 WindowGeometryShapeChanged becomes a signal 2011-03-12 12:34:59 +01:00
Thomas Lübking 0b1599680d stage one, call martin 2011-03-08 22:05:09 +01:00
Thomas Lübking dd19f5e1a7 Unlink maximization state from actual geometry
Since clients with restricted geometry now cannot cover the entire screen by default it was necessary to unlink the state from the actual geometry to re-provide the "restore" feature.
The patch also extends the protection of the maximized state to unilateral maximizations (emacs issue)

BUG: 265568
BUG: 252314
CCBUG: 252255
review request https://git.reviewboard.kde.org/r/100606/
2011-03-08 21:48:08 +01:00
Martin Gräßlin a404ec4259 WindowUnminimized becomes a signal 2011-03-06 11:08:19 +01:00
Martin Gräßlin 012222037e WindowMinimized becomes a signal 2011-03-06 10:55:27 +01:00
Martin Gräßlin eeb10c69d5 Signal for windowUserMovedResize
In core a new signal is added for maximizedState change of client.
Other function calls remain as direct calls for the moment.
2011-02-28 21:03:13 +01:00
Martin Gräßlin 0b85768ec5 EffectsHandler emits windowClosed signal
Client and Unmanaged use a signal to notify that they are about to be closed.
The EffectsHandlerImpl is connected to those signals and emits the appropriate
windowClosed signal to which the effects are connected.
2011-02-27 09:25:45 +01:00
Martin Gräßlin 0a7e48f7aa KWin uses kdelibs coding style. 2011-01-31 20:07:03 +01:00
Martin Gräßlin fcf6778057 Fix typos reported by Krazy
SVN_SILENT

svn path=/trunk/KDE/kdebase/workspace/; revision=1210596
2011-01-01 09:39:02 +00:00
Chani Armitage 7ce380497f Merge branch 'allactivities'
svn path=/trunk/KDE/kdebase/workspace/; revision=1207069
2010-12-16 20:14:22 +00:00
Kevin Ottens ff61f40d8d Don't rely on the kdgstream typedef which is deprecated. Use QDebug
directly.

svn path=/trunk/KDE/kdebase/workspace/; revision=1190379
2010-10-27 14:16:56 +00:00
Martin Gräßlin 545801de62 Unset noBorder when switching from Netbook to Desktop Shell.
Check on reloading of settings if the no borders for maximized windows option got disabled.
If it got disabled unset the no border option for all maximized windows to get the borders back.
BUG: 222045
FIXED-IN: 4.6.0

svn path=/trunk/KDE/kdebase/workspace/; revision=1189981
2010-10-26 14:43:29 +00:00
Chani Armitage 3c633a48ab Use an X property for activity associations
the new property name is "_KDE_NET_WM_ACTIVITIES", of type XA_STRING,
and it's a comma-separated list of activity UUIDs.

kwin should respond to other processes changing the activity list for a
window, and filter out any bogus IDs. It also caches KActivityController's
list of activities to prevent dbus deadlocks.

CCMAIL: plasma-devel@kde.org

svn path=/trunk/KDE/kdebase/workspace/; revision=1179043
2010-09-24 12:03:22 +00:00
Rohan Ramdas Prabhu 2aec750ebf Trembles the weave as the clock ticks, attain another microstate.
Every disorder causes every duration, which ensures the one that stays.
reality is relative. natural is disorder.
[R]obinhood[P]andey

Merging scripting from
^/branches/work/kwin_scripting TO
^/trunk

svn path=/trunk/KDE/kdebase/workspace/; revision=1177865
2010-09-21 14:31:40 +00:00
Martin Gräßlin 5b54bb1d03 Forward port rev 1137263:
Make icon sizes 64x64 and 128x128 available in KWin and use it in TabBox for large icon modes.
So no more ugly upscaling.
CCBUG: 241384

svn path=/trunk/KDE/kdebase/workspace/; revision=1137264
2010-06-12 06:56:40 +00:00
Chani Armitage d44b3f11f1 update window groups properly when activities change
also cleaned up the activity functions a little

svn path=/trunk/KDE/kdebase/workspace/; revision=1128678
2010-05-19 22:32:57 +00:00
Chani Armitage a9ad071575 Activity association for windows.
ok'd by fredrikh.
this code is buggy right now, but I promise to squash the bugs by the 19th :)


svn path=/trunk/KDE/kdebase/workspace/; revision=1125614
2010-05-11 20:30:20 +00:00
Martin Gräßlin fa7f160cb3 Window specific setting to skip window switchers (tabbox, present windows, desktop grid).
FEATURE: 171192
CCBUG: 179723

svn path=/trunk/KDE/kdebase/workspace/; revision=1122404
2010-05-03 20:04:44 +00:00
Lucas Murray 41e5bfd793 Change how quick tiling and maximization is activated slightly. Instead
of using electric borders just check the location of the cursor; if the
cursor is near the edge enable the resize snap. This makes the features
easier to activate, removes the conflict with desktop switching and
allows the features to be used completely on multi-screen systems.
Patch inspired by one from Marcel Schaal.
BUG: 218957

svn path=/trunk/KDE/kdebase/workspace/; revision=1071996
2010-01-09 09:49:52 +00:00
Lucas Murray ae3ef3f765 Allow the quick tiling keyboard shortcuts to move the window between
Xinerama screens.

svn path=/trunk/KDE/kdebase/workspace/; revision=1065319
2009-12-23 01:36:44 +00:00
Fredrik Höglund 0a8c06b054 Implement support for _KDE_NET_WM_FRAME_OVERLAP.
svn path=/trunk/KDE/kdebase/workspace/; revision=1054393
2009-11-25 23:32:35 +00:00
Lucas Murray 00e131a1a5 Allow window tabbing titlebar actions to be configurable; Set default
middle-click titlebar action to tab drag; Fix KCM config file corruption
caused by r1015273.
BUG: 214898

svn path=/trunk/KDE/kdebase/workspace/; revision=1050309
2009-11-17 07:17:49 +00:00
Lucas Murray f57028f387 Take into account the decoration when resizing windows based off their
min/max size hints.

svn path=/trunk/KDE/kdebase/workspace/; revision=1049889
2009-11-16 02:53:12 +00:00
Lucas Murray a0d07d12a2 Merged r970865:1049322 from /branches/work/kwin-tabbing
Adds window tabbing support to KWin.
FEATURE: 42023

svn path=/trunk/KDE/kdebase/workspace/; revision=1049334
2009-11-15 03:24:04 +00:00
Jacopo De Simoi 71a73acae8 Avoids a nasty race condition that caused corrupted window decorations
BUG:199735


svn path=/trunk/KDE/kdebase/workspace/; revision=1046461
2009-11-08 19:47:58 +00:00
Lucas Murray 65e8bea70d Make quick maximization and tiling more intuitive by handling resize and
move operations in a logical fashion when a window is in the maximized
or tiled state.

svn path=/trunk/KDE/kdebase/workspace/; revision=1035021
2009-10-14 09:33:00 +00:00
Lucas Murray 743e058af5 Detect when _MOTIF_WM_HINTS gains or loses the no border hint.
Patch by Daniel Erat.
BUG: 201523

svn path=/trunk/KDE/kdebase/workspace/; revision=1030932
2009-10-03 14:32:24 +00:00
Robin Harold Burchell 102ec081e2 Extend on the quicktiling(/snap) work by mgraesslin in r1021305:
- Add hotkeys for snap left/snap right, kwin won't need a seperate hotkey for snap up, as maximize will do that job for us, and it already has a hotkey
 - Add geometry restoring to quick tile, meaning that windows can be moved back to their original state after a tile, useful if just looking at something quickly.

Thanks to mgraesslin for review and lots of mentoring.

svn path=/trunk/KDE/kdebase/workspace/; revision=1022987
2009-09-13 17:09:44 +00:00
Martin Gräßlin 76f17e6de1 Here comes the new TabBox. It is a complete rewrite using a MVC approach. Here some highlights:
* Models and Delegates for Clients and Desktops
 * Horizontal, vertical and tabular layout
 * Layout of one item can be configured by an XML definition
 * A desktop item can include a client list
 * An optional second list view showing only the selected item
 * A new KCM "kwintabbox"
 * An alternative TabBox with independent settings and keybindings
 * Optional Highlight Windows effect integration
 * List scrolls instead of removing items
 * Scroll wheel support
 * Cursor key support
 * Middle click on item closes window
BUG: 195745
BUG: 197187
BUG: 201103
FEATURE: 118184
FEATURE: 156723
FEATURE: 177441
FEATURE: 182897
FEATURE: 193882
GUI:

svn path=/trunk/KDE/kdebase/workspace/; revision=1022861
2009-09-13 11:36:45 +00:00
Martin Gräßlin 754f5d0829 Quick maximize and tiling when moving a window to the left/right or top screen edge.
Top screen edge (un)maximizes. Left screen edge sets window to left half of screen geometry, right edge to other half.

svn path=/trunk/KDE/kdebase/workspace/; revision=1021305
2009-09-08 20:01:08 +00:00
Martin Gräßlin 8981223956 Reimplement addRepaintFull() in Client and add the padding to the repaint region.
CCBUG: 201596

svn path=/trunk/KDE/kdebase/workspace/; revision=1004121
2009-07-29 11:48:55 +00:00
Martin Gräßlin ba27d2ebb0 Copy decoration pixmaps to Deleted. By that we see the decoration also when having a fade out animation.
As this is a bigger commit I will wait with backporting to 4.3 for something about two or three weeks and will only backport if nobody yells.
BUG: 201780

svn path=/trunk/KDE/kdebase/workspace/; revision=1004096
2009-07-29 11:07:28 +00:00
Fredrik Höglund 3685b3260a Make sure that the repainted area includes the whole area
used by the decoration.

This fixes ghost shadows being left behind when windows
are minimized.

svn path=/trunk/KDE/kdebase/workspace/; revision=980474
2009-06-11 20:12:11 +00:00
Lucas Murray 8d09ed341a Remove old decoration shadow API, rename AbilityProvidesShadow and add
support for the new decoration shadow API in the shadow effect.

svn path=/trunk/KDE/kdebase/workspace/; revision=980130
2009-06-11 08:11:13 +00:00
Fredrik Höglund 809bdaa1f0 Fix a crash that happens sometimes when gwenview starts.
svn path=/trunk/KDE/kdebase/workspace/; revision=973675
2009-05-27 16:08:26 +00:00
Fredrik Höglund a088f660a5 Make sure that the repainted area includes the whole decoration when
a window is moved or resized.

svn path=/trunk/KDE/kdebase/workspace/; revision=963609
2009-05-04 23:19:42 +00:00
Fredrik Höglund 8bba7aed7d Make it possible for the decorations to paint outside the window frame
when compositing is enabled, by letting them add additional padding
to the sides of the frame.

svn path=/trunk/KDE/kdebase/workspace/; revision=963586
2009-05-04 22:35:33 +00:00
Martin Gräßlin 1c45f2a2d8 Forgot to add the changes to client for argb decoration (rev 957681)
svn path=/trunk/KDE/kdebase/workspace/; revision=957718
2009-04-22 19:00:51 +00:00
Fredrik Höglund e92aab0518 Implement initial support for ARGB window decorations.
Based on earlier work done by Lubos Lunak and ideas by Lucas Murray.

svn path=/trunk/KDE/kdebase/workspace/; revision=957680
2009-04-22 17:29:56 +00:00
Lucas Murray ca901dae30 Improved window movement around struts. Windows can be moved anywhere
where the titlebar is still clickable even if it is outside the normal
work area. When struts are added or removed only move the windows that
cover the same area, leave all others untouched. If a strut is removed
on a xinerama screen that is not on the edge of the full desktop area
prevent the windows from being moved offscreen. Prevent struts/panels
from interfering with the movement of windows on other xinerama screens.
BUG: 74559
BUG: 90833
BUG: 160068

svn path=/trunk/KDE/kdebase/workspace/; revision=927466
2009-02-17 15:50:00 +00:00
Lucas Murray 0d6f29c18d Ignore struts half-way up the screen when calculating the available work
area. Fixes placement and resizing of windows on the larger monitor of a
xinerama setup where each monitor has a different resolution.
BUG: 184348

svn path=/trunk/KDE/kdebase/workspace/; revision=926545
2009-02-15 16:37:42 +00:00
Lucas Murray 038667db7a SVN_SILENT Standardize coding style on client.* and workspace.*
svn path=/trunk/KDE/kdebase/workspace/; revision=898612
2008-12-18 13:50:57 +00:00
Lucas Murray d5a630cabd When window shade hovering is enabled do not immediately shade the
window once the cursor leaves the window, instead wait a little while.
Patch by Marcel Partap.
BUG: 81085

svn path=/trunk/KDE/kdebase/workspace/; revision=897056
2008-12-15 08:27:17 +00:00
Jason vanRijn Kasper fb0a01228f This change allows KWin to use the new NETWinInfo2 class (binary
compatibility class) and subsequently properly handle the
_NET_WM_FULLSCREEN_MONITORS EWMH spec hint.

svn path=/trunk/KDE/kdebase/workspace/; revision=885362
2008-11-17 08:03:39 +00:00