bump product version to 7.6.3.2-android
[LibreOffice.git] / vcl / source / window / event.cxx
blob22845912fb3688440d8915aa0685b761537f379a
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 <sal/log.hxx>
26 #include <window.h>
27 #include <svdata.hxx>
28 #include <salframe.hxx>
29 #include <config_features.h>
30 #include <comphelper/scopeguard.hxx>
32 #include "impldockingwrapper.hxx"
34 namespace vcl {
36 void Window::DataChanged( const DataChangedEvent& )
40 void Window::NotifyAllChildren( DataChangedEvent& rDCEvt )
42 CompatDataChanged( rDCEvt );
44 vcl::Window* pChild = mpWindowImpl->mpFirstChild;
45 while ( pChild )
47 pChild->NotifyAllChildren( rDCEvt );
48 pChild = pChild->mpWindowImpl->mpNext;
52 bool Window::PreNotify( NotifyEvent& rNEvt )
54 bool bDone = false;
55 if ( mpWindowImpl->mpParent && !ImplIsOverlapWindow() )
56 bDone = mpWindowImpl->mpParent->CompatPreNotify( rNEvt );
58 if ( !bDone )
60 if( rNEvt.GetType() == NotifyEventType::GETFOCUS )
62 bool bCompoundFocusChanged = false;
63 if ( mpWindowImpl->mbCompoundControl && !mpWindowImpl->mbCompoundControlHasFocus && HasChildPathFocus() )
65 mpWindowImpl->mbCompoundControlHasFocus = true;
66 bCompoundFocusChanged = true;
69 if ( bCompoundFocusChanged || ( rNEvt.GetWindow() == this ) )
70 CallEventListeners( VclEventId::WindowGetFocus );
72 else if( rNEvt.GetType() == NotifyEventType::LOSEFOCUS )
74 bool bCompoundFocusChanged = false;
75 if ( mpWindowImpl->mbCompoundControl && mpWindowImpl->mbCompoundControlHasFocus && !HasChildPathFocus() )
77 mpWindowImpl->mbCompoundControlHasFocus = false ;
78 bCompoundFocusChanged = true;
81 if ( bCompoundFocusChanged || ( rNEvt.GetWindow() == this ) )
82 CallEventListeners( VclEventId::WindowLoseFocus );
85 // #82968# mouse and key events will be notified after processing ( in ImplNotifyKeyMouseCommandEventListeners() )!
86 // see also ImplHandleMouseEvent(), ImplHandleKey()
90 return bDone;
93 namespace
95 bool parentNotDialogControl(Window* pWindow)
97 vcl::Window* pParent = getNonLayoutParent(pWindow);
98 if (!pParent)
99 return true;
100 return ((pParent->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) != WB_DIALOGCONTROL);
104 bool Window::EventNotify( NotifyEvent& rNEvt )
106 bool bRet = false;
108 if (isDisposed())
109 return false;
111 // check for docking window
112 // but do nothing if window is docked and locked
113 ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this );
114 if ((GetStyle() & WB_DOCKABLE) &&
115 pWrapper && ( pWrapper->IsFloatingMode() || !pWrapper->IsLocked() ))
117 const bool bDockingSupportCrippled = !StyleSettings::GetDockingFloatsSupported();
119 if ( rNEvt.GetType() == NotifyEventType::MOUSEBUTTONDOWN )
121 const MouseEvent* pMEvt = rNEvt.GetMouseEvent();
122 bool bHit = pWrapper->GetDragArea().Contains( pMEvt->GetPosPixel() );
123 if ( pMEvt->IsLeft() )
125 if (!bDockingSupportCrippled && pMEvt->IsMod1() && (pMEvt->GetClicks() == 2))
127 // ctrl double click toggles floating mode
128 pWrapper->SetFloatingMode( !pWrapper->IsFloatingMode() );
129 return true;
131 else if ( pMEvt->GetClicks() == 1 && bHit)
133 // allow start docking during mouse move
134 pWrapper->ImplEnableStartDocking();
135 return true;
139 else if ( rNEvt.GetType() == NotifyEventType::MOUSEMOVE )
141 const MouseEvent* pMEvt = rNEvt.GetMouseEvent();
142 bool bHit = pWrapper->GetDragArea().Contains( pMEvt->GetPosPixel() );
143 if ( pMEvt->IsLeft() )
145 // check if a single click initiated this sequence ( ImplStartDockingEnabled() )
146 // check if window is docked and
147 if( pWrapper->ImplStartDockingEnabled() && !pWrapper->IsFloatingMode() &&
148 !pWrapper->IsDocking() && bHit )
150 Point aPos = pMEvt->GetPosPixel();
151 vcl::Window* pWindow = rNEvt.GetWindow();
152 if ( pWindow != this )
154 aPos = pWindow->OutputToScreenPixel( aPos );
155 aPos = ScreenToOutputPixel( aPos );
157 pWrapper->ImplStartDocking( aPos );
159 return true;
162 else if( rNEvt.GetType() == NotifyEventType::KEYINPUT )
164 const vcl::KeyCode& rKey = rNEvt.GetKeyEvent()->GetKeyCode();
165 if (rKey.GetCode() == KEY_F10 && rKey.GetModifier() &&
166 rKey.IsShift() && rKey.IsMod1() && !bDockingSupportCrippled)
168 pWrapper->SetFloatingMode( !pWrapper->IsFloatingMode() );
169 /* At this point the floating toolbar frame does not have the
170 * input focus since these frames don't get the focus per default
171 * To enable keyboard handling of this toolbar set the input focus
172 * to the frame. This needs to be done with ToTop since GrabFocus
173 * would not notice any change since "this" already has the focus.
175 if( pWrapper->IsFloatingMode() )
176 ToTop( ToTopFlags::GrabFocusOnly );
177 return true;
182 // manage the dialogs
183 if ( (GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) == WB_DIALOGCONTROL )
185 // if the parent also has dialog control activated, the parent takes over control
186 if ( (rNEvt.GetType() == NotifyEventType::KEYINPUT) || (rNEvt.GetType() == NotifyEventType::KEYUP) )
188 // ScGridWindow has WB_DIALOGCONTROL set, so pressing tab in ScCheckListMenuControl won't
189 // get processed here by the toplevel DockingWindow of ScCheckListMenuControl by
190 // just checking if parentNotDialogControl is true
191 bool bTopLevelFloatingWindow = (pWrapper && pWrapper->IsFloatingMode());
192 if (ImplIsOverlapWindow() || parentNotDialogControl(this) || bTopLevelFloatingWindow)
194 bRet = ImplDlgCtrl( *rNEvt.GetKeyEvent(), rNEvt.GetType() == NotifyEventType::KEYINPUT );
197 else if ( (rNEvt.GetType() == NotifyEventType::GETFOCUS) || (rNEvt.GetType() == NotifyEventType::LOSEFOCUS) )
199 ImplDlgCtrlFocusChanged( rNEvt.GetWindow(), rNEvt.GetType() == NotifyEventType::GETFOCUS );
200 if ( (rNEvt.GetWindow() == this) && (rNEvt.GetType() == NotifyEventType::GETFOCUS) &&
201 !(GetStyle() & WB_TABSTOP) && !(mpWindowImpl->mnDlgCtrlFlags & DialogControlFlags::WantFocus) )
203 vcl::Window* pFirstChild = ImplGetDlgWindow( 0, GetDlgWindowType::First );
204 if ( pFirstChild )
205 pFirstChild->ImplControlFocus();
210 if ( !bRet )
212 if ( mpWindowImpl->mpParent && !ImplIsOverlapWindow() )
213 bRet = mpWindowImpl->mpParent->CompatNotify( rNEvt );
216 return bRet;
219 void Window::CallEventListeners( VclEventId nEvent, void* pData )
221 VclWindowEvent aEvent( this, nEvent, pData );
223 VclPtr<vcl::Window> xWindow = this;
225 Application::ImplCallEventListeners( aEvent );
227 // if we have ObjectDying, then the bIsDisposed flag has already been set,
228 // but we still need to let listeners know.
229 const bool bIgnoreDisposed = nEvent == VclEventId::ObjectDying;
231 if ( !bIgnoreDisposed && xWindow->isDisposed() )
232 return;
234 // If maEventListeners is empty, the XVCLWindow has not yet been initialized.
235 // Calling GetComponentInterface will do that.
236 if (mpWindowImpl->maEventListeners.empty() && pData)
237 xWindow->GetComponentInterface();
239 if (!mpWindowImpl->maEventListeners.empty())
241 // Copy the list, because this can be destroyed when calling a Link...
242 std::vector<Link<VclWindowEvent&,void>> aCopy( mpWindowImpl->maEventListeners );
243 // we use an iterating counter/flag and a set of deleted Link's to avoid O(n^2) behaviour
244 mpWindowImpl->mnEventListenersIteratingCount++;
245 auto& rWindowImpl = *mpWindowImpl;
246 comphelper::ScopeGuard aGuard(
247 [&rWindowImpl, &xWindow, &bIgnoreDisposed]()
249 if (bIgnoreDisposed || !xWindow->isDisposed())
251 rWindowImpl.mnEventListenersIteratingCount--;
252 if (rWindowImpl.mnEventListenersIteratingCount == 0)
253 rWindowImpl.maEventListenersDeleted.clear();
257 for ( const Link<VclWindowEvent&,void>& rLink : aCopy )
259 if (!bIgnoreDisposed && xWindow->isDisposed()) break;
260 // check this hasn't been removed in some re-enterancy scenario fdo#47368
261 if( rWindowImpl.maEventListenersDeleted.find(rLink) == rWindowImpl.maEventListenersDeleted.end() )
262 rLink.Call( aEvent );
266 while ( xWindow )
269 if ( !bIgnoreDisposed && xWindow->isDisposed() )
270 return;
272 auto& rWindowImpl = *xWindow->mpWindowImpl;
273 if (!rWindowImpl.maChildEventListeners.empty())
275 // Copy the list, because this can be destroyed when calling a Link...
276 std::vector<Link<VclWindowEvent&,void>> aCopy( rWindowImpl.maChildEventListeners );
277 // we use an iterating counter/flag and a set of deleted Link's to avoid O(n^2) behaviour
278 rWindowImpl.mnChildEventListenersIteratingCount++;
279 comphelper::ScopeGuard aGuard(
280 [&rWindowImpl, &xWindow, &bIgnoreDisposed]()
282 if (bIgnoreDisposed || !xWindow->isDisposed())
284 rWindowImpl.mnChildEventListenersIteratingCount--;
285 if (rWindowImpl.mnChildEventListenersIteratingCount == 0)
286 rWindowImpl.maChildEventListenersDeleted.clear();
290 for ( const Link<VclWindowEvent&,void>& rLink : aCopy )
292 if (!bIgnoreDisposed && xWindow->isDisposed())
293 return;
294 // Check this hasn't been removed in some re-enterancy scenario fdo#47368.
295 if( rWindowImpl.maChildEventListenersDeleted.find(rLink) == rWindowImpl.maChildEventListenersDeleted.end() )
296 rLink.Call( aEvent );
300 if ( !bIgnoreDisposed && xWindow->isDisposed() )
301 return;
303 xWindow = xWindow->GetParent();
307 void Window::AddEventListener( const Link<VclWindowEvent&,void>& rEventListener )
309 mpWindowImpl->maEventListeners.push_back( rEventListener );
312 void Window::RemoveEventListener( const Link<VclWindowEvent&,void>& rEventListener )
314 if (mpWindowImpl)
316 auto& rListeners = mpWindowImpl->maEventListeners;
317 rListeners.erase( std::remove(rListeners.begin(), rListeners.end(), rEventListener ), rListeners.end() );
318 if (mpWindowImpl->mnEventListenersIteratingCount)
319 mpWindowImpl->maEventListenersDeleted.insert(rEventListener);
323 void Window::AddChildEventListener( const Link<VclWindowEvent&,void>& rEventListener )
325 mpWindowImpl->maChildEventListeners.push_back( rEventListener );
328 void Window::RemoveChildEventListener( const Link<VclWindowEvent&,void>& rEventListener )
330 if (mpWindowImpl)
332 auto& rListeners = mpWindowImpl->maChildEventListeners;
333 rListeners.erase( std::remove(rListeners.begin(), rListeners.end(), rEventListener ), rListeners.end() );
334 if (mpWindowImpl->mnChildEventListenersIteratingCount)
335 mpWindowImpl->maChildEventListenersDeleted.insert(rEventListener);
339 ImplSVEvent * Window::PostUserEvent( const Link<void*,void>& rLink, void* pCaller, bool bReferenceLink )
341 std::unique_ptr<ImplSVEvent> pSVEvent(new ImplSVEvent);
342 pSVEvent->mpData = pCaller;
343 pSVEvent->maLink = rLink;
344 pSVEvent->mpWindow = this;
345 pSVEvent->mbCall = true;
346 if (bReferenceLink)
348 pSVEvent->mpInstanceRef = static_cast<vcl::Window *>(rLink.GetInstance());
351 auto pTmpEvent = pSVEvent.get();
352 if (!mpWindowImpl->mpFrame->PostEvent( std::move(pSVEvent) ))
353 return nullptr;
354 return pTmpEvent;
357 void Window::RemoveUserEvent( ImplSVEvent * nUserEvent )
359 SAL_WARN_IF( nUserEvent->mpWindow.get() != this, "vcl",
360 "Window::RemoveUserEvent(): Event doesn't send to this window or is already removed" );
361 SAL_WARN_IF( !nUserEvent->mbCall, "vcl",
362 "Window::RemoveUserEvent(): Event is already removed" );
364 if ( nUserEvent->mpWindow )
366 nUserEvent->mpWindow = nullptr;
369 nUserEvent->mbCall = false;
373 static MouseEvent ImplTranslateMouseEvent( const MouseEvent& rE, vcl::Window const * pSource, vcl::Window const * pDest )
375 // the mouse event occurred in a different window, we need to translate the coordinates of
376 // the mouse cursor within that (source) window to the coordinates the mouse cursor would
377 // be in the destination window
378 Point aPos = pSource->OutputToScreenPixel( rE.GetPosPixel() );
379 return MouseEvent( pDest->ScreenToOutputPixel( aPos ), rE.GetClicks(), rE.GetMode(), rE.GetButtons(), rE.GetModifier() );
382 void Window::ImplNotifyKeyMouseCommandEventListeners( NotifyEvent& rNEvt )
384 if( rNEvt.GetType() == NotifyEventType::COMMAND )
386 const CommandEvent* pCEvt = rNEvt.GetCommandEvent();
387 if ( pCEvt->GetCommand() != CommandEventId::ContextMenu )
388 // non context menu events are not to be notified up the chain
389 // so we return immediately
390 return;
392 if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
394 // not interested: The event listeners are already called in ::Command,
395 // and calling them here a second time doesn't make sense
396 if ( rNEvt.GetWindow() != this )
398 CommandEvent aCommandEvent;
400 if ( !pCEvt->IsMouseEvent() )
402 aCommandEvent = *pCEvt;
404 else
406 // the mouse event occurred in a different window, we need to translate the coordinates of
407 // the mouse cursor within that window to the coordinates the mouse cursor would be in the
408 // current window
409 vcl::Window* pSource = rNEvt.GetWindow();
410 Point aPos = pSource->OutputToScreenPixel( pCEvt->GetMousePosPixel() );
411 aCommandEvent = CommandEvent( ScreenToOutputPixel( aPos ), pCEvt->GetCommand(), pCEvt->IsMouseEvent(), pCEvt->GetEventData() );
414 CallEventListeners( VclEventId::WindowCommand, &aCommandEvent );
419 // #82968# notify event listeners for mouse and key events separately and
420 // not in PreNotify ( as for focus listeners )
421 // this allows for processing those events internally first and pass it to
422 // the toolkit later
424 VclPtr<vcl::Window> xWindow = this;
426 if( rNEvt.GetType() == NotifyEventType::MOUSEMOVE )
428 if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
430 if ( rNEvt.GetWindow() == this )
431 CallEventListeners( VclEventId::WindowMouseMove, const_cast<MouseEvent *>(rNEvt.GetMouseEvent()) );
432 else
434 MouseEvent aMouseEvent = ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this );
435 CallEventListeners( VclEventId::WindowMouseMove, &aMouseEvent );
439 else if( rNEvt.GetType() == NotifyEventType::MOUSEBUTTONUP )
441 if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
443 if ( rNEvt.GetWindow() == this )
444 CallEventListeners( VclEventId::WindowMouseButtonUp, const_cast<MouseEvent *>(rNEvt.GetMouseEvent()) );
445 else
447 MouseEvent aMouseEvent = ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this );
448 CallEventListeners( VclEventId::WindowMouseButtonUp, &aMouseEvent );
452 else if( rNEvt.GetType() == NotifyEventType::MOUSEBUTTONDOWN )
454 if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
456 if ( rNEvt.GetWindow() == this )
457 CallEventListeners( VclEventId::WindowMouseButtonDown, const_cast<MouseEvent *>(rNEvt.GetMouseEvent()) );
458 else
460 MouseEvent aMouseEvent = ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this );
461 CallEventListeners( VclEventId::WindowMouseButtonDown, &aMouseEvent );
465 else if( rNEvt.GetType() == NotifyEventType::KEYINPUT )
467 if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
468 CallEventListeners( VclEventId::WindowKeyInput, const_cast<KeyEvent *>(rNEvt.GetKeyEvent()) );
470 else if( rNEvt.GetType() == NotifyEventType::KEYUP )
472 if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
473 CallEventListeners( VclEventId::WindowKeyUp, const_cast<KeyEvent *>(rNEvt.GetKeyEvent()) );
476 if ( xWindow->isDisposed() )
477 return;
479 // #106721# check if we're part of a compound control and notify
480 vcl::Window *pParent = ImplGetParent();
481 while( pParent )
483 if( pParent->IsCompoundControl() )
485 pParent->ImplNotifyKeyMouseCommandEventListeners( rNEvt );
486 break;
488 pParent = pParent->ImplGetParent();
492 void Window::ImplCallInitShow()
494 mpWindowImpl->mbReallyShown = true;
495 mpWindowImpl->mbInInitShow = true;
496 CompatStateChanged( StateChangedType::InitShow );
497 mpWindowImpl->mbInInitShow = false;
499 vcl::Window* pWindow = mpWindowImpl->mpFirstOverlap;
500 while ( pWindow )
502 if ( pWindow->mpWindowImpl->mbVisible )
503 pWindow->ImplCallInitShow();
504 pWindow = pWindow->mpWindowImpl->mpNext;
507 pWindow = mpWindowImpl->mpFirstChild;
508 while ( pWindow )
510 if ( pWindow->mpWindowImpl->mbVisible )
511 pWindow->ImplCallInitShow();
512 pWindow = pWindow->mpWindowImpl->mpNext;
517 void Window::ImplCallResize()
519 mpWindowImpl->mbCallResize = false;
521 // Normally we avoid blanking on re-size unless people might notice:
522 if( GetBackground().IsGradient() )
523 Invalidate();
525 Resize();
527 // #88419# Most classes don't call the base class in Resize() and Move(),
528 // => Call ImpleResize/Move instead of Resize/Move directly...
529 CallEventListeners( VclEventId::WindowResize );
532 void Window::ImplCallMove()
534 mpWindowImpl->mbCallMove = false;
536 if( mpWindowImpl->mbFrame )
538 // update frame position
539 SalFrame *pParentFrame = nullptr;
540 vcl::Window *pParent = ImplGetParent();
541 while( pParent )
543 if( pParent->mpWindowImpl &&
544 pParent->mpWindowImpl->mpFrame != mpWindowImpl->mpFrame )
546 pParentFrame = pParent->mpWindowImpl->mpFrame;
547 break;
549 pParent = pParent->GetParent();
552 SalFrameGeometry g = mpWindowImpl->mpFrame->GetGeometry();
553 mpWindowImpl->maPos = Point(g.x(), g.y());
554 if( pParentFrame )
556 g = pParentFrame->GetGeometry();
557 mpWindowImpl->maPos -= Point(g.x(), g.y());
559 // the client window and all its subclients have the same position as the borderframe
560 // this is important for floating toolbars where the borderwindow is a floating window
561 // which has another borderwindow (ie the system floating window)
562 vcl::Window *pClientWin = mpWindowImpl->mpClientWindow;
563 while( pClientWin )
565 pClientWin->mpWindowImpl->maPos = mpWindowImpl->maPos;
566 pClientWin = pClientWin->mpWindowImpl->mpClientWindow;
570 Move();
572 CallEventListeners( VclEventId::WindowMove );
575 void Window::ImplCallFocusChangeActivate( vcl::Window* pNewOverlapWindow,
576 vcl::Window* pOldOverlapWindow )
578 ImplSVData* pSVData = ImplGetSVData();
579 vcl::Window* pNewRealWindow;
580 vcl::Window* pOldRealWindow;
581 bool bCallActivate = true;
582 bool bCallDeactivate = true;
584 if (!pOldOverlapWindow)
586 return;
589 pOldRealWindow = pOldOverlapWindow->ImplGetWindow();
590 if (!pNewOverlapWindow)
592 return;
595 pNewRealWindow = pNewOverlapWindow->ImplGetWindow();
596 if ( (pOldRealWindow->GetType() != WindowType::FLOATINGWINDOW) ||
597 pOldRealWindow->GetActivateMode() != ActivateModeFlags::NONE )
599 if ( (pNewRealWindow->GetType() == WindowType::FLOATINGWINDOW) &&
600 pNewRealWindow->GetActivateMode() == ActivateModeFlags::NONE)
602 pSVData->mpWinData->mpLastDeacWin = pOldOverlapWindow;
603 bCallDeactivate = false;
606 else if ( (pNewRealWindow->GetType() != WindowType::FLOATINGWINDOW) ||
607 pNewRealWindow->GetActivateMode() != ActivateModeFlags::NONE )
609 if (pSVData->mpWinData->mpLastDeacWin)
611 if (pSVData->mpWinData->mpLastDeacWin.get() == pNewOverlapWindow)
612 bCallActivate = false;
613 else
615 vcl::Window* pLastRealWindow = pSVData->mpWinData->mpLastDeacWin->ImplGetWindow();
616 pSVData->mpWinData->mpLastDeacWin->mpWindowImpl->mbActive = false;
617 pSVData->mpWinData->mpLastDeacWin->Deactivate();
618 if (pLastRealWindow != pSVData->mpWinData->mpLastDeacWin.get())
620 pLastRealWindow->mpWindowImpl->mbActive = true;
621 pLastRealWindow->Activate();
624 pSVData->mpWinData->mpLastDeacWin = nullptr;
628 if ( bCallDeactivate )
630 if( pOldOverlapWindow->mpWindowImpl->mbActive )
632 pOldOverlapWindow->mpWindowImpl->mbActive = false;
633 pOldOverlapWindow->Deactivate();
635 if ( pOldRealWindow != pOldOverlapWindow )
637 if( pOldRealWindow->mpWindowImpl->mbActive )
639 pOldRealWindow->mpWindowImpl->mbActive = false;
640 pOldRealWindow->Deactivate();
644 if ( !bCallActivate || pNewOverlapWindow->mpWindowImpl->mbActive )
645 return;
647 pNewOverlapWindow->mpWindowImpl->mbActive = true;
648 pNewOverlapWindow->Activate();
650 if ( pNewRealWindow != pNewOverlapWindow )
652 if( ! pNewRealWindow->mpWindowImpl->mbActive )
654 pNewRealWindow->mpWindowImpl->mbActive = true;
655 pNewRealWindow->Activate();
660 } /* namespace vcl */
663 NotifyEvent::NotifyEvent( NotifyEventType nEventType, vcl::Window* pWindow,
664 const void* pEvent )
666 mpWindow = pWindow;
667 mpData = const_cast<void*>(pEvent);
668 mnEventType = nEventType;
671 NotifyEvent::~NotifyEvent() = default;
673 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */