From d4bae3c10e8f9ccafcc911a677093101eaed3ad1 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 24 May 2021 10:55:22 +0100 Subject: gtk[3|4] wrap gtk_widget_get_window/gtk_native_get_surface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I21c1cf9ab65e056242f09c8c2bbd84afa9ac42e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116044 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- vcl/inc/unx/gtk/gtkdata.hxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'vcl/inc') diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx index eccac367ca40..6203d10d4530 100644 --- a/vcl/inc/unx/gtk/gtkdata.hxx +++ b/vcl/inc/unx/gtk/gtkdata.hxx @@ -115,6 +115,15 @@ inline void style_context_get_color(GtkStyleContext *pStyle, GdkRGBA *pColor) #endif } +inline GdkSurface* widget_get_surface(GtkWidget* pWidget) +{ +#if GTK_CHECK_VERSION(4,0,0) + return gtk_native_get_surface(gtk_widget_get_native(pWidget)); +#else + return gtk_widget_get_window(pWidget); +#endif +} + inline void widget_set_cursor(GtkWidget *pWidget, GdkCursor *pCursor) { #if GTK_CHECK_VERSION(4, 0, 0) -- cgit