diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-04-14 09:59:02 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-04-14 14:51:00 +0200 |
commit | fb3a41b328f5e221e96e7f90e28f84988188cbe2 (patch) | |
tree | 6cbe25afd1acb4888a49f30da66abcae74e1781f /vcl/unx/gtk3/gtk3gtkframe.cxx | |
parent | 89b2fd604420d53b6d6ccc6e7656c3bcf282703d (diff) |
use gdk_window_move_to_rect if available at runtime
vs at buildtime
Change-Id: I22fdf5f98058bf5212248f33cf879e1420748ba3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92152
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx/gtk3/gtk3gtkframe.cxx')
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkframe.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx index 9b221311a8b3..18db569607ee 100644 --- a/vcl/unx/gtk3/gtk3gtkframe.cxx +++ b/vcl/unx/gtk3/gtk3gtkframe.cxx @@ -45,6 +45,8 @@ #include <basegfx/vector/b2ivector.hxx> +#include <dlfcn.h> + #include <algorithm> #if OSL_DEBUG_LEVEL > 1 @@ -2908,7 +2910,6 @@ void GtkSalFrame::sizeAllocated(GtkWidget* pWidget, GdkRectangle *pAllocation, g pThis->TriggerPaintEvent(); } -#if GTK_CHECK_VERSION(3,23,0) namespace { void swapDirection(GdkGravity& gravity) @@ -2924,7 +2925,6 @@ void swapDirection(GdkGravity& gravity) } } -#endif void GtkSalFrame::signalRealize(GtkWidget*, gpointer frame) { @@ -2934,8 +2934,13 @@ void GtkSalFrame::signalRealize(GtkWidget*, gpointer frame) return; pThis->TriggerPaintEvent(); -#if GTK_CHECK_VERSION(3,23,0) - if (gtk_check_version(3, 23, 0) == nullptr && pThis->m_bFloatPositioned) + if (!pThis->m_bFloatPositioned) + return; + + static auto window_move_to_rect = reinterpret_cast<void (*) (GdkWindow*, const GdkRectangle*, GdkGravity, + GdkGravity, GdkAnchorHints, gint, gint)>( + dlsym(nullptr, "gdk_window_move_to_rect")); + if (window_move_to_rect) { GdkGravity rect_anchor = GDK_GRAVITY_SOUTH_WEST, menu_anchor = GDK_GRAVITY_NORTH_WEST; @@ -2969,9 +2974,8 @@ void GtkSalFrame::signalRealize(GtkWidget*, gpointer frame) static_cast<int>(aFloatRect.GetWidth()), static_cast<int>(aFloatRect.GetHeight())}; GdkWindow* gdkWindow = gtk_widget_get_window(pThis->m_pWindow); - gdk_window_move_to_rect(gdkWindow, &rect, rect_anchor, menu_anchor, GDK_ANCHOR_FLIP, 0, 0); + window_move_to_rect(gdkWindow, &rect, rect_anchor, menu_anchor, GDK_ANCHOR_FLIP, 0, 0); } -#endif } gboolean GtkSalFrame::signalConfigure(GtkWidget*, GdkEventConfigure* pEvent, gpointer frame) |