43 // |
43 // |
44 LcMainWindow::LcMainWindow() : |
44 LcMainWindow::LcMainWindow() : |
45 HbMainWindow(0, Hb::WindowFlagFixedHorizontal | Hb::WindowFlagTransparent) |
45 HbMainWindow(0, Hb::WindowFlagFixedHorizontal | Hb::WindowFlagTransparent) |
46 { |
46 { |
47 // TODO: remove flag WindowFlagFixedHorizontal if portait layout |
47 // TODO: remove flag WindowFlagFixedHorizontal if portait layout |
48 // is going to be supported. |
48 connect( this, SIGNAL(obscured()), this, SLOT(handleBackground())); |
49 qApp->installEventFilter(this); |
49 connect( this, SIGNAL(revealed()), this, SLOT(handleForeground())); |
50 } |
50 } |
51 |
51 |
52 // ----------------------------------------------------------------------------- |
52 // ----------------------------------------------------------------------------- |
53 // LcMainWindow::~LcMainWindow |
53 // LcMainWindow::~LcMainWindow |
54 // ----------------------------------------------------------------------------- |
54 // ----------------------------------------------------------------------------- |
56 LcMainWindow::~LcMainWindow() |
56 LcMainWindow::~LcMainWindow() |
57 { |
57 { |
58 } |
58 } |
59 |
59 |
60 // ----------------------------------------------------------------------------- |
60 // ----------------------------------------------------------------------------- |
61 // LcMainWindow::eventFilter |
61 // LcMainWindow::handleBackground |
62 // ----------------------------------------------------------------------------- |
62 // ----------------------------------------------------------------------------- |
63 // |
63 // |
64 bool LcMainWindow::eventFilter ( QObject * watched, QEvent * event ) |
64 void LcMainWindow::handleBackground() |
65 { |
65 { |
66 if ( event->type() == QEvent::ApplicationActivate ){ |
66 emit appFocusLost(); |
67 LC_QDEBUG( "livecomms [UI] -> LcMainWindow::eventFilter(), ApplicationActivate" ) |
67 } |
68 emit appFocusGained(); |
68 |
69 } else if (( event->type() == QEvent::ApplicationDeactivate ) && |
69 // ----------------------------------------------------------------------------- |
70 ( !this->windowSurface()) ){ |
70 // LcMainWindow::handleForeground |
71 LC_QDEBUG( "livecomms [UI] -> LcMainWindow::eventFilter(), ApplicationDeactivate" ) |
71 // ----------------------------------------------------------------------------- |
72 emit appFocusLost(); |
72 // |
73 } |
73 void LcMainWindow::handleForeground() |
74 return QObject::eventFilter(watched, event); |
74 { |
|
75 emit appFocusGained(); |
75 } |
76 } |
76 |
77 |
77 |
78 |
78 // ----------------------------------------------------------------------------- |
79 // ----------------------------------------------------------------------------- |
79 // LcViewManagerPrivate::LcViewManagerPrivate |
80 // LcViewManagerPrivate::LcViewManagerPrivate |