Blame 0002-remove-newly-unused-WB_NEEDSFOCUS-and-fragile-FLOAT_.patch

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