From ad63029ee8f2743c3d945cf120e82bcbc36eac2c Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 28 Apr 2015 09:01:53 -0400 Subject: Final fix for the new panel window-reactivation routine: only re-activate the window if it is still visible on the screen --- lumina-desktop/LPanel.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lumina-desktop') diff --git a/lumina-desktop/LPanel.cpp b/lumina-desktop/LPanel.cpp index 84c18bf2..3755e9a6 100644 --- a/lumina-desktop/LPanel.cpp +++ b/lumina-desktop/LPanel.cpp @@ -335,9 +335,12 @@ void LPanel::leaveEvent(QEvent *event){ if( !this->geometry().contains(QCursor::pos()) ){ //Move the panel back to it's "hiding" spot if(hidden){ this->move(hidepoint); } - //Only re-activate the old window if the panel is still currently active - if(tmpID!=0 && (this->winId()==LSession::handle()->XCB->ActiveWindow()) ){ LSession::handle()->XCB->ActivateWindow(tmpID); } - tmpID = 0; + //Only re-activate the old window if the panel is still currently active and the old window is still visible + if(tmpID!=0){ + LXCB::WINDOWSTATE state = LSession::handle()->XCB->WindowState(tmpID); + if( state!=LXCB::IGNORE && state !=LXCB::INVISIBLE && (this->winId()==LSession::handle()->XCB->ActiveWindow()) ){ LSession::handle()->XCB->ActivateWindow(tmpID); } + tmpID = 0; + } } event->accept(); //just to quiet the compile warning -- cgit