build fix: no comphelper/profilezone.hxx in this branch
[LibreOffice.git] / vcl / source / window / event.cxx
blob54997dda317de7cd91d8f78ba128ad0b16c43288
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <vcl/event.hxx>
21 #include <vcl/window.hxx>
22 #include <vcl/dockwin.hxx>
23 #include <vcl/layout.hxx>
24 #include <vcl/opengl/OpenGLWrapper.hxx>
26 #include <window.h>
27 #include <svdata.hxx>
28 #include <salframe.hxx>
29 #include <config_features.h>
30 #include <com/sun/star/awt/MouseEvent.hpp>
31 #include <com/sun/star/awt/KeyModifier.hpp>
32 #include <com/sun/star/awt/MouseButton.hpp>
33 #include <comphelper/scopeguard.hxx>
35 namespace vcl {
37 void Window::DataChanged( const DataChangedEvent& )
41 void Window::NotifyAllChildren( DataChangedEvent& rDCEvt )
43 CompatDataChanged( rDCEvt );
45 vcl::Window* pChild = mpWindowImpl->mpFirstChild;
46 while ( pChild )
48 pChild->NotifyAllChildren( rDCEvt );
49 pChild = pChild->mpWindowImpl->mpNext;
53 bool Window::PreNotify( NotifyEvent& rNEvt )
55 bool bDone = false;
56 if ( mpWindowImpl->mpParent && !ImplIsOverlapWindow() )
57 bDone = mpWindowImpl->mpParent->CompatPreNotify( rNEvt );
59 if ( !bDone )
61 if( rNEvt.GetType() == MouseNotifyEvent::GETFOCUS )
63 bool bCompoundFocusChanged = false;
64 if ( mpWindowImpl->mbCompoundControl && !mpWindowImpl->mbCompoundControlHasFocus && HasChildPathFocus() )
66 mpWindowImpl->mbCompoundControlHasFocus = true;
67 bCompoundFocusChanged = true;
70 if ( bCompoundFocusChanged || ( rNEvt.GetWindow() == this ) )
71 CallEventListeners( VCLEVENT_WINDOW_GETFOCUS );
73 else if( rNEvt.GetType() == MouseNotifyEvent::LOSEFOCUS )
75 bool bCompoundFocusChanged = false;
76 if ( mpWindowImpl->mbCompoundControl && mpWindowImpl->mbCompoundControlHasFocus && !HasChildPathFocus() )
78 mpWindowImpl->mbCompoundControlHasFocus = false ;
79 bCompoundFocusChanged = true;
82 if ( bCompoundFocusChanged || ( rNEvt.GetWindow() == this ) )
83 CallEventListeners( VCLEVENT_WINDOW_LOSEFOCUS );
86 // #82968# mouse and key events will be notified after processing ( in ImplNotifyKeyMouseCommandEventListeners() )!
87 // see also ImplHandleMouseEvent(), ImplHandleKey()
91 return bDone;
94 bool Window::EventNotify( NotifyEvent& rNEvt )
96 bool bRet = false;
98 if (IsDisposed())
99 return false;
101 // check for docking window
102 // but do nothing if window is docked and locked
103 ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this );
104 if (pWrapper && !( !pWrapper->IsFloatingMode() && pWrapper->IsLocked() ))
106 const bool bDockingSupportCrippled = !StyleSettings::GetDockingFloatsSupported();
108 if ( rNEvt.GetType() == MouseNotifyEvent::MOUSEBUTTONDOWN )
110 const MouseEvent* pMEvt = rNEvt.GetMouseEvent();
111 bool bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() );
112 if ( pMEvt->IsLeft() )
114 if (!bDockingSupportCrippled && pMEvt->IsMod1() && (pMEvt->GetClicks() == 2))
116 // ctrl double click toggles floating mode
117 pWrapper->SetFloatingMode( !pWrapper->IsFloatingMode() );
118 return true;
120 else if ( pMEvt->GetClicks() == 1 && bHit)
122 // allow start docking during mouse move
123 pWrapper->ImplEnableStartDocking();
124 return true;
128 else if ( rNEvt.GetType() == MouseNotifyEvent::MOUSEMOVE )
130 const MouseEvent* pMEvt = rNEvt.GetMouseEvent();
131 bool bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() );
132 if ( pMEvt->IsLeft() )
134 // check if a single click initiated this sequence ( ImplStartDockingEnabled() )
135 // check if window is docked and
136 if( pWrapper->ImplStartDockingEnabled() && !pWrapper->IsFloatingMode() &&
137 !pWrapper->IsDocking() && bHit )
139 Point aPos = pMEvt->GetPosPixel();
140 vcl::Window* pWindow = rNEvt.GetWindow();
141 if ( pWindow != this )
143 aPos = pWindow->OutputToScreenPixel( aPos );
144 aPos = ScreenToOutputPixel( aPos );
146 pWrapper->ImplStartDocking( aPos );
148 return true;
151 else if( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
153 const vcl::KeyCode& rKey = rNEvt.GetKeyEvent()->GetKeyCode();
154 if (rKey.GetCode() == KEY_F10 && rKey.GetModifier() &&
155 rKey.IsShift() && rKey.IsMod1() && !bDockingSupportCrippled)
157 pWrapper->SetFloatingMode( !pWrapper->IsFloatingMode() );
158 /* At this point the floating toolbar frame does not have the
159 * input focus since these frames don't get the focus per default
160 * To enable keyboard handling of this toolbar set the input focus
161 * to the frame. This needs to be done with ToTop since GrabFocus
162 * would not notice any change since "this" already has the focus.
164 if( pWrapper->IsFloatingMode() )
165 ToTop( ToTopFlags::GrabFocusOnly );
166 return true;
171 // manage the dialogs
172 if ( (GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) == WB_DIALOGCONTROL )
174 // if the parent also has dialog control activated, the parent takes over control
175 if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) || (rNEvt.GetType() == MouseNotifyEvent::KEYUP) )
177 if ( ImplIsOverlapWindow() ||
178 ((getNonLayoutParent(this)->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) != WB_DIALOGCONTROL) )
180 bRet = ImplDlgCtrl( *rNEvt.GetKeyEvent(), rNEvt.GetType() == MouseNotifyEvent::KEYINPUT );
183 else if ( (rNEvt.GetType() == MouseNotifyEvent::GETFOCUS) || (rNEvt.GetType() == MouseNotifyEvent::LOSEFOCUS) )
185 ImplDlgCtrlFocusChanged( rNEvt.GetWindow(), rNEvt.GetType() == MouseNotifyEvent::GETFOCUS );
186 if ( (rNEvt.GetWindow() == this) && (rNEvt.GetType() == MouseNotifyEvent::GETFOCUS) &&
187 !(GetStyle() & WB_TABSTOP) && !(mpWindowImpl->mnDlgCtrlFlags & DialogControlFlags::WantFocus) )
189 sal_uInt16 n = 0;
190 vcl::Window* pFirstChild = ImplGetDlgWindow( n, GetDlgWindowType::First );
191 if ( pFirstChild )
192 pFirstChild->ImplControlFocus();
197 if ( !bRet )
199 if ( mpWindowImpl->mpParent && !ImplIsOverlapWindow() )
200 bRet = mpWindowImpl->mpParent->CompatNotify( rNEvt );
203 return bRet;
206 void Window::CallEventListeners( sal_uLong nEvent, void* pData )
208 VclWindowEvent aEvent( this, nEvent, pData );
210 VclPtr<vcl::Window> xWindow = this;
212 Application::ImplCallEventListeners( aEvent );
214 if ( xWindow->IsDisposed() )
215 return;
217 if (!mpWindowImpl->maEventListeners.empty())
219 // Copy the list, because this can be destroyed when calling a Link...
220 std::vector<Link<VclWindowEvent&,void>> aCopy( mpWindowImpl->maEventListeners );
221 // we use an iterating counter/flag and a set of deleted Link's to avoid O(n^2) behaviour
222 mpWindowImpl->mnEventListenersIteratingCount++;
223 auto& rWindowImpl = *mpWindowImpl;
224 comphelper::ScopeGuard aGuard(
225 [&rWindowImpl, &xWindow]()
227 if (!xWindow->IsDisposed())
229 rWindowImpl.mnEventListenersIteratingCount--;
230 if (rWindowImpl.mnEventListenersIteratingCount == 0)
231 rWindowImpl.maEventListenersDeleted.clear();
235 for ( Link<VclWindowEvent&,void>& rLink : aCopy )
237 if (xWindow->IsDisposed()) break;
238 // check this hasn't been removed in some re-enterancy scenario fdo#47368
239 if( rWindowImpl.maEventListenersDeleted.find(rLink) == rWindowImpl.maEventListenersDeleted.end() )
240 rLink.Call( aEvent );
244 while ( xWindow )
247 if ( xWindow->IsDisposed() )
248 return;
250 auto& rWindowImpl = *xWindow->mpWindowImpl;
251 if (!rWindowImpl.maChildEventListeners.empty())
253 // Copy the list, because this can be destroyed when calling a Link...
254 std::vector<Link<VclWindowEvent&,void>> aCopy( rWindowImpl.maChildEventListeners );
255 // we use an iterating counter/flag and a set of deleted Link's to avoid O(n^2) behaviour
256 rWindowImpl.mnChildEventListenersIteratingCount++;
257 comphelper::ScopeGuard aGuard(
258 [&rWindowImpl, &xWindow]()
260 if (!xWindow->IsDisposed())
262 rWindowImpl.mnChildEventListenersIteratingCount--;
263 if (rWindowImpl.mnChildEventListenersIteratingCount == 0)
264 rWindowImpl.maChildEventListenersDeleted.clear();
268 for ( Link<VclWindowEvent&,void>& rLink : aCopy )
270 if (xWindow->IsDisposed())
271 return;
272 // Check this hasn't been removed in some re-enterancy scenario fdo#47368.
273 if( rWindowImpl.maChildEventListenersDeleted.find(rLink) == rWindowImpl.maChildEventListenersDeleted.end() )
274 rLink.Call( aEvent );
278 if ( xWindow->IsDisposed() )
279 return;
281 xWindow = xWindow->GetParent();
285 void Window::FireVclEvent( VclSimpleEvent& rEvent )
287 Application::ImplCallEventListeners(rEvent);
290 void Window::AddEventListener( const Link<VclWindowEvent&,void>& rEventListener )
292 mpWindowImpl->maEventListeners.push_back( rEventListener );
295 void Window::RemoveEventListener( const Link<VclWindowEvent&,void>& rEventListener )
297 if (mpWindowImpl)
299 auto& rListeners = mpWindowImpl->maEventListeners;
300 rListeners.erase( std::remove(rListeners.begin(), rListeners.end(), rEventListener ), rListeners.end() );
301 if (mpWindowImpl->mnEventListenersIteratingCount)
302 mpWindowImpl->maEventListenersDeleted.insert(rEventListener);
306 void Window::AddChildEventListener( const Link<VclWindowEvent&,void>& rEventListener )
308 mpWindowImpl->maChildEventListeners.push_back( rEventListener );
311 void Window::RemoveChildEventListener( const Link<VclWindowEvent&,void>& rEventListener )
313 if (mpWindowImpl)
315 auto& rListeners = mpWindowImpl->maChildEventListeners;
316 rListeners.erase( std::remove(rListeners.begin(), rListeners.end(), rEventListener ), rListeners.end() );
317 if (mpWindowImpl->mnChildEventListenersIteratingCount)
318 mpWindowImpl->maChildEventListenersDeleted.insert(rEventListener);
322 ImplSVEvent * Window::PostUserEvent( const Link<void*,void>& rLink, void* pCaller, bool bReferenceLink )
324 ImplSVEvent* pSVEvent = new ImplSVEvent;
325 pSVEvent->mpData = pCaller;
326 pSVEvent->maLink = rLink;
327 pSVEvent->mpWindow = this;
328 pSVEvent->mbCall = true;
329 if (bReferenceLink)
331 // Double check that this is indeed a vcl::Window instance.
332 assert(dynamic_cast<vcl::Window *>(
333 static_cast<vcl::Window *>(rLink.GetInstance())) ==
334 static_cast<vcl::Window *>(rLink.GetInstance()));
335 pSVEvent->mpInstanceRef = static_cast<vcl::Window *>(rLink.GetInstance());
338 if ( !mpWindowImpl->mpFrame->PostEvent( pSVEvent ) )
340 delete pSVEvent;
341 pSVEvent = nullptr;
343 return pSVEvent;
346 void Window::RemoveUserEvent( ImplSVEvent * nUserEvent )
348 SAL_WARN_IF( nUserEvent->mpWindow.get() != this, "vcl",
349 "Window::RemoveUserEvent(): Event doesn't send to this window or is already removed" );
350 SAL_WARN_IF( !nUserEvent->mbCall, "vcl",
351 "Window::RemoveUserEvent(): Event is already removed" );
353 if ( nUserEvent->mpWindow )
355 nUserEvent->mpWindow = nullptr;
358 nUserEvent->mbCall = false;
362 static MouseEvent ImplTranslateMouseEvent( const MouseEvent& rE, vcl::Window* pSource, vcl::Window* pDest )
364 // the mouse event occurred in a different window, we need to translate the coordinates of
365 // the mouse cursor within that (source) window to the coordinates the mouse cursor would
366 // be in the destination window
367 Point aPos = pSource->OutputToScreenPixel( rE.GetPosPixel() );
368 return MouseEvent( pDest->ScreenToOutputPixel( aPos ), rE.GetClicks(), rE.GetMode(), rE.GetButtons(), rE.GetModifier() );
371 void Window::ImplNotifyKeyMouseCommandEventListeners( NotifyEvent& rNEvt )
373 if( rNEvt.GetType() == MouseNotifyEvent::COMMAND )
375 const CommandEvent* pCEvt = rNEvt.GetCommandEvent();
376 if ( pCEvt->GetCommand() != CommandEventId::ContextMenu )
377 // non context menu events are not to be notified up the chain
378 // so we return immediately
379 return;
381 if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
383 // not interested: The event listeners are already called in ::Command,
384 // and calling them here a second time doesn't make sense
385 if ( rNEvt.GetWindow() != this )
387 CommandEvent aCommandEvent;
389 if ( !pCEvt->IsMouseEvent() )
391 aCommandEvent = *pCEvt;
393 else
395 // the mouse event occurred in a different window, we need to translate the coordinates of
396 // the mouse cursor within that window to the coordinates the mouse cursor would be in the
397 // current window
398 vcl::Window* pSource = rNEvt.GetWindow();
399 Point aPos = pSource->OutputToScreenPixel( pCEvt->GetMousePosPixel() );
400 aCommandEvent = CommandEvent( ScreenToOutputPixel( aPos ), pCEvt->GetCommand(), pCEvt->IsMouseEvent(), pCEvt->GetEventData() );
403 CallEventListeners( VCLEVENT_WINDOW_COMMAND, &aCommandEvent );
408 // #82968# notify event listeners for mouse and key events separately and
409 // not in PreNotify ( as for focus listeners )
410 // this allows for processing those events internally first and pass it to
411 // the toolkit later
413 VclPtr<vcl::Window> xWindow = this;
415 if( rNEvt.GetType() == MouseNotifyEvent::MOUSEMOVE )
417 if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
419 if ( rNEvt.GetWindow() == this )
420 CallEventListeners( VCLEVENT_WINDOW_MOUSEMOVE, const_cast<MouseEvent *>(rNEvt.GetMouseEvent()) );
421 else
423 MouseEvent aMouseEvent = ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this );
424 CallEventListeners( VCLEVENT_WINDOW_MOUSEMOVE, &aMouseEvent );
428 else if( rNEvt.GetType() == MouseNotifyEvent::MOUSEBUTTONUP )
430 if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
432 if ( rNEvt.GetWindow() == this )
433 CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONUP, const_cast<MouseEvent *>(rNEvt.GetMouseEvent()) );
434 else
436 MouseEvent aMouseEvent = ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this );
437 CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONUP, &aMouseEvent );
441 else if( rNEvt.GetType() == MouseNotifyEvent::MOUSEBUTTONDOWN )
443 if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
445 if ( rNEvt.GetWindow() == this )
446 CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, const_cast<MouseEvent *>(rNEvt.GetMouseEvent()) );
447 else
449 MouseEvent aMouseEvent = ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this );
450 CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, &aMouseEvent );
454 else if( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
456 if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
457 CallEventListeners( VCLEVENT_WINDOW_KEYINPUT, const_cast<KeyEvent *>(rNEvt.GetKeyEvent()) );
459 else if( rNEvt.GetType() == MouseNotifyEvent::KEYUP )
461 if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
462 CallEventListeners( VCLEVENT_WINDOW_KEYUP, const_cast<KeyEvent *>(rNEvt.GetKeyEvent()) );
465 if ( xWindow->IsDisposed() )
466 return;
468 // #106721# check if we're part of a compound control and notify
469 vcl::Window *pParent = ImplGetParent();
470 while( pParent )
472 if( pParent->IsCompoundControl() )
474 pParent->ImplNotifyKeyMouseCommandEventListeners( rNEvt );
475 break;
477 pParent = pParent->ImplGetParent();
481 void Window::ImplCallInitShow()
483 mpWindowImpl->mbReallyShown = true;
484 mpWindowImpl->mbInInitShow = true;
485 CompatStateChanged( StateChangedType::InitShow );
486 mpWindowImpl->mbInInitShow = false;
488 vcl::Window* pWindow = mpWindowImpl->mpFirstOverlap;
489 while ( pWindow )
491 if ( pWindow->mpWindowImpl->mbVisible )
492 pWindow->ImplCallInitShow();
493 pWindow = pWindow->mpWindowImpl->mpNext;
496 pWindow = mpWindowImpl->mpFirstChild;
497 while ( pWindow )
499 if ( pWindow->mpWindowImpl->mbVisible )
500 pWindow->ImplCallInitShow();
501 pWindow = pWindow->mpWindowImpl->mpNext;
506 void Window::ImplCallResize()
508 mpWindowImpl->mbCallResize = false;
510 // OpenGL has a charming feature of black clearing the whole window
511 // some legacy code eg. the app-menu has the beautiful feature of
512 // avoiding re-paints when width doesn't change => invalidate all.
513 #if HAVE_FEATURE_OPENGL
514 if( OpenGLWrapper::isVCLOpenGLEnabled() )
515 Invalidate();
517 // Normally we avoid blanking on re-size unless people might notice:
518 else
519 #endif
520 if( GetBackground().IsGradient() )
521 Invalidate();
523 Resize();
525 // #88419# Most classes don't call the base class in Resize() and Move(),
526 // => Call ImpleResize/Move instead of Resize/Move directly...
527 CallEventListeners( VCLEVENT_WINDOW_RESIZE );
530 void Window::ImplCallMove()
532 mpWindowImpl->mbCallMove = false;
534 if( mpWindowImpl->mbFrame )
536 // update frame position
537 SalFrame *pParentFrame = nullptr;
538 vcl::Window *pParent = ImplGetParent();
539 while( pParent )
541 if( pParent->mpWindowImpl->mpFrame != mpWindowImpl->mpFrame )
543 pParentFrame = pParent->mpWindowImpl->mpFrame;
544 break;
546 pParent = pParent->GetParent();
549 SalFrameGeometry g = mpWindowImpl->mpFrame->GetGeometry();
550 mpWindowImpl->maPos = Point( g.nX, g.nY );
551 if( pParentFrame )
553 g = pParentFrame->GetGeometry();
554 mpWindowImpl->maPos -= Point( g.nX, g.nY );
556 // the client window and all its subclients have the same position as the borderframe
557 // this is important for floating toolbars where the borderwindow is a floating window
558 // which has another borderwindow (ie the system floating window)
559 vcl::Window *pClientWin = mpWindowImpl->mpClientWindow;
560 while( pClientWin )
562 pClientWin->mpWindowImpl->maPos = mpWindowImpl->maPos;
563 pClientWin = pClientWin->mpWindowImpl->mpClientWindow;
567 Move();
569 CallEventListeners( VCLEVENT_WINDOW_MOVE );
572 void Window::ImplCallFocusChangeActivate( vcl::Window* pNewOverlapWindow,
573 vcl::Window* pOldOverlapWindow )
575 ImplSVData* pSVData = ImplGetSVData();
576 vcl::Window* pNewRealWindow;
577 vcl::Window* pOldRealWindow;
578 bool bCallActivate = true;
579 bool bCallDeactivate = true;
581 pOldRealWindow = pOldOverlapWindow->ImplGetWindow();
582 pNewRealWindow = pNewOverlapWindow->ImplGetWindow();
583 if ( (pOldRealWindow->GetType() != WINDOW_FLOATINGWINDOW) ||
584 pOldRealWindow->GetActivateMode() != ActivateModeFlags::NONE )
586 if ( (pNewRealWindow->GetType() == WINDOW_FLOATINGWINDOW) &&
587 pNewRealWindow->GetActivateMode() == ActivateModeFlags::NONE)
589 pSVData->maWinData.mpLastDeacWin = pOldOverlapWindow;
590 bCallDeactivate = false;
593 else if ( (pNewRealWindow->GetType() != WINDOW_FLOATINGWINDOW) ||
594 pNewRealWindow->GetActivateMode() != ActivateModeFlags::NONE )
596 if ( pSVData->maWinData.mpLastDeacWin )
598 if ( pSVData->maWinData.mpLastDeacWin.get() == pNewOverlapWindow )
599 bCallActivate = false;
600 else
602 vcl::Window* pLastRealWindow = pSVData->maWinData.mpLastDeacWin->ImplGetWindow();
603 pSVData->maWinData.mpLastDeacWin->mpWindowImpl->mbActive = false;
604 pSVData->maWinData.mpLastDeacWin->Deactivate();
605 if ( pLastRealWindow != pSVData->maWinData.mpLastDeacWin.get() )
607 pLastRealWindow->mpWindowImpl->mbActive = true;
608 pLastRealWindow->Activate();
611 pSVData->maWinData.mpLastDeacWin = nullptr;
615 if ( bCallDeactivate )
617 if( pOldOverlapWindow->mpWindowImpl->mbActive )
619 pOldOverlapWindow->mpWindowImpl->mbActive = false;
620 pOldOverlapWindow->Deactivate();
622 if ( pOldRealWindow != pOldOverlapWindow )
624 if( pOldRealWindow->mpWindowImpl->mbActive )
626 pOldRealWindow->mpWindowImpl->mbActive = false;
627 pOldRealWindow->Deactivate();
631 if ( bCallActivate && ! pNewOverlapWindow->mpWindowImpl->mbActive )
633 if( ! pNewOverlapWindow->mpWindowImpl->mbActive )
635 pNewOverlapWindow->mpWindowImpl->mbActive = true;
636 pNewOverlapWindow->Activate();
638 if ( pNewRealWindow != pNewOverlapWindow )
640 if( ! pNewRealWindow->mpWindowImpl->mbActive )
642 pNewRealWindow->mpWindowImpl->mbActive = true;
643 pNewRealWindow->Activate();
649 } /* namespace vcl */
652 NotifyEvent::NotifyEvent( MouseNotifyEvent nEventType, vcl::Window* pWindow,
653 const void* pEvent )
655 mpWindow = pWindow;
656 mpData = const_cast<void*>(pEvent);
657 mnEventType = nEventType;
660 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */