Commit 6e619bf7 authored by Daniel P. Berrange's avatar Daniel P. Berrange

Require gtk >= 3.22

Since we require gobject introspection >= 1.54, we know
the distro will have gtk >= 3.22 too.
Signed-off-by: 's avatarDaniel P. Berrange <berrange@redhat.com>
parent 67fed810
Pipeline #43130968 passed with stage
in 2 minutes and 12 seconds
......@@ -55,7 +55,7 @@ be present
meson >= 0.41.0
glib2 >= 2.26.0
gdk-pixbf >= 2.12.0
gtk3 >= 3.12.0
gtk3 >= 3.22.0
libgphoto2 >= 2.4.11
gudev >= 145
gobject-introspection >= 1.54.0
......
......@@ -9,7 +9,7 @@ Source: http://entangle-photo.org/download/sources/%{name}-%{version}.tar.xz
URL: http://entangle-photo.org/
BuildRequires: glib2-devel >= 2.36.0
BuildRequires: gtk3-devel >= 3.12
BuildRequires: gtk3-devel >= 3.22.0
BuildRequires: libgphoto2-devel >= 2.4.11
BuildRequires: libgudev1-devel >= 145
BuildRequires: lcms2-devel >= 2.0
......
......@@ -16,7 +16,7 @@ cc = meson.get_compiler('c')
glib_min_version = '>= 2.38.0'
gdk_pixbuf_min_version = '>= 2.12.0'
gtk_min_version = '>= 3.12.0'
gtk_min_version = '>= 3.22.0'
gphoto2_min_version = '>= 2.5.0'
gudev_min_version = '>= 145'
gobject_introspection_min_version = '>= 1.54.0'
......
......@@ -275,18 +275,11 @@ static void do_action_manual(GSimpleAction *act G_GNUC_UNUSED,
{
g_return_if_fail(ENTANGLE_IS_APPLICATION(opaque));
#if GTK_CHECK_VERSION(3, 22, 0)
EntangleApplication *app = ENTANGLE_APPLICATION(opaque);
gtk_show_uri_on_window(gtk_application_get_active_window(GTK_APPLICATION(app)),
"help:entangle",
GDK_CURRENT_TIME,
NULL);
#else
gtk_show_uri(gdk_screen_get_default(),
"help:entangle",
GDK_CURRENT_TIME,
NULL);
#endif
}
static void do_action_new_window(GSimpleAction *act G_GNUC_UNUSED,
......
......@@ -160,7 +160,6 @@ static EntanglePreferences *entangle_camera_manager_get_preferences(EntangleCame
return entangle_application_get_preferences(app);
}
#if GTK_CHECK_VERSION(3, 22, 0)
static int
entangle_camera_manager_get_monitor_num(GdkMonitor *monitor)
{
......@@ -175,14 +174,11 @@ entangle_camera_manager_get_monitor_num(GdkMonitor *monitor)
}
return -1;
}
#endif
static EntangleColourProfile *entangle_camera_manager_monitor_profile(GtkWindow *window)
{
#if GTK_CHECK_VERSION(3, 22, 0)
GdkDisplay *display;
GdkMonitor *monitor;
#endif
GdkScreen *screen;
GByteArray *profileData;
gchar *atom;
......@@ -196,15 +192,10 @@ static EntangleColourProfile *entangle_camera_manager_monitor_profile(GtkWindow
gtk_widget_realize(GTK_WIDGET(window));
screen = gtk_widget_get_screen(GTK_WIDGET(window));
#if GTK_CHECK_VERSION(3, 22, 0)
display = gtk_widget_get_display(GTK_WIDGET(window));
monitor = gdk_display_get_monitor_at_window(display,
gtk_widget_get_window(GTK_WIDGET(window)));
monitorIdx = entangle_camera_manager_get_monitor_num(monitor);
#else
monitorIdx = gdk_screen_get_monitor_at_window(screen,
gtk_widget_get_window(GTK_WIDGET(window)));
#endif
if (monitorIdx == 0)
atom = g_strdup("_ICC_PROFILE");
......@@ -407,38 +398,24 @@ static GMenu *entangle_camera_manager_monitor_menu(EntangleCameraManager *manage
g_return_val_if_fail(ENTANGLE_IS_CAMERA_MANAGER(manager), NULL);
EntangleCameraManagerPrivate *priv = entangle_camera_manager_get_instance_private(manager);
#if GTK_CHECK_VERSION(3, 22, 0)
GdkDisplay *display = gtk_widget_get_display(GTK_WIDGET(manager));
#else
GdkScreen *screen = gtk_window_get_screen(GTK_WINDOW(manager));
#endif
GMenu *menu = g_menu_new();
#ifdef gdk_screen_get_primary_monitor
int active = gdk_screen_get_primary_monitor(screen);
#else
GdkMonitor *thismon = gdk_display_get_monitor_at_window(display,
gtk_widget_get_window(GTK_WIDGET(manager)));
int active = 0;
#endif
GSimpleAction *action;
action = G_SIMPLE_ACTION(g_action_map_lookup_action(G_ACTION_MAP(manager), "presentation-monitor"));
for (int i = 0; i <
#if GTK_CHECK_VERSION(3, 22, 0)
gdk_display_get_n_monitors(display);
#else
gdk_screen_get_n_monitors(screen);
#endif
i++) {
#if GTK_CHECK_VERSION(3, 22, 0)
for (int i = 0; i < gdk_display_get_n_monitors(display); i++) {
GdkMonitor *monitor = gdk_display_get_monitor(display, i);
const gchar *name = gdk_monitor_get_model(monitor);
#else
const gchar *name = gdk_screen_get_monitor_plug_name(screen, i);
#endif
GMenuItem *submenu = g_menu_item_new(name, NULL);
g_menu_item_set_action_and_target_value(submenu,
"win.presentation-monitor",
g_variant_new_int32(i));
if (monitor == thismon)
active = i;
g_menu_append_item(menu, submenu);
g_object_unref(submenu);
......@@ -2603,12 +2580,7 @@ static gboolean do_session_browser_popup(EntangleSessionBrowser *browser,
gtk_menu_item_set_submenu(GTK_MENU_ITEM(openWith), GTK_WIDGET(appList));
#if GTK_CHECK_VERSION(3, 22, 0)
gtk_menu_popup_at_pointer(priv->sessionBrowserMenu, (GdkEvent *)event);
#else
gtk_menu_popup(priv->sessionBrowserMenu, NULL, NULL, NULL, NULL,
event->button, event->time);
#endif
gtk_widget_set_sensitive(GTK_WIDGET(open), ctype && appInfoList ? TRUE : FALSE);
return TRUE;
......@@ -2649,13 +2621,8 @@ static void do_session_browser_drag_failed(GtkWidget *widget G_GNUC_UNUSED,
GdkScreen *screen;
GdkDevice *dev;
int x, y;
#if GTK_CHECK_VERSION(3, 20, 0)
GdkSeat *seat = gdk_display_get_default_seat(gtk_widget_get_display(widget));
dev = gdk_seat_get_pointer(seat);
#else
GdkDeviceManager *devmgr = gdk_display_get_device_manager(gtk_widget_get_display(widget));
dev = gdk_device_manager_get_client_pointer(devmgr);
#endif
gdk_device_get_position(dev,
&screen,
&x, &y);
......@@ -2984,13 +2951,8 @@ static void entangle_camera_manager_init(EntangleCameraManager *manager)
gtk_widget_show(settingsBox);
gtk_widget_show(imageHistogramExpander);
#if GTK_CHECK_VERSION(3, 12, 0)
gtk_widget_set_margin_end(priv->scriptConfigExpander, 6);
gtk_widget_set_margin_end(imageHistogramExpander, 6);
#else
gtk_widget_set_margin_right(priv->scriptConfigExpander, 6);
gtk_widget_set_margin_right(imageHistogramExpander, 6);
#endif
priv->monitorCancel = g_cancellable_new();
priv->taskCancel = g_cancellable_new();
......
......@@ -444,7 +444,7 @@ static void do_setup_control(EntangleControlPanel *panel,
gtk_widget_set_sensitive(value, FALSE);
gtk_combo_box_set_active(GTK_COMBO_BOX(value), active);
#if GTK_CHECK_VERSION(3, 20, 0) && defined(GDK_WINDOWING_WAYLAND)
#ifdef GDK_WINDOWING_WAYLAND
/* Hack until https://gitlab.gnome.org/GNOME/gtk/issues/1463 is fixed */
if (GDK_IS_WAYLAND_DISPLAY(gtk_widget_get_display(GTK_WIDGET(value))) &&
(entangle_control_choice_entry_count(ENTANGLE_CONTROL_CHOICE(control)) > 15)) {
......@@ -827,12 +827,7 @@ static void do_setup_controls(EntangleControlPanel *panel)
menu);
gtk_widget_set_hexpand(settingsButton, TRUE);
gtk_widget_set_halign(settingsButton, GTK_ALIGN_END);
#if GTK_CHECK_VERSION(3, 12, 0)
gtk_widget_set_margin_end(settingsButton, 6);
#else
gtk_widget_set_margin_right(settingsButton, 6);
#endif
gtk_grid_attach(GTK_GRID(priv->grid), settingsButton, 1, priv->rows, 2, 1);
......
......@@ -252,19 +252,11 @@ void entangle_media_popup_move_to_monitor(EntangleMediaPopup *popup, gint monito
{
g_return_if_fail(ENTANGLE_IS_MEDIA_POPUP(popup));
#if GTK_CHECK_VERSION(3, 22, 0)
GdkDisplay *display = gtk_widget_get_display(GTK_WIDGET(popup));
GdkMonitor *monitor = gdk_display_get_monitor(display, monitorIdx);
#else
GdkScreen *screen = gtk_window_get_screen(GTK_WINDOW(popup));
#endif
GdkRectangle r;
#if GTK_CHECK_VERSION(3, 22, 0)
gdk_monitor_get_geometry(monitor, &r);
#else
gdk_screen_get_monitor_geometry(screen, monitorIdx, &r);
#endif
ENTANGLE_DEBUG("At %d,%d Size %d,%d", r.x, r.y, r.width, r.height);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment