From bd2199bf800ab2709a2f8ff1aefb5ca3c17736cb Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Fri, 18 Dec 2009 09:09:40 +0000 Subject: fix for #651 git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@3706 17fca916-40b9-46aa-a4ea-0a15b648b75c --- src/kvirc/ui/kvi_frame.cpp | 23 +++++++++++++++++++++++ src/kvirc/ui/kvi_frame.h | 1 + 2 files changed, 24 insertions(+) (limited to 'src') diff --git a/src/kvirc/ui/kvi_frame.cpp b/src/kvirc/ui/kvi_frame.cpp index cb9f40e44..233c758fb 100644 --- a/src/kvirc/ui/kvi_frame.cpp +++ b/src/kvirc/ui/kvi_frame.cpp @@ -788,6 +788,29 @@ void KviFrame::childWindowActivated(KviWindow *wnd, bool bForce) KVS_TRIGGER_EVENT_0(KviEvent_OnWindowActivated,wnd); } +void KviFrame::changeEvent(QEvent * e) +{ + if (e->type() == QEvent::ActivationChange) + { + //WINDOW (DE)ACTIVATION + // if we have just been activated by the WM + // then update the active window task bar item + // It will then reset its highlight state + // and hopefully make the dock widget work correctly + // in this case. + // This will also trigger the OnWindowActivated event :) + if(isActiveWindow()) + { + if(g_pActiveWindow) + childWindowActivated(g_pActiveWindow, true); + } else { + if(g_pActiveWindow) + g_pActiveWindow->lostUserFocus(); + } + } + KviTalMainWindow::changeEvent(e); +} + void KviFrame::closeEvent(QCloseEvent *e) { //check if the user just want us to minimize in tray; if we're not the sender diff --git a/src/kvirc/ui/kvi_frame.h b/src/kvirc/ui/kvi_frame.h index 508abd2ae..b415fbfa3 100644 --- a/src/kvirc/ui/kvi_frame.h +++ b/src/kvirc/ui/kvi_frame.h @@ -196,6 +196,7 @@ protected: virtual void resizeEvent(QResizeEvent *e); virtual void moveEvent(QMoveEvent *e); virtual bool focusNextPrevChild(bool next); + virtual void changeEvent(QEvent * event); void updatePseudoTransparency(); void installAccelerators(); -- cgit v1.3.1-10-gc9f91