diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-05-11 15:20:42 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-05-11 17:38:55 +0200 |
commit | 3f4400f1ac9185b7b123585deafef04a3d91bc66 (patch) | |
tree | c032032ea97b21a2a0bf0c7e87d4918388429530 /vcl | |
parent | 8fb62def894ce6ea37ade9fc20e3cdad5562d0aa (diff) |
gtk4: flatten this method
Change-Id: I4dfceaf70a2be541b7ed750e47e3565e3341b32e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115432
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk3/gtkframe.cxx | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx index ba5478c8249a..babdb5fbdcb5 100644 --- a/vcl/unx/gtk3/gtkframe.cxx +++ b/vcl/unx/gtk3/gtkframe.cxx @@ -2134,27 +2134,24 @@ void GtkSalFrame::SetScreenNumber( unsigned int nNewScreen ) void GtkSalFrame::updateWMClass() { #if !GTK_CHECK_VERSION(4, 0, 0) - OString aResClass = OUStringToOString(m_sWMClass, RTL_TEXTENCODING_ASCII_US); - const char *pResClass = !aResClass.isEmpty() ? aResClass.getStr() : - SalGenericSystem::getFrameClassName(); - Display *display; - if (!getDisplay()->IsX11Display()) return; - display = gdk_x11_display_get_xdisplay(getGdkDisplay()); + if (!gtk_widget_get_realized(m_pWindow)) + return; - if( gtk_widget_get_realized( m_pWindow ) ) - { - XClassHint* pClass = XAllocClassHint(); - OString aResName = SalGenericSystem::getFrameResName(); - pClass->res_name = const_cast<char*>(aResName.getStr()); - pClass->res_class = const_cast<char*>(pResClass); - XSetClassHint( display, - GtkSalFrame::GetNativeWindowHandle(m_pWindow), - pClass ); - XFree( pClass ); - } + OString aResClass = OUStringToOString(m_sWMClass, RTL_TEXTENCODING_ASCII_US); + const char *pResClass = !aResClass.isEmpty() ? aResClass.getStr() : + SalGenericSystem::getFrameClassName(); + XClassHint* pClass = XAllocClassHint(); + OString aResName = SalGenericSystem::getFrameResName(); + pClass->res_name = const_cast<char*>(aResName.getStr()); + pClass->res_class = const_cast<char*>(pResClass); + Display *display = gdk_x11_display_get_xdisplay(getGdkDisplay()); + XSetClassHint( display, + GtkSalFrame::GetNativeWindowHandle(m_pWindow), + pClass ); + XFree( pClass ); #endif } |