vcl/unx/gtk3/gtkframe.cxx | 8 ++++++++ 1 file changed, 8 insertions(+)
New commits: commit 903b8f8524b8c84eced3ccbf7cfec9c5b9015f4b Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri Aug 26 23:03:05 2022 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Sat Aug 27 00:45:54 2022 +0200 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.wegh...@posteo.de> 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);