LibreOffice Module vcl (master)  1
event.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #include <vcl/event.hxx>
21 #include <vcl/window.hxx>
22 #include <vcl/dockwin.hxx>
23 #include <vcl/layout.hxx>
25 #include <sal/log.hxx>
26 
27 #include <window.h>
28 #include <svdata.hxx>
29 #include <salframe.hxx>
30 #include <config_features.h>
32 
33 namespace vcl {
34 
36 {
37 }
38 
40 {
41  CompatDataChanged( rDCEvt );
42 
43  vcl::Window* pChild = mpWindowImpl->mpFirstChild;
44  while ( pChild )
45  {
46  pChild->NotifyAllChildren( rDCEvt );
47  pChild = pChild->mpWindowImpl->mpNext;
48  }
49 }
50 
52 {
53  bool bDone = false;
54  if ( mpWindowImpl->mpParent && !ImplIsOverlapWindow() )
55  bDone = mpWindowImpl->mpParent->CompatPreNotify( rNEvt );
56 
57  if ( !bDone )
58  {
59  if( rNEvt.GetType() == MouseNotifyEvent::GETFOCUS )
60  {
61  bool bCompoundFocusChanged = false;
62  if ( mpWindowImpl->mbCompoundControl && !mpWindowImpl->mbCompoundControlHasFocus && HasChildPathFocus() )
63  {
64  mpWindowImpl->mbCompoundControlHasFocus = true;
65  bCompoundFocusChanged = true;
66  }
67 
68  if ( bCompoundFocusChanged || ( rNEvt.GetWindow() == this ) )
70  }
71  else if( rNEvt.GetType() == MouseNotifyEvent::LOSEFOCUS )
72  {
73  bool bCompoundFocusChanged = false;
74  if ( mpWindowImpl->mbCompoundControl && mpWindowImpl->mbCompoundControlHasFocus && !HasChildPathFocus() )
75  {
76  mpWindowImpl->mbCompoundControlHasFocus = false ;
77  bCompoundFocusChanged = true;
78  }
79 
80  if ( bCompoundFocusChanged || ( rNEvt.GetWindow() == this ) )
82  }
83 
84  // #82968# mouse and key events will be notified after processing ( in ImplNotifyKeyMouseCommandEventListeners() )!
85  // see also ImplHandleMouseEvent(), ImplHandleKey()
86 
87  }
88 
89  return bDone;
90 }
91 
92 namespace
93 {
94  bool parentNotDialogControl(Window* pWindow)
95  {
96  vcl::Window* pParent = getNonLayoutParent(pWindow);
97  if (!pParent)
98  return true;
99  return ((pParent->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) != WB_DIALOGCONTROL);
100  }
101 }
102 
104 {
105  bool bRet = false;
106 
107  if (IsDisposed())
108  return false;
109 
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() ))
114  {
115  const bool bDockingSupportCrippled = !StyleSettings::GetDockingFloatsSupported();
116 
118  {
119  const MouseEvent* pMEvt = rNEvt.GetMouseEvent();
120  bool bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() );
121  if ( pMEvt->IsLeft() )
122  {
123  if (!bDockingSupportCrippled && pMEvt->IsMod1() && (pMEvt->GetClicks() == 2))
124  {
125  // ctrl double click toggles floating mode
126  pWrapper->SetFloatingMode( !pWrapper->IsFloatingMode() );
127  return true;
128  }
129  else if ( pMEvt->GetClicks() == 1 && bHit)
130  {
131  // allow start docking during mouse move
132  pWrapper->ImplEnableStartDocking();
133  return true;
134  }
135  }
136  }
137  else if ( rNEvt.GetType() == MouseNotifyEvent::MOUSEMOVE )
138  {
139  const MouseEvent* pMEvt = rNEvt.GetMouseEvent();
140  bool bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() );
141  if ( pMEvt->IsLeft() )
142  {
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 )
147  {
148  Point aPos = pMEvt->GetPosPixel();
149  vcl::Window* pWindow = rNEvt.GetWindow();
150  if ( pWindow != this )
151  {
152  aPos = pWindow->OutputToScreenPixel( aPos );
153  aPos = ScreenToOutputPixel( aPos );
154  }
155  pWrapper->ImplStartDocking( aPos );
156  }
157  return true;
158  }
159  }
160  else if( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
161  {
162  const vcl::KeyCode& rKey = rNEvt.GetKeyEvent()->GetKeyCode();
163  if (rKey.GetCode() == KEY_F10 && rKey.GetModifier() &&
164  rKey.IsShift() && rKey.IsMod1() && !bDockingSupportCrippled)
165  {
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.
172  */
173  if( pWrapper->IsFloatingMode() )
175  return true;
176  }
177  }
178  }
179 
180  // manage the dialogs
182  {
183  // if the parent also has dialog control activated, the parent takes over control
184  if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) || (rNEvt.GetType() == MouseNotifyEvent::KEYUP) )
185  {
186  if (ImplIsOverlapWindow() || parentNotDialogControl(this))
187  {
188  bRet = ImplDlgCtrl( *rNEvt.GetKeyEvent(), rNEvt.GetType() == MouseNotifyEvent::KEYINPUT );
189  }
190  }
191  else if ( (rNEvt.GetType() == MouseNotifyEvent::GETFOCUS) || (rNEvt.GetType() == MouseNotifyEvent::LOSEFOCUS) )
192  {
194  if ( (rNEvt.GetWindow() == this) && (rNEvt.GetType() == MouseNotifyEvent::GETFOCUS) &&
195  !(GetStyle() & WB_TABSTOP) && !(mpWindowImpl->mnDlgCtrlFlags & DialogControlFlags::WantFocus) )
196  {
198  if ( pFirstChild )
199  pFirstChild->ImplControlFocus();
200  }
201  }
202  }
203 
204  if ( !bRet )
205  {
206  if ( mpWindowImpl->mpParent && !ImplIsOverlapWindow() )
207  bRet = mpWindowImpl->mpParent->CompatNotify( rNEvt );
208  }
209 
210  return bRet;
211 }
212 
213 void Window::CallEventListeners( VclEventId nEvent, void* pData )
214 {
215  VclWindowEvent aEvent( this, nEvent, pData );
216 
217  VclPtr<vcl::Window> xWindow = this;
218 
220 
221  if ( xWindow->IsDisposed() )
222  return;
223 
224  // If maEventListeners is empty, the XVCLWindow has not yet been initialized.
225  // Calling GetComponentInterface will do that.
226  if (mpWindowImpl->maEventListeners.empty() && pData)
227  xWindow->GetComponentInterface();
228 
229  if (!mpWindowImpl->maEventListeners.empty())
230  {
231  // Copy the list, because this can be destroyed when calling a Link...
232  std::vector<Link<VclWindowEvent&,void>> aCopy( mpWindowImpl->maEventListeners );
233  // we use an iterating counter/flag and a set of deleted Link's to avoid O(n^2) behaviour
234  mpWindowImpl->mnEventListenersIteratingCount++;
235  auto& rWindowImpl = *mpWindowImpl;
236  comphelper::ScopeGuard aGuard(
237  [&rWindowImpl, &xWindow]()
238  {
239  if (!xWindow->IsDisposed())
240  {
241  rWindowImpl.mnEventListenersIteratingCount--;
242  if (rWindowImpl.mnEventListenersIteratingCount == 0)
243  rWindowImpl.maEventListenersDeleted.clear();
244  }
245  }
246  );
247  for ( const Link<VclWindowEvent&,void>& rLink : aCopy )
248  {
249  if (xWindow->IsDisposed()) break;
250  // check this hasn't been removed in some re-enterancy scenario fdo#47368
251  if( rWindowImpl.maEventListenersDeleted.find(rLink) == rWindowImpl.maEventListenersDeleted.end() )
252  rLink.Call( aEvent );
253  }
254  }
255 
256  while ( xWindow )
257  {
258 
259  if ( xWindow->IsDisposed() )
260  return;
261 
262  auto& rWindowImpl = *xWindow->mpWindowImpl;
263  if (!rWindowImpl.maChildEventListeners.empty())
264  {
265  // Copy the list, because this can be destroyed when calling a Link...
266  std::vector<Link<VclWindowEvent&,void>> aCopy( rWindowImpl.maChildEventListeners );
267  // we use an iterating counter/flag and a set of deleted Link's to avoid O(n^2) behaviour
268  rWindowImpl.mnChildEventListenersIteratingCount++;
269  comphelper::ScopeGuard aGuard(
270  [&rWindowImpl, &xWindow]()
271  {
272  if (!xWindow->IsDisposed())
273  {
274  rWindowImpl.mnChildEventListenersIteratingCount--;
275  if (rWindowImpl.mnChildEventListenersIteratingCount == 0)
276  rWindowImpl.maChildEventListenersDeleted.clear();
277  }
278  }
279  );
280  for ( const Link<VclWindowEvent&,void>& rLink : aCopy )
281  {
282  if (xWindow->IsDisposed())
283  return;
284  // Check this hasn't been removed in some re-enterancy scenario fdo#47368.
285  if( rWindowImpl.maChildEventListenersDeleted.find(rLink) == rWindowImpl.maChildEventListenersDeleted.end() )
286  rLink.Call( aEvent );
287  }
288  }
289 
290  if ( xWindow->IsDisposed() )
291  return;
292 
293  xWindow = xWindow->GetParent();
294  }
295 }
296 
298 {
300 }
301 
303 {
304  mpWindowImpl->maEventListeners.push_back( rEventListener );
305 }
306 
308 {
309  if (mpWindowImpl)
310  {
311  auto& rListeners = mpWindowImpl->maEventListeners;
312  rListeners.erase( std::remove(rListeners.begin(), rListeners.end(), rEventListener ), rListeners.end() );
313  if (mpWindowImpl->mnEventListenersIteratingCount)
314  mpWindowImpl->maEventListenersDeleted.insert(rEventListener);
315  }
316 }
317 
319 {
320  mpWindowImpl->maChildEventListeners.push_back( rEventListener );
321 }
322 
324 {
325  if (mpWindowImpl)
326  {
327  auto& rListeners = mpWindowImpl->maChildEventListeners;
328  rListeners.erase( std::remove(rListeners.begin(), rListeners.end(), rEventListener ), rListeners.end() );
329  if (mpWindowImpl->mnChildEventListenersIteratingCount)
330  mpWindowImpl->maChildEventListenersDeleted.insert(rEventListener);
331  }
332 }
333 
334 ImplSVEvent * Window::PostUserEvent( const Link<void*,void>& rLink, void* pCaller, bool bReferenceLink )
335 {
336  std::unique_ptr<ImplSVEvent> pSVEvent(new ImplSVEvent);
337  pSVEvent->mpData = pCaller;
338  pSVEvent->maLink = rLink;
339  pSVEvent->mpWindow = this;
340  pSVEvent->mbCall = true;
341  if (bReferenceLink)
342  {
343  // Double check that this is indeed a vcl::Window instance.
344  assert(dynamic_cast<vcl::Window *>(
345  static_cast<OutputDevice *>(rLink.GetInstance())) ==
346  static_cast<vcl::Window *>(rLink.GetInstance()));
347  pSVEvent->mpInstanceRef = static_cast<vcl::Window *>(rLink.GetInstance());
348  }
349 
350  auto pTmpEvent = pSVEvent.get();
351  if (!mpWindowImpl->mpFrame->PostEvent( std::move(pSVEvent) ))
352  return nullptr;
353  return pTmpEvent;
354 }
355 
357 {
358  SAL_WARN_IF( nUserEvent->mpWindow.get() != this, "vcl",
359  "Window::RemoveUserEvent(): Event doesn't send to this window or is already removed" );
360  SAL_WARN_IF( !nUserEvent->mbCall, "vcl",
361  "Window::RemoveUserEvent(): Event is already removed" );
362 
363  if ( nUserEvent->mpWindow )
364  {
365  nUserEvent->mpWindow = nullptr;
366  }
367 
368  nUserEvent->mbCall = false;
369 }
370 
371 
372 static MouseEvent ImplTranslateMouseEvent( const MouseEvent& rE, vcl::Window const * pSource, vcl::Window const * pDest )
373 {
374  // the mouse event occurred in a different window, we need to translate the coordinates of
375  // the mouse cursor within that (source) window to the coordinates the mouse cursor would
376  // be in the destination window
377  Point aPos = pSource->OutputToScreenPixel( rE.GetPosPixel() );
378  return MouseEvent( pDest->ScreenToOutputPixel( aPos ), rE.GetClicks(), rE.GetMode(), rE.GetButtons(), rE.GetModifier() );
379 }
380 
382 {
383  if( rNEvt.GetType() == MouseNotifyEvent::COMMAND )
384  {
385  const CommandEvent* pCEvt = rNEvt.GetCommandEvent();
386  if ( pCEvt->GetCommand() != CommandEventId::ContextMenu )
387  // non context menu events are not to be notified up the chain
388  // so we return immediately
389  return;
390 
391  if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
392  {
393  // not interested: The event listeners are already called in ::Command,
394  // and calling them here a second time doesn't make sense
395  if ( rNEvt.GetWindow() != this )
396  {
397  CommandEvent aCommandEvent;
398 
399  if ( !pCEvt->IsMouseEvent() )
400  {
401  aCommandEvent = *pCEvt;
402  }
403  else
404  {
405  // the mouse event occurred in a different window, we need to translate the coordinates of
406  // the mouse cursor within that window to the coordinates the mouse cursor would be in the
407  // current window
408  vcl::Window* pSource = rNEvt.GetWindow();
409  Point aPos = pSource->OutputToScreenPixel( pCEvt->GetMousePosPixel() );
410  aCommandEvent = CommandEvent( ScreenToOutputPixel( aPos ), pCEvt->GetCommand(), pCEvt->IsMouseEvent(), pCEvt->GetEventData() );
411  }
412 
414  }
415  }
416  }
417 
418  // #82968# notify event listeners for mouse and key events separately and
419  // not in PreNotify ( as for focus listeners )
420  // this allows for processing those events internally first and pass it to
421  // the toolkit later
422 
423  VclPtr<vcl::Window> xWindow = this;
424 
425  if( rNEvt.GetType() == MouseNotifyEvent::MOUSEMOVE )
426  {
427  if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
428  {
429  if ( rNEvt.GetWindow() == this )
430  CallEventListeners( VclEventId::WindowMouseMove, const_cast<MouseEvent *>(rNEvt.GetMouseEvent()) );
431  else
432  {
433  MouseEvent aMouseEvent = ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this );
435  }
436  }
437  }
438  else if( rNEvt.GetType() == MouseNotifyEvent::MOUSEBUTTONUP )
439  {
440  if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
441  {
442  if ( rNEvt.GetWindow() == this )
443  CallEventListeners( VclEventId::WindowMouseButtonUp, const_cast<MouseEvent *>(rNEvt.GetMouseEvent()) );
444  else
445  {
446  MouseEvent aMouseEvent = ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this );
448  }
449  }
450  }
451  else if( rNEvt.GetType() == MouseNotifyEvent::MOUSEBUTTONDOWN )
452  {
453  if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
454  {
455  if ( rNEvt.GetWindow() == this )
456  CallEventListeners( VclEventId::WindowMouseButtonDown, const_cast<MouseEvent *>(rNEvt.GetMouseEvent()) );
457  else
458  {
459  MouseEvent aMouseEvent = ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this );
461  }
462  }
463  }
464  else if( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
465  {
466  if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
467  CallEventListeners( VclEventId::WindowKeyInput, const_cast<KeyEvent *>(rNEvt.GetKeyEvent()) );
468  }
469  else if( rNEvt.GetType() == MouseNotifyEvent::KEYUP )
470  {
471  if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
472  CallEventListeners( VclEventId::WindowKeyUp, const_cast<KeyEvent *>(rNEvt.GetKeyEvent()) );
473  }
474 
475  if ( xWindow->IsDisposed() )
476  return;
477 
478  // #106721# check if we're part of a compound control and notify
479  vcl::Window *pParent = ImplGetParent();
480  while( pParent )
481  {
482  if( pParent->IsCompoundControl() )
483  {
484  pParent->ImplNotifyKeyMouseCommandEventListeners( rNEvt );
485  break;
486  }
487  pParent = pParent->ImplGetParent();
488  }
489 }
490 
492 {
493  mpWindowImpl->mbReallyShown = true;
494  mpWindowImpl->mbInInitShow = true;
496  mpWindowImpl->mbInInitShow = false;
497 
498  vcl::Window* pWindow = mpWindowImpl->mpFirstOverlap;
499  while ( pWindow )
500  {
501  if ( pWindow->mpWindowImpl->mbVisible )
502  pWindow->ImplCallInitShow();
503  pWindow = pWindow->mpWindowImpl->mpNext;
504  }
505 
506  pWindow = mpWindowImpl->mpFirstChild;
507  while ( pWindow )
508  {
509  if ( pWindow->mpWindowImpl->mbVisible )
510  pWindow->ImplCallInitShow();
511  pWindow = pWindow->mpWindowImpl->mpNext;
512  }
513 }
514 
515 
517 {
518  mpWindowImpl->mbCallResize = false;
519 
520  // OpenGL has a charming feature of black clearing the whole window
521  // some legacy code eg. the app-menu has the beautiful feature of
522  // avoiding re-paints when width doesn't change => invalidate all.
523 #if HAVE_FEATURE_OPENGL
525  Invalidate();
526 
527  // Normally we avoid blanking on re-size unless people might notice:
528  else
529 #endif
530  if( GetBackground().IsGradient() )
531  Invalidate();
532 
533  Resize();
534 
535  // #88419# Most classes don't call the base class in Resize() and Move(),
536  // => Call ImpleResize/Move instead of Resize/Move directly...
538 }
539 
541 {
542  mpWindowImpl->mbCallMove = false;
543 
544  if( mpWindowImpl->mbFrame )
545  {
546  // update frame position
547  SalFrame *pParentFrame = nullptr;
548  vcl::Window *pParent = ImplGetParent();
549  while( pParent )
550  {
551  if( pParent->mpWindowImpl->mpFrame != mpWindowImpl->mpFrame )
552  {
553  pParentFrame = pParent->mpWindowImpl->mpFrame;
554  break;
555  }
556  pParent = pParent->GetParent();
557  }
558 
559  SalFrameGeometry g = mpWindowImpl->mpFrame->GetGeometry();
560  mpWindowImpl->maPos = Point( g.nX, g.nY );
561  if( pParentFrame )
562  {
563  g = pParentFrame->GetGeometry();
564  mpWindowImpl->maPos -= Point( g.nX, g.nY );
565  }
566  // the client window and all its subclients have the same position as the borderframe
567  // this is important for floating toolbars where the borderwindow is a floating window
568  // which has another borderwindow (ie the system floating window)
569  vcl::Window *pClientWin = mpWindowImpl->mpClientWindow;
570  while( pClientWin )
571  {
572  pClientWin->mpWindowImpl->maPos = mpWindowImpl->maPos;
573  pClientWin = pClientWin->mpWindowImpl->mpClientWindow;
574  }
575  }
576 
577  Move();
578 
580 }
581 
583  vcl::Window* pOldOverlapWindow )
584 {
585  ImplSVData* pSVData = ImplGetSVData();
586  vcl::Window* pNewRealWindow;
587  vcl::Window* pOldRealWindow;
588  bool bCallActivate = true;
589  bool bCallDeactivate = true;
590 
591  if (!pOldOverlapWindow)
592  {
593  return;
594  }
595 
596  pOldRealWindow = pOldOverlapWindow->ImplGetWindow();
597  if (!pNewOverlapWindow)
598  {
599  return;
600  }
601 
602  pNewRealWindow = pNewOverlapWindow->ImplGetWindow();
603  if ( (pOldRealWindow->GetType() != WindowType::FLOATINGWINDOW) ||
604  pOldRealWindow->GetActivateMode() != ActivateModeFlags::NONE )
605  {
606  if ( (pNewRealWindow->GetType() == WindowType::FLOATINGWINDOW) &&
607  pNewRealWindow->GetActivateMode() == ActivateModeFlags::NONE)
608  {
609  pSVData->mpWinData->mpLastDeacWin = pOldOverlapWindow;
610  bCallDeactivate = false;
611  }
612  }
613  else if ( (pNewRealWindow->GetType() != WindowType::FLOATINGWINDOW) ||
614  pNewRealWindow->GetActivateMode() != ActivateModeFlags::NONE )
615  {
616  if (pSVData->mpWinData->mpLastDeacWin)
617  {
618  if (pSVData->mpWinData->mpLastDeacWin.get() == pNewOverlapWindow)
619  bCallActivate = false;
620  else
621  {
622  vcl::Window* pLastRealWindow = pSVData->mpWinData->mpLastDeacWin->ImplGetWindow();
623  pSVData->mpWinData->mpLastDeacWin->mpWindowImpl->mbActive = false;
624  pSVData->mpWinData->mpLastDeacWin->Deactivate();
625  if (pLastRealWindow != pSVData->mpWinData->mpLastDeacWin.get())
626  {
627  pLastRealWindow->mpWindowImpl->mbActive = true;
628  pLastRealWindow->Activate();
629  }
630  }
631  pSVData->mpWinData->mpLastDeacWin = nullptr;
632  }
633  }
634 
635  if ( bCallDeactivate )
636  {
637  if( pOldOverlapWindow->mpWindowImpl->mbActive )
638  {
639  pOldOverlapWindow->mpWindowImpl->mbActive = false;
640  pOldOverlapWindow->Deactivate();
641  }
642  if ( pOldRealWindow != pOldOverlapWindow )
643  {
644  if( pOldRealWindow->mpWindowImpl->mbActive )
645  {
646  pOldRealWindow->mpWindowImpl->mbActive = false;
647  pOldRealWindow->Deactivate();
648  }
649  }
650  }
651  if ( bCallActivate && ! pNewOverlapWindow->mpWindowImpl->mbActive )
652  {
653  pNewOverlapWindow->mpWindowImpl->mbActive = true;
654  pNewOverlapWindow->Activate();
655 
656  if ( pNewRealWindow != pNewOverlapWindow )
657  {
658  if( ! pNewRealWindow->mpWindowImpl->mbActive )
659  {
660  pNewRealWindow->mpWindowImpl->mbActive = true;
661  pNewRealWindow->Activate();
662  }
663  }
664  }
665 }
666 
667 } /* namespace vcl */
668 
669 
671  const void* pEvent )
672 {
673  mpWindow = pWindow;
674  mpData = const_cast<void*>(pEvent);
675  mnEventType = nEventType;
676 }
677 
678 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void Move()
Definition: window.cxx:1850
vcl::Window * ImplGetWindow() const
if this is a proxy return the client, otherwise itself
Definition: window2.cxx:835
const Wallpaper & GetBackground() const
Definition: outdev.hxx:637
ActivateModeFlags GetActivateMode() const
Definition: window2.cxx:1137
SAL_DLLPRIVATE void ImplCallResize()
Definition: event.cxx:516
SalFrameGeometry GetGeometry() const
const CommandEvent * GetCommandEvent() const
Definition: event.hxx:327
void NotifyAllChildren(DataChangedEvent &rDCEvt)
Definition: event.cxx:39
bool IsDocking() const
Definition: dockwin.hxx:151
WinBits const WB_NODIALOGCONTROL
MouseEventModifiers GetMode() const
Definition: event.hxx:121
SAL_DLLPRIVATE void ImplCallMove()
Definition: event.cxx:540
SAL_DLLPRIVATE void ImplCallInitShow()
Definition: event.cxx:491
void ImplStartDocking(const Point &rPos)
Definition: dockmgr.cxx:489
void CompatStateChanged(StateChangedType nStateChange)
Definition: window.cxx:3910
sal_uInt16 GetCode() const
Definition: keycod.hxx:53
virtual void Deactivate()
Definition: window.cxx:1856
void RemoveChildEventListener(const Link< VclWindowEvent &, void > &rEventListener)
Definition: event.cxx:323
const KeyEvent * GetKeyEvent() const
Definition: event.hxx:311
bool HasChildPathFocus(bool bSystemWindow=false) const
Definition: window.cxx:3062
bool IsFloatingMode() const
Definition: dockmgr.cxx:1029
MouseNotifyEvent mnEventType
Definition: event.hxx:296
void * mpData
Definition: event.hxx:295
SAL_DLLPRIVATE bool ImplIsOverlapWindow() const
Definition: window2.cxx:926
sal_uInt16 GetClicks() const
Definition: event.hxx:123
vcl::Window * GetWindow() const
Definition: event.hxx:304
virtual css::uno::Reference< css::awt::XWindowPeer > GetComponentInterface(bool bCreate=true)
Definition: window.cxx:3194
sal_uInt16 GetButtons() const
Definition: event.hxx:144
bool IsMouseEvent() const
VclEventId
Definition: vclevent.hxx:39
sal_uInt16 GetModifier() const
Definition: keycod.hxx:56
static bool isVCLOpenGLEnabled()
Returns true if VCL has OpenGL rendering enabled.
void * GetEventData() const
SAL_DLLPRIVATE void ImplControlFocus(GetFocusFlags nFlags=GetFocusFlags::NONE)
Definition: dlgctrl.cxx:516
SAL_DLLPRIVATE vcl::Window * ImplGetDlgWindow(sal_uInt16 n, GetDlgWindowType nType, sal_uInt16 nStart=0, sal_uInt16 nEnd=0xFFFF, sal_uInt16 *pIndex=nullptr)
Definition: dlgctrl.cxx:205
static void ImplCallEventListeners(VclSimpleEvent &rEvent)
Send event to all VCL application event listeners.
Definition: svapp.cxx:769
WinBits const WB_DIALOGCONTROL
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:75
SAL_DLLPRIVATE void ImplDlgCtrlFocusChanged(vcl::Window *pWindow, bool bGetFocus)
Definition: dlgctrl.cxx:1089
SAL_DLLPRIVATE bool ImplDlgCtrl(const KeyEvent &rKEvt, bool bKeyInput)
Definition: dlgctrl.cxx:619
bool mbCall
Definition: svdata.hxx:458
virtual bool PreNotify(NotifyEvent &rNEvt)
Definition: event.cxx:51
virtual bool EventNotify(NotifyEvent &rNEvt)
Definition: event.cxx:103
void ToTop(ToTopFlags nFlags=ToTopFlags::NONE)
Definition: stacking.cxx:420
static void FireVclEvent(VclSimpleEvent &rEvent)
Definition: event.cxx:297
ImplDockingWindowWrapper.
Definition: dockwin.hxx:71
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1160
SAL_DLLPRIVATE void ImplNotifyKeyMouseCommandEventListeners(NotifyEvent &rNEvt)
Definition: event.cxx:381
CommandEventId GetCommand() const
std::unique_ptr< WindowImpl > mpWindowImpl
Definition: window.hxx:511
virtual void Resize()
Definition: window.cxx:1852
SAL_DLLPRIVATE vcl::Window * ImplGetParent() const
Definition: window2.cxx:865
MouseNotifyEvent GetType() const
Definition: event.hxx:303
bool IsInside(const Point &rPOINT) const
VclPtr< vcl::Window > mpLastDeacWin
Definition: svdata.hxx:250
sal_uInt16 GetModifier() const
Definition: event.hxx:153
static SAL_DLLPRIVATE void ImplCallFocusChangeActivate(vcl::Window *pNewOverlapWindow, vcl::Window *pOldOverlapWindow)
Definition: event.cxx:582
Point ScreenToOutputPixel(const Point &rPos) const
Definition: window.cxx:2878
constexpr sal_uInt16 KEY_F10
Definition: keycodes.hxx:92
vcl::Window * GetParent() const
Definition: window2.cxx:1097
bool IsCompoundControl() const
Definition: window2.cxx:1193
void SetFloatingMode(bool bFloatMode)
Definition: dockmgr.cxx:867
const Point & GetMousePosPixel() const
void AddEventListener(const Link< VclWindowEvent &, void > &rEventListener)
Definition: event.cxx:302
void RemoveUserEvent(ImplSVEvent *nUserEvent)
Definition: event.cxx:356
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:112
const vcl::KeyCode & GetKeyCode() const
Definition: event.hxx:54
VclPtr< vcl::Window > mpWindow
Definition: event.hxx:294
bool IsShift() const
Definition: keycod.hxx:58
DockingManager * ImplGetDockingManager()
Definition: svdata.cxx:307
static bool GetDockingFloatsSupported()
#define SAL_WARN_IF(condition, area, stream)
const MouseEvent * GetMouseEvent() const
Definition: event.hxx:319
bool ImplStartDockingEnabled() const
Definition: dockwin.hxx:113
ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
Definition: event.cxx:334
bool IsLeft() const
Definition: event.hxx:146
bool IsMod1() const
Definition: keycod.hxx:60
bool IsLocked() const
Definition: dockwin.hxx:135
const Point & GetPosPixel() const
Definition: event.hxx:120
virtual void Activate()
Definition: window.cxx:1854
VclPtr< vcl::Window > mpWindow
Definition: svdata.hxx:457
bool IsDisposed() const
Definition: window.cxx:139
WinBits const WB_TABSTOP
NotifyEvent(MouseNotifyEvent nEventType, vcl::Window *pWindow, const void *pEvent=nullptr)
Definition: event.cxx:670
static MouseEvent ImplTranslateMouseEvent(const MouseEvent &rE, vcl::Window const *pSource, vcl::Window const *pDest)
Definition: event.cxx:372
vcl::Window * getNonLayoutParent(vcl::Window *pWindow)
Definition: layout.cxx:2760
WindowType GetType() const
Definition: window2.cxx:974
const tools::Rectangle & GetDragArea() const
Definition: dockwin.hxx:131
reference_type * get() const
Get the body.
Definition: vclptr.hxx:143
void RemoveEventListener(const Link< VclWindowEvent &, void > &rEventListener)
Definition: event.cxx:307
WinBits GetStyle() const
Definition: window2.cxx:953
void CompatDataChanged(const DataChangedEvent &rDCEvt)
Definition: window.cxx:3915
Point OutputToScreenPixel(const Point &rPos) const
Definition: window.cxx:2872
void CallEventListeners(VclEventId nEvent, void *pData=nullptr)
Definition: event.cxx:213
MouseNotifyEvent
Definition: event.hxx:277
AnyEventRef aEvent
void AddChildEventListener(const Link< VclWindowEvent &, void > &rEventListener)
Definition: event.cxx:318
virtual void DataChanged(const DataChangedEvent &rDCEvt)
Definition: event.cxx:35
ImplSVWinData * mpWinData
Definition: svdata.hxx:396
bool IsMod1() const
Definition: event.hxx:157