Merge branch 'KDE/4.11'

Conflicts:
	ksmserver/screenlocker/greeter/greeterapp.cpp
	ksmserver/screenlocker/greeter/greeterapp.h
	ksmserver/screenlocker/greeter/themes/org.kde.passworddialog/contents/ui/main.qml
	kwin/libkwineffects/kwineffects.cpp
	kwin/useractions.cpp
	plasma/desktop/applets/window-list/metadata.desktop
	plasma/desktop/containments/panel/plasma-containment-panel.desktop
	plasma/desktop/toolboxes/plasma-toolbox-paneltoolbox.desktop
	plasma/generic/wallpapers/color/plasma-wallpaper-color.desktop
This commit is contained in:
Thomas Lübking 2013-11-24 15:35:17 +01:00
commit 26febda4a0
4 changed files with 79 additions and 44 deletions

View file

@ -913,7 +913,12 @@ void DesktopGridEffect::setHighlightedDesktop(int d)
{ {
if (d == highlightedDesktop || d <= 0 || d > effects->numberOfDesktops()) if (d == highlightedDesktop || d <= 0 || d > effects->numberOfDesktops())
return; return;
if (highlightedDesktop > 0 && highlightedDesktop <= hoverTimeline.count())
hoverTimeline[highlightedDesktop-1]->setCurrentTime(qMin(hoverTimeline[highlightedDesktop-1]->currentTime(),
hoverTimeline[highlightedDesktop-1]->duration()));
highlightedDesktop = d; highlightedDesktop = d;
if (highlightedDesktop <= hoverTimeline.count())
hoverTimeline[highlightedDesktop-1]->setCurrentTime(qMax(hoverTimeline[highlightedDesktop-1]->currentTime(), 0));
effects->addRepaintFull(); effects->addRepaintFull();
} }

View file

@ -987,15 +987,17 @@ WindowQuadList WindowQuadList::splitAtY(double y) const
return ret; return ret;
} }
WindowQuadList WindowQuadList::makeGrid(int maxquadsize) const WindowQuadList WindowQuadList::makeGrid(int maxQuadSize) const
{ {
if (empty()) if (empty())
return *this; return *this;
// find the bounding rectangle
// Find the bounding rectangle
double left = first().left(); double left = first().left();
double right = first().right(); double right = first().right();
double top = first().top(); double top = first().top();
double bottom = first().bottom(); double bottom = first().bottom();
foreach (const WindowQuad &quad, *this) { foreach (const WindowQuad &quad, *this) {
#ifndef NDEBUG #ifndef NDEBUG
if (quad.isTransformed()) if (quad.isTransformed())
@ -1006,22 +1008,33 @@ WindowQuadList WindowQuadList::makeGrid(int maxquadsize) const
top = qMin(top, quad.top()); top = qMin(top, quad.top());
bottom = qMax(bottom, quad.bottom()); bottom = qMax(bottom, quad.bottom());
} }
WindowQuadList ret; WindowQuadList ret;
for (double x = left;
x < right;
x += maxquadsize) {
for (double y = top;
y < bottom;
y += maxquadsize) {
foreach (const WindowQuad &quad, *this) { foreach (const WindowQuad &quad, *this) {
if (QRectF(QPointF(quad.left(), quad.top()), QPointF(quad.right(), quad.bottom())) const double quadLeft = quad.left();
.intersects(QRectF(x, y, maxquadsize, maxquadsize))) { const double quadRight = quad.right();
ret.append(quad.makeSubQuad(qMax(x, quad.left()), qMax(y, quad.top()), const double quadTop = quad.top();
qMin(quad.right(), x + maxquadsize), qMin(quad.bottom(), y + maxquadsize))); const double quadBottom = quad.bottom();
}
// Compute the top-left corner of the first intersecting grid cell
const double xBegin = left + qFloor((quadLeft - left) / maxQuadSize) * maxQuadSize;
const double yBegin = top + qFloor((quadTop - top) / maxQuadSize) * maxQuadSize;
// Loop over all intersecting cells and add sub-quads
for (double y = yBegin; y < quadBottom; y += maxQuadSize) {
const double y0 = qMax(y, quadTop);
const double y1 = qMin(quadBottom, y + maxQuadSize);
for (double x = xBegin; x < quadRight; x += maxQuadSize) {
const double x0 = qMax(x, quadLeft);
const double x1 = qMin(quadRight, x + maxQuadSize);
ret.append(quad.makeSubQuad(x0, y0, x1, y1));
} }
} }
} }
return ret; return ret;
} }
@ -1029,11 +1042,13 @@ WindowQuadList WindowQuadList::makeRegularGrid(int xSubdivisions, int ySubdivisi
{ {
if (empty()) if (empty())
return *this; return *this;
// find the bounding rectangle
// Find the bounding rectangle
double left = first().left(); double left = first().left();
double right = first().right(); double right = first().right();
double top = first().top(); double top = first().top();
double bottom = first().bottom(); double bottom = first().bottom();
foreach (const WindowQuad &quad, *this) { foreach (const WindowQuad &quad, *this) {
#ifndef NDEBUG #ifndef NDEBUG
if (quad.isTransformed()) if (quad.isTransformed())
@ -1045,24 +1060,35 @@ WindowQuadList WindowQuadList::makeRegularGrid(int xSubdivisions, int ySubdivisi
bottom = qMax(bottom, quad.bottom()); bottom = qMax(bottom, quad.bottom());
} }
double xincrement = (right - left) / xSubdivisions; double xIncrement = (right - left) / xSubdivisions;
double yincrement = (bottom - top) / ySubdivisions; double yIncrement = (bottom - top) / ySubdivisions;
WindowQuadList ret; WindowQuadList ret;
for (double y = top;
y < bottom;
y += yincrement) {
for (double x = left;
x < right;
x += xincrement) {
foreach (const WindowQuad &quad, *this) { foreach (const WindowQuad &quad, *this) {
if (QRectF(QPointF(quad.left(), quad.top()), QPointF(quad.right(), quad.bottom())) const double quadLeft = quad.left();
.intersects(QRectF(x, y, xincrement, yincrement))) { const double quadRight = quad.right();
ret.append(quad.makeSubQuad(qMax(x, quad.left()), qMax(y, quad.top()), const double quadTop = quad.top();
qMin(quad.right(), x + xincrement), qMin(quad.bottom(), y + yincrement))); const double quadBottom = quad.bottom();
}
// Compute the top-left corner of the first intersecting grid cell
const double xBegin = left + qFloor((quadLeft - left) / xIncrement) * xIncrement;
const double yBegin = top + qFloor((quadTop - top) / yIncrement) * yIncrement;
// Loop over all intersecting cells and add sub-quads
for (double y = yBegin; y < quadBottom; y += yIncrement) {
const double y0 = qMax(y, quadTop);
const double y1 = qMin(quadBottom, y + yIncrement);
for (double x = xBegin; x < quadRight; x += xIncrement) {
const double x0 = qMax(x, quadLeft);
const double x1 = qMin(quadRight, x + xIncrement);
ret.append(quad.makeSubQuad(x0, y0, x1, y1));
} }
} }
} }
return ret; return ret;
} }

View file

@ -668,7 +668,6 @@ void Client::packTo(int left, int top)
void Workspace::slotWindowPackLeft() void Workspace::slotWindowPackLeft()
{ {
if (active_client && active_client->isMovable()) if (active_client && active_client->isMovable())
active_client->screen();
active_client->packTo(packPositionLeft(active_client, active_client->geometry().left(), true), active_client->packTo(packPositionLeft(active_client, active_client->geometry().left(), true),
active_client->y()); active_client->y());
} }

View file

@ -1907,6 +1907,9 @@ void Client::setShortcut(const QString& _cut)
QString cut = rules()->checkShortcut(_cut); QString cut = rules()->checkShortcut(_cut);
if (cut.isEmpty()) if (cut.isEmpty())
return setShortcutInternal(); return setShortcutInternal();
if (cut == shortcut().toString()) {
return; // no change
}
// Format: // Format:
// base+(abcdef)<space>base+(abcdef) // base+(abcdef)<space>base+(abcdef)
// E.g. Alt+Ctrl+(ABCDEF);Meta+X,Meta+(ABCDEF) // E.g. Alt+Ctrl+(ABCDEF);Meta+X,Meta+(ABCDEF)
@ -1981,6 +1984,8 @@ void Client::delayedSetShortcut()
bool Workspace::shortcutAvailable(const QKeySequence &cut, Client* ignore) const bool Workspace::shortcutAvailable(const QKeySequence &cut, Client* ignore) const
{ {
if (ignore && cut == ignore->shortcut())
return true;
if (!KGlobalAccel::getGlobalShortcutsByKey(cut).isEmpty()) { if (!KGlobalAccel::getGlobalShortcutsByKey(cut).isEmpty()) {
return false; return false;