Only needed for ScopedCPointer which can be defined in both utils and
xcbutils.h.
Not having utils.h in xcbutils.h makes it easier to have unit tests use
xcbutils.h as it removes the dependencies.
Like with WindowSwitcher the configured value might be for the
look and feel package and thus we should first try to locate it
from the look and feel package.
We assume the configured layout name is a look and feel package. Thus
the Switcher is located at contents/windowswitcher/WindowSwitcher.qml
of that package.
REVIEW: 120849
We need to send the event to a QQuickItem which accepts focus. Just
sending it to the Window or to the contentItem doesn't work as there is
no activeFocusItem (might be related to having the keyboard grabbed).
We try to send the event to all children of the Window's content item.
There should hopefully be one item which accepts the event and properly
reacts on cursor keys.
REVIEW: 118471
Both were only added for the use case of Plasma Active. In the next
iteration we won't need the embedded any more as Plasma is able to draw
thumbnails by itself. So there is neither need for the embedded
functionality nor for the D-Bus interface.
REVIEW: 118464
Instead of having it's own QQmlEngine TabBox just uses the newly
exposed engine from Scripting and creates a new context for it's
own usage.
REVIEW: 116565
By not using a QQuickView it becomes possible to just use a
PlasmaCore.Dialog or a Quick.Window in the TabBox qml and thus it's
possible to simplify the qml code.
To support this a new SwitcherItem is introduced and exported to QML.
It's a simple QObject providing all the properties which used to be
exported to the root context. A declarative TabBox is expected to
use one of these items. The C++ side finds the Switcher and for that
supports the case that the SwitcherItem is the rootItem or a child
item.
A declarative TabBox has also to create a QQuickWindow, e.g. a
PlasmaCore.Dialog. The visibility of that window should be controlled
through the visible property on the SwitcherItem. The underlying C++
implementation assumes that a TabBox only uses one window (it needs to
get destroyed once it's hidden and included in highlight windows).
Thanks to this change it's no longer needed to reload the TabBox
whenever it gets shown or the alternative TabBox gets shown. Instead
the same QML script can get reused. Other created switchers are ignored
as the visible property won't be changed to true.
Not the best solution, but at least TabBox works each time it's invoked.
It doesn't make much of a difference as the QML is reparsed anyway at
each show.
Straight forward port. Note: this is currently crashing deep down in
QtQuick. To circumvent the crashes it helps to disable the property
highlightFollowsCurrentItem in the listviews. This solves the problem
that QtQuick crashes on first loading. Unfortunately it still crashes
if one tries to invoke TabBox for the second time.
This happens because some distros ship broken installations
of KWin and KWinActive, but could also appear to QML hacking users
BUG: 322830
FIXED-IN: 4.11
REVIEW: 111732
It's an option doing pretty much the same as the highlight of selected
window option. But it is known to conflict especially with some Plasma
themes.
BUG: 310935
FIXED-IN: 4.11
REVIEW: 110140
Use xcb to create and manage the X11 backend of Outline. In addition the
used background pixmaps are rendered with XRender instead of using a
QPainter on a QPixmap. This is done because QPixmap is no longer bound to
an X Pixmap.
To create the XRender Picture the available functionality from
kwinxrenderutils is used. To be able to use it in KWin core the compile
option to build without XRender is removed for kwinxrenderutils, but
still supported for effects.
Obviously the port to XCB is not complete as xremderutils itself is still
on XLib.
REVIEW: 108642
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
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
If there are no windows for Alt+Tab the Show Desktop entry
is shown. This works better with both layouts and effects.
Before this change effects were not activated at all but
a fallback to the layouts was used. Concerning the layouts
some looked rather bad. E.g. Thumbnails did not show a
thumbnail but a legacy text had been shown.
When a window gets added to the empty list, the show desktop
window is removed and consequently when the last window goes
away the show desktop entry is added again.
There is a not considered corner case: if there is no desktop
window, the show desktop functionality is not available and
the behavior is unfortunately undefined. It is a corner case
as we can expect that there is always a desktop window when
using KWin. E.g. there is either Plasma Desktop or Netbook
and on PA there is always at least one window.
BUG: 260938
FIXED-IN: 4.9.0
REVIEW: 104379
The grabbed key events inside TabBox are forwarded to the declarative
view which passes it to the normal keyPressedEvent() method. This
allows the QML files to handle keyboard navigation themselves.
The views support key navigation natively, though this cannot be
used as we need to update the ModelIndex when a new item is selected.
Also there seems to be a problem if the tabbox is shown again, in
that case the focus seems to be somehow lost. Because of that the
navigation is handled in the Item embedding the list.
REVIEW: 104357
FEATURE: 291916
FIXED-IN: 4.9.0
REVIEW: 104340
Acked by Martin Gräßlin
(cherry picked from commit 56345a9f158790e5f7102618c55c600cc688c855)
Conflicts:
kwin/tabbox/declarative.cpp
kwin/tabbox/declarative.h
This includes the delegates, the layout configuration for the delegates
and the custom view for the TabBox.
This can now finally be done as desktop tabbox is based on QML, too.