parent
11eefe4574
commit
d2bfdd05c3
@ -0,0 +1,50 @@
|
||||
From 3d3e95d68557e93224ebdf75a2ac56acf42e7d44 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
||||
Date: Wed, 16 Dec 2015 21:26:15 +0000
|
||||
Subject: [PATCH 1/3] impress's AnnotationWindow is the only user of
|
||||
WB_NEEDSFOCUS
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Here it is creating a toplevel floating system window which needs special
|
||||
hackery to function.
|
||||
|
||||
Instead convert it to a non-system window which means that it is in reality
|
||||
only a vcl construct. The small downside is that it is now unable to leave the
|
||||
confines of the toplevel system window in which it lives. Upside is that
|
||||
all the special hackery related to it which generally doesn't work half the time
|
||||
in various window managers and now in wayland can go away.
|
||||
|
||||
Change-Id: I7ad7c35091086f7671ff4a178c7fa04202c20e09
|
||||
Reviewed-on: https://gerrit.libreoffice.org/20745
|
||||
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
||||
Tested-by: Caolán McNamara <caolanm@redhat.com>
|
||||
---
|
||||
sd/source/ui/annotations/annotationwindow.cxx | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx
|
||||
index eecc0e3..dcbeb22 100644
|
||||
--- a/sd/source/ui/annotations/annotationwindow.cxx
|
||||
+++ b/sd/source/ui/annotations/annotationwindow.cxx
|
||||
@@ -272,7 +272,7 @@ Selection AnnotationTextWindow::GetSurroundingTextSelection() const
|
||||
/************** AnnotationWindow***********************************++*/
|
||||
|
||||
AnnotationWindow::AnnotationWindow( AnnotationManagerImpl& rManager, DrawDocShell* pDocShell, vcl::Window* pParent )
|
||||
-: FloatingWindow(pParent, WB_SYSTEMWINDOW|WB_BORDER|WB_NEEDSFOCUS)
|
||||
+: FloatingWindow(pParent, WB_BORDER)
|
||||
, mrManager( rManager )
|
||||
, mpDocShell( pDocShell )
|
||||
, mpDoc( pDocShell->GetDoc() )
|
||||
@@ -285,6 +285,7 @@ AnnotationWindow::AnnotationWindow( AnnotationManagerImpl& rManager, DrawDocShel
|
||||
, mpTextWindow(nullptr)
|
||||
, mpMeta(nullptr)
|
||||
{
|
||||
+ EnableAlwaysOnTop();
|
||||
}
|
||||
|
||||
AnnotationWindow::~AnnotationWindow()
|
||||
--
|
||||
2.5.0
|
||||
|
@ -0,0 +1,210 @@
|
||||
From 016730421e5e58415170b464bf9d9ca47d6c3b4e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
||||
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 <caolanm@redhat.com>
|
||||
Tested-by: Caolán McNamara <caolanm@redhat.com>
|
||||
---
|
||||
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<ImplBorderWindow> pBorderWin( pParent, nStyle & (WB_BORDER | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_NEEDSFOCUS), nBorderTypeStyle );
|
||||
+ VclPtrInstance<ImplBorderWindow> pBorderWin( pParent, nStyle & (WB_BORDER | WB_DIALOGCONTROL | WB_NODIALOGCONTROL), nBorderTypeStyle );
|
||||
static_cast<vcl::Window*>(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
|
||||
|
@ -0,0 +1,56 @@
|
||||
From dab2582f05979cd99a5937cb95a387cfed70bb8d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
||||
Date: Wed, 16 Dec 2015 14:18:11 +0000
|
||||
Subject: [PATCH 3/3] gtk3+wayland: start floating windows hidden
|
||||
|
||||
once they are visible we can't move them under wayland, so
|
||||
start then hidden, move them and then show
|
||||
|
||||
these floating windows are very delicate.
|
||||
|
||||
Change-Id: Ia233c23f25cec453df79ef70cab6210dbdd280a0
|
||||
---
|
||||
sfx2/uiconfig/ui/floatingrecord.ui | 1 -
|
||||
svx/uiconfig/ui/colorwindow.ui | 1 -
|
||||
svx/uiconfig/ui/floatingundoredo.ui | 1 -
|
||||
3 files changed, 3 deletions(-)
|
||||
|
||||
diff --git a/sfx2/uiconfig/ui/floatingrecord.ui b/sfx2/uiconfig/ui/floatingrecord.ui
|
||||
index 653867a..9136b38 100644
|
||||
--- a/sfx2/uiconfig/ui/floatingrecord.ui
|
||||
+++ b/sfx2/uiconfig/ui/floatingrecord.ui
|
||||
@@ -3,7 +3,6 @@
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.0"/>
|
||||
<object class="GtkWindow" id="FloatingRecord">
|
||||
- <property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="border_width">6</property>
|
||||
diff --git a/svx/uiconfig/ui/colorwindow.ui b/svx/uiconfig/ui/colorwindow.ui
|
||||
index 71cda63..9482562 100644
|
||||
--- a/svx/uiconfig/ui/colorwindow.ui
|
||||
+++ b/svx/uiconfig/ui/colorwindow.ui
|
||||
@@ -17,7 +17,6 @@
|
||||
<property name="icon_size">1</property>
|
||||
</object>
|
||||
<object class="GtkWindow" id="palette_popup_window">
|
||||
- <property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
diff --git a/svx/uiconfig/ui/floatingundoredo.ui b/svx/uiconfig/ui/floatingundoredo.ui
|
||||
index 10491f8..66f30a6 100644
|
||||
--- a/svx/uiconfig/ui/floatingundoredo.ui
|
||||
+++ b/svx/uiconfig/ui/floatingundoredo.ui
|
||||
@@ -3,7 +3,6 @@
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.0"/>
|
||||
<object class="GtkWindow" id="FloatingUndoRedo:border">
|
||||
- <property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
--
|
||||
2.5.0
|
||||
|
Loading…
Reference in new issue