Commit graph

156 commits

Author SHA1 Message Date
Martin Gräßlin
2f18fe002f Start building up of ClientModel with the first Client to include
So far the first Client to be shown in the list (that is the
currently active window) was inserted as the last client into
the list by prepending it to the list.

This meant that if another Client actually blocks the inclusion
of the currently selected Client (e.g. only one window per app)
the currently active Client never got included in this list.

This change ensures that the recently used model switching has
the starting Client as the first Client in the list and also
simplifies the code.

Stacking order switching mode is not adjusted as it seems rather
broken, like the comment already says.

BUG: 304950
FIXED-IN: 4.9.1
REVIEW: 106139
2012-08-26 20:07:52 +02:00
Martin Gräßlin
a4fed7188c Use the first client as entrance to the focus chain if no active window
The recently used mode of TabBox uses the active window as the entrance
into the focus chain. If there is no active window it does not find any
Clients. To solve this issue the ClientModel now uses the first entry
of the focus chain in case there is no active window.

BUG: 305449
FIXED-IN: 4.9.1
REVIEW: 106088
2012-08-26 20:07:52 +02:00
Martin Gräßlin
83b9cb6697 Verify QVariant is valid before casting to Client*
If the ClientModel does not contain any Clients, which can
happen if there is no desktop window, accessing the data of a
ModelIndex returns an invalid QVariant. Because of that it
needs to be ensured that the QVariant is valid before trying to
cast it to a Client Pointer.

BUG: 304620
FIXED-IN: 4.9.1
REVIEW: 105935
2012-08-17 17:48:15 +02:00
Martin Gräßlin
e32d1761c3 Properly elide text in large icons TabBox theme
Using the same elide adjustments as in Thumbnails theme.

BUG: 304847
FIXED-IN: 4.9.1
REVIEW: 105959
2012-08-17 17:46:42 +02:00
Thomas Lübking
266a9d5218 Fix tabboxconfig copy operator
REVIEW: 105880
FIXED-IN: 4.9.1
2012-08-11 21:41:54 +02:00
Script Kiddy
9c40152c03 SVN_SILENT made messages (.desktop file) 2012-08-10 17:29:15 +02:00
Script Kiddy
c79bf24903 SVN_SILENT made messages (.desktop file) 2012-08-06 09:32:20 +02:00
Andre Woebbeking
9eb1cc43a3 link X11 lib (for gold?) 2012-07-27 22:12:59 +02:00
Script Kiddy
3aba56e778 SVN_SILENT made messages (.desktop file) 2012-07-25 18:00:01 +02:00
Script Kiddy
9db4ae2344 SVN_SILENT made messages (.desktop file) 2012-07-24 19:29:09 +02:00
Martin Gräßlin
bd7958392d Verify pointer is valid when calculating the longest caption
The method was missing a check whether the weak pointers in the
internal list got deleted. This could in very unlikely cases
lead to a crash.

In order to verify that adding the null pointer check fixes the
crash a unit test is added to simulate the situation of a
pointer being deleted. This required to add a mock a few
classes of TabBox. A MockTabBoxHandler and MockTabBoxClient are
added implementing the specific interfaces. The DeclarativeView
is completely mocked to make the linker happy. Including the
actual implementation is not possible as it pulls in half of
KWin core.

BUG: 303840
FIXED-IN: 4.9.0
REVIEW: 105645
2012-07-22 19:23:36 +02:00
Script Kiddy
b909bdc5c4 SVN_SILENT made messages (.desktop file) 2012-07-21 11:43:56 +02:00
Script Kiddy
88710b0f60 SVN_SILENT made messages (.desktop file) 2012-07-19 10:14:19 +02:00
Script Kiddy
6c572929d8 SVN_SILENT made messages (.desktop file) 2012-07-18 10:04:35 +02:00
Script Kiddy
a0b9107edb SVN_SILENT made messages (.desktop file) 2012-07-17 17:16:25 +02:00
Script Kiddy
d79989b162 SVN_SILENT made messages (.desktop file) 2012-07-16 11:12:26 +02:00
Script Kiddy
825a9c4f6e SVN_SILENT made messages (.desktop file) 2012-07-09 11:17:38 +02:00
Script Kiddy
11788e8b6f SVN_SILENT made messages (.desktop file) 2012-07-06 10:16:34 +02:00
Script Kiddy
836c2b41b3 SVN_SILENT made messages (.desktop file) 2012-06-20 11:19:37 +02:00
Script Kiddy
50dea703ca SVN_SILENT made messages (.desktop file) 2012-06-19 17:46:37 +02:00
Script Kiddy
f305f0eee4 SVN_SILENT made messages (.desktop file) 2012-06-18 10:12:23 +02:00
Script Kiddy
73c4b48c18 SVN_SILENT made messages (.desktop file) 2012-06-17 11:39:36 +02:00
Script Kiddy
c1f8590216 SVN_SILENT made messages (.desktop file) 2012-06-15 12:12:07 +02:00
Script Kiddy
953d088b6a SVN_SILENT made messages (.desktop file) 2012-06-12 17:07:51 +02:00
Script Kiddy
b4ff83ad3b SVN_SILENT made messages (.desktop file) 2012-06-03 09:41:45 +02:00
Script Kiddy
e999536c83 SVN_SILENT made messages (.desktop file) 2012-05-29 17:01:37 +02:00
Script Kiddy
62211420c7 SVN_SILENT made messages (.desktop file) 2012-05-28 11:08:19 +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
Martin Gräßlin
88e4ede6ce Window Switching layouts are not flickable over bounds
Flicking has to stop at the bounds in the window switcher
layouts. It's not natural on the desktop that they are
flickable in the first place.

Window Strip is unchanged as this layout is intended to be used
on touch and flickable user experiences.

REVIEW: 105001
2012-05-22 18:29:30 +02:00
Script Kiddy
2cbe2226f8 SVN_SILENT made messages (.desktop file) 2012-05-20 12:02:09 +02:00
Thomas Lübking
498a0a6a41 force showTabBox when opening layout through dbus
REVIEW: 104961
2012-05-16 00:12:30 +02:00
Script Kiddy
7c8aa660d1 SVN_SILENT made messages (.desktop file) 2012-05-15 16:43:40 +02:00
Script Kiddy
16d0a1733a SVN_SILENT made messages (.desktop file) 2012-05-12 12:31:50 +02:00
Script Kiddy
1e1467b18c SVN_SILENT made messages (.desktop file) 2012-05-11 09:44:50 +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
Martin Gräßlin
f3443a6b07 Add CMake variable to rename kwin binaries
A CMake variable is used to specify the name of the binary.
By default this is "kwin" but building for PA changes the
name to "kwinactive". The variable adjusts all names, e.g.
kwinnvidiahack becomes kwinactivenvidiahack.

The remaining usage of kwinrc in core and libs is replaced
by a cmakedefine for the configuration name and all data
installations are moved to the defined name. Dynamic loading
for scripts & co is adjusted for loading based on defined name.

This change allows the side-by-side installation of both kwin
for desktop and kwin for Plasma Desktop without the known
issues like conflicts in config files or missing build options
if kwin desktop is used for Plasma Active.

Likewise the KCMs are not adjusted as they are not intended to
be used for kwinactive.

REVIEW: 104299
BUG: 296084
FIXED-IN: 4.9.0
CCMAIL: active@kde.org
2012-05-10 10:25:15 +02:00
Ghislain MARY
c66c78f1d2 Key Bindings for Switching between Windows of current Application
Additional TabBox Mode which allows to switch between all open
windows of the current selected application. By default Alt+tilde
is used which is on qwerty just one key above tab. For non-qwerty
layouts the shortcut is unfortunately not convenient.

REVIEW: 104730
FEATURE: 299308
FIXED-IN: 4.9.0
2012-05-10 09:53:10 +02:00
Martin Gräßlin
7f654ee959 Add layout name to D-Bus interface to open TabBox
If the layout name is specified a custom layout config is
passed to the TabBoxHandler with the configured name.

This can be used by Plasma Active to specify the window strip
(overwrites any settings) and for Netbook shell as a replacement
to opening Present Windows Effect.

REVIEW: 104838
2012-05-06 12:58:43 +02:00
Thomas Lübking
ed2fabf527 elevate tabbox when elevating highlighted windows
BUG: 299324
FIXED-IN: 4.9
REVIEW: 104845
2012-05-04 19:29:29 +02:00
Script Kiddy
3dab9470e1 SVN_SILENT made messages (.desktop file) 2012-05-03 11:06:49 +02:00
Philipp Knechtges
9a1ad96e93 kwin: provide clipping for the TabBox thumbnails
BUG: 299198
REVIEW: 104399
2012-05-02 19:18:13 +02:00
Script Kiddy
be7573445a SVN_SILENT made messages (.desktop file) 2012-05-01 17:26:20 +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
Script Kiddy
2ebc52e0a5 SVN_SILENT made messages (.desktop file) 2012-04-19 11:15:13 +02:00
Martin Gräßlin
611e225fd6 Horizontal center the Thumbnail ListView
This ensures that also for a small TabBox with just one item
the thumbnail is nicely centered.

REVIEW: 104541
CCBUG: 297856
2012-04-16 17:42:10 +02:00
Martin Gräßlin
3193b46108 Constrain width of text element in Thumbnail Layout
Fixes a layouting issue when caption does not fit into
the window switcher box.

REVIEW: 104507
CCBUG: 297028
2012-04-16 17:41:57 +02:00
Thomas Lübking
0fe48f971d use compositor to elevate current tabbox window
BUG: 297809
REVIEW: 104538
2012-04-14 23:22:05 +02:00
Script Kiddy
40c8c94460 SVN_SILENT made messages (.desktop file) 2012-04-11 09:43:26 +02:00
Script Kiddy
8ced79739f SVN_SILENT made messages (.desktop file) 2012-04-02 10:09:26 +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