nss: upgrade to release 3.73
[LibreOffice.git] / vcl / source / window / event.cxx
blob251cddaaf0485c5a2c679eaee7ca45ca11bc19e7
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>
25 #include <sal/log.hxx>
27 #include <window.h>
28 #include <svdata.hxx>
29 #include <salframe.hxx>
30 #include <config_features.h>
31 #include <comphelper/scopeguard.hxx>
33 namespace vcl {
35 void Window::DataChanged( const DataChangedEvent& )
39 void Window::NotifyAllChildren( DataChangedEvent& rDCEvt )
41 CompatDataChanged( rDCEvt );
43 vcl::Window* pChild = mpWindowImpl->mpFirstChild;
44 while ( pChild )
46 pChild->NotifyAllChildren( rDCEvt );
47 pChild = pChild->mpWindowImpl->mpNext;
51 bool Window::PreNotify( NotifyEvent& rNEvt )
53 bool bDone = false;
54 if ( mpWindowImpl->mpParent && !ImplIsOverlapWindow() )
55 bDone = mpWindowImpl->mpParent->CompatPreNotify( rNEvt );
57 if ( !bDone )
59 if( rNEvt.GetType() == MouseNotifyEvent::GETFOCUS )
61 bool bCompoundFocusChanged = false;
62 if ( mpWindowImpl->mbCompoundControl && !mpWindowImpl->mbCompoundControlHasFocus && HasChildPathFocus() )
64 mpWindowImpl->mbCompoundControlHasFocus = true;
65 bCompoundFocusChanged = true;
68 if ( bCompoundFocusChanged || ( rNEvt.GetWindow() == this ) )
69 CallEventListeners( VclEventId::WindowGetFocus );
71 else if( rNEvt.GetType() == MouseNotifyEvent::LOSEFOCUS )
73 bool bCompoundFocusChanged = false;
74 if ( mpWindowImpl->mbCompoundControl && mpWindowImpl->mbCompoundControlHasFocus && !HasChildPathFocus() )
76 mpWindowImpl->mbCompoundControlHasFocus = false ;
77 bCompoundFocusChanged = true;
80 if ( bCompoundFocusChanged || ( rNEvt.GetWindow() == this ) )
81 CallEventListeners( VclEventId::WindowLoseFocus );
84 // #82968# mouse and key events will be notified after processing ( in ImplNotifyKeyMouseCommandEventListeners() )!
85 // see also ImplHandleMouseEvent(), ImplHandleKey()
89 return bDone;
92 namespace
94 bool parentNotDialogControl(Window* pWindow)
96 vcl::Window* pParent = getNonLayoutParent(pWindow);
97 if (!pParent)
98 return true;
99 return ((pParent->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) != WB_DIALOGCONTROL);
103 bool Window::EventNotify( NotifyEvent& rNEvt )
105 bool bRet = false;
107 if (IsDisposed())
108 return false;
110 // check for docking window
111 // but do nothing if window is docked and locked
112 ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this );
113 if (pWrapper && ( pWrapper->IsFloatingMode() || !pWrapper->IsLocked() ))
115 const bool bDockingSupportCrippled = !StyleSettings::GetDockingFloatsSupported();
117 if ( rNEvt.GetType() == MouseNotifyEvent::MOUSEBUTTONDOWN )
119 const MouseEvent* pMEvt = rNEvt.GetMouseEvent();
120 bool bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() );
121 if ( pMEvt->IsLeft() )
123 if (!bDockingSupportCrippled && pMEvt->IsMod1() && (pMEvt->GetClicks() == 2))
125 // ctrl double click toggles floating mode
126 pWrapper->SetFloatingMode( !pWrapper->IsFloatingMode() );
127 return true;
129 else if ( pMEvt->GetClicks() == 1 && bHit)
131 // allow start docking during mouse move
132 pWrapper->ImplEnableStartDocking();
133 return true;
137 else if ( rNEvt.GetType() == MouseNotifyEvent::MOUSEMOVE )
139 const MouseEvent* pMEvt = rNEvt.GetMouseEvent();
140 bool bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() );
141 if ( pMEvt->IsLeft() )
143 // check if a single click initiated this sequence ( ImplStartDockingEnabled() )
144 // check if window is docked and
145 if( pWrapper->ImplStartDockingEnabled() && !pWrapper->IsFloatingMode() &&
146 !pWrapper->IsDocking() && bHit )
148 Point aPos = pMEvt->GetPosPixel();
149 vcl::Window* pWindow = rNEvt.GetWindow();
150 if ( pWindow != this )
152 aPos = pWindow->OutputToScreenPixel( aPos );
153 aPos = ScreenToOutputPixel( aPos );
155 pWrapper->ImplStartDocking( aPos );
157 return true;
160 else if( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
162 const vcl::KeyCode& rKey = rNEvt.GetKeyEvent()->GetKeyCode();
163 if (rKey.GetCode() == KEY_F10 && rKey.GetModifier() &&
164 rKey.IsShift() && rKey.IsMod1() && !bDockingSupportCrippled)
166 pWrapper->SetFloatingMode( !pWrapper->IsFloatingMode() );
167 /* At this point the floating toolbar frame does not have the
168 * input focus since these frames don't get the focus per default
169 * To enable keyboard handling of this toolbar set the input focus
170 * to the frame. This needs to be done with ToTop since GrabFocus
171 * would not notice any change since "this" already has the focus.
173 if( pWrapper->IsFloatingMode() )
174 ToTop( ToTopFlags::GrabFocusOnly );
175 return true;
180 // manage the dialogs
181 if ( (GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) == WB_DIALOGCONTROL )
183 // if the parent also has dialog control activated, the parent takes over control
184 if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) || (rNEvt.GetType() == MouseNotifyEvent::KEYUP) )
186 // ScGridWindow has WB_DIALOGCONTROL set, so pressing tab in ScCheckListMenuControl won't
187 // get processed here by the toplevel DockingWindow of ScCheckListMenuControl by
188 // just checking if parentNotDialogControl is true
189 bool bTopLevelFloatingWindow = (pWrapper && pWrapper->IsFloatingMode());
190 if (ImplIsOverlapWindow() || parentNotDialogControl(this) || bTopLevelFloatingWindow)
192 bRet = ImplDlgCtrl( *rNEvt.GetKeyEvent(), rNEvt.GetType() == MouseNotifyEvent::KEYINPUT );
195 else if ( (rNEvt.GetType() == MouseNotifyEvent::GETFOCUS) || (rNEvt.GetType() == MouseNotifyEvent::LOSEFOCUS) )
197 ImplDlgCtrlFocusChanged( rNEvt.GetWindow(), rNEvt.GetType() == MouseNotifyEvent::GETFOCUS );
198 if ( (rNEvt.GetWindow() == this) && (rNEvt.GetType() == MouseNotifyEvent::GETFOCUS) &&
199 !(GetStyle() & WB_TABSTOP) && !(mpWindowImpl->mnDlgCtrlFlags & DialogControlFlags::WantFocus) )
201 vcl::Window* pFirstChild = ImplGetDlgWindow( 0, GetDlgWindowType::First );
202 if ( pFirstChild )
203 pFirstChild->ImplControlFocus();
208 if ( !bRet )
210 if ( mpWindowImpl->mpParent && !ImplIsOverlapWindow() )
211 bRet = mpWindowImpl->mpParent->CompatNotify( rNEvt );
214 return bRet;
217 void Window::CallEventListeners( VclEventId nEvent, void* pData )
219 VclWindowEvent aEvent( this, nEvent, pData );
221 VclPtr<vcl::Window> xWindow = this;
223 Application::ImplCallEventListeners( aEvent );
225 if ( xWindow->IsDisposed() )
226 return;
228 // If maEventListeners is empty, the XVCLWindow has not yet been initialized.
229 // Calling GetComponentInterface will do that.
230 if (mpWindowImpl->maEventListeners.empty() && pData)
231 xWindow->GetComponentInterface();
233 if (!mpWindowImpl->maEventListeners.empty())
235 // Copy the list, because this can be destroyed when calling a Link...
236 std::vector<Link<VclWindowEvent&,void>> aCopy( mpWindowImpl->maEventListeners );
237 // we use an iterating counter/flag and a set of deleted Link's to avoid O(n^2) behaviour
238 mpWindowImpl->mnEventListenersIteratingCount++;
239 auto& rWindowImpl = *mpWindowImpl;
240 comphelper::ScopeGuard aGuard(
241 [&rWindowImpl, &xWindow]()
243 if (!xWindow->IsDisposed())
245 rWindowImpl.mnEventListenersIteratingCount--;
246 if (rWindowImpl.mnEventListenersIteratingCount == 0)
247 rWindowImpl.maEventListenersDeleted.clear();
251 for ( const Link<VclWindowEvent&,void>& rLink : aCopy )
253 if (xWindow->IsDisposed()) break;
254 // check this hasn't been removed in some re-enterancy scenario fdo#47368
255 if( rWindowImpl.maEventListenersDeleted.find(rLink) == rWindowImpl.maEventListenersDeleted.end() )
256 rLink.Call( aEvent );
260 while ( xWindow )
263 if ( xWindow->IsDisposed() )
264 return;
266 auto& rWindowImpl = *xWindow->mpWindowImpl;
267 if (!rWindowImpl.maChildEventListeners.empty())
269 // Copy the list, because this can be destroyed when calling a Link...
270 std::vector<Link<VclWindowEvent&,void>> aCopy( rWindowImpl.maChildEventListeners );
271 // we use an iterating counter/flag and a set of deleted Link's to avoid O(n^2) behaviour
272 rWindowImpl.mnChildEventListenersIteratingCount++;
273 comphelper::ScopeGuard aGuard(
274 [&rWindowImpl, &xWindow]()
276 if (!xWindow->IsDisposed())
278 rWindowImpl.mnChildEventListenersIteratingCount--;
279 if (rWindowImpl.mnChildEventListenersIteratingCount == 0)
280 rWindowImpl.maChildEventListenersDeleted.clear();
284 for ( const Link<VclWindowEvent&,void>& rLink : aCopy )
286 if (xWindow->IsDisposed())
287 return;
288 // Check this hasn't been removed in some re-enterancy scenario fdo#47368.
289 if( rWindowImpl.maChildEventListenersDeleted.find(rLink) == rWindowImpl.maChildEventListenersDeleted.end() )
290 rLink.Call( aEvent );
294 if ( xWindow->IsDisposed() )
295 return;
297 xWindow = xWindow->GetParent();
301 void Window::AddEventListener( const Link<VclWindowEvent&,void>& rEventListener )
303 mpWindowImpl->maEventListeners.push_back( rEventListener );
306 void Window::RemoveEventListener( const Link<VclWindowEvent&,void>& rEventListener )
308 if (mpWindowImpl)
310 auto& rListeners = mpWindowImpl->maEventListeners;
311 rListeners.erase( std::remove(rListeners.begin(), rListeners.end(), rEventListener ), rListeners.end() );
312 if (mpWindowImpl->mnEventListenersIteratingCount)
313 mpWindowImpl->maEventListenersDeleted.insert(rEventListener);
317 void Window::AddChildEventListener( const Link<VclWindowEvent&,void>& rEventListener )
319 mpWindowImpl->maChildEventListeners.push_back( rEventListener );
322 void Window::RemoveChildEventListener( const Link<VclWindowEvent&,void>& rEventListener )
324 if (mpWindowImpl)
326 auto& rListeners = mpWindowImpl->maChildEventListeners;
327 rListeners.erase( std::remove(rListeners.begin(), rListeners.end(), rEventListener ), rListeners.end() );
328 if (mpWindowImpl->mnChildEventListenersIteratingCount)
329 mpWindowImpl->maChildEventListenersDeleted.insert(rEventListener);
333 ImplSVEvent * Window::PostUserEvent( const Link<void*,void>& rLink, void* pCaller, bool bReferenceLink )
335 std::unique_ptr<ImplSVEvent> pSVEvent(new ImplSVEvent);
336 pSVEvent->mpData = pCaller;
337 pSVEvent->maLink = rLink;
338 pSVEvent->mpWindow = this;
339 pSVEvent->mbCall = true;
340 if (bReferenceLink)
342 // Double check that this is indeed a vcl::Window instance.
343 assert(dynamic_cast<vcl::Window *>(
344 static_cast<OutputDevice *>(rLink.GetInstance())) ==
345 static_cast<vcl::Window *>(rLink.GetInstance()));
346 pSVEvent->mpInstanceRef = static_cast<vcl::Window *>(rLink.GetInstance());
349 auto pTmpEvent = pSVEvent.get();
350 if (!mpWindowImpl->mpFrame->PostEvent( std::move(pSVEvent) ))
351 return nullptr;
352 return pTmpEvent;
355 void Window::RemoveUserEvent( ImplSVEvent * nUserEvent )
357 SAL_WARN_IF( nUserEvent->mpWindow.get() != this, "vcl",
358 "Window::RemoveUserEvent(): Event doesn't send to this window or is already removed" );
359 SAL_WARN_IF( !nUserEvent->mbCall, "vcl",
360 "Window::RemoveUserEvent(): Event is already removed" );
362 if ( nUserEvent->mpWindow )
364 nUserEvent->mpWindow = nullptr;
367 nUserEvent->mbCall = false;
371 static MouseEvent ImplTranslateMouseEvent( const MouseEvent& rE, vcl::Window const * pSource, vcl::Window const * pDest )
373 // the mouse event occurred in a different window, we need to translate the coordinates of
374 // the mouse cursor within that (source) window to the coordinates the mouse cursor would
375 // be in the destination window
376 Point aPos = pSource->OutputToScreenPixel( rE.GetPosPixel() );
377 return MouseEvent( pDest->ScreenToOutputPixel( aPos ), rE.GetClicks(), rE.GetMode(), rE.GetButtons(), rE.GetModifier() );
380 void Window::ImplNotifyKeyMouseCommandEventListeners( NotifyEvent& rNEvt )
382 if( rNEvt.GetType() == MouseNotifyEvent::COMMAND )
384 const CommandEvent* pCEvt = rNEvt.GetCommandEvent();
385 if ( pCEvt->GetCommand() != CommandEventId::ContextMenu )
386 // non context menu events are not to be notified up the chain
387 // so we return immediately
388 return;
390 if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
392 // not interested: The event listeners are already called in ::Command,
393 // and calling them here a second time doesn't make sense
394 if ( rNEvt.GetWindow() != this )
396 CommandEvent aCommandEvent;
398 if ( !pCEvt->IsMouseEvent() )
400 aCommandEvent = *pCEvt;
402 else
404 // the mouse event occurred in a different window, we need to translate the coordinates of
405 // the mouse cursor within that window to the coordinates the mouse cursor would be in the
406 // current window
407 vcl::Window* pSource = rNEvt.GetWindow();
408 Point aPos = pSource->OutputToScreenPixel( pCEvt->GetMousePosPixel() );
409 aCommandEvent = CommandEvent( ScreenToOutputPixel( aPos ), pCEvt->GetCommand(), pCEvt->IsMouseEvent(), pCEvt->GetEventData() );
412 CallEventListeners( VclEventId::WindowCommand, &aCommandEvent );
417 // #82968# notify event listeners for mouse and key events separately and
418 // not in PreNotify ( as for focus listeners )
419 // this allows for processing those events internally first and pass it to
420 // the toolkit later
422 VclPtr<vcl::Window> xWindow = this;
424 if( rNEvt.GetType() == MouseNotifyEvent::MOUSEMOVE )
426 if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
428 if ( rNEvt.GetWindow() == this )
429 CallEventListeners( VclEventId::WindowMouseMove, const_cast<MouseEvent *>(rNEvt.GetMouseEvent()) );
430 else
432 MouseEvent aMouseEvent = ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this );
433 CallEventListeners( VclEventId::WindowMouseMove, &aMouseEvent );
437 else if( rNEvt.GetType() == MouseNotifyEvent::MOUSEBUTTONUP )
439 if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
441 if ( rNEvt.GetWindow() == this )
442 CallEventListeners( VclEventId::WindowMouseButtonUp, const_cast<MouseEvent *>(rNEvt.GetMouseEvent()) );
443 else
445 MouseEvent aMouseEvent = ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this );
446 CallEventListeners( VclEventId::WindowMouseButtonUp, &aMouseEvent );
450 else if( rNEvt.GetType() == MouseNotifyEvent::MOUSEBUTTONDOWN )
452 if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
454 if ( rNEvt.GetWindow() == this )
455 CallEventListeners( VclEventId::WindowMouseButtonDown, const_cast<MouseEvent *>(rNEvt.GetMouseEvent()) );
456 else
458 MouseEvent aMouseEvent = ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this );
459 CallEventListeners( VclEventId::WindowMouseButtonDown, &aMouseEvent );
463 else if( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
465 if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
466 CallEventListeners( VclEventId::WindowKeyInput, const_cast<KeyEvent *>(rNEvt.GetKeyEvent()) );
468 else if( rNEvt.GetType() == MouseNotifyEvent::KEYUP )
470 if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
471 CallEventListeners( VclEventId::WindowKeyUp, const_cast<KeyEvent *>(rNEvt.GetKeyEvent()) );
474 if ( xWindow->IsDisposed() )
475 return;
477 // #106721# check if we're part of a compound control and notify
478 vcl::Window *pParent = ImplGetParent();
479 while( pParent )
481 if( pParent->IsCompoundControl() )
483 pParent->ImplNotifyKeyMouseCommandEventListeners( rNEvt );
484 break;
486 pParent = pParent->ImplGetParent();
490 void Window::ImplCallInitShow()
492 mpWindowImpl->mbReallyShown = true;
493 mpWindowImpl->mbInInitShow = true;
494 CompatStateChanged( StateChangedType::InitShow );
495 mpWindowImpl->mbInInitShow = false;
497 vcl::Window* pWindow = mpWindowImpl->mpFirstOverlap;
498 while ( pWindow )
500 if ( pWindow->mpWindowImpl->mbVisible )
501 pWindow->ImplCallInitShow();
502 pWindow = pWindow->mpWindowImpl->mpNext;
505 pWindow = mpWindowImpl->mpFirstChild;
506 while ( pWindow )
508 if ( pWindow->mpWindowImpl->mbVisible )
509 pWindow->ImplCallInitShow();
510 pWindow = pWindow->mpWindowImpl->mpNext;
515 void Window::ImplCallResize()
517 mpWindowImpl->mbCallResize = false;
519 // OpenGL has a charming feature of black clearing the whole window
520 // some legacy code eg. the app-menu has the beautiful feature of
521 // avoiding re-paints when width doesn't change => invalidate all.
522 #if HAVE_FEATURE_OPENGL
523 if( OpenGLWrapper::isVCLOpenGLEnabled() )
524 Invalidate();
526 // Normally we avoid blanking on re-size unless people might notice:
527 else
528 #endif
529 if( GetBackground().IsGradient() )
530 Invalidate();
532 Resize();
534 // #88419# Most classes don't call the base class in Resize() and Move(),
535 // => Call ImpleResize/Move instead of Resize/Move directly...
536 CallEventListeners( VclEventId::WindowResize );
539 void Window::ImplCallMove()
541 mpWindowImpl->mbCallMove = false;
543 if( mpWindowImpl->mbFrame )
545 // update frame position
546 SalFrame *pParentFrame = nullptr;
547 vcl::Window *pParent = ImplGetParent();
548 while( pParent )
550 if( pParent->mpWindowImpl->mpFrame != mpWindowImpl->mpFrame )
552 pParentFrame = pParent->mpWindowImpl->mpFrame;
553 break;
555 pParent = pParent->GetParent();
558 SalFrameGeometry g = mpWindowImpl->mpFrame->GetGeometry();
559 mpWindowImpl->maPos = Point( g.nX, g.nY );
560 if( pParentFrame )
562 g = pParentFrame->GetGeometry();
563 mpWindowImpl->maPos -= Point( g.nX, g.nY );
565 // the client window and all its subclients have the same position as the borderframe
566 // this is important for floating toolbars where the borderwindow is a floating window
567 // which has another borderwindow (ie the system floating window)
568 vcl::Window *pClientWin = mpWindowImpl->mpClientWindow;
569 while( pClientWin )
571 pClientWin->mpWindowImpl->maPos = mpWindowImpl->maPos;
572 pClientWin = pClientWin->mpWindowImpl->mpClientWindow;
576 Move();
578 CallEventListeners( VclEventId::WindowMove );
581 void Window::ImplCallFocusChangeActivate( vcl::Window* pNewOverlapWindow,
582 vcl::Window* pOldOverlapWindow )
584 ImplSVData* pSVData = ImplGetSVData();
585 vcl::Window* pNewRealWindow;
586 vcl::Window* pOldRealWindow;
587 bool bCallActivate = true;
588 bool bCallDeactivate = true;
590 if (!pOldOverlapWindow)
592 return;
595 pOldRealWindow = pOldOverlapWindow->ImplGetWindow();
596 if (!pNewOverlapWindow)
598 return;
601 pNewRealWindow = pNewOverlapWindow->ImplGetWindow();
602 if ( (pOldRealWindow->GetType() != WindowType::FLOATINGWINDOW) ||
603 pOldRealWindow->GetActivateMode() != ActivateModeFlags::NONE )
605 if ( (pNewRealWindow->GetType() == WindowType::FLOATINGWINDOW) &&
606 pNewRealWindow->GetActivateMode() == ActivateModeFlags::NONE)
608 pSVData->mpWinData->mpLastDeacWin = pOldOverlapWindow;
609 bCallDeactivate = false;
612 else if ( (pNewRealWindow->GetType() != WindowType::FLOATINGWINDOW) ||
613 pNewRealWindow->GetActivateMode() != ActivateModeFlags::NONE )
615 if (pSVData->mpWinData->mpLastDeacWin)
617 if (pSVData->mpWinData->mpLastDeacWin.get() == pNewOverlapWindow)
618 bCallActivate = false;
619 else
621 vcl::Window* pLastRealWindow = pSVData->mpWinData->mpLastDeacWin->ImplGetWindow();
622 pSVData->mpWinData->mpLastDeacWin->mpWindowImpl->mbActive = false;
623 pSVData->mpWinData->mpLastDeacWin->Deactivate();
624 if (pLastRealWindow != pSVData->mpWinData->mpLastDeacWin.get())
626 pLastRealWindow->mpWindowImpl->mbActive = true;
627 pLastRealWindow->Activate();
630 pSVData->mpWinData->mpLastDeacWin = nullptr;
634 if ( bCallDeactivate )
636 if( pOldOverlapWindow->mpWindowImpl->mbActive )
638 pOldOverlapWindow->mpWindowImpl->mbActive = false;
639 pOldOverlapWindow->Deactivate();
641 if ( pOldRealWindow != pOldOverlapWindow )
643 if( pOldRealWindow->mpWindowImpl->mbActive )
645 pOldRealWindow->mpWindowImpl->mbActive = false;
646 pOldRealWindow->Deactivate();
650 if ( !bCallActivate || pNewOverlapWindow->mpWindowImpl->mbActive )
651 return;
653 pNewOverlapWindow->mpWindowImpl->mbActive = true;
654 pNewOverlapWindow->Activate();
656 if ( pNewRealWindow != pNewOverlapWindow )
658 if( ! pNewRealWindow->mpWindowImpl->mbActive )
660 pNewRealWindow->mpWindowImpl->mbActive = true;
661 pNewRealWindow->Activate();
666 } /* namespace vcl */
669 NotifyEvent::NotifyEvent( MouseNotifyEvent nEventType, vcl::Window* pWindow,
670 const void* pEvent )
672 mpWindow = pWindow;
673 mpData = const_cast<void*>(pEvent);
674 mnEventType = nEventType;
677 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */