From 016730421e5e58415170b464bf9d9ca47d6c3b4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 16 Dec 2015 21:30:22 +0000 Subject: [PATCH 2/3] remove newly unused WB_NEEDSFOCUS and fragile FLOAT_FOCUSABLE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Idce03318fbc01039a6c0638879785607970993c0 Reviewed-on: https://gerrit.libreoffice.org/20746 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- include/tools/wintypes.hxx | 1 - vcl/inc/salframe.hxx | 2 -- vcl/inc/unx/gtk/gtkframe.hxx | 3 +-- vcl/osx/salframeview.mm | 2 -- vcl/source/window/brdwin.cxx | 2 +- vcl/source/window/window.cxx | 4 +--- vcl/unx/gtk/gtksalframe.cxx | 11 +++-------- vcl/unx/gtk3/gtk3gtkframe.cxx | 9 ++------- vcl/win/window/salframe.cxx | 4 ++-- 9 files changed, 10 insertions(+), 28 deletions(-) diff --git a/include/tools/wintypes.hxx b/include/tools/wintypes.hxx index 781865d..f7ebaa2 100644 --- a/include/tools/wintypes.hxx +++ b/include/tools/wintypes.hxx @@ -179,7 +179,6 @@ WinBits const WB_NOSHADOW = SAL_CONST_INT64(0x400000000); WinBits const WB_TOOLTIPWIN = SAL_CONST_INT64(0x800000000); WinBits const WB_OWNERDRAWDECORATION = SAL_CONST_INT64(0x2000000000); WinBits const WB_DEFAULTWIN = SAL_CONST_INT64(0x4000000000); -WinBits const WB_NEEDSFOCUS = SAL_CONST_INT64(0x1000000000); WinBits const WB_POPUP = SAL_CONST_INT64(0x20000000); WinBits const WB_HSCROLL = WB_HORZ; diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx index dacf3fa..c08486f 100644 --- a/vcl/inc/salframe.hxx +++ b/vcl/inc/salframe.hxx @@ -74,8 +74,6 @@ enum class SalFrameStyleFlags INTRO = 0x00000100, // partial fullscreen: fullscreen on one monitor of a multimonitor display PARTIAL_FULLSCREEN = 0x00800000, - // floating window that needs to be focusable - FLOAT_FOCUSABLE = 0x04000000, // system child window inside another SalFrame SYSTEMCHILD = 0x08000000, // plugged system child window diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx index 5c59dc8..972b241 100644 --- a/vcl/inc/unx/gtk/gtkframe.hxx +++ b/vcl/inc/unx/gtk/gtkframe.hxx @@ -278,8 +278,7 @@ class GtkSalFrame : public SalFrame, public X11WindowProvider return (m_nStyle & SalFrameStyleFlags::FLOAT) && // only a float can be floatgrab !(m_nStyle & SalFrameStyleFlags::TOOLTIP) && // tool tips are not - !(m_nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION) && // toolbars are also not - !(m_nStyle & SalFrameStyleFlags::FLOAT_FOCUSABLE); // focusable floats are not + !(m_nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION); // toolbars are also not } bool isChild( bool bPlug = true, bool bSysChild = true ) diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm index d163169..d4d37c8 100644 --- a/vcl/osx/salframeview.mm +++ b/vcl/osx/salframeview.mm @@ -242,8 +242,6 @@ static AquaSalFrame* getMouseContainerFrame() return YES; if( mpFrame->mbFullScreen ) return YES; - if( (mpFrame->mnStyle & SalFrameStyleFlags::FLOAT_FOCUSABLE) ) - return YES; return [super canBecomeKeyWindow]; } diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index 0e844e2..1e27374 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -1738,7 +1738,7 @@ void ImplBorderWindow::ImplInit( vcl::Window* pParent, { // remove all unwanted WindowBits WinBits nOrgStyle = nStyle; - WinBits nTestStyle = (WB_MOVEABLE | WB_SIZEABLE | WB_ROLLABLE | WB_PINABLE | WB_CLOSEABLE | WB_STANDALONE | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_SYSTEMFLOATWIN | WB_INTROWIN | WB_DEFAULTWIN | WB_TOOLTIPWIN | WB_NOSHADOW | WB_OWNERDRAWDECORATION | WB_SYSTEMCHILDWINDOW | WB_NEEDSFOCUS | WB_POPUP); + WinBits nTestStyle = (WB_MOVEABLE | WB_SIZEABLE | WB_ROLLABLE | WB_PINABLE | WB_CLOSEABLE | WB_STANDALONE | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_SYSTEMFLOATWIN | WB_INTROWIN | WB_DEFAULTWIN | WB_TOOLTIPWIN | WB_NOSHADOW | WB_OWNERDRAWDECORATION | WB_SYSTEMCHILDWINDOW | WB_POPUP); if ( nTypeStyle & BORDERWINDOW_STYLE_APP ) nTestStyle |= WB_APP; nStyle &= nTestStyle; diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index edbdbdd..cbfcc37 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -913,7 +913,7 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p nBorderTypeStyle |= BORDERWINDOW_STYLE_FRAME; nStyle |= WB_BORDER; } - VclPtrInstance pBorderWin( pParent, nStyle & (WB_BORDER | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_NEEDSFOCUS), nBorderTypeStyle ); + VclPtrInstance pBorderWin( pParent, nStyle & (WB_BORDER | WB_DIALOGCONTROL | WB_NODIALOGCONTROL), nBorderTypeStyle ); static_cast(pBorderWin)->mpWindowImpl->mpClientWindow = this; pBorderWin->GetBorder( mpWindowImpl->mnLeftBorder, mpWindowImpl->mnTopBorder, mpWindowImpl->mnRightBorder, mpWindowImpl->mnBottomBorder ); mpWindowImpl->mpBorderWindow = pBorderWin; @@ -968,8 +968,6 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p nFrameStyle = SalFrameStyleFlags::FLOAT; if( nStyle & WB_OWNERDRAWDECORATION ) nFrameStyle |= (SalFrameStyleFlags::OWNERDRAWDECORATION | SalFrameStyleFlags::NOSHADOW); - if( nStyle & WB_NEEDSFOCUS ) - nFrameStyle |= SalFrameStyleFlags::FLOAT_FOCUSABLE; } else if( mpWindowImpl->mbFloatWin ) nFrameStyle |= SalFrameStyleFlags::TOOLWINDOW; diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx index 1772990..f813e64 100644 --- a/vcl/unx/gtk/gtksalframe.cxx +++ b/vcl/unx/gtk/gtksalframe.cxx @@ -1205,8 +1205,7 @@ void GtkSalFrame::Init( SalFrame* pParent, SalFrameStyleFlags nStyle ) m_nStyle = nStyle; GtkWindowType eWinType = ( (nStyle & SalFrameStyleFlags::FLOAT) && - ! (nStyle & (SalFrameStyleFlags::OWNERDRAWDECORATION| - SalFrameStyleFlags::FLOAT_FOCUSABLE)) + ! (nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION) ) ? GTK_WINDOW_POPUP : GTK_WINDOW_TOPLEVEL; @@ -1251,7 +1250,7 @@ void GtkSalFrame::Init( SalFrame* pParent, SalFrameStyleFlags nStyle ) bool bDecoHandling = ! isChild() && ( ! (nStyle & SalFrameStyleFlags::FLOAT) || - (nStyle & (SalFrameStyleFlags::OWNERDRAWDECORATION|SalFrameStyleFlags::FLOAT_FOCUSABLE) ) ); + (nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION) ); if( bDecoHandling ) { @@ -1273,10 +1272,6 @@ void GtkSalFrame::Init( SalFrame* pParent, SalFrameStyleFlags nStyle ) eType = GDK_WINDOW_TYPE_HINT_TOOLBAR; lcl_set_accept_focus( GTK_WINDOW(m_pWindow), false, true ); } - else if( (nStyle & SalFrameStyleFlags::FLOAT_FOCUSABLE) ) - { - eType = GDK_WINDOW_TYPE_HINT_UTILITY; - } if( (nStyle & SalFrameStyleFlags::PARTIAL_FULLSCREEN ) && getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() ) { @@ -2201,7 +2196,7 @@ void GtkSalFrame::ToTop( sal_uInt16 nFlags ) * to our window - which it of course won't since our input hint * is set to false. */ - if( (m_nStyle & (SalFrameStyleFlags::OWNERDRAWDECORATION|SalFrameStyleFlags::FLOAT_FOCUSABLE)) ) + if (m_nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION) { // sad but true: this can cause an XError, we need to catch that // to do this we need to synchronize with the XServer diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx index db75016..17f81a0 100644 --- a/vcl/unx/gtk3/gtk3gtkframe.cxx +++ b/vcl/unx/gtk3/gtk3gtkframe.cxx @@ -1118,8 +1118,7 @@ void GtkSalFrame::Init( SalFrame* pParent, SalFrameStyleFlags nStyle ) m_nStyle = nStyle; GtkWindowType eWinType = ( (nStyle & SalFrameStyleFlags::FLOAT) && - ! (nStyle & (SalFrameStyleFlags::OWNERDRAWDECORATION| - SalFrameStyleFlags::FLOAT_FOCUSABLE)) + ! (nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION) ) ? GTK_WINDOW_POPUP : GTK_WINDOW_TOPLEVEL; @@ -1164,7 +1163,7 @@ void GtkSalFrame::Init( SalFrame* pParent, SalFrameStyleFlags nStyle ) bool bDecoHandling = ! isChild() && ( ! (nStyle & SalFrameStyleFlags::FLOAT) || - (nStyle & (SalFrameStyleFlags::OWNERDRAWDECORATION|SalFrameStyleFlags::FLOAT_FOCUSABLE) ) ); + (nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION) ); if( bDecoHandling ) { @@ -1187,10 +1186,6 @@ void GtkSalFrame::Init( SalFrame* pParent, SalFrameStyleFlags nStyle ) gtk_window_set_accept_focus(GTK_WINDOW(m_pWindow), false); gtk_window_set_decorated(GTK_WINDOW(m_pWindow), false); } - else if( (nStyle & SalFrameStyleFlags::FLOAT_FOCUSABLE) ) - { - eType = GDK_WINDOW_TYPE_HINT_UTILITY; - } gtk_window_set_type_hint( GTK_WINDOW(m_pWindow), eType ); gtk_window_set_gravity( GTK_WINDOW(m_pWindow), GDK_GRAVITY_STATIC ); } diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index 4b873a9..fa53572 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -371,11 +371,11 @@ SalFrame* ImplSalCreateFrame( WinSalInstance* pInst, nExSysStyle |= WS_EX_TOOLWINDOW; pFrame->mbFloatWin = TRUE; - if ( (pEnvTransparentFloats /* does not work remote! || (nSalFrameStyle & SalFrameStyleFlags::FLOAT_FOCUSABLE) */ ) ) + if (pEnvTransparentFloats) nExSysStyle |= WS_EX_LAYERED; } - if( (nSalFrameStyle & SalFrameStyleFlags::TOOLTIP) || (nSalFrameStyle & SalFrameStyleFlags::FLOAT_FOCUSABLE) ) + if (nSalFrameStyle & SalFrameStyleFlags::TOOLTIP) nExSysStyle |= WS_EX_TOPMOST; // init frame data -- 2.5.0