summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorJosé Expósito <jose.exposito89@gmail.com>2021-07-29 18:07:32 +0200
committerJosé Expósito <jose.exposito89@gmail.com>2021-08-03 16:52:39 +0000
commit895e866da642f381e4cbfbea9703ab1843561f8e (patch)
tree02800965e2be06b759eb8417243ab3cb9e34cfc2 /meson.build
parent55889adeff3fe5dd666709bdbc006e1905b4dd3c (diff)
downloadlibinput-895e866da642f381e4cbfbea9703ab1843561f8e.tar.gz
debug-gui: migrate to GTK4
Global: - Stop passing commandline arguments to gtk_init: https://docs.gtk.org/gtk4/migrating-3to4.html#stop-passing-commandline-arguments-to-gtk_init window_init function: - gtk_window_new doesn't require a type anymore - gtk_window_iconify has been renamed to gtk_window_minimize - gtk_container_add has been removed in favor of container specific APIs. Use gtk_window_set_child in this case. - gtk_widget_show_all has been removed, widgets are now visible by default: https://docs.gtk.org/gtk4/migrating-3to4.html#widgets-are-now-visible-by-default - gtk_widget_set_events to NULL is no longer required, widgets must set their event handlers explicitly now: https://blog.gtk.org/2020/04/29/custom-widgets-in-gtk-4-input/ window_delete_event_cb function: - Use the new close-request event: https://docs.gtk.org/gtk4/migrating-3to4.html#stop-using-gtkwidget-event-signals map_event_cb function: - gtk_widget_set_cursor_from_name instead of gdk_window_set_cursor - Wait until the draw area is resized to use the whole window to start calculating sizes window_place_ui_elements function: - Use gtk_widget_get_width and gtk_widget_get_height instead of gtk_window_get_size Drawing: - Use gtk_drawing_area_set_draw_func instead of the GtkWidget::draw signal: https://docs.gtk.org/gtk4/migrating-3to4.html#adapt-to-drawing-model-changes Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build8
1 files changed, 7 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index e78fafd1..9db3283f 100644
--- a/meson.build
+++ b/meson.build
@@ -550,7 +550,13 @@ executable('libinput-record',
)
if get_option('debug-gui')
- dep_gtk = dependency('gtk+-3.0', version : '>= 3.20')
+ dep_gtk = dependency('gtk4', version : '>= 4.0', required : false)
+ config_h.set10('HAVE_GTK4', dep_gtk.found())
+ if not dep_gtk.found()
+ dep_gtk = dependency('gtk+-3.0', version : '>= 3.20')
+ config_h.set10('HAVE_GTK3', dep_gtk.found())
+ endif
+
dep_cairo = dependency('cairo')
dep_glib = dependency('glib-2.0')