diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-12-08 13:09:34 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-12-08 13:40:02 +0000 |
commit | 8f93c591a6d6faf8f503c61e70a54d47feadca30 (patch) | |
tree | 2f8a6acf3f26334844884ed309308c988a42f33f | |
parent | 26f62c80aa3684301e29dd17f9efba1bcd68264d (diff) |
Resolves: tdf#96285 restore bodge for unresizable windows with no min size set
Change-Id: Ia1af11514f6096ac55d561f729bbcba9ee5b0b14
(cherry picked from commit e1df21cfe0318bf287ae8ce29261d4759c49bd5a)
-rw-r--r-- | vcl/inc/unx/gtk/gtkframe.hxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkframe.cxx | 21 |
2 files changed, 22 insertions, 1 deletions
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx index d1203a3a50c5..1ea2704e1041 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 62b2ac46125e..554ba57908f3 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(); } } |