diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-09-07 13:37:06 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-09-07 19:19:21 +0000 |
commit | e928e2daa3a8a9ad5d8ee7bf5982b41ec9cc6344 (patch) | |
tree | 378a35d04eb3e0fe7f1acfc2c0463fb402bab167 /vcl/unx | |
parent | 56fdbdbe51d10d08936f4514bef82887000ea53c (diff) |
less dlopen, call gtk2 things direct, baseline is newer now
Change-Id: Iff385fe836f8e959fb8b16aa76603b490bc44d9f
Reviewed-on: https://gerrit.libreoffice.org/28719
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/gtk/gtksalframe.cxx | 47 | ||||
-rw-r--r-- | vcl/unx/gtk/salnativewidgets-gtk.cxx | 7 |
2 files changed, 8 insertions, 46 deletions
diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx index bb5567757a39..9bf46e34d2ab 100644 --- a/vcl/unx/gtk/gtksalframe.cxx +++ b/vcl/unx/gtk/gtksalframe.cxx @@ -1048,33 +1048,10 @@ void GtkSalFrame::InitCommon() None ); } -/* Sadly gtk_window_set_accept_focus exists only since gtk 2.4 - * for achieving the same effect we will remove the WM_TAKE_FOCUS - * protocol from the window and set the input hint to false. - * But gtk_window_set_accept_focus needs to be called before - * window realization whereas the removal obviously can only happen - * after realization. - */ - -extern "C" { - typedef void(*setAcceptFn)( GtkWindow*, gboolean ); - static setAcceptFn p_gtk_window_set_accept_focus = nullptr; - static bool bGetAcceptFocusFn = true; - - typedef void(*setUserTimeFn)( GdkWindow*, guint32 ); - static setUserTimeFn p_gdk_x11_window_set_user_time = nullptr; - static bool bGetSetUserTimeFn = true; -} - static void lcl_set_accept_focus( GtkWindow* pWindow, gboolean bAccept, bool bBeforeRealize ) { - if( bGetAcceptFocusFn ) - { - bGetAcceptFocusFn = false; - p_gtk_window_set_accept_focus = reinterpret_cast<setAcceptFn>(osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gtk_window_set_accept_focus" )); - } - if( p_gtk_window_set_accept_focus && bBeforeRealize ) - p_gtk_window_set_accept_focus( pWindow, bAccept ); + if (bBeforeRealize) + gtk_window_set_accept_focus( pWindow, bAccept ); else if( ! bBeforeRealize ) { Display* pDisplay = GetGtkSalData()->GetGtkDisplay()->GetDisplay(); @@ -1130,22 +1107,10 @@ static void lcl_set_accept_focus( GtkWindow* pWindow, gboolean bAccept, bool bBe static void lcl_set_user_time( GtkWindow* i_pWindow, guint32 i_nTime ) { - if( bGetSetUserTimeFn ) - { - bGetSetUserTimeFn = false; - p_gdk_x11_window_set_user_time = reinterpret_cast<setUserTimeFn>(osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_x11_window_set_user_time" )); - } - bool bSet = false; - if( p_gdk_x11_window_set_user_time ) - { - GdkWindow* pWin = widget_get_window(GTK_WIDGET(i_pWindow)); - if( pWin ) // only if the window is realized. - { - p_gdk_x11_window_set_user_time( pWin, i_nTime ); - bSet = true; - } - } - if( !bSet ) + GdkWindow* pWin = widget_get_window(GTK_WIDGET(i_pWindow)); + if (pWin) // only if the window is realized. + gdk_x11_window_set_user_time( pWin, i_nTime ); + else { Display* pDisplay = GetGtkSalData()->GetGtkDisplay()->GetDisplay(); Atom nUserTime = XInternAtom( pDisplay, "_NET_WM_USER_TIME", True ); diff --git a/vcl/unx/gtk/salnativewidgets-gtk.cxx b/vcl/unx/gtk/salnativewidgets-gtk.cxx index b5810a87926d..813d5a5a7f30 100644 --- a/vcl/unx/gtk/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/salnativewidgets-gtk.cxx @@ -4113,11 +4113,8 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) #endif sal_Int32 nDispDPIY = GetDisplay()->GetResolution().B(); - int nPointHeight = 0; - static gboolean(*pAbso)(const PangoFontDescription*) = - reinterpret_cast<gboolean(*)(const PangoFontDescription*)>(osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "pango_font_description_get_size_is_absolute" )); - - if( pAbso && pAbso( pStyle->font_desc ) ) + int nPointHeight; + if (pango_font_description_get_size_is_absolute(pStyle->font_desc)) nPointHeight = (nPangoHeight * 72 + nDispDPIY*PANGO_SCALE/2) / (nDispDPIY * PANGO_SCALE); else nPointHeight = nPangoHeight/PANGO_SCALE; |