Make no focus stealing prevention really do nothing, and change

the rule for it to specify new level instead of adjustment.

svn path=/trunk/kdebase/kwin/; revision=319664
This commit is contained in:
Luboš Luňák 2004-06-11 15:12:07 +00:00
parent 0f972d789f
commit 7e35926c37
4 changed files with 15 additions and 12 deletions

View file

@ -594,13 +594,13 @@ KAdvancedConfig::KAdvancedConfig (bool _standAlone, KConfig *_config, QWidget *p
"caused by unexpected activation of new windows. (Note: This feature does not "
"work with the Focus Under Mouse or Focus Strictly Under Mouse focus policies.)"
"<ul>"
"<li><em>None:</em> The standard old behavior - prevention is turned off "
"<li><em>None:</em> Prevention is turned off "
"and new windows always become activated.</li>"
"<li><em>Low:</em> Prevention is enabled; when some window does not have support "
"for the underlying mechanism and KWin cannot reliably decide whether to "
"activate the window or not, it will be activated. This setting may have both "
"worse and better results than normal level, depending on the applications.</li>"
"<li><em>Normal:</em> Prevention is enabled; the default setting.</li>"
"<li><em>Normal:</em> Prevention is enabled.</li>"
"<li><em>High:</em> New windows get activated only if no window is currently active "
"or if they belong to the currently active application. This setting is probably "
"not really usable when not using mouse focus policy.</li>"

View file

@ -416,8 +416,11 @@ bool Client::manage( Window w, bool isMapped )
if( isNormalWindow())
Notify::raise( Notify::New );
bool allow = workspace()->allowClientActivation( this, userTime(), false, session && session->active );
// if session saving, force showing new windows (i.e. "save file?" dialogs etc.)
if( workspace()->sessionSaving() && !isOnCurrentDesktop())
// also force if activation is allowed
if( !isOnCurrentDesktop() && !isMapped && ( allow || workspace()->sessionSaving()))
workspace()->setCurrentDesktop( desktop());
if( isOnCurrentDesktop())
@ -431,7 +434,7 @@ bool Client::manage( Window w, bool isMapped )
}
else
{
if( workspace()->allowClientActivation( this, userTime(), false, session && session->active ))
if( allow )
{
workspace()->raiseClient( this );
rawShow();

View file

@ -50,7 +50,7 @@ WindowRules::WindowRules()
, belowrule( DontCareRule )
, fullscreenrule( DontCareRule )
, noborderrule( DontCareRule )
, fspleveladjustrule( DontCareRule )
, fsplevelrule( DontCareRule )
, acceptfocusrule( DontCareRule )
, moveresizemoderule( DontCareRule )
, closeablerule( DontCareRule )
@ -95,6 +95,8 @@ WindowRules::WindowRules( KConfig& cfg )
readFromCfg( cfg );
}
static int limit0to4( int i ) { return QMAX( 0, QMIN( 4, i )); }
void WindowRules::readFromCfg( KConfig& cfg )
{
wmclass = cfg.readEntry( "wmclass" ).lower().latin1();
@ -129,7 +131,7 @@ void WindowRules::readFromCfg( KConfig& cfg )
READ_SET_RULE( below, Bool, );
READ_SET_RULE( fullscreen, Bool, );
READ_SET_RULE( noborder, Bool, );
READ_FORCE_RULE( fspleveladjust, Num, );
READ_FORCE_RULE( fsplevel, Num, limit0to4 ); // fsp is 0-4
READ_FORCE_RULE( acceptfocus, Bool, );
READ_FORCE_RULE( moveresizemode, , Options::stringToMoveResizeMode );
READ_FORCE_RULE( closeable, Bool, );
@ -200,7 +202,7 @@ void WindowRules::write( KConfig& cfg ) const
WRITE_SET_RULE( below, );
WRITE_SET_RULE( fullscreen, );
WRITE_SET_RULE( noborder, );
WRITE_SET_RULE( fspleveladjust, );
WRITE_SET_RULE( fsplevel, );
WRITE_SET_RULE( acceptfocus, );
WRITE_SET_RULE( moveresizemode, Options::moveResizeModeToString );
WRITE_SET_RULE( closeable, );
@ -412,9 +414,7 @@ bool WindowRules::checkNoBorder( bool noborder, bool init ) const
int WindowRules::checkFSP( int fsp ) const
{
if( !checkForceRule( fspleveladjustrule ))
return fsp;
return QMIN( 4, QMAX( 0, fsp + fspleveladjust ));
return checkForceRule( fsplevelrule ) ? this->fsplevel : fsp;
}
bool WindowRules::checkAcceptFocus( bool focus ) const

View file

@ -124,8 +124,8 @@ class WindowRules
SettingRule fullscreenrule;
bool noborder;
SettingRule noborderrule;
int fspleveladjust;
SettingRule fspleveladjustrule;
int fsplevel;
SettingRule fsplevelrule;
bool acceptfocus;
SettingRule acceptfocusrule;
Options::MoveResizeMode moveresizemode;