diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-11-10 13:20:34 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-11-11 08:51:10 +0000 |
commit | a6d324f30bd5cfd09d54614d8df67b7857550429 (patch) | |
tree | 2d5d64d2aac6e104ac811cdc7272e43ca29d03d5 /vcl/source/window | |
parent | 39f14ada958ff2cdd4ec5f7454983bfc5c35f89d (diff) |
Resolves: rhbz#1391418 wayland toolbars can't be docked after undocking
see gnome#768128 for extra details
under wayland, given the misery here I'm going to just disable toggling between
docked and undocked under wayland, and throw away user config on toggling
docked/undocked away from the defaults. You can still drag docked things around
to new docking position, but you can't pull them out of the dock to float.
non-wayland is unaffected
Change-Id: Iaa859f3420e6d1b103a8b93d1ad8f82dbffe75d4
Reviewed-on: https://gerrit.libreoffice.org/30752
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/window')
-rw-r--r-- | vcl/source/window/dockmgr.cxx | 3 | ||||
-rw-r--r-- | vcl/source/window/dockwin.cxx | 9 | ||||
-rw-r--r-- | vcl/source/window/event.cxx | 10 |
3 files changed, 16 insertions, 6 deletions
diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index 2b212af24313..9012a9018e23 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -935,6 +935,9 @@ void ImplDockingWindowWrapper::EndDocking( const Rectangle& rRect, bool bFloatMo { Rectangle aRect( rRect ); + if (bFloatMode && !StyleSettings::GetDockingFloatsSupported()) + mbDockCanceled = true; + if ( !IsDockingCanceled() ) { bool bShow = false; diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx index 0a2518ee891d..8f63c69e4103 100644 --- a/vcl/source/window/dockwin.cxx +++ b/vcl/source/window/dockwin.cxx @@ -530,12 +530,14 @@ bool DockingWindow::Notify( NotifyEvent& rNEvt ) if ( mbDockable ) { + const bool bDockingSupportCrippled = !StyleSettings::GetDockingFloatsSupported(); + if ( rNEvt.GetType() == MouseNotifyEvent::MOUSEBUTTONDOWN ) { const MouseEvent* pMEvt = rNEvt.GetMouseEvent(); if ( pMEvt->IsLeft() ) { - if ( pMEvt->IsMod1() && (pMEvt->GetClicks() == 2) ) + if (!bDockingSupportCrippled && pMEvt->IsMod1() && (pMEvt->GetClicks() == 2) ) { SetFloatingMode( !IsFloatingMode() ); return true; @@ -564,7 +566,7 @@ bool DockingWindow::Notify( NotifyEvent& rNEvt ) { const vcl::KeyCode& rKey = rNEvt.GetKeyEvent()->GetKeyCode(); if( rKey.GetCode() == KEY_F10 && rKey.GetModifier() && - rKey.IsShift() && rKey.IsMod1() ) + rKey.IsShift() && rKey.IsMod1() && !bDockingSupportCrippled ) { SetFloatingMode( !IsFloatingMode() ); return true; @@ -587,6 +589,9 @@ bool DockingWindow::Docking( const Point&, Rectangle& ) void DockingWindow::EndDocking( const Rectangle& rRect, bool bFloatMode ) { + if (bFloatMode && !StyleSettings::GetDockingFloatsSupported()) + mbDockCanceled = true; + if ( !IsDockingCanceled() ) { bool bShow = false; diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx index ca1439f867a7..8021c074c549 100644 --- a/vcl/source/window/event.cxx +++ b/vcl/source/window/event.cxx @@ -101,15 +101,17 @@ bool Window::Notify( NotifyEvent& rNEvt ) // check for docking window // but do nothing if window is docked and locked ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this ); - if( pWrapper && !( !pWrapper->IsFloatingMode() && pWrapper->IsLocked() ) ) + if (pWrapper && !( !pWrapper->IsFloatingMode() && pWrapper->IsLocked() )) { + const bool bDockingSupportCrippled = !StyleSettings::GetDockingFloatsSupported(); + if ( rNEvt.GetType() == MouseNotifyEvent::MOUSEBUTTONDOWN ) { const MouseEvent* pMEvt = rNEvt.GetMouseEvent(); bool bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() ); if ( pMEvt->IsLeft() ) { - if ( pMEvt->IsMod1() && (pMEvt->GetClicks() == 2) ) + if (!bDockingSupportCrippled && pMEvt->IsMod1() && (pMEvt->GetClicks() == 2)) { // ctrl double click toggles floating mode pWrapper->SetFloatingMode( !pWrapper->IsFloatingMode() ); @@ -149,8 +151,8 @@ bool Window::Notify( NotifyEvent& rNEvt ) else if( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT ) { const vcl::KeyCode& rKey = rNEvt.GetKeyEvent()->GetKeyCode(); - if( rKey.GetCode() == KEY_F10 && rKey.GetModifier() && - rKey.IsShift() && rKey.IsMod1() ) + if (rKey.GetCode() == KEY_F10 && rKey.GetModifier() && + rKey.IsShift() && rKey.IsMod1() && !bDockingSupportCrippled) { pWrapper->SetFloatingMode( !pWrapper->IsFloatingMode() ); /* At this point the floating toolbar frame does not have the |