diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-09-09 16:21:22 +1000 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-09-10 20:14:49 +1000 |
commit | f62aa7cafe3e5413c70c5cb2e75de2114b4fd9d0 (patch) | |
tree | b9c12e91598b00de0adba9198e593019747a60ec /vcl | |
parent | 4157780bedd048a27cc33302ab5ebca5a93afa70 (diff) |
vcl: GtkSalFrame::AcquireGraphics() calls GtkSalGraphics::Init() twice
We really don't want to call on GtkSalGraphics::Init() twice, the only
reason we do this is because we pass in a new screen. To get around this,
I've created a new GtkSalGraphics constructor that takes and additional
screen parameter.
Change-Id: Ie53d609c2b8f64d77a3bfb2efe0e97027c75c5d0
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/unx/gtk/gtkgdi.hxx | 1 | ||||
-rw-r--r-- | vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 9 | ||||
-rw-r--r-- | vcl/unx/gtk/window/gtksalframe.cxx | 5 |
3 files changed, 12 insertions, 3 deletions
diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx index f6cec547fa7d..8bd45b0148df 100644 --- a/vcl/inc/unx/gtk/gtkgdi.hxx +++ b/vcl/inc/unx/gtk/gtkgdi.hxx @@ -121,6 +121,7 @@ class GtkSalGraphics : public X11SalGraphics public: GtkSalGraphics( GtkSalFrame *, GtkWidget *window ); + GtkSalGraphics( GtkSalFrame *, GtkWidget *window, SalX11Screen nXScreen ); virtual ~GtkSalGraphics(); inline GtkWidget* GetGtkWidget() const { return m_pWindow; } diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 11aec8713fc0..de64314bd09d 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -57,6 +57,15 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow ) gtk_widget_get_screen( pWindow ) ) ) ); } +GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow, + SalX11Screen nXScreen ) + : X11SalGraphics(), + m_pWindow( pWindow ), + m_aClipRegion(true) +{ + Init( pFrame, GDK_WINDOW_XID( widget_get_window( pWindow ) ), nXScreen ); +} + GtkSalGraphics::~GtkSalGraphics() { } diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx index 004c5a8b09c7..f8322e33cc6d 100644 --- a/vcl/unx/gtk/window/gtksalframe.cxx +++ b/vcl/unx/gtk/window/gtksalframe.cxx @@ -1505,14 +1505,13 @@ SalGraphics* GtkSalFrame::AcquireGraphics() m_aGraphics[i].bInUse = true; if( ! m_aGraphics[i].pGraphics ) { - m_aGraphics[i].pGraphics = new GtkSalGraphics( this, m_pWindow ); #if GTK_CHECK_VERSION(3,0,0) + m_aGraphics[i].pGraphics = new GtkSalGraphics( this, m_pWindow ); if( !m_aFrame.get() ) AllocateFrame(); m_aGraphics[i].pGraphics->setDevice( m_aFrame ); #else // common case: - m_aGraphics[i].pGraphics->Init( this, widget_get_xid(m_pWindow), - m_nXScreen ); + m_aGraphics[i].pGraphics = new GtkSalGraphics( this, m_pWindow, m_nXScreen ); #endif } return m_aGraphics[i].pGraphics; |