[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - vcl/inc vcl/unx
Caolán McNamara
caolanm at redhat.com
Tue Dec 8 05:43:20 PST 2015
vcl/inc/unx/gtk/gtkframe.hxx | 2 ++
vcl/unx/gtk3/gtk3gtkframe.cxx | 21 ++++++++++++++++++++-
2 files changed, 22 insertions(+), 1 deletion(-)
New commits:
commit 8f93c591a6d6faf8f503c61e70a54d47feadca30
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Dec 8 13:09:34 2015 +0000
Resolves: tdf#96285 restore bodge for unresizable windows with no min size set
Change-Id: Ia1af11514f6096ac55d561f729bbcba9ee5b0b14
(cherry picked from commit e1df21cfe0318bf287ae8ce29261d4759c49bd5a)
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index d1203a3..1ea2704 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -199,6 +199,8 @@ class GtkSalFrame : public SalFrame, public X11WindowProvider
Rectangle m_aRestorePosSize;
#if GTK_CHECK_VERSION(3,0,0)
+ long m_nWidthRequest;
+ long m_nHeightRequest;
cairo_region_t* m_pRegion;
#else
GdkRegion* m_pRegion;
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 62b2ac4..554ba57 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -879,6 +879,8 @@ void GtkSalFrame::widget_set_size_request(long nWidth, long nHeight)
void GtkSalFrame::window_resize(long nWidth, long nHeight)
{
+ m_nWidthRequest = nWidth;
+ m_nHeightRequest = nHeight;
gtk_window_resize(GTK_WINDOW(m_pWindow), nWidth, nHeight);
}
@@ -1052,6 +1054,9 @@ void GtkSalFrame::InitCommon()
m_bGraphics = false;
m_pGraphics = nullptr;
+ m_nWidthRequest = 0;
+ m_nHeightRequest = 0;
+
// fake an initial geometry, gets updated via configure event or SetPosSize
if( m_bDefaultPos || m_bDefaultSize )
{
@@ -1462,6 +1467,20 @@ void GtkSalFrame::setMinMaxSize()
aHints |= GDK_HINT_MAX_SIZE;
}
}
+ else
+ {
+ if (!m_bFullscreen && m_nWidthRequest && m_nHeightRequest)
+ {
+ aGeo.min_width = m_nWidthRequest;
+ aGeo.min_height = m_nHeightRequest;
+ aHints |= GDK_HINT_MIN_SIZE;
+
+ aGeo.max_width = m_nWidthRequest;
+ aGeo.max_height = m_nHeightRequest;
+ aHints |= GDK_HINT_MAX_SIZE;
+ }
+ }
+
if( m_bFullscreen && m_aMaxSize.Width() && m_aMaxSize.Height() )
{
aGeo.max_width = m_aMaxSize.Width();
@@ -1493,7 +1512,7 @@ void GtkSalFrame::SetMinClientSize( long nWidth, long nHeight )
m_aMinSize = Size( nWidth, nHeight );
if( m_pWindow )
{
- widget_set_size_request(nWidth, nHeight );
+ widget_set_size_request(nWidth, nHeight);
setMinMaxSize();
}
}
More information about the Libreoffice-commits
mailing list