[Libreoffice-commits] core.git: vcl/unx
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Tue May 11 15:39:44 UTC 2021
vcl/unx/gtk3/gtkframe.cxx | 31 ++++++++++++++-----------------
1 file changed, 14 insertions(+), 17 deletions(-)
New commits:
commit 3f4400f1ac9185b7b123585deafef04a3d91bc66
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue May 11 15:20:42 2021 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue May 11 17:38:55 2021 +0200
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 at redhat.com>
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
}
More information about the Libreoffice-commits
mailing list