diff --git a/kcmkwin/kwinoptions/windows.cpp b/kcmkwin/kwinoptions/windows.cpp
index b44fbe8785..83176a7093 100644
--- a/kcmkwin/kwinoptions/windows.cpp
+++ b/kcmkwin/kwinoptions/windows.cpp
@@ -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.)"
"
"
- "- None: The standard old behavior - prevention is turned off "
+ "
- None: Prevention is turned off "
"and new windows always become activated.
"
"- Low: 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.
"
- "- Normal: Prevention is enabled; the default setting.
"
+ "- Normal: Prevention is enabled.
"
"- High: 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.
"
diff --git a/manage.cpp b/manage.cpp
index 209a9a5856..0ec81e46be 100644
--- a/manage.cpp
+++ b/manage.cpp
@@ -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();
diff --git a/rules.cpp b/rules.cpp
index 3182adb3bf..c1c32596f3 100644
--- a/rules.cpp
+++ b/rules.cpp
@@ -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
diff --git a/rules.h b/rules.h
index e81f753316..a597cadbf2 100644
--- a/rules.h
+++ b/rules.h
@@ -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;