OSDN Git Service

generic: mostly KWin auditing
authorIvailo Monev <xakepa10@laimg.moc>
Thu, 1 Sep 2016 16:17:20 +0000 (16:17 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Thu, 1 Sep 2016 16:17:20 +0000 (16:17 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
19 files changed:
kcontrol/componentchooser/windowmanagers/compiz-custom.desktop
kcontrol/componentchooser/windowmanagers/kwin_gles.desktop [deleted file]
kwin/client.cpp
kwin/clients/oxygen/config/oxygenconfig.cpp
kwin/clients/oxygen/oxygenclient.cpp
kwin/clients/oxygen/oxygenexceptionlist.cpp
kwin/clients/oxygen/oxygenfactory.cpp
kwin/composite.cpp
kwin/compositingprefs.cpp
kwin/compositingprefs.h
kwin/effects/diminactive/diminactive.cpp
kwin/effects/taskbarthumbnail/taskbarthumbnail.cpp
kwin/effects/thumbnailaside/thumbnailaside.cpp
kwin/geometry.cpp
kwin/group.cpp
kwin/kcmkwin/kwinscreenedges/monitor.cpp
kwin/options.cpp
kwin/useractions.cpp
kwin/workspace.cpp

index f642834..2af5f92 100644 (file)
@@ -76,6 +76,6 @@ Name[x-test]=xxCompiz custom (create wrapper script 'compiz-kde-launcher' to lau
 Name[zh_CN]=Compiz 定制(创建包装脚本“compiz-kde-launcher”以启动它)
 Name[zh_TW]=Compiz 自訂(建立外包文稿 compiz-kde-launcher 來啟動)
 Exec=compiz-kde-launcher
-TryExec=compiz
+TryExec=compiz-kde-launcher
 X-KDE-WindowManagerId=compiz
 X-KDE-WindowManagerRestartArgument=--replace
diff --git a/kcontrol/componentchooser/windowmanagers/kwin_gles.desktop b/kcontrol/componentchooser/windowmanagers/kwin_gles.desktop
deleted file mode 100644 (file)
index 700557b..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-[Desktop Entry]
-Name=KWin GLES
-Exec=kwin_gles
-TryExec=kwin_gles
-X-KDE-WindowManagerRestartArgument=--replace
index 327f59a..ed21975 100644 (file)
@@ -1449,7 +1449,7 @@ void Client::setDesktop(int desktop)
         // the next desktop change
     {
         foreach (Client * c2, mainClients())
-        c2->setDesktop(desktop);
+            c2->setDesktop(desktop);
     }
 
     FocusChain::self()->update(this, FocusChain::MakeFirst);
index df1b76f..977fd1e 100644 (file)
@@ -88,8 +88,9 @@ namespace Oxygen
         loadConfiguration( configuration );
 
         // load shadows
-        foreach( ShadowConfigWidget* ui, _configWidget->shadowConfigurations )
-        { ui->readConfig( _configuration.data() ); }
+        foreach( ShadowConfigWidget* ui, _configWidget->shadowConfigurations ) {
+            ui->readConfig( _configuration.data() );
+        }
 
         // load exceptions
         ExceptionList exceptions;
@@ -136,8 +137,9 @@ namespace Oxygen
         ExceptionList( exceptions ).writeConfig( _configuration );
 
         // write shadow configuration
-        foreach( ShadowConfigWidget* ui, _configWidget->shadowConfigurations )
-        { ui->writeConfig( _configuration.data() ); }
+        foreach( ShadowConfigWidget* ui, _configWidget->shadowConfigurations ) {
+            ui->writeConfig( _configuration.data() );
+        }
 
         // sync configuration
         _configuration->sync();
@@ -157,8 +159,9 @@ namespace Oxygen
         loadConfiguration( configuration );
 
         // load shadows
-        foreach( ShadowConfigWidget* ui, _configWidget->shadowConfigurations )
-        { ui->readDefaults( _configuration.data() ); }
+        foreach( ShadowConfigWidget* ui, _configWidget->shadowConfigurations ) {
+            ui->readDefaults( _configuration.data() );
+        }
 
         updateChanged();
 
index d77809b..70f5336 100644 (file)
@@ -101,8 +101,9 @@ namespace Oxygen
         {
 
             QList<QLabel*> children( widget()->findChildren<QLabel*>() );
-            foreach( QLabel* widget, children )
-            { widget->setAutoFillBackground( false ); }
+            foreach( QLabel* widget, children ) {
+                widget->setAutoFillBackground( false );
+            }
 
             // also change shadow configuration size to something that fits in the preview list
             shadowCache().setShadowSize( QPalette::Active, 15 );
@@ -1360,8 +1361,7 @@ namespace Oxygen
 
             // update buttons
             QList<Button*> buttons( widget()->findChildren<Button*>() );
-            foreach( Button* button, buttons )
-            {
+            foreach( Button* button, buttons ) {
                 if( ( button->isVisible() || isPreview() ) && event->rect().intersects( button->geometry() ) )
                 {
 
@@ -1391,10 +1391,10 @@ namespace Oxygen
 
             // update buttons
             QList<Button*> buttons( widget()->findChildren<Button*>() );
-            foreach( Button* button, buttons )
-            {
-                if( event->rect().intersects( button->geometry() ) )
-                { button->update(); }
+            foreach( Button* button, buttons ) {
+                if( event->rect().intersects( button->geometry() ) ) {
+                    button->update();
+                }
             }
 
         }
index cf54f0a..6095d1c 100644 (file)
@@ -83,8 +83,7 @@ namespace Oxygen
 
         // rewrite current exceptions
         int index = 0;
-        foreach( const ConfigurationPtr& exception, _exceptions )
-        {
+        foreach( const ConfigurationPtr& exception, _exceptions ) {
 
             Util::writeConfig( exception.data(), config.data(), exceptionGroupName( index ) );
             ++index;
index e508d36..3b42420 100644 (file)
@@ -154,8 +154,7 @@ namespace Oxygen
 
         QString windowTitle;
         QString className;
-        foreach( const ConfigurationPtr& configuration, _exceptions )
-        {
+        foreach( const ConfigurationPtr& configuration, _exceptions ) {
 
             // discard disabled exceptions
             if( !configuration->enabled() ) continue;
index dab24ff..fc9592a 100644 (file)
@@ -258,13 +258,13 @@ void Compositor::finish()
     foreach (Deleted * c, Workspace::self()->deletedList())
         m_scene->windowDeleted(c);
     foreach (Client * c, Workspace::self()->clientList())
-    c->finishCompositing();
+        c->finishCompositing();
     foreach (Client * c, Workspace::self()->desktopList())
-    c->finishCompositing();
+        c->finishCompositing();
     foreach (Unmanaged * c, Workspace::self()->unmanagedList())
-    c->finishCompositing();
+        c->finishCompositing();
     foreach (Deleted * c, Workspace::self()->deletedList())
-    c->finishCompositing();
+        c->finishCompositing();
     xcb_composite_unredirect_subwindows(connection(), rootWindow(), XCB_COMPOSITE_REDIRECT_MANUAL);
     delete effects;
     effects = NULL;
@@ -545,9 +545,10 @@ void Compositor::performCompositing()
     // TODO ?
     // this cannot be used so carelessly - needs protections against broken clients, the window
     // should not get focus before it's displayed, handle unredirected windows properly and so on.
-    foreach (Toplevel *t, windows)
+    foreach (Toplevel *t, windows) {
         if (!t->readyForPainting())
             windows.removeAll(t);
+    }
 
     QRegion repaints = repaints_region;
     // clear all repaints, so that post-pass can add repaints for the next repaint
@@ -566,18 +567,22 @@ void Compositor::performCompositing()
 
 bool Compositor::windowRepaintsPending() const
 {
-    foreach (Toplevel * c, Workspace::self()->clientList())
-    if (!c->repaints().isEmpty())
-        return true;
-    foreach (Toplevel * c, Workspace::self()->desktopList())
-    if (!c->repaints().isEmpty())
-        return true;
-    foreach (Toplevel * c, Workspace::self()->unmanagedList())
-    if (!c->repaints().isEmpty())
-        return true;
-    foreach (Toplevel * c, Workspace::self()->deletedList())
-    if (!c->repaints().isEmpty())
-        return true;
+    foreach (Toplevel * c, Workspace::self()->clientList()) {
+        if (!c->repaints().isEmpty())
+            return true;
+    }
+    foreach (Toplevel * c, Workspace::self()->desktopList()) {
+        if (!c->repaints().isEmpty())
+            return true;
+    }
+    foreach (Toplevel * c, Workspace::self()->unmanagedList()) {
+        if (!c->repaints().isEmpty())
+            return true;
+    }
+    foreach (Toplevel * c, Workspace::self()->deletedList()) {
+        if (!c->repaints().isEmpty())
+            return true;
+    }
     return false;
 }
 
@@ -670,9 +675,9 @@ void Compositor::delayedCheckUnredirect()
     ToplevelList list;
     bool changed = forceUnredirectCheck;
     foreach (Client * c, Workspace::self()->clientList())
-    list.append(c);
+        list.append(c);
     foreach (Unmanaged * c, Workspace::self()->unmanagedList())
-    list.append(c);
+        list.append(c);
     foreach (Toplevel * c, list) {
         if (c->updateUnredirectedState())
             changed = true;
index 946f086..8154c40 100644 (file)
@@ -21,35 +21,15 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "config-kwin.h"
 
 #include "compositingprefs.h"
-
 #include "xcbutils.h"
 
-#include <kconfiggroup.h>
 #include <kdebug.h>
-#include <kxerrorhandler.h>
-#include <KGlobal>
-#include <KLocalizedString>
-#include <kdeversion.h>
-#include <ksharedconfig.h>
-#include <kstandarddirs.h>
-
-#include <qprocess.h>
+#include <klocale.h>
 
 
 namespace KWin
 {
 
-extern int screen_number; // main.cpp
-extern bool is_multihead;
-
-CompositingPrefs::CompositingPrefs()
-{
-}
-
-CompositingPrefs::~CompositingPrefs()
-{
-}
-
 bool CompositingPrefs::compositingPossible()
 {
     if (!Xcb::Extensions::self()->isCompositeAvailable()) {
index d65c801..6d7c11c 100644 (file)
@@ -22,7 +22,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define KWIN_COMPOSITINGPREFS_H
 
 #include <QString>
-#include <QStringList>
 
 #include "kwinglobals.h"
 
@@ -33,9 +32,6 @@ namespace KWin
 class CompositingPrefs
 {
 public:
-    CompositingPrefs();
-    ~CompositingPrefs();
-
     static bool compositingPossible();
     static QString compositingNotPossibleReason();
 };
index 6a4a287..af86e7b 100644 (file)
@@ -122,7 +122,7 @@ void DimInactiveEffect::slotWindowActivated(EffectWindow* w)
             if ((w == NULL || w->group() != active->group()) && active->group() != NULL) {
                 // repaint windows that are no longer in the active group
                 foreach (EffectWindow * tmp, active->group()->members())
-                tmp->addRepaintFull();
+                    tmp->addRepaintFull();
             }
         } else
             active->addRepaintFull();
@@ -133,7 +133,7 @@ void DimInactiveEffect::slotWindowActivated(EffectWindow* w)
             if (active->group() != NULL) {
                 // repaint newly active windows
                 foreach (EffectWindow * tmp, active->group()->members())
-                tmp->addRepaintFull();
+                    tmp->addRepaintFull();
             }
         } else
             active->addRepaintFull();
index e85b2ff..818768f 100644 (file)
@@ -87,10 +87,12 @@ void TaskbarThumbnailEffect::slotWindowDamaged(EffectWindow* w, const QRect& dam
 {
     Q_UNUSED(damage);
     // Update the thumbnail if the window was damaged
-    foreach (EffectWindow * window, thumbnails.uniqueKeys())
-    foreach (const Data & thumb, thumbnails.values(window))
-    if (w == effects->findWindow(thumb.window))
-        window->addRepaint(thumb.rect);
+    foreach (EffectWindow * window, thumbnails.uniqueKeys()) {
+        foreach (const Data & thumb, thumbnails.values(window)) {
+            if (w == effects->findWindow(thumb.window))
+                window->addRepaint(thumb.rect);
+        }
+    }
 }
 
 void TaskbarThumbnailEffect::slotWindowAdded(EffectWindow* w)
index 85f66e2..25ed3c3 100644 (file)
@@ -178,7 +178,7 @@ void ThumbnailAsideEffect::arrange()
 void ThumbnailAsideEffect::repaintAll()
 {
     foreach (const Data & d, windows)
-    effects->addRepaint(d.rect);
+        effects->addRepaint(d.rect);
 }
 
 bool ThumbnailAsideEffect::isActive() const
index 9a573b4..822f3a1 100644 (file)
@@ -333,9 +333,10 @@ QRegion Workspace::restrictedMoveArea(int desktop, StrutAreas areas) const
     if (desktop == NETWinInfo::OnAllDesktops || desktop == 0)
         desktop = VirtualDesktopManager::self()->current();
     QRegion region;
-    foreach (const StrutRect & rect, restrictedmovearea[desktop])
-    if (areas & rect.area())
-        region += rect;
+    foreach (const StrutRect & rect, restrictedmovearea[desktop]) {
+        if (areas & rect.area())
+            region += rect;
+    }
     return region;
 }
 
@@ -349,9 +350,10 @@ QRegion Workspace::previousRestrictedMoveArea(int desktop, StrutAreas areas) con
     if (desktop == NETWinInfo::OnAllDesktops || desktop == 0)
         desktop = VirtualDesktopManager::self()->current();
     QRegion region;
-    foreach (const StrutRect & rect, oldrestrictedmovearea.at(desktop))
-    if (areas & rect.area())
-        region += rect;
+    foreach (const StrutRect & rect, oldrestrictedmovearea.at(desktop)) {
+        if (areas & rect.area())
+            region += rect;
+    }
     return region;
 }
 
index c061e23..2251f7a 100644 (file)
@@ -384,7 +384,7 @@ void Workspace::updateMinimizedOfTransients(Client* c)
         }
         if (c->isModal()) { // if a modal dialog is minimized, minimize its mainwindow too
             foreach (Client * c2, c->mainClients())
-            c2->minimize();
+                c2->minimize();
         }
     } else {
         // else unmiminize the transients
@@ -398,7 +398,7 @@ void Workspace::updateMinimizedOfTransients(Client* c)
         }
         if (c->isModal()) {
             foreach (Client * c2, c->mainClients())
-            c2->unminimize();
+                c2->unminimize();
         }
     }
 }
@@ -923,7 +923,7 @@ ClientList Client::allMainClients() const
 {
     ClientList result = mainClients();
     foreach (const Client * cl, result)
-    result += cl->allMainClients();
+        result += cl->allMainClients();
     return result;
 }
 
index f567a12..2c5ed88 100644 (file)
@@ -163,9 +163,10 @@ void Monitor::selectEdgeItem(int edge, int index)
 
 int Monitor::selectedEdgeItem(int edge) const
 {
-    foreach (QAction * act, popup_actions[ edge ])
-    if (act->isChecked())
-        return popup_actions[ edge ].indexOf(act);
+    foreach (QAction * act, popup_actions[ edge ]) {
+        if (act->isChecked())
+            return popup_actions[ edge ].indexOf(act);
+    }
     abort();
 }
 
index e0ae576..e303b98 100644 (file)
@@ -27,7 +27,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include <QPalette>
 #include <QPixmap>
-#include <QProcess>
 #include <kapplication.h>
 #include <kconfig.h>
 #include <kglobal.h>
index 4ffccc3..5660692 100755 (executable)
@@ -1762,7 +1762,7 @@ void Workspace::slotInvertScreen()
 
     if (succeeded)
         return;
-#endif
+#endif // KWIN_NO_XF86VM
 
     if (!succeeded)
         kDebug(1212) << "sorry - neither Xrandr, nor XF86VidModeSetGammaRamp worked and there's no inversion supplying effect plugin either";
@@ -1791,11 +1791,9 @@ void Client::setShortcut(const QString& _cut)
     }
     QList< KShortcut > keys;
     QStringList groups = cut.split(" - ");
-    for (QStringList::ConstIterator it = groups.constBegin();
-            it != groups.constEnd();
-            ++it) {
+    foreach (const QString it, groups) {
         QRegExp reg("(.*\\+)\\((.*)\\)");
-        if (reg.indexIn(*it) > -1) {
+        if (reg.indexIn(it) > -1) {
             QString base = reg.cap(1);
             QString list = reg.cap(2);
             for (int i = 0;
@@ -1807,23 +1805,17 @@ void Client::setShortcut(const QString& _cut)
             }
         } else {
             // regexp doesn't match, so it should be a normal shortcut
-            KShortcut c(*it);
+            KShortcut c(it);
             if (!c.isEmpty()) {
                 keys.append(c);
             }
         }
     }
-    for (QList< KShortcut >::ConstIterator it = keys.constBegin();
-            it != keys.constEnd();
-            ++it) {
-        if (_shortcut == *it)   // current one is in the list
+    foreach (const KShortcut it, keys) {
+        if (_shortcut == it)   // current one is in the list
             return;
-    }
-    for (QList< KShortcut >::ConstIterator it = keys.constBegin();
-            it != keys.constEnd();
-            ++it) {
-        if (workspace()->shortcutAvailable(*it, this)) {
-            setShortcutInternal(*it);
+        if (workspace()->shortcutAvailable(it, this)) {
+            setShortcutInternal(it);
             return;
         }
     }
@@ -1855,15 +1847,13 @@ bool Workspace::shortcutAvailable(const KShortcut& cut, Client* ignore) const
 {
     if (ignore && cut == ignore->shortcut())
         return true;
-    Q_FOREACH (const QKeySequence &seq, cut.toList()) {
+    foreach (const QKeySequence &seq, cut.toList()) {
         if (!KGlobalAccel::getGlobalShortcutsByKey(seq).isEmpty()) {
             return false;
         }
     }
-    for (ClientList::ConstIterator it = clients.constBegin();
-            it != clients.constEnd();
-            ++it) {
-        if ((*it) != ignore && (*it)->shortcut() == cut)
+    foreach (const Client* it, clients) {
+        if (it != ignore && it->shortcut() == cut)
             return false;
     }
     return true;
index 4616867..00d84f3 100644 (file)
@@ -434,7 +434,7 @@ Workspace::~Workspace()
     delete Placement::self();
     delete client_keys_dialog;
     foreach (SessionInfo * s, session)
-    delete s;
+        delete s;
 
     // TODO: ungrabXServer();