summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk/window
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2011-11-02 18:48:50 -0400
committerCosimo Cecchi <cosimoc@gnome.org>2011-11-03 13:15:09 -0400
commit671b1d26d0e8a1aad97b672172298d3c70e277f1 (patch)
treea5103ca8e5840c851af5ccd2c0d5967a93fad1ac /vcl/unx/gtk/window
parent56d287872accefc0269cd3454da3688acc839e65 (diff)
gtk3: always set the wmclass using the X helper
The helper provided by GTK is only meant to be used before the toplevel is realized, so it's not useful for this case. Instead, always call the X helper. This also gets rid of some GTK warnings we get on the terminal.
Diffstat (limited to 'vcl/unx/gtk/window')
-rw-r--r--vcl/unx/gtk/window/gtkframe.cxx20
1 files changed, 12 insertions, 8 deletions
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index 10fdbfdb7dce..a80e0be0846f 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -1944,24 +1944,28 @@ void GtkSalFrame::updateWMClass()
rtl::OString aResClass = rtl::OUStringToOString(m_sWMClass, RTL_TEXTENCODING_ASCII_US);
const char *pResClass = aResClass.getLength() ? aResClass.getStr() :
SalGenericSystem::getFrameClassName();
+ Display *display;
+
+ if (!getDisplay()->IsX11Display())
+ return;
+
+#if GTK_CHECK_VERSION(3,0,0)
+ display = GDK_DISPLAY_XDISPLAY(getGdkDisplay());
+#else
+ display = getDisplay()->GetDisplay();
+#endif
-#if !GTK_CHECK_VERSION(3,0,0)
if( IS_WIDGET_REALIZED( m_pWindow ) )
{
XClassHint* pClass = XAllocClassHint();
rtl::OString aResName = SalGenericSystem::getFrameResName( m_nExtStyle );
pClass->res_name = const_cast<char*>(aResName.getStr());
pClass->res_class = const_cast<char*>(pResClass);
- XSetClassHint( getDisplay()->GetDisplay(),
- GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)),
+ XSetClassHint( display,
+ widget_get_xid(m_pWindow),
pClass );
XFree( pClass );
}
- else
-#endif
- gtk_window_set_wmclass( GTK_WINDOW(m_pWindow),
- SalGenericSystem::getFrameResName( m_nExtStyle ).getStr(),
- pResClass );
}
void GtkSalFrame::SetApplicationID( const rtl::OUString &rWMClass )