Kaydet (Commit) 8f93c591 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: tdf#96285 restore bodge for unresizable windows with no min size set

Change-Id: Ia1af11514f6096ac55d561f729bbcba9ee5b0b14
(cherry picked from commit e1df21cf)
üst 26f62c80
...@@ -199,6 +199,8 @@ class GtkSalFrame : public SalFrame, public X11WindowProvider ...@@ -199,6 +199,8 @@ class GtkSalFrame : public SalFrame, public X11WindowProvider
Rectangle m_aRestorePosSize; Rectangle m_aRestorePosSize;
#if GTK_CHECK_VERSION(3,0,0) #if GTK_CHECK_VERSION(3,0,0)
long m_nWidthRequest;
long m_nHeightRequest;
cairo_region_t* m_pRegion; cairo_region_t* m_pRegion;
#else #else
GdkRegion* m_pRegion; GdkRegion* m_pRegion;
......
...@@ -879,6 +879,8 @@ void GtkSalFrame::widget_set_size_request(long nWidth, long nHeight) ...@@ -879,6 +879,8 @@ void GtkSalFrame::widget_set_size_request(long nWidth, long nHeight)
void GtkSalFrame::window_resize(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); gtk_window_resize(GTK_WINDOW(m_pWindow), nWidth, nHeight);
} }
...@@ -1052,6 +1054,9 @@ void GtkSalFrame::InitCommon() ...@@ -1052,6 +1054,9 @@ void GtkSalFrame::InitCommon()
m_bGraphics = false; m_bGraphics = false;
m_pGraphics = nullptr; m_pGraphics = nullptr;
m_nWidthRequest = 0;
m_nHeightRequest = 0;
// fake an initial geometry, gets updated via configure event or SetPosSize // fake an initial geometry, gets updated via configure event or SetPosSize
if( m_bDefaultPos || m_bDefaultSize ) if( m_bDefaultPos || m_bDefaultSize )
{ {
...@@ -1462,6 +1467,20 @@ void GtkSalFrame::setMinMaxSize() ...@@ -1462,6 +1467,20 @@ void GtkSalFrame::setMinMaxSize()
aHints |= GDK_HINT_MAX_SIZE; 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() ) if( m_bFullscreen && m_aMaxSize.Width() && m_aMaxSize.Height() )
{ {
aGeo.max_width = m_aMaxSize.Width(); aGeo.max_width = m_aMaxSize.Width();
...@@ -1493,7 +1512,7 @@ void GtkSalFrame::SetMinClientSize( long nWidth, long nHeight ) ...@@ -1493,7 +1512,7 @@ void GtkSalFrame::SetMinClientSize( long nWidth, long nHeight )
m_aMinSize = Size( nWidth, nHeight ); m_aMinSize = Size( nWidth, nHeight );
if( m_pWindow ) if( m_pWindow )
{ {
widget_set_size_request(nWidth, nHeight ); widget_set_size_request(nWidth, nHeight);
setMinMaxSize(); setMinMaxSize();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment