Remove show outline from TabBox

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
icc-effect-5.14.5
Martin Gräßlin 2013-04-24 08:27:31 +02:00
parent 6d0d9cfe43
commit badc7a2bc4
12 changed files with 9 additions and 158 deletions

View File

@ -111,7 +111,6 @@ KWinTabBoxConfig::KWinTabBoxConfig(QWidget* parent, const QVariantList& args)
ui[i]->ghns->setIcon(KIcon("get-hot-new-stuff"));
connect(ui[i]->highlightWindowCheck, SIGNAL(clicked(bool)), SLOT(changed()));
connect(ui[i]->showOutlineCheck, SIGNAL(clicked(bool)), SLOT(changed()));
connect(ui[i]->showTabBox, SIGNAL(clicked(bool)), SLOT(tabBoxToggled(bool)));
connect(ui[i]->effectCombo, SIGNAL(currentIndexChanged(int)), SLOT(changed()));
connect(ui[i]->effectCombo, SIGNAL(currentIndexChanged(int)), SLOT(effectSelectionChanged(int)));
@ -265,7 +264,6 @@ void KWinTabBoxConfig::loadConfig(const KConfigGroup& config, KWin::TabBox::TabB
tabBoxConfig.setClientSwitchingMode(TabBoxConfig::ClientSwitchingMode(
config.readEntry<int>("SwitchingMode", TabBoxConfig::defaultSwitchingMode())));
tabBoxConfig.setShowOutline(config.readEntry<bool>("ShowOutline", TabBoxConfig::defaultShowOutline()));
tabBoxConfig.setShowTabBox(config.readEntry<bool>("ShowTabBox", TabBoxConfig::defaultShowTabBox()));
tabBoxConfig.setHighlightWindows(config.readEntry<bool>("HighlightWindows", TabBoxConfig::defaultHighlightWindow()));
@ -285,7 +283,6 @@ void KWinTabBoxConfig::saveConfig(KConfigGroup& config, const KWin::TabBox::TabB
config.writeEntry("LayoutName", tabBoxConfig.layoutName());
// check boxes
config.writeEntry("ShowOutline", tabBoxConfig.isShowOutline());
config.writeEntry("ShowTabBox", tabBoxConfig.isShowTabBox());
config.writeEntry("HighlightWindows", tabBoxConfig.isHighlightWindows());
@ -365,7 +362,6 @@ void KWinTabBoxConfig::defaults()
ui[i]->switchingModeCombo->setCurrentIndex(TabBoxConfig::defaultSwitchingMode());
// checkboxes
ui[i]->showOutlineCheck->setChecked(TabBoxConfig::defaultShowOutline());
ui[i]->showTabBox->setChecked(TabBoxConfig::defaultShowTabBox());
ui[i]->highlightWindowCheck->setChecked(TabBoxConfig::defaultHighlightWindow());
CONFIGURE(showDesktop, ShowDesktop, ==, ShowDesktopClient);
@ -422,7 +418,6 @@ void KWinTabBoxConfig::updateUiFromConfig(KWinTabBoxConfigForm* ui, const KWin::
ui->switchingModeCombo->setCurrentIndex(config.clientSwitchingMode());
// check boxes
ui->showOutlineCheck->setChecked(config.isShowOutline());
ui->showTabBox->setChecked(config.isShowTabBox());
ui->highlightWindowCheck->setChecked(config.isHighlightWindows());
ui->effectCombo->setCurrentIndex(ui->effectCombo->findData(config.layoutName()));
@ -452,7 +447,6 @@ void KWinTabBoxConfig::updateConfigFromUi(const KWin::KWinTabBoxConfigForm* ui,
config.setClientSwitchingMode(TabBoxConfig::ClientSwitchingMode(ui->switchingModeCombo->currentIndex()));
config.setShowOutline(ui->showOutlineCheck->isChecked());
config.setShowTabBox(ui->showTabBox->isChecked());
config.setHighlightWindows(ui->highlightWindowCheck->isChecked());
if (ui->effectCombo->currentIndex() >= Layout) {
@ -476,7 +470,6 @@ void KWinTabBoxConfig::effectSelectionChanged(int index)
if (!ui->showTabBox->isChecked())
return;
ui->highlightWindowCheck->setEnabled(index >= Layout);
ui->showOutlineCheck->setEnabled(index >= Layout);
if (m_layoutPreview && m_layoutPreview->isVisible()) {
if (index < Layout)
m_layoutPreview->hide();
@ -489,7 +482,6 @@ void KWinTabBoxConfig::tabBoxToggled(bool on) {
CHECK_CURRENT_TABBOX_UI
on = !on || ui->effectCombo->currentIndex() >= Layout;
ui->highlightWindowCheck->setEnabled(on);
ui->showOutlineCheck->setEnabled(on);
emit changed();
}

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>621</width>
<height>398</height>
<width>630</width>
<height>418</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="1,1,2">
@ -472,7 +472,7 @@
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="2" column="1">
<item row="1" column="1">
<widget class="QWidget" name="widget_6" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="margin">
@ -504,7 +504,7 @@
</layout>
</widget>
</item>
<item row="2" column="0">
<item row="1" column="0">
<widget class="QCheckBox" name="showTabBox">
<property name="text">
<string/>
@ -514,13 +514,6 @@
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="showOutlineCheck">
<property name="text">
<string>Outline selected window</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="highlightWindowCheck">
<property name="toolTip">
@ -531,7 +524,7 @@
</property>
</widget>
</item>
<item row="2" column="2">
<item row="1" column="2">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -544,7 +537,7 @@
</property>
</spacer>
</item>
<item row="2" column="3">
<item row="1" column="3">
<widget class="KPushButton" name="ghns">
<property name="toolTip">
<string>Get New Window Switcher Layout</string>
@ -597,7 +590,6 @@
</customwidgets>
<tabstops>
<tabstop>highlightWindowCheck</tabstop>
<tabstop>showOutlineCheck</tabstop>
<tabstop>showTabBox</tabstop>
<tabstop>effectCombo</tabstop>
<tabstop>effectConfigButton</tabstop>

View File

@ -73,16 +73,6 @@ void Outline::setGeometry(const QRect& outlineGeometry)
m_outlineGeometry = outlineGeometry;
}
QVector< xcb_window_t > Outline::windowIds() const
{
QVector<xcb_window_t> windows;
if (m_initialized) {
windows.reserve(4);
windows << m_leftOutline << m_topOutline << m_rightOutline << m_bottomOutline;
}
return windows;
}
void Outline::showWithX()
{
if (!m_initialized) {

View File

@ -22,7 +22,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define KWIN_OUTLINE_H
#include "xcbutils.h"
#include <QRect>
#include <QVector>
namespace KWin {
@ -72,11 +71,6 @@ public:
*/
void hide();
/**
* Return outline window ids
* @return The window ids created to represent the outline
*/
QVector<xcb_window_t> windowIds() const;
private:
/**

View File

@ -57,7 +57,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <fixx11h.h>
#include <X11/keysym.h>
#include <X11/keysymdef.h>
#include "outline.h"
// specify externals before namespace
@ -329,21 +328,6 @@ QWeakPointer<TabBoxClient> TabBoxHandlerImpl::desktopClient() const
return QWeakPointer<TabBoxClient>();
}
void TabBoxHandlerImpl::showOutline(const QRect &outline)
{
Workspace::self()->outline()->show(outline);
}
void TabBoxHandlerImpl::hideOutline()
{
Workspace::self()->outline()->hide();
}
QVector< xcb_window_t > TabBoxHandlerImpl::outlineWindowIds() const
{
return Workspace::self()->outline()->windowIds();
}
void TabBoxHandlerImpl::activateAndClose()
{
m_tabBox->accept();
@ -783,8 +767,6 @@ void TabBox::loadConfig(const KConfigGroup& config, TabBoxConfig& tabBoxConfig)
tabBoxConfig.setClientSwitchingMode(TabBoxConfig::ClientSwitchingMode(
config.readEntry<int>("SwitchingMode", TabBoxConfig::defaultSwitchingMode())));
tabBoxConfig.setShowOutline(config.readEntry<bool>("ShowOutline",
TabBoxConfig::defaultShowOutline()));
tabBoxConfig.setShowTabBox(config.readEntry<bool>("ShowTabBox",
TabBoxConfig::defaultShowTabBox()));
tabBoxConfig.setHighlightWindows(config.readEntry<bool>("HighlightWindows",

View File

@ -64,9 +64,6 @@ public:
virtual void restack(TabBoxClient *c, TabBoxClient *under);
virtual QWeakPointer< TabBoxClient > clientToAddToList(KWin::TabBox::TabBoxClient* client, int desktop) const;
virtual QWeakPointer< TabBoxClient > desktopClient() const;
virtual void hideOutline();
virtual void showOutline(const QRect &outline);
virtual QVector< xcb_window_t > outlineWindowIds() const;
virtual void activateAndClose();
private:

View File

@ -30,7 +30,6 @@ public:
TabBoxConfigPrivate()
: showTabBox(TabBoxConfig::defaultShowTabBox())
, highlightWindows(TabBoxConfig::defaultHighlightWindow())
, showOutline(TabBoxConfig::defaultShowOutline())
, tabBoxMode(TabBoxConfig::ClientTabBox)
, clientDesktopMode(TabBoxConfig::defaultDesktopMode())
, clientActivitiesMode(TabBoxConfig::defaultActivitiesMode())
@ -46,7 +45,6 @@ public:
}
bool showTabBox;
bool highlightWindows;
bool showOutline;
TabBoxConfig::TabBoxMode tabBoxMode;
TabBoxConfig::ClientDesktopMode clientDesktopMode;
@ -74,7 +72,6 @@ TabBoxConfig& TabBoxConfig::operator=(const KWin::TabBox::TabBoxConfig& object)
{
d->showTabBox = object.isShowTabBox();
d->highlightWindows = object.isHighlightWindows();
d->showOutline = object.isShowOutline();
d->tabBoxMode = object.tabBoxMode();
d->clientDesktopMode = object.clientDesktopMode();
d->clientActivitiesMode = object.clientActivitiesMode();
@ -98,16 +95,6 @@ bool TabBoxConfig::isHighlightWindows() const
return d->highlightWindows;
}
void TabBoxConfig::setShowOutline(bool show)
{
d->showOutline = show;
}
bool TabBoxConfig::isShowOutline() const
{
return d->showOutline;
}
void TabBoxConfig::setShowTabBox(bool show)
{
d->showTabBox = show;

View File

@ -148,13 +148,6 @@ public:
*/
bool isHighlightWindows() const;
/**
* @return If an outline of selected window should be shown
* This option does not apply for TabBoxMode DesktopTabBox.
* @see setShowOutline
* @see defaultShowOutline
*/
bool isShowOutline() const;
/**
* @return The current TabBoxMode
* @see setTabBoxMode
*/
@ -234,12 +227,6 @@ public:
*/
void setHighlightWindows(bool highlight);
/**
* @param show Show outline for current selected client.
* This option does not apply for TabBoxMode DesktopTabBox.
* @see isShowOutline
*/
void setShowOutline(bool show);
/**
* @param mode The new TabBoxMode to be used.
* @see tabBoxMode
*/
@ -323,9 +310,6 @@ public:
static bool defaultShowTabBox() {
return true;
}
static bool defaultShowOutline() {
return true;
}
static bool defaultHighlightWindow() {
return true;
}

View File

@ -47,10 +47,6 @@ public:
~TabBoxHandlerPrivate();
/**
* Updates the currently shown outline.
*/
void updateOutline();
/**
* Updates the current highlight window state
*/
@ -73,7 +69,6 @@ public:
QModelIndex index;
/**
* Indicates if the tabbox is shown.
* Used to determine if the outline has to be updated, etc.
*/
bool isShown;
TabBoxClient *lastRaisedClient, *lastRaisedClientSucc;
@ -115,23 +110,6 @@ DesktopModel* TabBoxHandlerPrivate::desktopModel() const
return m_desktopModel;
}
void TabBoxHandlerPrivate::updateOutline()
{
if (config.tabBoxMode() != TabBoxConfig::ClientTabBox)
return;
// if ( c == NULL || !m_isShown || !c->isShown( true ) || !c->isOnCurrentDesktop())
if (!isShown) {
q->hideOutline();
return;
}
const QVariant client = m_clientModel->data(index, ClientModel::ClientRole);
if (!client.isValid()) {
return;
}
TabBoxClient* c = static_cast< TabBoxClient* >(client.value<void *>());
q->showOutline(QRect(c->x(), c->y(), c->width(), c->height()));
}
void TabBoxHandlerPrivate::updateHighlightWindows()
{
if (!isShown || config.tabBoxMode() != TabBoxConfig::ClientTabBox)
@ -185,13 +163,6 @@ void TabBoxHandlerPrivate::updateHighlightWindows()
data.resize(1);
}
data[ 0 ] = currentClient ? currentClient->window() : 0L;
if (config.isShowOutline()) {
QVector<xcb_window_t> outlineWindows = q->outlineWindowIds();
data.resize(2+outlineWindows.size());
for (int i=0; i<outlineWindows.size(); ++i) {
data[2+i] = outlineWindows[i];
}
}
Atom atom = XInternAtom(dpy, "_KDE_WINDOW_HIGHLIGHT", False);
XChangeProperty(dpy, wId, atom, atom, 32, PropModeReplace,
reinterpret_cast<unsigned char *>(data.data()), data.size());
@ -244,10 +215,6 @@ void TabBoxHandler::show()
d->isShown = true;
d->lastRaisedClient = 0;
d->lastRaisedClientSucc = 0;
// show the outline
if (d->config.isShowOutline()) {
d->updateOutline();
}
if (d->config.isShowTabBox()) {
if (d->config.tabBoxMode() == TabBoxConfig::ClientTabBox) {
// use declarative view
@ -285,9 +252,6 @@ void TabBoxHandler::hide(bool abort)
if (d->config.isHighlightWindows()) {
d->endHighlightWindows(abort);
}
if (d->config.isShowOutline()) {
hideOutline();
}
if (d->m_declarativeView) {
d->m_declarativeView->hide();
}
@ -388,9 +352,6 @@ void TabBoxHandler::setCurrentIndex(const QModelIndex& index)
}
d->index = index;
if (d->config.tabBoxMode() == TabBoxConfig::ClientTabBox) {
if (d->config.isShowOutline()) {
d->updateOutline();
}
if (d->config.isHighlightWindows()) {
d->updateHighlightWindows();
}

View File

@ -59,12 +59,12 @@ namespace KWin
* In order to use the TabBox the TabBoxConfig has to be set. This defines if the model for desktops or for
* clients will be used. The model has to be initialized by calling TabBoxHandler::createModel(), as the
* model is undefined when the TabBox is not active. The TabBox is activated by TabBoxHandler::show().
* Depending on the current set TabBoxConfig it is possible that an additional outline is shown, the
* Depending on the current set TabBoxConfig it is possible that the
* highlight windows effect activated and that the view is not displayed at all. As already mentioned
* the TabBox does not handle any updating of the selected item. This has to be done by invoking
* TabBoxHandler::setCurrentIndex(). Nevertheless the TabBoxHandler provides methods to query for the
* model index or the next or previous item, for a cursor position or for a given item (that is
* TabBoxClient or desktop). By invoking TabBoxHandler::hide() the view, the optional outline and the
* TabBoxClient or desktop). By invoking TabBoxHandler::hide() the view, the
* optional highlight windows effect are removed. The model is invalidated immediately. So if it is
* necessary to retrieve the last selected item this has to be done before calling the hide method.
*
@ -225,25 +225,22 @@ public:
* Call this method to show the TabBoxView. Depending on current
* configuration this method might not do anything.
* If highlight windows effect is to be used it will be activated.
* If the outline has to be shown, it will be shown.
* Highlight windows and outline are not shown if
* TabBoxConfig::TabBoxMode is TabBoxConfig::DesktopTabBox.
* @see TabBoxConfig::isShowTabBox
* @see TabBoxConfig::isHighlightWindows
* @see TabBoxConfig::showOutline
*/
void show();
/**
* Hides the TabBoxView if shown.
* Deactivates highlight windows effect if active.
* Removes the outline if active.
* @see show
*/
void hide(bool abort = false);
/**
* Sets the current model index in the view and updates
* highlight windows and outline if active.
* highlight windows if active.
* @param index The current Model index
*/
void setCurrentIndex(const QModelIndex& index);
@ -338,27 +335,6 @@ public:
Qt::Alignment embeddedAlignment() const;
void resetEmbedded();
protected:
/**
* Show the outline of the current selected window
* @param outline The geometry of the window the outline will be shown
* @since 4.7
**/
virtual void showOutline(const QRect &outline) = 0;
/**
* Hide previously shown outline
* @since 4.7
**/
virtual void hideOutline() = 0;
/**
* Return outline window ids
* @return The outline window ids given in the order left, top, right, bottom
* @since 4.7
**/
virtual QVector<xcb_window_t> outlineWindowIds() const = 0;
signals:
/**
* This signal is fired when the TabBoxConfig changes

View File

@ -35,7 +35,6 @@ void TestTabBoxConfig::testDefaultCtor()
TabBoxConfig config;
QCOMPARE(config.isShowTabBox(), TabBoxConfig::defaultShowTabBox());
QCOMPARE(config.isHighlightWindows(), TabBoxConfig::defaultHighlightWindow());
QCOMPARE(config.isShowOutline(), TabBoxConfig::defaultShowOutline());
QCOMPARE(config.tabBoxMode(), TabBoxConfig::ClientTabBox);
QCOMPARE(config.clientDesktopMode(), TabBoxConfig::defaultDesktopMode());
QCOMPARE(config.clientActivitiesMode(), TabBoxConfig::defaultActivitiesMode());
@ -54,7 +53,6 @@ void TestTabBoxConfig::testAssignmentOperator()
// changing all values of the config object
config.setShowTabBox(!TabBoxConfig::defaultShowTabBox());
config.setHighlightWindows(!TabBoxConfig::defaultHighlightWindow());
config.setShowOutline(!TabBoxConfig::defaultShowOutline());
config.setTabBoxMode(TabBoxConfig::DesktopTabBox);
config.setClientDesktopMode(TabBoxConfig::AllDesktopsClients);
config.setClientActivitiesMode(TabBoxConfig::AllActivitiesClients);
@ -70,7 +68,6 @@ void TestTabBoxConfig::testAssignmentOperator()
// verify the config2 values
QCOMPARE(config2.isShowTabBox(), !TabBoxConfig::defaultShowTabBox());
QCOMPARE(config2.isHighlightWindows(), !TabBoxConfig::defaultHighlightWindow());
QCOMPARE(config2.isShowOutline(), !TabBoxConfig::defaultShowOutline());
QCOMPARE(config2.tabBoxMode(), TabBoxConfig::DesktopTabBox);
QCOMPARE(config2.clientDesktopMode(), TabBoxConfig::AllDesktopsClients);
QCOMPARE(config2.clientActivitiesMode(), TabBoxConfig::AllActivitiesClients);

View File

@ -42,7 +42,6 @@ void TestTabBoxHandler::testDontCrashUpdateOutlineNullClient()
MockTabBoxHandler tabboxhandler;
TabBox::TabBoxConfig config;
config.setTabBoxMode(TabBox::TabBoxConfig::ClientTabBox);
config.setShowOutline(true);
config.setShowTabBox(false);
config.setHighlightWindows(false);
tabboxhandler.setConfig(config);