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>
24 #include <sal/log.hxx>
25 
26 #include <window.h>
27 #include <svdata.hxx>
28 #include <salframe.hxx>
29 #include <config_features.h>
31 
32 #include "impldockingwrapper.hxx"
33 
34 namespace vcl {
35 
37 {
38 }
39 
41 {
42  CompatDataChanged( rDCEvt );
43 
44  vcl::Window* pChild = mpWindowImpl->mpFirstChild;
45  while ( pChild )
46  {
47  pChild->NotifyAllChildren( rDCEvt );
48  pChild = pChild->mpWindowImpl->mpNext;
49  }
50 }
51 
53 {
54  bool bDone = false;
55  if ( mpWindowImpl->mpParent && !ImplIsOverlapWindow() )
56  bDone = mpWindowImpl->mpParent->CompatPreNotify( rNEvt );
57 
58  if ( !bDone )
59  {
60  if( rNEvt.GetType() == MouseNotifyEvent::GETFOCUS )
61  {
62  bool bCompoundFocusChanged = false;
63  if ( mpWindowImpl->mbCompoundControl && !mpWindowImpl->mbCompoundControlHasFocus && HasChildPathFocus() )
64  {
65  mpWindowImpl->mbCompoundControlHasFocus = true;
66  bCompoundFocusChanged = true;
67  }
68 
69  if ( bCompoundFocusChanged || ( rNEvt.GetWindow() == this ) )
71  }
72  else if( rNEvt.GetType() == MouseNotifyEvent::LOSEFOCUS )
73  {
74  bool bCompoundFocusChanged = false;
75  if ( mpWindowImpl->mbCompoundControl && mpWindowImpl->mbCompoundControlHasFocus && !HasChildPathFocus() )
76  {
77  mpWindowImpl->mbCompoundControlHasFocus = false ;
78  bCompoundFocusChanged = true;
79  }
80 
81  if ( bCompoundFocusChanged || ( rNEvt.GetWindow() == this ) )
83  }
84 
85  // #82968# mouse and key events will be notified after processing ( in ImplNotifyKeyMouseCommandEventListeners() )!
86  // see also ImplHandleMouseEvent(), ImplHandleKey()
87 
88  }
89 
90  return bDone;
91 }
92 
93 namespace
94 {
95  bool parentNotDialogControl(Window* pWindow)
96  {
97  vcl::Window* pParent = getNonLayoutParent(pWindow);
98  if (!pParent)
99  return true;
100  return ((pParent->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) != WB_DIALOGCONTROL);
101  }
102 }
103 
105 {
106  bool bRet = false;
107 
108  if (IsDisposed())
109  return false;
110 
111  // check for docking window
112  // but do nothing if window is docked and locked
114  if (pWrapper && ( pWrapper->IsFloatingMode() || !pWrapper->IsLocked() ))
115  {
116  const bool bDockingSupportCrippled = !StyleSettings::GetDockingFloatsSupported();
117 
119  {
120  const MouseEvent* pMEvt = rNEvt.GetMouseEvent();
121  bool bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() );
122  if ( pMEvt->IsLeft() )
123  {
124  if (!bDockingSupportCrippled && pMEvt->IsMod1() && (pMEvt->GetClicks() == 2))
125  {
126  // ctrl double click toggles floating mode
127  pWrapper->SetFloatingMode( !pWrapper->IsFloatingMode() );
128  return true;
129  }
130  else if ( pMEvt->GetClicks() == 1 && bHit)
131  {
132  // allow start docking during mouse move
133  pWrapper->ImplEnableStartDocking();
134  return true;
135  }
136  }
137  }
138  else if ( rNEvt.GetType() == MouseNotifyEvent::MOUSEMOVE )
139  {
140  const MouseEvent* pMEvt = rNEvt.GetMouseEvent();
141  bool bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() );
142  if ( pMEvt->IsLeft() )
143  {
144  // check if a single click initiated this sequence ( ImplStartDockingEnabled() )
145  // check if window is docked and
146  if( pWrapper->ImplStartDockingEnabled() && !pWrapper->IsFloatingMode() &&
147  !pWrapper->IsDocking() && bHit )
148  {
149  Point aPos = pMEvt->GetPosPixel();
150  vcl::Window* pWindow = rNEvt.GetWindow();
151  if ( pWindow != this )
152  {
153  aPos = pWindow->OutputToScreenPixel( aPos );
154  aPos = ScreenToOutputPixel( aPos );
155  }
156  pWrapper->ImplStartDocking( aPos );
157  }
158  return true;
159  }
160  }
161  else if( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
162  {
163  const vcl::KeyCode& rKey = rNEvt.GetKeyEvent()->GetKeyCode();
164  if (rKey.GetCode() == KEY_F10 && rKey.GetModifier() &&
165  rKey.IsShift() && rKey.IsMod1() && !bDockingSupportCrippled)
166  {
167  pWrapper->SetFloatingMode( !pWrapper->IsFloatingMode() );
168  /* At this point the floating toolbar frame does not have the
169  * input focus since these frames don't get the focus per default
170  * To enable keyboard handling of this toolbar set the input focus
171  * to the frame. This needs to be done with ToTop since GrabFocus
172  * would not notice any change since "this" already has the focus.
173  */
174  if( pWrapper->IsFloatingMode() )
176  return true;
177  }
178  }
179  }
180 
181  // manage the dialogs
183  {
184  // if the parent also has dialog control activated, the parent takes over control
185  if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) || (rNEvt.GetType() == MouseNotifyEvent::KEYUP) )
186  {
187  // ScGridWindow has WB_DIALOGCONTROL set, so pressing tab in ScCheckListMenuControl won't
188  // get processed here by the toplevel DockingWindow of ScCheckListMenuControl by
189  // just checking if parentNotDialogControl is true
190  bool bTopLevelFloatingWindow = (pWrapper && pWrapper->IsFloatingMode());
191  if (ImplIsOverlapWindow() || parentNotDialogControl(this) || bTopLevelFloatingWindow)
192  {
193  bRet = ImplDlgCtrl( *rNEvt.GetKeyEvent(), rNEvt.GetType() == MouseNotifyEvent::KEYINPUT );
194  }
195  }
196  else if ( (rNEvt.GetType() == MouseNotifyEvent::GETFOCUS) || (rNEvt.GetType() == MouseNotifyEvent::LOSEFOCUS) )
197  {
199  if ( (rNEvt.GetWindow() == this) && (rNEvt.GetType() == MouseNotifyEvent::GETFOCUS) &&
200  !(GetStyle() & WB_TABSTOP) && !(mpWindowImpl->mnDlgCtrlFlags & DialogControlFlags::WantFocus) )
201  {
203  if ( pFirstChild )
204  pFirstChild->ImplControlFocus();
205  }
206  }
207  }
208 
209  if ( !bRet )
210  {
211  if ( mpWindowImpl->mpParent && !ImplIsOverlapWindow() )
212  bRet = mpWindowImpl->mpParent->CompatNotify( rNEvt );
213  }
214 
215  return bRet;
216 }
217 
218 void Window::CallEventListeners( VclEventId nEvent, void* pData )
219 {
220  VclWindowEvent aEvent( this, nEvent, pData );
221 
222  VclPtr<vcl::Window> xWindow = this;
223 
225 
226  if ( xWindow->IsDisposed() )
227  return;
228 
229  // If maEventListeners is empty, the XVCLWindow has not yet been initialized.
230  // Calling GetComponentInterface will do that.
231  if (mpWindowImpl->maEventListeners.empty() && pData)
232  xWindow->GetComponentInterface();
233 
234  if (!mpWindowImpl->maEventListeners.empty())
235  {
236  // Copy the list, because this can be destroyed when calling a Link...
237  std::vector<Link<VclWindowEvent&,void>> aCopy( mpWindowImpl->maEventListeners );
238  // we use an iterating counter/flag and a set of deleted Link's to avoid O(n^2) behaviour
239  mpWindowImpl->mnEventListenersIteratingCount++;
240  auto& rWindowImpl = *mpWindowImpl;
241  comphelper::ScopeGuard aGuard(
242  [&rWindowImpl, &xWindow]()
243  {
244  if (!xWindow->IsDisposed())
245  {
246  rWindowImpl.mnEventListenersIteratingCount--;
247  if (rWindowImpl.mnEventListenersIteratingCount == 0)
248  rWindowImpl.maEventListenersDeleted.clear();
249  }
250  }
251  );
252  for ( const Link<VclWindowEvent&,void>& rLink : aCopy )
253  {
254  if (xWindow->IsDisposed()) break;
255  // check this hasn't been removed in some re-enterancy scenario fdo#47368
256  if( rWindowImpl.maEventListenersDeleted.find(rLink) == rWindowImpl.maEventListenersDeleted.end() )
257  rLink.Call( aEvent );
258  }
259  }
260 
261  while ( xWindow )
262  {
263 
264  if ( xWindow->IsDisposed() )
265  return;
266 
267  auto& rWindowImpl = *xWindow->mpWindowImpl;
268  if (!rWindowImpl.maChildEventListeners.empty())
269  {
270  // Copy the list, because this can be destroyed when calling a Link...
271  std::vector<Link<VclWindowEvent&,void>> aCopy( rWindowImpl.maChildEventListeners );
272  // we use an iterating counter/flag and a set of deleted Link's to avoid O(n^2) behaviour
273  rWindowImpl.mnChildEventListenersIteratingCount++;
274  comphelper::ScopeGuard aGuard(
275  [&rWindowImpl, &xWindow]()
276  {
277  if (!xWindow->IsDisposed())
278  {
279  rWindowImpl.mnChildEventListenersIteratingCount--;
280  if (rWindowImpl.mnChildEventListenersIteratingCount == 0)
281  rWindowImpl.maChildEventListenersDeleted.clear();
282  }
283  }
284  );
285  for ( const Link<VclWindowEvent&,void>& rLink : aCopy )
286  {
287  if (xWindow->IsDisposed())
288  return;
289  // Check this hasn't been removed in some re-enterancy scenario fdo#47368.
290  if( rWindowImpl.maChildEventListenersDeleted.find(rLink) == rWindowImpl.maChildEventListenersDeleted.end() )
291  rLink.Call( aEvent );
292  }
293  }
294 
295  if ( xWindow->IsDisposed() )
296  return;
297 
298  xWindow = xWindow->GetParent();
299  }
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  // Normally we avoid blanking on re-size unless people might notice:
521  if( GetBackground().IsGradient() )
522  Invalidate();
523 
524  Resize();
525 
526  // #88419# Most classes don't call the base class in Resize() and Move(),
527  // => Call ImpleResize/Move instead of Resize/Move directly...
529 }
530 
532 {
533  mpWindowImpl->mbCallMove = false;
534 
535  if( mpWindowImpl->mbFrame )
536  {
537  // update frame position
538  SalFrame *pParentFrame = nullptr;
539  vcl::Window *pParent = ImplGetParent();
540  while( pParent )
541  {
542  if( pParent->mpWindowImpl->mpFrame != mpWindowImpl->mpFrame )
543  {
544  pParentFrame = pParent->mpWindowImpl->mpFrame;
545  break;
546  }
547  pParent = pParent->GetParent();
548  }
549 
550  SalFrameGeometry g = mpWindowImpl->mpFrame->GetGeometry();
551  mpWindowImpl->maPos = Point( g.nX, g.nY );
552  if( pParentFrame )
553  {
554  g = pParentFrame->GetGeometry();
555  mpWindowImpl->maPos -= Point( g.nX, g.nY );
556  }
557  // the client window and all its subclients have the same position as the borderframe
558  // this is important for floating toolbars where the borderwindow is a floating window
559  // which has another borderwindow (ie the system floating window)
560  vcl::Window *pClientWin = mpWindowImpl->mpClientWindow;
561  while( pClientWin )
562  {
563  pClientWin->mpWindowImpl->maPos = mpWindowImpl->maPos;
564  pClientWin = pClientWin->mpWindowImpl->mpClientWindow;
565  }
566  }
567 
568  Move();
569 
571 }
572 
574  vcl::Window* pOldOverlapWindow )
575 {
576  ImplSVData* pSVData = ImplGetSVData();
577  vcl::Window* pNewRealWindow;
578  vcl::Window* pOldRealWindow;
579  bool bCallActivate = true;
580  bool bCallDeactivate = true;
581 
582  if (!pOldOverlapWindow)
583  {
584  return;
585  }
586 
587  pOldRealWindow = pOldOverlapWindow->ImplGetWindow();
588  if (!pNewOverlapWindow)
589  {
590  return;
591  }
592 
593  pNewRealWindow = pNewOverlapWindow->ImplGetWindow();
594  if ( (pOldRealWindow->GetType() != WindowType::FLOATINGWINDOW) ||
595  pOldRealWindow->GetActivateMode() != ActivateModeFlags::NONE )
596  {
597  if ( (pNewRealWindow->GetType() == WindowType::FLOATINGWINDOW) &&
598  pNewRealWindow->GetActivateMode() == ActivateModeFlags::NONE)
599  {
600  pSVData->mpWinData->mpLastDeacWin = pOldOverlapWindow;
601  bCallDeactivate = false;
602  }
603  }
604  else if ( (pNewRealWindow->GetType() != WindowType::FLOATINGWINDOW) ||
605  pNewRealWindow->GetActivateMode() != ActivateModeFlags::NONE )
606  {
607  if (pSVData->mpWinData->mpLastDeacWin)
608  {
609  if (pSVData->mpWinData->mpLastDeacWin.get() == pNewOverlapWindow)
610  bCallActivate = false;
611  else
612  {
613  vcl::Window* pLastRealWindow = pSVData->mpWinData->mpLastDeacWin->ImplGetWindow();
614  pSVData->mpWinData->mpLastDeacWin->mpWindowImpl->mbActive = false;
615  pSVData->mpWinData->mpLastDeacWin->Deactivate();
616  if (pLastRealWindow != pSVData->mpWinData->mpLastDeacWin.get())
617  {
618  pLastRealWindow->mpWindowImpl->mbActive = true;
619  pLastRealWindow->Activate();
620  }
621  }
622  pSVData->mpWinData->mpLastDeacWin = nullptr;
623  }
624  }
625 
626  if ( bCallDeactivate )
627  {
628  if( pOldOverlapWindow->mpWindowImpl->mbActive )
629  {
630  pOldOverlapWindow->mpWindowImpl->mbActive = false;
631  pOldOverlapWindow->Deactivate();
632  }
633  if ( pOldRealWindow != pOldOverlapWindow )
634  {
635  if( pOldRealWindow->mpWindowImpl->mbActive )
636  {
637  pOldRealWindow->mpWindowImpl->mbActive = false;
638  pOldRealWindow->Deactivate();
639  }
640  }
641  }
642  if ( !bCallActivate || pNewOverlapWindow->mpWindowImpl->mbActive )
643  return;
644 
645  pNewOverlapWindow->mpWindowImpl->mbActive = true;
646  pNewOverlapWindow->Activate();
647 
648  if ( pNewRealWindow != pNewOverlapWindow )
649  {
650  if( ! pNewRealWindow->mpWindowImpl->mbActive )
651  {
652  pNewRealWindow->mpWindowImpl->mbActive = true;
653  pNewRealWindow->Activate();
654  }
655  }
656 }
657 
658 } /* namespace vcl */
659 
660 
662  const void* pEvent )
663 {
664  mpWindow = pWindow;
665  mpData = const_cast<void*>(pEvent);
666  mnEventType = nEventType;
667 }
668 
669 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void Move()
Definition: window.cxx:1826
vcl::Window * ImplGetWindow() const
if this is a proxy return the client, otherwise itself
Definition: window2.cxx:834
const Wallpaper & GetBackground() const
Definition: outdev.hxx:647
ActivateModeFlags GetActivateMode() const
Definition: window2.cxx:1136
SAL_DLLPRIVATE void ImplCallResize()
Definition: event.cxx:516
SalFrameGeometry GetGeometry() const
const CommandEvent * GetCommandEvent() const
Definition: event.hxx:324
void NotifyAllChildren(DataChangedEvent &rDCEvt)
Definition: event.cxx:40
WinBits const WB_NODIALOGCONTROL
MouseEventModifiers GetMode() const
Definition: event.hxx:124
SAL_DLLPRIVATE void ImplCallMove()
Definition: event.cxx:531
SAL_DLLPRIVATE void ImplCallInitShow()
Definition: event.cxx:491
void ImplStartDocking(const Point &rPos)
Definition: dockmgr.cxx:511
void CompatStateChanged(StateChangedType nStateChange)
Definition: window.cxx:3888
sal_uInt16 GetCode() const
Definition: keycod.hxx:51
virtual void Deactivate()
Definition: window.cxx:1832
void RemoveChildEventListener(const Link< VclWindowEvent &, void > &rEventListener)
Definition: event.cxx:323
const KeyEvent * GetKeyEvent() const
Definition: event.hxx:308
bool HasChildPathFocus(bool bSystemWindow=false) const
Definition: window.cxx:2996
bool IsFloatingMode() const
Definition: dockmgr.cxx:1049
MouseNotifyEvent mnEventType
Definition: event.hxx:293
void * mpData
Definition: event.hxx:292
SAL_DLLPRIVATE bool ImplIsOverlapWindow() const
Definition: window2.cxx:925
sal_uInt16 GetClicks() const
Definition: event.hxx:126
vcl::Window * GetWindow() const
Definition: event.hxx:301
virtual css::uno::Reference< css::awt::XWindowPeer > GetComponentInterface(bool bCreate=true)
Definition: window.cxx:3128
sal_uInt16 GetButtons() const
Definition: event.hxx:147
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
bool IsMouseEvent() const
VclEventId
Definition: vclevent.hxx:37
sal_uInt16 GetModifier() const
Definition: keycod.hxx:54
void * GetEventData() const
SAL_DLLPRIVATE void ImplControlFocus(GetFocusFlags nFlags=GetFocusFlags::NONE)
Definition: dlgctrl.cxx:515
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:204
static void ImplCallEventListeners(VclSimpleEvent &rEvent)
Send event to all VCL application event listeners.
Definition: svapp.cxx:787
WinBits const WB_DIALOGCONTROL
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:74
SAL_DLLPRIVATE void ImplDlgCtrlFocusChanged(vcl::Window *pWindow, bool bGetFocus)
Definition: dlgctrl.cxx:1088
SAL_DLLPRIVATE bool ImplDlgCtrl(const KeyEvent &rKEvt, bool bKeyInput)
Definition: dlgctrl.cxx:618
bool mbCall
Definition: svdata.hxx:456
virtual bool PreNotify(NotifyEvent &rNEvt)
Definition: event.cxx:52
virtual bool EventNotify(NotifyEvent &rNEvt)
Definition: event.cxx:104
void ToTop(ToTopFlags nFlags=ToTopFlags::NONE)
Definition: stacking.cxx:418
ImplDockingWindowWrapper.
tools::Long nY
Definition: salgeom.hxx:30
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1140
SAL_DLLPRIVATE void ImplNotifyKeyMouseCommandEventListeners(NotifyEvent &rNEvt)
Definition: event.cxx:381
CommandEventId GetCommand() const
std::unique_ptr< WindowImpl > mpWindowImpl
Definition: window.hxx:493
virtual void Resize()
Definition: window.cxx:1828
SAL_DLLPRIVATE vcl::Window * ImplGetParent() const
Definition: window2.cxx:864
MouseNotifyEvent GetType() const
Definition: event.hxx:300
bool IsInside(const Point &rPOINT) const
VclPtr< vcl::Window > mpLastDeacWin
Definition: svdata.hxx:250
sal_uInt16 GetModifier() const
Definition: event.hxx:156
static SAL_DLLPRIVATE void ImplCallFocusChangeActivate(vcl::Window *pNewOverlapWindow, vcl::Window *pOldOverlapWindow)
Definition: event.cxx:573
Point ScreenToOutputPixel(const Point &rPos) const
Definition: window.cxx:2801
constexpr sal_uInt16 KEY_F10
Definition: keycodes.hxx:92
vcl::Window * GetParent() const
Definition: window2.cxx:1096
bool IsCompoundControl() const
Definition: window2.cxx:1192
tools::Long nX
Definition: salgeom.hxx:30
void SetFloatingMode(bool bFloatMode)
Definition: dockmgr.cxx:894
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:57
VclPtr< vcl::Window > mpWindow
Definition: event.hxx:291
bool IsShift() const
Definition: keycod.hxx:56
DockingManager * ImplGetDockingManager()
Definition: svdata.cxx:299
static bool GetDockingFloatsSupported()
#define SAL_WARN_IF(condition, area, stream)
const MouseEvent * GetMouseEvent() const
Definition: event.hxx:316
ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
Definition: event.cxx:334
ImplDockingWindowWrapper * GetDockingWindowWrapper(const vcl::Window *pWin)
Definition: dockmgr.cxx:280
bool IsLeft() const
Definition: event.hxx:149
bool IsMod1() const
Definition: keycod.hxx:58
const Point & GetPosPixel() const
Definition: event.hxx:123
virtual void Activate()
Definition: window.cxx:1830
VclPtr< vcl::Window > mpWindow
Definition: svdata.hxx:455
bool IsDisposed() const
Definition: window.cxx:143
WinBits const WB_TABSTOP
NotifyEvent(MouseNotifyEvent nEventType, vcl::Window *pWindow, const void *pEvent=nullptr)
Definition: event.cxx:661
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:2837
WindowType GetType() const
Definition: window2.cxx:973
const tools::Rectangle & GetDragArea() const
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:952
void CompatDataChanged(const DataChangedEvent &rDCEvt)
Definition: window.cxx:3896
Point OutputToScreenPixel(const Point &rPos) const
Definition: window.cxx:2795
void CallEventListeners(VclEventId nEvent, void *pData=nullptr)
Definition: event.cxx:218
MouseNotifyEvent
Definition: event.hxx:275
AnyEventRef aEvent
void AddChildEventListener(const Link< VclWindowEvent &, void > &rEventListener)
Definition: event.cxx:318
virtual void DataChanged(const DataChangedEvent &rDCEvt)
Definition: event.cxx:36
ImplSVWinData * mpWinData
Definition: svdata.hxx:394
bool IsMod1() const
Definition: event.hxx:160