diff --git a/clients/b2/b2client.cpp b/clients/b2/b2client.cpp index 97368f805d..0ba2656b48 100644 --- a/clients/b2/b2client.cpp +++ b/clients/b2/b2client.cpp @@ -9,7 +9,7 @@ * Thin frame in fixed size windows, titlebar gradient support, accessibility * improvements, customizable menu double click action and button hover * effects are - * Copyright (c) 2003, 2004, 2006 Luciano Montanaro + * Copyright (c) 2003,2004 Luciano Montanaro */ #include "b2client.h" @@ -144,10 +144,10 @@ static void read_config(B2ClientFactory *f) thickness = 8; break; case KDecoration::BorderHuge: - case KDecoration::BorderVeryHuge: - case KDecoration::BorderOversized: thickness = 12; break; + case KDecoration::BorderVeryHuge: + case KDecoration::BorderOversized: case KDecoration::BorderNormal: default: thickness = 4; @@ -199,37 +199,37 @@ static void create_pixmaps() for (i = 0; i < NUM_PIXMAPS; i++) { switch (i / NumStates) { - case P_MAX: // will be initialized by copying P_CLOSE - case P_RESIZE: - pixmap[i] = new QPixmap(); - break; - case P_ICONIFY: - pixmap[i] = new QPixmap(10, 10); - break; - case P_SHADE: - case P_CLOSE: - pixmap[i] = new QPixmap(bsize, bsize); - break; - default: - pixmap[i] = new QPixmap(16, 16); - break; + case P_MAX: // will be initialized by copying P_CLOSE + case P_RESIZE: + pixmap[i] = new QPixmap(); + break; + case P_ICONIFY: + pixmap[i] = new QPixmap(10, 10); + break; + case P_SHADE: + case P_CLOSE: + pixmap[i] = new QPixmap(bsize, bsize); + break; + default: + pixmap[i] = new QPixmap(16, 16); + break; } } // there seems to be no way to load X bitmaps from data properly, so // we need to create new ones for each mask :P - QBitmap pinupMask = QBitmap::fromData(QSize(16, 16), pinup_mask_bits); + QBitmap pinupMask = QBitmap::fromData(QSize( 16, 16 ), pinup_mask_bits); PIXMAP_A(P_PINUP)->setMask(pinupMask); PIXMAP_I(P_PINUP)->setMask(pinupMask); - QBitmap pindownMask = QBitmap::fromData(QSize(16, 16), pindown_mask_bits); + QBitmap pindownMask = QBitmap::fromData(QSize( 16, 16 ), pindown_mask_bits); PIXMAP_AD(P_PINUP)->setMask(pindownMask); PIXMAP_ID(P_PINUP)->setMask(pindownMask); - QBitmap menuMask = QBitmap::fromData(QSize(16, 16), menu_mask_bits); + QBitmap menuMask = QBitmap::fromData(QSize( 16, 16 ), menu_mask_bits); for (i = 0; i < NumStates; i++) pixmap[P_MENU * NumStates + i]->setMask(menuMask); - QBitmap helpMask = QBitmap::fromData(QSize(16, 16), help_mask_bits); + QBitmap helpMask = QBitmap::fromData(QSize( 16, 16 ), help_mask_bits); for (i = 0; i < NumStates; i++) pixmap[P_HELP * NumStates + i]->setMask(helpMask); @@ -309,9 +309,10 @@ bool B2ClientFactory::reset(unsigned long changed) return needsReset; } -bool B2ClientFactory::supports(Ability ability) +bool B2ClientFactory::supports( Ability ability ) { - switch (ability) { + switch( ability ) + { case AbilityAnnounceButtons: case AbilityButtonMenu: case AbilityButtonOnAllDesktops: @@ -415,7 +416,7 @@ void B2Client::init() } // titlebar - g->addItem( new QSpacerItem(0, buttonSize + 4), 0, 0 ); + g->addItem( new QSpacerItem( 0, buttonSize + 4 ), 0, 0 ); titlebar = new B2Titlebar(this); titlebar->setMinimumWidth(buttonSize + 4); @@ -649,7 +650,7 @@ void B2Client::paintEvent(QPaintEvent* e) qDrawShadePanel(&p, 1, t.bottom() - thickness + 2, width() - 2, fHeight - 2 - bb + thickness, fillColor, false); if (thickness == 4) { - p.setPen(fillColor.color(QPalette::Background)); + p.setPen(fillColor.color( QPalette::Background ) ); p.drawRect(thickness - 2, t.bottom() - 1, width() - 2 * (thickness - 2), fHeight + 4 - bDepth); } else if (thickness > 4) { @@ -685,12 +686,12 @@ void B2Client::paintEvent(QPaintEvent* e) p.fillRect(hx + 1, height() - thickness - 3, hw - 2, thickness + 2, fillBrush); - p.setPen(fillColor.color(QPalette::Dark)); + p.setPen(fillColor.color( QPalette::Dark )); p.drawLine(width() - 2, height() - thickness - 4, width() - 2, height() - 2); p.drawLine(hx + 1, height() - 2, width() - 2, height() - 2); - p.setPen(fillColor.color(QPalette::Light)); + p.setPen(fillColor.color( QPalette::Light )); p.drawLine(hx + 1, height() - thickness - 2, hx + 1, height() - 3); p.drawLine(hx + 1, height() - thickness - 3, @@ -728,7 +729,7 @@ void B2Client::doShape() } if (t.right() < width() - 1) { mask -= QRect(width() - 1, - t.height() - thickness, 1, 1); // top right point + t.height() - thickness, 1, 1); //top right point mask -= QRect(t.right() + 1, 0, width() - t.right() - 1, t.height() - thickness); } @@ -855,7 +856,7 @@ void B2Client::activeChange() titlebar->repaint(); QColor c = options()->palette( - KDecoration::ColorTitleBar, isActive()).color(QPalette::Active, QPalette::Button); + KDecoration::ColorTitleBar, isActive()).color(QPalette::Active, QPalette::Button); for (int i = 0; i < BtnCount; i++) if (button[i]) { @@ -871,7 +872,7 @@ void B2Client::shadeChange() g->activate(); doShape(); if (B2Button *b = button[BtnShade]) { - b->setToolTip(isSetShade() ? i18n("Unshade") : i18n("Shade")); + b->setToolTip( isSetShade() ? i18n("Unshade") : i18n("Shade")); } } @@ -939,7 +940,7 @@ void B2Client::unobscureTitlebar() return; } in_unobs = 1; - QRegion reg(QRect(0, 0, width(), buttonSize + 4)); + QRegion reg(QRect(0,0,width(), buttonSize + 4)); reg = unobscuredRegion(reg); if (!reg.isEmpty()) { // there is at least _one_ pixel from our title area, which is not @@ -954,8 +955,8 @@ void B2Client::unobscureTitlebar() static void redraw_pixmaps() { int i; - QPalette aGrp = options()->palette(KDecoration::ColorButtonBg, true); - QPalette iGrp = options()->palette(KDecoration::ColorButtonBg, false); + QPalette aGrp = options()->palette(KDecoration::ColorButtonBg, true); + QPalette iGrp = options()->palette(KDecoration::ColorButtonBg, false); // close drawB2Rect(PIXMAP_A(P_CLOSE), aGrp.color( QPalette::Button ), false); @@ -1136,10 +1137,10 @@ bool B2Client::drawbound(const QRect& geom, bool clear) if (barRight > geom.right()) barRight = geom.right(); // line width is 5 pixels, so compensate for the 2 outer pixels (#88657) QRect g = geom; - g.setLeft(g.left() + 2); - g.setTop(g.top() + 2); - g.setRight(g.right() - 2); - g.setBottom(g.bottom() - 2); + g.setLeft( g.left() + 2 ); + g.setTop( g.top() + 2 ); + g.setRight( g.right() - 2 ); + g.setBottom( g.bottom() - 2 ); frameTop += 2; barLeft += 2; barRight -= 2; @@ -1208,7 +1209,7 @@ B2Button::B2Button(B2Client *_client, QWidget *parent, client = _client; useMiniIcon = false; setFixedSize(buttonSize, buttonSize); - this->setToolTip(tip); + this->setToolTip( tip); } @@ -1231,8 +1232,7 @@ void B2Button::drawButton(QPainter *p) p->fillRect(rect(), bg); } if (useMiniIcon) { - QPixmap miniIcon = client->icon().pixmap( - style()->pixelMetric(QStyle::PM_SmallIconSize), + QPixmap miniIcon = client->icon().pixmap(style()->pixelMetric( QStyle::PM_SmallIconSize ), client->isActive() ? QIcon::Normal : QIcon::Disabled); p->drawPixmap((width() - miniIcon.width()) / 2, (height() - miniIcon.height()) / 2, miniIcon); @@ -1386,7 +1386,7 @@ void B2Titlebar::resizeEvent(QResizeEvent *) void B2Titlebar::paintEvent(QPaintEvent *) { - if (client->isActive()) + if(client->isActive()) bitBlt(this, 0, 0, &titleBuffer, 0, 0, titleBuffer.width(), titleBuffer.height()); else { @@ -1436,6 +1436,6 @@ void B2Titlebar::mouseMoveEvent(QMouseEvent * e) #include "b2client.moc" -// vim: sw=4 ts=8 +// vim: sw=4 #endif // CLIENTS/B2/B2CLIENT.CPP diff --git a/clients/modernsystem/modernsys.cpp b/clients/modernsystem/modernsys.cpp index 76c0fc179b..7afb9e84a7 100644 --- a/clients/modernsystem/modernsys.cpp +++ b/clients/modernsystem/modernsys.cpp @@ -294,7 +294,8 @@ ModernButton::ModernButton(ButtonType type, ModernSys *parent, const char *name) setObjectName( name ); setAttribute(Qt::WA_NoSystemBackground, true); - QBitmap mask = QBitmap::fromData( QSize(14, 15), QPixmap::defaultDepth() > 8 ? btnhighcolor_mask_bits : lowcolor_mask_bits); + QBitmap mask(14, 15, QPixmap::defaultDepth() > 8 ? + btnhighcolor_mask_bits : lowcolor_mask_bits, true); resize(14, 15); setMask(mask); @@ -343,7 +344,7 @@ void ModernButton::reset(unsigned long changed) void ModernButton::setBitmap(const unsigned char *bitmap) { if (bitmap) - deco = QBitmap::fromData( QSize(8, 8), bitmap); + deco = QBitmap(8, 8, bitmap, true); else { deco = QBitmap(8,8); deco.fill(Qt::color0); diff --git a/clients/redmond/redmond.cpp b/clients/redmond/redmond.cpp index ca7c24a7f4..1487814682 100644 --- a/clients/redmond/redmond.cpp +++ b/clients/redmond/redmond.cpp @@ -288,7 +288,7 @@ void RedmondButton::setBitmap(const unsigned char *bitmap) pix = QPixmap(); if (bitmap) - deco = QBitmap::fromData( QSize(10, 10), bitmap); + deco = QBitmap(10, 10, bitmap, true); else { deco = QBitmap(10,10); deco.fill(Qt::color0); diff --git a/kcmkwin/kwindecoration/kwindecoration.cpp b/kcmkwin/kwindecoration/kwindecoration.cpp index 08a52f6f2a..6d5d5cee43 100644 --- a/kcmkwin/kwindecoration/kwindecoration.cpp +++ b/kcmkwin/kwindecoration/kwindecoration.cpp @@ -531,11 +531,8 @@ void KWinDecorationModule::save() emit pluginSave( kwinConfig ); kwinConfig.sync(); - // Send signal to all kwin instances - QDBusMessage message = - QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig"); - QDBusConnection::sessionBus().send(message); - + QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" ); + kwin.call( "reconfigure" ); } diff --git a/kcmkwin/kwinoptions/main.cpp b/kcmkwin/kwinoptions/main.cpp index a696c472f8..c28acb55d6 100644 --- a/kcmkwin/kwinoptions/main.cpp +++ b/kcmkwin/kwinoptions/main.cpp @@ -33,6 +33,7 @@ #include "mouse.h" #include "windows.h" + #include "main.h" static KComponentData *_kcmkwm = 0; @@ -179,12 +180,12 @@ void KWinOptions::save() emit KCModule::changed( false ); // Send signal to kwin mConfig->sync(); - // Send signal to all kwin instances - QDBusMessage message = - QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig"); - QDBusConnection::sessionBus().send(message); - - +#ifdef __GNUC__ +#warning D-BUS TODO +// All these calls in kcmkwin modules should be actually kwin*, because of multihead. +#endif + QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" ); + kwin.call( "reconfigure" ); } @@ -259,11 +260,8 @@ void KActionsOptions::save() emit KCModule::changed( false ); // Send signal to kwin mConfig->sync(); - // Send signal to all kwin instances - QDBusMessage message = - QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig"); - QDBusConnection::sessionBus().send(message); - + QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" ); + kwin.call( "reconfigure" ); } diff --git a/kcmkwin/kwinoptions/windows.cpp b/kcmkwin/kwinoptions/windows.cpp index cf4e256da7..7192c044b3 100644 --- a/kcmkwin/kwinoptions/windows.cpp +++ b/kcmkwin/kwinoptions/windows.cpp @@ -39,7 +39,6 @@ #include #include -#include #include #include #include @@ -57,6 +56,7 @@ #include "windows.h" + // kwin config keywords #define KWIN_FOCUS "FocusPolicy" #define KWIN_PLACEMENT "Placement" @@ -496,10 +496,8 @@ void KFocusConfig::save( void ) if (standAlone) { config->sync(); - // Send signal to all kwin instances - QDBusMessage message = - QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig"); - QDBusConnection::sessionBus().send(message); + QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" ); + kwin.call( "reconfigure" ); } emit KCModule::changed(false); } @@ -690,7 +688,7 @@ void KAdvancedConfig::load( void ) setShadeHover(config->readEntry(KWIN_SHADEHOVER, false)); setShadeHoverInterval(config->readEntry(KWIN_SHADEHOVER_INTERVAL, 250)); - setElectricBorders(config->readEntry(KWM_ELECTRIC_BORDER, 0)); + setElectricBorders(config->readEntry(KWM_ELECTRIC_BORDER, false)); setElectricBorderDelay(config->readEntry(KWM_ELECTRIC_BORDER_DELAY, 150)); // setFocusStealing( config->readEntry(KWIN_FOCUS_STEALING, 2 )); @@ -725,11 +723,8 @@ void KAdvancedConfig::save( void ) if (standAlone) { config->sync(); - // Send signal to all kwin instances - QDBusMessage message = - QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig"); - QDBusConnection::sessionBus().send(message); - + QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" ); + kwin.call( "reconfigure" ); } emit KCModule::changed(false); } @@ -1192,10 +1187,8 @@ void KMovingConfig::save( void ) if (standAlone) { config->sync(); - // Send signal to all kwin instances - QDBusMessage message = - QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig"); - QDBusConnection::sessionBus().send(message); + QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" ); + kwin.call( "reconfigure" ); } emit KCModule::changed(false); } @@ -1261,8 +1254,6 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, KConfig *_config, co "And if your GPU provides hardware-accelerated Xrender support (mainly nVidia cards):

" "Option \"RenderAccel\" \"true\"
" "In Section \"Device\""), this); - label->setOpenExternalLinks(true); - label->setTextInteractionFlags(Qt::LinksAccessibleByMouse); lay->addWidget(label); } else @@ -1483,10 +1474,8 @@ void KTranslucencyConfig::load( void ) if (!kompmgrAvailable_) return; - config->setGroup( "Notification Messages" ); - useTranslucency->setChecked(config->readEntry("UseTranslucency", false)); - config->setGroup( "Translucency" ); + useTranslucency->setChecked(config->readEntry("UseTranslucency", false)); activeWindowTransparency->setChecked(config->readEntry("TranslucentActiveWindows", false)); inactiveWindowTransparency->setChecked(config->readEntry("TranslucentInactiveWindows", true)); movingWindowTransparency->setChecked(config->readEntry("TranslucentMovingWindows", false)); @@ -1546,10 +1535,8 @@ void KTranslucencyConfig::save( void ) { if (!kompmgrAvailable_) return; - config->setGroup( "Notification Messages" ); - config->writeEntry("UseTranslucency",useTranslucency->isChecked()); - config->setGroup( "Translucency" ); + config->writeEntry("UseTranslucency",useTranslucency->isChecked()); config->writeEntry("TranslucentActiveWindows",activeWindowTransparency->isChecked()); config->writeEntry("TranslucentInactiveWindows",inactiveWindowTransparency->isChecked()); config->writeEntry("TranslucentMovingWindows",movingWindowTransparency->isChecked()); @@ -1599,11 +1586,8 @@ void KTranslucencyConfig::save( void ) if (standAlone) { config->sync(); - // Send signal to all kwin instances - QDBusMessage message = - QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig"); - QDBusConnection::sessionBus().send(message); - + QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" ); + kwin.call( "reconfigure" ); } emit KCModule::changed(false); } diff --git a/kcmkwin/kwinrules/main.cpp b/kcmkwin/kwinrules/main.cpp index f814d86a07..001263950f 100644 --- a/kcmkwin/kwinrules/main.cpp +++ b/kcmkwin/kwinrules/main.cpp @@ -22,6 +22,7 @@ #include #include #include + #include #include @@ -256,10 +257,8 @@ static int edit( Window wid, bool whole_app ) delete orig_rule; } saveRules( rules ); - // Send signal to all kwin instances - QDBusMessage message = - QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig"); - QDBusConnection::sessionBus().send(message); + QDBusInterface kwin( "org.kde.kwin", "/KWin", "org.kde.KWin" ); + kwin.call( "reconfigure" ); return 0; } diff --git a/kcmkwin/kwinrules/ruleslist.cpp b/kcmkwin/kwinrules/ruleslist.cpp index f2249428ae..946b606cdd 100644 --- a/kcmkwin/kwinrules/ruleslist.cpp +++ b/kcmkwin/kwinrules/ruleslist.cpp @@ -18,7 +18,6 @@ #include "ruleslist.h" -#include #include #include #include @@ -29,14 +28,14 @@ namespace KWinInternal { -KCMRulesList::KCMRulesList( QWidget* parent) -: KCMRulesListBase( parent) +KCMRulesList::KCMRulesList( QWidget* parent, const char* name ) +: KCMRulesListBase( parent, name ) { // connect both current/selected, so that current==selected (stupid QListBox :( ) - connect( rules_listbox, SIGNAL(itemChanged(QListWidgetItem*)), - SLOT(activeChanged(QListWidgetItem*))); - connect( rules_listbox, SIGNAL( selectionChanged( QListWidgetItem* )), - SLOT( activeChanged( QListWidgetItem*))); + connect( rules_listbox, SIGNAL( currentChanged( Q3ListBoxItem* )), + SLOT( activeChanged( Q3ListBoxItem*))); + connect( rules_listbox, SIGNAL( selectionChanged( Q3ListBoxItem* )), + SLOT( activeChanged( Q3ListBoxItem*))); connect( new_button, SIGNAL( clicked()), SLOT( newClicked())); connect( modify_button, SIGNAL( clicked()), @@ -47,7 +46,7 @@ KCMRulesList::KCMRulesList( QWidget* parent) SLOT( moveupClicked())); connect( movedown_button, SIGNAL( clicked()), SLOT( movedownClicked())); - connect( rules_listbox, SIGNAL(itemDoubleClicked(QListWidgetItem*) ), + connect( rules_listbox, SIGNAL( doubleClicked ( Q3ListBoxItem * ) ), SLOT( modifyClicked())); load(); } @@ -61,16 +60,14 @@ KCMRulesList::~KCMRulesList() rules.clear(); } -void KCMRulesList::activeChanged( QListWidgetItem* item ) +void KCMRulesList::activeChanged( Q3ListBoxItem* item ) { - int itemRow = rules_listbox->row(item); - if( item != NULL ) - item->setSelected( true ); // make current==selected + rules_listbox->setSelected( item, true ); // make current==selected modify_button->setEnabled( item != NULL ); delete_button->setEnabled( item != NULL ); - moveup_button->setEnabled( item != NULL && itemRow > 0 ); - movedown_button->setEnabled( item != NULL && itemRow < (rules_listbox->count()-1) ); + moveup_button->setEnabled( item != NULL && item->prev() != NULL ); + movedown_button->setEnabled( item != NULL && item->next() != NULL ); } void KCMRulesList::newClicked() @@ -79,16 +76,16 @@ void KCMRulesList::newClicked() Rules* rule = dlg.edit( NULL, 0, false ); if( rule == NULL ) return; - int pos = rules_listbox->currentRow() + 1; - rules_listbox->insertItem( pos , rule->description ); - rules_listbox->item(pos)->setSelected( true ); + int pos = rules_listbox->currentItem() + 1; + rules_listbox->insertItem( rule->description, pos ); + rules_listbox->setSelected( pos, true ); rules.insert( rules.begin() + pos, rule ); emit changed( true ); } void KCMRulesList::modifyClicked() { - int pos = rules_listbox->currentRow(); + int pos = rules_listbox->currentItem(); if ( pos == -1 ) return; RulesDialog dlg; @@ -97,29 +94,29 @@ void KCMRulesList::modifyClicked() return; delete rules[ pos ]; rules[ pos ] = rule; - rules_listbox->item(pos)->setText( rule->description ); + rules_listbox->changeItem( rule->description, pos ); emit changed( true ); } void KCMRulesList::deleteClicked() { - int pos = rules_listbox->currentRow(); + int pos = rules_listbox->currentItem(); assert( pos != -1 ); - delete rules_listbox->takeItem( pos ); + rules_listbox->removeItem( pos ); rules.erase( rules.begin() + pos ); emit changed( true ); } void KCMRulesList::moveupClicked() { - int pos = rules_listbox->currentRow(); + int pos = rules_listbox->currentItem(); assert( pos != -1 ); if( pos > 0 ) { - QString txt = rules_listbox->item(pos)->text(); - delete rules_listbox->takeItem( pos ); - rules_listbox->insertItem( pos - 1 , txt ); - rules_listbox->item(pos-1)->setSelected( true ); + QString txt = rules_listbox->text( pos ); + rules_listbox->removeItem( pos ); + rules_listbox->insertItem( txt, pos - 1 ); + rules_listbox->setSelected( pos - 1, true ); Rules* rule = rules[ pos ]; rules[ pos ] = rules[ pos - 1 ]; rules[ pos - 1 ] = rule; @@ -129,14 +126,14 @@ void KCMRulesList::moveupClicked() void KCMRulesList::movedownClicked() { - int pos = rules_listbox->currentRow(); + int pos = rules_listbox->currentItem(); assert( pos != -1 ); if( pos < int( rules_listbox->count()) - 1 ) { - QString txt = rules_listbox->item(pos)->text(); - delete rules_listbox->takeItem( pos ); - rules_listbox->insertItem( pos + 1 , txt); - rules_listbox->item(pos+1)->setSelected( true ); + QString txt = rules_listbox->text( pos ); + rules_listbox->removeItem( pos ); + rules_listbox->insertItem( txt, pos + 1 ); + rules_listbox->setSelected( pos + 1, true ); Rules* rule = rules[ pos ]; rules[ pos ] = rules[ pos + 1 ]; rules[ pos + 1 ] = rule; @@ -163,10 +160,10 @@ void KCMRulesList::load() cfg.changeGroup( QString::number( i )); Rules* rule = new Rules( cfg ); rules.append( rule ); - rules_listbox->addItem( rule->description ); + rules_listbox->insertItem( rule->description ); } if( rules.count() > 0 ) - rules_listbox->item(0)->setSelected( true ); + rules_listbox->setSelected( 0, true ); else activeChanged( NULL ); } diff --git a/main.cpp b/main.cpp index 795aeea61d..11506af306 100644 --- a/main.cpp +++ b/main.cpp @@ -14,7 +14,6 @@ License. See the file "COPYING" for the exact licensing terms. #include "main.h" -#include #include #include #include @@ -26,12 +25,13 @@ License. See the file "COPYING" for the exact licensing terms. #include #include #include -#include "ksplash_interface.h" +#include #include "atoms.h" #include "options.h" #include "sm.h" #include "utils.h" +#include "effects.h" #define INT8 _X11INT8 #define INT32 _X11INT32 @@ -121,6 +121,8 @@ Application::Application( ) options = new Options; atoms = new Atoms; + initting = false; // TODO + // create workspace. (void) new Workspace( isSessionRestored() ); @@ -128,9 +130,8 @@ Application::Application( ) initting = false; // startup done, we are up and running now. - org::kde::KSplash ksplash("org.kde.ksplash", "/KSplash", QDBusConnection::sessionBus()); - ksplash.upAndRunning(QString( "wm started" )); - + QDBusInterface ksplash( "org.kde.ksplash", "/ksplash", "org.kde.KSplash" ); + ksplash.call( "upAndRunning", QString( "wm started" )); XEvent e; e.xclient.type = ClientMessage; e.xclient.message_type = XInternAtom( display(), "_KDE_SPLASH_PROGRESS", False ); @@ -147,6 +148,8 @@ Application::~Application() if( owner.ownerWindow() != None ) // if there was no --replace (no new WM) XSetInputFocus( display(), PointerRoot, RevertToPointerRoot, xTime() ); delete options; + delete effects; + delete atoms; } void Application::lostSelection() @@ -281,9 +284,9 @@ KDE_EXPORT int kdemain( int argc, char * argv[] ) QString appname; if (KWinInternal::screen_number == 0) - appname = "org.kde.kwin"; + appname = "kwin"; else - appname.sprintf("org.kde.kwin-screen-%d", KWinInternal::screen_number); + appname.sprintf("kwin-screen-%d", KWinInternal::screen_number); QDBusConnection::sessionBus().interface()->registerService( appname, QDBusConnectionInterface::DontQueueService ); diff --git a/options.cpp b/options.cpp index 85451cd4b7..5a486ae663 100644 --- a/options.cpp +++ b/options.cpp @@ -174,9 +174,8 @@ unsigned long Options::updateSettings() CmdAllWheel = mouseWheelCommand(config->readEntry("CommandAllWheel","Nothing")); //translucency settings - TODO - config->setGroup( "Notification Messages" ); - useTranslucency = config->readEntry("UseTranslucency", false); config->setGroup( "Translucency"); + useTranslucency = config->readEntry("UseTranslucency", true); translucentActiveWindows = config->readEntry("TranslucentActiveWindows", false); activeWindowOpacity = uint((config->readEntry("ActiveWindowOpacity", 100)/100.0)*0xFFFFFFFF); translucentInactiveWindows = config->readEntry("TranslucentInactiveWindows", false); @@ -195,6 +194,27 @@ unsigned long Options::updateSettings() removeShadowsOnResize = config->readEntry("RemoveShadowsOnResize", true); onlyDecoTranslucent = config->readEntry("OnlyDecoTranslucent", false); + refreshRate = config->readEntry( "RefreshRate", 0 ); + smoothScale = qBound( -1, config->readEntry( "SmoothScale", -1 ), 2 ); + + QString glmode = config->readEntry("GLMode", "TFP" ).upper(); + if( glmode == "TFP" ) + glMode = GLTFP; + else if( glmode == "SHM" ) + glMode = GLSHM; + else + glMode = GLFallback; + glAlwaysRebind = config->readEntry("GLAlwaysRebind", false ); + glDirect = config->readEntry("GLDirect", true ); + glVSync = config->readEntry("GLVSync", true ); + + config->setGroup( "Effects" ); + defaultEffects = config->readEntry( "Load", QStringList() << "ShowFps" << "Fade" ); + + config->setGroup( "EffectShowFps" ); + effectShowFpsAlpha = config->readEntry( "Alpha", 0.5 ); + effectShowFpsX = config->readEntry( "X", -10000 ); + effectShowFpsY = config->readEntry( "Y", 0 ); // Read button tooltip animation effect from kdeglobals // Since we want to allow users to enable window decoration tooltips // and not kstyle tooltips and vise-versa, we don't read the diff --git a/popupinfo.cpp b/popupinfo.cpp index 999b764c74..c7594efe4b 100644 --- a/popupinfo.cpp +++ b/popupinfo.cpp @@ -66,7 +66,7 @@ PopupInfo::~PopupInfo() */ void PopupInfo::reset() { - QRect r = KGlobalSettings::desktopGeometry(QCursor::pos()); + QRect r = KGlobalSettings::desktopGeometry(cursorPos()); int w = fontMetrics().width( m_infoString ) + 30;