CT: Scott Lamb <slamb@oh.yeah.org> corrected the spelling of
Strickly and wanted to implement focus configurability. Here is the (for now) "politically correct" version. svn path=/trunk/kdebase/kwin/; revision=37123
This commit is contained in:
parent
91cb1debe1
commit
f9c7091e05
3 changed files with 15 additions and 9 deletions
|
@ -1254,7 +1254,7 @@ bool Client::x11Event( XEvent * e)
|
|||
if ( e->type == LeaveNotify ) {
|
||||
if ( !buttonDown )
|
||||
setCursor( arrowCursor );
|
||||
if ( options->focusPolicy == Options::FocusStricklyUnderMouse ) {
|
||||
if ( options->focusPolicy == Options::FocusStrictlyUnderMouse ) {
|
||||
if ( isActive() && !rect().contains( QPoint( e->xcrossing.x, e->xcrossing.y ) ) )
|
||||
workspace()->requestFocus( 0 ) ;
|
||||
}
|
||||
|
|
16
options.cpp
16
options.cpp
|
@ -50,8 +50,6 @@ const QColorGroup& Options::colorGroup(ColorType type, bool active)
|
|||
|
||||
void Options::reload()
|
||||
{
|
||||
focusPolicy = ClickToFocus;
|
||||
|
||||
QPalette pal = QApplication::palette();
|
||||
KConfig *config = KGlobal::config();
|
||||
config->setGroup("WM");
|
||||
|
@ -138,8 +136,16 @@ void Options::reload()
|
|||
config->setGroup( "Windows" );
|
||||
moveMode = config->readEntry("MoveMode", "Opaque" ) == "Opaque"?Opaque:Transparent;
|
||||
resizeMode = config->readEntry("ResizeMode", "Opaque" ) == "Opaque"?Opaque:Transparent;
|
||||
|
||||
|
||||
|
||||
QString val;
|
||||
|
||||
val = config->readEntry ("focusPolicy", "ClickToFocus");
|
||||
if (val == "ClickToFocus")
|
||||
focusPolicy = ClickToFocus;
|
||||
else
|
||||
focusPolicy = FocusFollowsMouse;
|
||||
|
||||
val = config->readEntry("Placement","Smart");
|
||||
if (val == "Smart") placement = Smart;
|
||||
else if (val == "Random") placement = Random;
|
||||
|
@ -151,8 +157,8 @@ void Options::reload()
|
|||
|
||||
border_snap_zone = config->readNumEntry("BorderSnapZone", 10);
|
||||
window_snap_zone = config->readNumEntry("WindowSnapZone", 10);
|
||||
|
||||
|
||||
|
||||
|
||||
OpTitlebarDblClick = windowOperation( config->readEntry("TitlebarDoubleClickCommand", "winShade") );
|
||||
|
||||
// Mouse bindings
|
||||
|
|
|
@ -29,18 +29,18 @@ public:
|
|||
<li>FocusUnderMouse - The window that happens to be under the
|
||||
mouse pointer becomes active.
|
||||
|
||||
<li>FocusStricklyUnderMouse - Only the window under the mouse
|
||||
<li>FocusStrictlyUnderMouse - Only the window under the mouse
|
||||
pointer is active. If the mouse points nowhere, nothing has the
|
||||
focus. In practice, this is the same as FocusUnderMouse, since
|
||||
kdesktop can take the focus.
|
||||
|
||||
Note that FocusUnderMouse and FocusStricklyUnderMouse are not
|
||||
Note that FocusUnderMouse and FocusStrictlyUnderMouse are not
|
||||
particulary useful. They are only provided for old-fashined
|
||||
die-hard UNIX people ;-)
|
||||
|
||||
</ul>
|
||||
*/
|
||||
enum FocusPolicy { ClickToFocus, FocusFollowsMouse, FocusUnderMouse, FocusStricklyUnderMouse };
|
||||
enum FocusPolicy { ClickToFocus, FocusFollowsMouse, FocusUnderMouse, FocusStrictlyUnderMouse };
|
||||
FocusPolicy focusPolicy;
|
||||
|
||||
enum MoveResizeMode { Transparent, Opaque };
|
||||
|
|
Loading…
Reference in a new issue