Commit Graph

23 Commits (533d57da60d053aec99b018ef9f2e752ab1f373f)

Author SHA1 Message Date
Martin Gräßlin 533d57da60 Mark most ctors as explicit as reported by Krazy2 checker 2013-01-02 18:35:46 +01:00
Martin Gräßlin ed3effa2d3 Ensure that the start Client to build up the ClientModel is in the Focus Chain
If the start Client is not part of the focus chain the call to
nextClientFocusChain() cannot return the Client again. So the loop break
condition is never reached and as the focus chain is not empty the call
always returns a not null Client which means KWin is caught in an endless
loop.

This change checks that the starting Client is in the focus chain and if
not the first Client of the focus chain is used.

BUG: 306260
BUG: 306275
FIXED-IN: 4.9.2
2012-09-05 20:55:07 +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 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 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
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
Thomas Lübking 0fe48f971d use compositor to elevate current tabbox window
BUG: 297809
REVIEW: 104538
2012-04-14 23:22:05 +02:00
Stefano Avallone 76c00aa189 Refactor checks for inclusion of TabBoxClients in the client list
REVIEW: 104025
2012-03-05 20:26:35 +01:00
Martin Gräßlin ff8c0e3f8f Emit a signal when an item gets selected 2011-12-02 10:48:04 +01:00
Martin Gräßlin e873efdc99 Adding an accept and reject method to TabBox 2011-12-02 10:31:52 +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
Martin Gräßlin 5eb5a60cc5 Embedded mode for TabBox
DBus method to embedd the TabBox into another window. It follows
the geometry changes and keeps a defined offset to the borders of
the parent window.

Required for Plasma Active's window strip.
2011-12-01 08:48:18 +01:00
Martin Gräßlin cc6fa14c9b API improvements: open/close instead of start/close 2011-11-29 07:05:41 +01:00
Martin Gräßlin e858b413a3 Activate TabBoxClient from mouse click and close TabBox
This is useful in combination of non-modal TabBox through DBus and
window-strip layout. With DBus the non-modal TabBox can be started
and selecting any item on the strip will end TabBox again.
2011-11-27 17:03:35 +01:00
Martin Gräßlin 5a7120fbf5 Non-modal TabBox mode
Available through DBus. Be aware that this does not make much
sense, as there is no way to end TabBox mode except through the
DBus interface and this does not yet select the selected window.
2011-11-27 16:39:54 +01:00
Martin Gräßlin d2c7123dc6 TabBox becomes activatable through a DBus interface
Therefore TabBox is changed to be controlled without pressing a
modifier key. Tab and Backtab are valid keys now which can be
used to navigate in the list and return, enter and space can be
used to close the box (and select the client).

The TabBox is exported as object /TabBox on the kwin interface
providing start and close methods and signal when the TabBox got
closed.
2011-11-27 16:38:11 +01:00
Martin Gräßlin 245f84d835 Close windows from TabBox QML
Model exposes a method to close a window by index which is invoked
by the window strip QML.
2011-11-27 15:00:09 +01:00
Martin Gräßlin 9eb5a17e30 Support Closeable in TabBox
Needed by window strip to not add a close button to non-closeable
windows such as the desktop shell.
2011-11-27 14:15:49 +01:00
Martin Gräßlin 8b9e7f56cf Pass mouse events to declarative Tabbox
The ListViews have therefore to emit a signal when the item changed
due to a mouse click event.
2011-10-31 14:34:37 +01:00
Arthur Arlt 5d2f8356f4 Make reconfigure() a Q_SLOT
make reconfigure() a Q_SLOT and connect to the signal configChanged()
of class Workspace.

REVIEW: 101942
2011-07-15 22:23:29 +02:00
Martin Gräßlin f89ba7a382 Move tabbox.(h|cpp) to tabbox sub directory 2011-07-15 17:22:41 +02:00