When window shade hovering is enabled do not immediately shade the

window once the cursor leaves the window, instead wait a little while.
Patch by Marcel Partap.
BUG: 81085

svn path=/trunk/KDE/kdebase/workspace/; revision=897056
This commit is contained in:
Lucas Murray 2008-12-15 08:27:17 +00:00
parent c5256e6b13
commit d5a630cabd
4 changed files with 29 additions and 14 deletions

View file

@ -808,10 +808,16 @@ void Client::setShade( ShadeMode mode )
void Client::shadeHover()
{
setShade( ShadeHover );
cancelShadeHover();
cancelShadeHoverTimer();
}
void Client::cancelShadeHover()
void Client::shadeUnhover()
{
setShade( ShadeNormal );
cancelShadeHoverTimer();
}
void Client::cancelShadeHoverTimer()
{
delete shadeHoverTimer;
shadeHoverTimer = 0;

View file

@ -271,7 +271,7 @@ class Client
void maximize( MaximizeMode );
void toggleShade();
void showContextHelp();
void cancelShadeHover();
void cancelShadeHoverTimer();
void cancelAutoRaise();
void checkActiveModal();
bool hasStrut() const;
@ -294,6 +294,7 @@ class Client
private slots:
void autoRaise();
void shadeHover();
void shadeUnhover();
void shortcutActivated();
void delayedMoveResize();

View file

@ -940,13 +940,16 @@ void Client::enterNotifyEvent( XCrossingEvent* e )
e->mode == NotifyUngrab ) )
{
if (options->shadeHover && isShade())
if ( options->shadeHover )
{
delete shadeHoverTimer;
shadeHoverTimer = new QTimer( this );
connect( shadeHoverTimer, SIGNAL( timeout() ), this, SLOT( shadeHover() ));
shadeHoverTimer->setSingleShot( true );
shadeHoverTimer->start( options->shadeHoverInterval );
cancelShadeHoverTimer();
if (isShade())
{
shadeHoverTimer = new QTimer( this );
connect( shadeHoverTimer, SIGNAL( timeout() ), this, SLOT( shadeHover() ));
shadeHoverTimer->setSingleShot( true );
shadeHoverTimer->start( options->shadeHoverInterval );
}
}
if ( options->focusPolicy == Options::ClickToFocus )
@ -1013,9 +1016,14 @@ void Client::leaveNotifyEvent( XCrossingEvent* e )
{
cancelAutoRaise();
workspace()->cancelDelayFocus();
cancelShadeHover();
cancelShadeHoverTimer();
if ( shade_mode == ShadeHover && !moveResizeMode && !buttonDown )
setShade( ShadeNormal );
{
shadeHoverTimer = new QTimer( this );
connect( shadeHoverTimer, SIGNAL( timeout() ), this, SLOT( shadeUnhover() ));
shadeHoverTimer->setSingleShot( true );
shadeHoverTimer->start( options->shadeHoverInterval );
}
}
if ( options->focusPolicy == Options::FocusStrictlyUnderMouse )
if ( isActive() && lostMouse )

View file

@ -574,15 +574,15 @@ bool Client::performMouseCommand( Options::MouseCommand command, const QPoint &g
break;
case Options::MouseShade :
toggleShade();
cancelShadeHover();
cancelShadeHoverTimer();
break;
case Options::MouseSetShade:
setShade( ShadeNormal );
cancelShadeHover();
cancelShadeHoverTimer();
break;
case Options::MouseUnsetShade:
setShade( ShadeNone );
cancelShadeHover();
cancelShadeHoverTimer();
break;
case Options::MouseOperationsMenu:
if ( isActive() && options->clickRaise )