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
+++ /dev/null
-[Desktop Entry]
-Name=KWin GLES
-Exec=kwin_gles
-TryExec=kwin_gles
-X-KDE-WindowManagerRestartArgument=--replace
// the next desktop change
{
foreach (Client * c2, mainClients())
- c2->setDesktop(desktop);
+ c2->setDesktop(desktop);
}
FocusChain::self()->update(this, FocusChain::MakeFirst);
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;
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();
loadConfiguration( configuration );
// load shadows
- foreach( ShadowConfigWidget* ui, _configWidget->shadowConfigurations )
- { ui->readDefaults( _configuration.data() ); }
+ foreach( ShadowConfigWidget* ui, _configWidget->shadowConfigurations ) {
+ ui->readDefaults( _configuration.data() );
+ }
updateChanged();
{
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 );
// 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() ) )
{
// 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();
+ }
}
}
// 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;
QString windowTitle;
QString className;
- foreach( const ConfigurationPtr& configuration, _exceptions )
- {
+ foreach( const ConfigurationPtr& configuration, _exceptions ) {
// discard disabled exceptions
if( !configuration->enabled() ) continue;
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;
// 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
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;
}
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;
#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()) {
#define KWIN_COMPOSITINGPREFS_H
#include <QString>
-#include <QStringList>
#include "kwinglobals.h"
class CompositingPrefs
{
public:
- CompositingPrefs();
- ~CompositingPrefs();
-
static bool compositingPossible();
static QString compositingNotPossibleReason();
};
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();
if (active->group() != NULL) {
// repaint newly active windows
foreach (EffectWindow * tmp, active->group()->members())
- tmp->addRepaintFull();
+ tmp->addRepaintFull();
}
} else
active->addRepaintFull();
{
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)
void ThumbnailAsideEffect::repaintAll()
{
foreach (const Data & d, windows)
- effects->addRepaint(d.rect);
+ effects->addRepaint(d.rect);
}
bool ThumbnailAsideEffect::isActive() 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;
}
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;
}
}
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
}
if (c->isModal()) {
foreach (Client * c2, c->mainClients())
- c2->unminimize();
+ c2->unminimize();
}
}
}
{
ClientList result = mainClients();
foreach (const Client * cl, result)
- result += cl->allMainClients();
+ result += cl->allMainClients();
return result;
}
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();
}
#include <QPalette>
#include <QPixmap>
-#include <QProcess>
#include <kapplication.h>
#include <kconfig.h>
#include <kglobal.h>
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";
}
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;
}
} 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;
}
}
{
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;
delete Placement::self();
delete client_keys_dialog;
foreach (SessionInfo * s, session)
- delete s;
+ delete s;
// TODO: ungrabXServer();