diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2022-08-26 23:03:05 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2022-08-27 00:45:54 +0200 |
commit | 903b8f8524b8c84eced3ccbf7cfec9c5b9015f4b (patch) | |
tree | 8303ac144f0ac78e6e451770175d15a38ddd98b1 /vcl | |
parent | 327a87f51d5a35d6dee0e9038b26f989052f6e0c (diff) |
gtk: Fix gtk4 build after f2bd19f672023 and e6bed4293814d
Other than their gtk3 counterparts, the gtk4 variants
of `gtk_gesture_zoom_new` and `gtk_gesture_rotate_new`
don't take any `GtkWidget*` param any more:
In file included from .../libreoffice//vcl/unx/gtk4/gtkframe.cxx:12:
.../libreoffice//vcl/unx/gtk4/../gtk3/gtkframe.cxx: In member function ‘void GtkSalFrame::InitCommon()’:
.../libreoffice//vcl/unx/gtk4/../gtk3/gtkframe.cxx:1025:42: error: too many arguments to function ‘GtkGesture* gtk_gesture_zoom_new()’
1025 | m_pZoomGesture = gtk_gesture_zoom_new(GTK_WIDGET(pEventWidget));
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/gtk-4.0/gtk/gtk.h:145,
from .../libreoffice//vcl/unx/gtk4/transferableprovider.hxx:14,
from .../libreoffice//vcl/unx/gtk4/gtkframe.cxx:10:
/usr/include/gtk-4.0/gtk/gtkgesturezoom.h:46:14: note: declared here
46 | GtkGesture * gtk_gesture_zoom_new (void);
| ^~~~~~~~~~~~~~~~~~~~
.../libreoffice//vcl/unx/gtk4/../gtk3/gtkframe.cxx:1034:46: error: too many arguments to function ‘GtkGesture* gtk_gesture_rotate_new()’
1034 | m_pRotateGesture = gtk_gesture_rotate_new(GTK_WIDGET(pEventWidget));
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/gtk-4.0/gtk/gtk.h:141:
/usr/include/gtk-4.0/gtk/gtkgesturerotate.h:46:14: note: declared here
46 | GtkGesture * gtk_gesture_rotate_new (void);
| ^~~~~~~~~~~~~~~~~~~~~~
make[1]: *** [.../libreoffice//solenv/gbuild/LinkTarget.mk:334: /home/michi/development/git/libreoffice/workdir/CxxObject/vcl/unx/gtk4/gtkframe.o] Error 1
make: *** [Makefile:289: build] Error 2
Change-Id: Ia2f0f76b6353c34baef9fd6adcafe4af07bec543
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138888
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk3/gtkframe.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx index 65f113ab1c33..a8b984608880 100644 --- a/vcl/unx/gtk3/gtkframe.cxx +++ b/vcl/unx/gtk3/gtkframe.cxx @@ -1022,7 +1022,11 @@ void GtkSalFrame::InitCommon() gtk_widget_add_controller(pEventWidget, pScrollController); #endif +#if GTK_CHECK_VERSION(4,0,0) + m_pZoomGesture = gtk_gesture_zoom_new(); +#else m_pZoomGesture = gtk_gesture_zoom_new(GTK_WIDGET(pEventWidget)); +#endif gtk_event_controller_set_propagation_phase(GTK_EVENT_CONTROLLER(m_pZoomGesture), GTK_PHASE_TARGET); // Note that the default zoom gesture signal handler needs to run first to setup correct @@ -1031,7 +1035,11 @@ void GtkSalFrame::InitCommon() g_signal_connect_after(m_pZoomGesture, "update", G_CALLBACK(signalZoomUpdate), this); g_signal_connect_after(m_pZoomGesture, "end", G_CALLBACK(signalZoomEnd), this); +#if GTK_CHECK_VERSION(4,0,0) + m_pRotateGesture = gtk_gesture_rotate_new(); +#else m_pRotateGesture = gtk_gesture_rotate_new(GTK_WIDGET(pEventWidget)); +#endif gtk_event_controller_set_propagation_phase(GTK_EVENT_CONTROLLER(m_pRotateGesture), GTK_PHASE_TARGET); g_signal_connect(m_pRotateGesture, "begin", G_CALLBACK(signalRotateBegin), this); |