Merge branch 'KDE/4.10'

Conflicts:
	kwin/useractions.cpp
This commit is contained in:
Thomas Lübking 2013-03-24 22:29:50 +01:00
commit 16998db274
4 changed files with 48 additions and 14 deletions

View file

@ -103,6 +103,8 @@ Client::Client(Workspace* ws)
, wrapper(None)
, decoration(NULL)
, bridge(new Bridge(this))
, m_activityUpdatesBlocked(false)
, m_blockedActivityUpdatesRequireTransients(false)
, move_resize_grab_window(None)
, move_resize_has_keyboard_grab(false)
, m_managed(false)
@ -1551,15 +1553,28 @@ void Client::setOnActivities(QStringList newActivitiesList)
updateActivities(false);
}
void Client::blockActivityUpdates(bool b)
{
if (b) {
++m_activityUpdatesBlocked;
} else {
Q_ASSERT(m_activityUpdatesBlocked);
--m_activityUpdatesBlocked;
if (!m_activityUpdatesBlocked)
updateActivities(m_blockedActivityUpdatesRequireTransients);
}
}
/**
* update after activities changed
*/
void Client::updateActivities(bool includeTransients)
{
/* FIXME do I need this?
if ( decoration != NULL )
decoration->desktopChange();
*/
if (m_activityUpdatesBlocked) {
m_blockedActivityUpdatesRequireTransients |= includeTransients;
return;
}
m_blockedActivityUpdatesRequireTransients = false; // reset
if (includeTransients)
workspace()->updateOnAllActivitiesOfTransients(this);
FocusChain::self()->update(this, FocusChain::MakeFirst);

View file

@ -364,6 +364,7 @@ public:
void setOnAllActivities(bool set);
void setOnActivities(QStringList newActivitiesList);
void updateActivities(bool includeTransients);
void blockActivityUpdates(bool b = true);
/// Is not minimized and not hidden. I.e. normally visible on some virtual desktop.
bool isShown(bool shaded_is_shown) const;
@ -848,6 +849,8 @@ private:
Bridge* bridge;
int desk;
QStringList activityList;
int m_activityUpdatesBlocked;
bool m_blockedActivityUpdatesRequireTransients;
bool buttonDown;
bool moveResizeMode;
Window move_resize_grab_window;

View file

@ -159,11 +159,8 @@ bool AuroraeFactory::reset(unsigned long changed)
const QString themeName = group.readEntry("ThemeName", "example-deco");
const KConfig config("aurorae/themes/" + themeName + '/' + themeName + "rc", KConfig::FullConfig, "data");
const KConfigGroup themeGroup(&conf, themeName);
if (themeName != m_theme->themeName()) {
delete m_engine;
m_engine = new QDeclarativeEngine(this);
delete m_component;
m_component = new QDeclarativeComponent(m_engine, this);
if (themeName != m_themeName) {
m_engine->clearComponentCache();
init();
// recreate all decorations
return true;

View file

@ -54,8 +54,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <X11/extensions/xf86vmode.h>
#endif
#include <fixx11h.h>
#include <QCheckBox>
#include <QPushButton>
#include <QSlider>
#include <kglobalsettings.h>
#include <KDE/KIcon>
@ -156,9 +156,14 @@ void UserActionsMenu::show(const QRect &pos, const QWeakPointer<Client> &cl)
Workspace *ws = Workspace::self();
int x = pos.left();
int y = pos.bottom();
if (y == pos.top())
if (y == pos.top()) {
m_client.data()->blockActivityUpdates(true);
m_menu->exec(QPoint(x, y));
if (!m_client.isNull())
m_client.data()->blockActivityUpdates(false);
}
else {
m_client.data()->blockActivityUpdates(true);
QRect area = ws->clientArea(ScreenArea, QPoint(x, y), VirtualDesktopManager::self()->current());
menuAboutToShow(); // needed for sizeHint() to be correct :-/
int popupHeight = m_menu->sizeHint().height();
@ -166,6 +171,8 @@ void UserActionsMenu::show(const QRect &pos, const QWeakPointer<Client> &cl)
m_menu->exec(QPoint(x, y));
else
m_menu->exec(QPoint(x, pos.top() - popupHeight));
if (!m_client.isNull())
m_client.data()->blockActivityUpdates(true);
}
}
@ -710,13 +717,22 @@ void UserActionsMenu::activityPopupAboutToShow()
KActivities::Info activity(id);
QString name = activity.name();
name.replace('&', "&&");
action = m_activityMenu->addAction(KIcon(activity.icon()), name);
QWidgetAction *action = new QWidgetAction(m_activityMenu);
QCheckBox *box = new QCheckBox(name, m_activityMenu);
action->setDefaultWidget(box);
const QString icon = activity.icon();
if (!icon.isEmpty())
box->setIcon(KIcon(icon));
box->setBackgroundRole(m_activityMenu->backgroundRole());
box->setForegroundRole(m_activityMenu->foregroundRole());
box->setPalette(m_activityMenu->palette());
connect (box, SIGNAL(clicked(bool)), action, SIGNAL(triggered(bool)));
m_activityMenu->addAction(action);
action->setData(id);
action->setCheckable(true);
if (!m_client.isNull() &&
!m_client.data()->isOnAllActivities() && m_client.data()->isOnActivity(id))
action->setChecked(true);
box->setChecked(true);
}
#endif
}
@ -796,6 +812,9 @@ void UserActionsMenu::slotToggleOnActivity(QAction *action)
}
Workspace::self()->toggleClientOnActivity(m_client.data(), activity, false);
if (m_activityMenu && m_activityMenu->isVisible() && m_activityMenu->actions().count()) {
m_activityMenu->actions().at(0)->setChecked(m_client.data()->isOnAllActivities());
}
}
//****************************************