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:
parent
c5256e6b13
commit
d5a630cabd
4 changed files with 29 additions and 14 deletions
10
client.cpp
10
client.cpp
|
@ -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;
|
||||
|
|
3
client.h
3
client.h
|
@ -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();
|
||||
|
||||
|
|
24
events.cpp
24
events.cpp
|
@ -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 )
|
||||
|
|
|
@ -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 )
|
||||
|
|
Loading…
Reference in a new issue