Commit Graph

763 Commits (e68955866d0b2f19b259962d73402f469e795d76)

Author SHA1 Message Date
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
Martin Gräßlin 6d2dfe06e7 Introduce dedicated OpenGL1 and OpenGL2 compositing types
The CompositingType enum turns into flags and two new values are
introduced: OpenGL1Compositing and OpenGL2Compositing.

Those new values are or-ed to OpenGLCompositing so that a simple check
for the flag OpenGLCompositing works in case of one of those two new
values. To make the generic check for OpenGL compositing easier a method
in EffectsHandler is introduced to just check for this.

The scenes now return either OpenGL1Compositing or OpenGL2Compositing
depending on which Scene implementation. None returns OpenGLCompositing.
2012-09-29 15:33:57 +02:00
Thomas Lübking 3b7c1fb69d correctly align tabbing shade mode, including hover
REVIEW: 106258
BUG: 294410
FIXED-IN: 4.9.2
2012-09-27 22:15:23 +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 0921af2129 fix ignoring dektop related windows for showing desktop state 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
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
Thomas Lübking a84cfb3a49 kill killhelper in client destructor
BUG: 305157
FIXED-IN: 4.9.1
REVIEW: 106022
2012-08-28 21:08:28 +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 952579bb09 fix untabbing position
the geometry setting needs to happen out of recursion,
has to be smarter for unmaximizing and also no real
place in TabGroup - the client is no longer tabbed thus
it's not the groups task to manage it's geometry.

BUG: 226881
REVIEW: 106182
FIXED-IN: 4.9.1
2012-08-28 21:08:03 +02:00
Thomas Lübking 976037717b delay unsynced window ready_for_painting state
by at max 50ms (and thus trigger a full repaint with the state change)

BUG: 295254
REVIEW: 106173
FIXED-IN: 4.9.1
2012-08-28 21:08:02 +02:00
Thomas Lübking 0d6cee6ccc kill killhelper in client destructor
BUG: 305157
FIXED-IN: 4.9.1
REVIEW: 106022
2012-08-28 15:35:35 +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
Thomas Lübking 3460d5b551 fix untabbing position
the geometry setting needs to happen out of recursion,
has to be smarter for unmaximizing and also no real
place in TabGroup - the client is no longer tabbed thus
it's not the groups task to manage it's geometry.

BUG: 226881
REVIEW: 106182
FIXED-IN: 4.9.1
2012-08-28 15:35:29 +02:00
Thomas Lübking a6296dda20 delay unsynced window ready_for_painting state
by at max 50ms (and thus trigger a full repaint with the state change)

BUG: 295254
REVIEW: 106173
FIXED-IN: 4.9.1
2012-08-28 15:34:00 +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
Martin Gräßlin 28a5487d4d Drop compositing prefixes from methods and variables in Compositor
Yes everything in the Compositor is related to compositing, no
need to state it everywhere.
2012-08-26 20:43:57 +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 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
Thomas Lübking bc24400010 honor rule when updating deco presence for reshape
CCBUG: 301909
REVIEW: 105485
2012-07-10 00:58:31 +02:00
Thomas Lübking 9a15d1921f honor rule when updating deco presence for reshape
CCBUG: 301909
REVIEW: 105485
2012-07-10 00:32:59 +02:00
Thomas Lübking 7340ac59e0 don't consider matching activity list sizes as ALL if size is "1"
CCBUG: 301239
REVIEW: 105195
2012-06-12 23:13:15 +02:00
Thomas Lübking fe2839b95b avoid setOnAllActivities recursion
BUG: 301397
FIXED-IN: 4.9
REVIEW: 105192
2012-06-12 23:12:58 +02:00
Thomas Lübking 11f28732db treat "ALL" activities as all activities when setting activities (aligning it to an empty list as checked elsewhere)
BUG: 300846
FIXED-IN: 4.9
REVIEW: 105113
2012-06-01 16:46:21 +02:00
Casian Andrei 33492358e5 Fix windows like kickoff from disappearing
When trying to launch kickoff (start menu) or the add widgets from
Plasma, they disappeared immediately after appearing, making them
completely unusable.

This regression was traced back to commit
bf0a241c2462072fbc52012784fa51b9b42a1baf.

In Client::setOnActivities, if newActivitiesList was empty, after
joining it and splitting it back, it would contain an empty string, i.e.
it would have a different size than before. This eventually caused the problems.

REVIEW: 105016
2012-05-23 10:50:14 +03: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
Ivan Čukić 0d60a7049d Adds activity window rules to KWin
- adds the kcm rule option to set the activity - one or all option like
  for virtual desktops
- makes the windows obey the rule
- makes the rule enforced even when the user tries to change the
  window's activity via the alt+f3 menu

REVIEW:104972
2012-05-17 16:32:06 +02:00
Martin Gräßlin 38ab8359d7 Simplify construction of TabBoxClientImpl
cppcheck complained about that piece of code and it was not
really good. A TabBoxClient belongs to exactly one Client which
means the setter should for Client should not be there in the
first place and was only used during construction.

REVIEW: 104909
2012-05-11 08:21:01 +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 2fce451be5 allow to sync dynamic Qt props on tabgroups
REVIEW: 104695
2012-04-24 20:41:06 +02:00
Martin Gräßlin 563dc7fb8e Do not create Deleted on Workspace Shutdown
When the Workspace is shutting down the compositor is torn down
before Clients and Unmanaged are released. This means that there
is no need to create the Deleted windows.

Furthermore creating the Deleted manipulates the stacking_order
while Workspace dtor loops over this list to release all clients.
This may cause crashes.

BUG: 282933
FIXED-IN: 4.9.0
REVIEW: 104690
2012-04-22 17:50:20 +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 92939b13d7 detach killHelper process from KWin
BUG: 295940
FIXED-IN: 4.9
REVIEW: 104627
2012-04-17 21:09:44 +02:00
Thomas Lübking 5d6613eb99 withdraw _NET_WM_STATE_DEMANDS_ATTENTION from windows which are attempted t be focus'd but cannot
BUG: 232423
FIXED-IN: 4.9
REVIEW: 104620
2012-04-17 21:09:27 +02:00
Thomas Lübking 651d4e4fbf do not setActive clients which don't take focus on ShadeHover - by this resort re-shade restacking code
BUG: 242217
FIXED-IN: 4.9
REVIEW: 104622
2012-04-17 21:07:16 +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 c900455599 don't hover unshade while moving
BUG: 223074
REVIEW: 104280
2012-03-30 15:27:02 +02: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 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 e46f81ec73 Make skipPager and skipTaskbar available to scripts 2012-02-29 18:57:17 +01:00
Martin Gräßlin 212908ee88 Refactoring of KWin::Options: getter methods instead of public variables 2012-02-27 19:31:58 +01:00
Martin Gräßlin 7f0770f99d Properly ifdef everything requiering HAVE_XSYNC
REVIEW: 104080
2012-02-26 17:22:38 +01:00
Thomas Lübking b79a176be3 resolve merge conflicts 2012-02-21 19:22:08 +01:00
Thomas Lübking 802abf09d1 allow windows to withdraw XShape masks
BUG: 293736
REVIEW: 104007
2012-02-21 17:18:04 +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