Added option to turn off hiding utility windows for inactive applications.

BUG: 103921


svn path=/trunk/KDE/kdebase/kwin/; revision=412381
This commit is contained in:
Luboš Luňák 2005-05-11 14:49:01 +00:00
parent c8088bb731
commit 5e1f36f580
5 changed files with 31 additions and 1 deletions

View file

@ -75,6 +75,7 @@
#define KWIN_SHADEHOVER "ShadeHover"
#define KWIN_SHADEHOVER_INTERVAL "ShadeHoverInterval"
#define KWIN_FOCUS_STEALING "FocusStealingPreventionLevel"
#define KWIN_HIDE_UTILITY "HideUtilityWindowsForInactive"
// kwm config keywords
#define KWM_ELECTRIC_BORDER "ElectricBorders"
@ -608,9 +609,16 @@ KAdvancedConfig::KAdvancedConfig (bool _standAlone, KConfig *_config, QWidget *p
"</ul>" );
QWhatsThis::add( focusStealing, wtstr );
QWhatsThis::add( focusStealingLabel, wtstr );
connect(focusStealing, SIGNAL(activated(int)), SLOT(changed()));
hideUtilityWindowsForInactive = new QCheckBox( i18n( "Hide utility windows for inactive applications" ), this );
QWhatsThis::add( hideUtilityWindowsForInactive,
i18n( "When turned on, utility windows (tool windows, torn-off menus,...) of inactive applications will be"
" hidden and will be shown only when the application becomes active. Note that applications"
" have to mark the windows with the proper window type for this feature to work." ));
connect(hideUtilityWindowsForInactive, SIGNAL(toggled(bool)), SLOT(changed()));
lay->addWidget( hideUtilityWindowsForInactive );
lay->addStretch();
load();
@ -643,6 +651,10 @@ void KAdvancedConfig::setFocusStealing(int l) {
focusStealing->setCurrentItem(l);
}
void KAdvancedConfig::setHideUtilityWindowsForInactive(bool s) {
hideUtilityWindowsForInactive->setChecked( s );
}
void KAdvancedConfig::load( void )
{
config->setGroup( "Windows" );
@ -657,6 +669,7 @@ void KAdvancedConfig::load( void )
// setFocusStealing( config->readNumEntry(KWIN_FOCUS_STEALING, 2 ));
// TODO default to low for now
setFocusStealing( config->readNumEntry(KWIN_FOCUS_STEALING, 1 ));
setHideUtilityWindowsForInactive( config->readBoolEntry( KWIN_HIDE_UTILITY, true ));
emit KCModule::changed(false);
}
@ -680,6 +693,7 @@ void KAdvancedConfig::save( void )
config->writeEntry(KWM_ELECTRIC_BORDER_DELAY,getElectricBorderDelay());
config->writeEntry(KWIN_FOCUS_STEALING, focusStealing->currentItem());
config->writeEntry(KWIN_HIDE_UTILITY, hideUtilityWindowsForInactive->isChecked());
if (standAlone)
{
@ -701,6 +715,7 @@ void KAdvancedConfig::defaults()
// setFocusStealing(2);
// TODO default to low for now
setFocusStealing(1);
setHideUtilityWindowsForInactive( true );
emit KCModule::changed(true);
}

View file

@ -223,8 +223,10 @@ private:
KIntNumInput *delays;
void setFocusStealing( int );
void setHideUtilityWindowsForInactive( bool );
QComboBox* focusStealing;
QCheckBox* hideUtilityWindowsForInactive;
};
class KProcess;

View file

@ -151,6 +151,7 @@ unsigned long Options::updateSettings()
(*it) = (*it).lower();
killPingTimeout = config->readNumEntry( "KillPingTimeout", 5000 );
hideUtilityWindowsForInactive = config->readBoolEntry( "HideUtilityWindowsForInactive", false );
// Mouse bindings
config->setGroup( "MouseBindings");

View file

@ -277,6 +277,9 @@ class Options : public KDecorationOptions
// timeout before non-responding application will be killed after attempt to close
int killPingTimeout;
// Whether to hide utility windows for inactive applications.
bool hideUtilityWindowsForInactive;
//translucency settings
bool useTranslucency;
bool translucentActiveWindows;

View file

@ -681,6 +681,14 @@ void Workspace::updateCurrentTopMenu()
void Workspace::updateToolWindows( bool also_hide )
{
// TODO what if Client's transiency/group changes? should this be called too? (I'm paranoid, am I not?)
if( !options->hideUtilityWindowsForInactive )
{
for( ClientList::ConstIterator it = clients.begin();
it != clients.end();
++it )
(*it)->hideClient( false );
return;
}
const Group* group = NULL;
const Client* client = active_client;
// Go up in transiency hiearchy, if the top is found, only tool transients for the top mainwindow
@ -816,6 +824,7 @@ void Workspace::slotReconfigure()
popupinfo->reconfigure();
readShortcuts();
forEachClient( CheckIgnoreFocusStealingProcedure());
updateToolWindows( true );
if( mgr->reset( changed ))
{ // decorations need to be recreated