merge in kconfig changes to make it compile

svn path=/branches/work/kwin_composite/; revision=635791
This commit is contained in:
Dirk Mueller 2007-02-20 22:31:26 +00:00
parent ce11a2cd80
commit 249a84c5d9
11 changed files with 135 additions and 136 deletions

View file

@ -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 <mikelima@cirulla.net>
* Copyright (c) 2003,2004 Luciano Montanaro <mikelima@cirulla.net>
*/
#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;
@ -311,7 +311,8 @@ bool B2ClientFactory::reset(unsigned long changed)
bool B2ClientFactory::supports( Ability ability )
{
switch (ability) {
switch( ability )
{
case AbilityAnnounceButtons:
case AbilityButtonMenu:
case AbilityButtonOnAllDesktops:
@ -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);
@ -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

View file

@ -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);

View file

@ -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);

View file

@ -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" );
}

View file

@ -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" );
}

View file

@ -39,7 +39,6 @@
#include <QVBoxLayout>
#include <kmessagebox.h>
#include <qlabel.h>
#include <klocale.h>
#include <kcolorbutton.h>
#include <kconfig.h>
@ -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):<br><br>"
"<i>Option \"RenderAccel\" \"true\"</i><br>"
"In <i>Section \"Device\"</i></qt>"), 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);
}

View file

@ -22,6 +22,7 @@
#include <klocale.h>
#include <kwin.h>
#include <QtDBus/QtDBus>
#include <X11/Xlib.h>
#include <fixx11h.h>
@ -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;
}

View file

@ -18,7 +18,6 @@
#include "ruleslist.h"
#include <klistwidget.h>
#include <kpushbutton.h>
#include <assert.h>
#include <kdebug.h>
@ -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 );
}

View file

@ -14,7 +14,6 @@ License. See the file "COPYING" for the exact licensing terms.
#include "main.h"
#include <kglobal.h>
#include <klocale.h>
#include <stdlib.h>
#include <kcmdlineargs.h>
@ -26,12 +25,13 @@ License. See the file "COPYING" for the exact licensing terms.
#include <stdio.h>
#include <fixx11h.h>
#include <QtDBus/QtDBus>
#include "ksplash_interface.h"
#include <kglobal.h>
#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 );

View file

@ -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

View file

@ -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;