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