Commit fc0f469f authored by Alexander Gramiak's avatar Alexander Gramiak

Bump minimum GTK versions to 2.24 and 3.10

* configure.ac: Bump required GTK 2 and GTK 3 versions and the
associated GLib versions. Remove obsolete AC_CHECK_FUNCS calls. These
check for functions available in later GTK 2 versions. These checks
and can safely be removed with the exception of
gtk_window_set_has_resize_grip, which according to a comment in
gtkutil.c causes an issue in Ubuntu's GTK 2.

* src/gtkutil.c:
* src/xfns.c:
* src/xterm.c:
* src/xterm.h: Remove now unused conditional blocks. Use HAVE_GTK3
instead of GTK_CHECK_VERSION where now applicable. Remove checks of
now always true USE_GTK_TOOLTIP.
parent 5c2f94a1
Pipeline #1295 failed with stage
in 50 minutes and 6 seconds
......@@ -2688,8 +2688,8 @@ check_gtk2=no
gtk3_pkg_errors=
if test "${opsys}" != "mingw32"; then
if test "${with_gtk3}" = "yes" || test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then
GLIB_REQUIRED=2.28
GTK_REQUIRED=3.0
GLIB_REQUIRED=2.37.5
GTK_REQUIRED=3.10
GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
dnl Checks for libraries.
......@@ -2716,8 +2716,8 @@ if test "${opsys}" != "mingw32"; then
fi
if test "${with_gtk2}" = "yes" || test "$check_gtk2" = "yes"; then
GLIB_REQUIRED=2.10
GTK_REQUIRED=2.10
GLIB_REQUIRED=2.28
GTK_REQUIRED=2.24
GTK_MODULES="gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
dnl Checks for libraries.
......@@ -2804,30 +2804,8 @@ if test "${HAVE_GTK}" = "yes"; then
AC_CHECK_FUNCS(gtk_file_selection_new)
fi
dnl Same as above for gtk_handle_box.
HAVE_GTK_HANDLE_BOX=no
AC_CHECK_DECL(GTK_TYPE_HANDLE_BOX, HAVE_GTK_HANDLE_BOX=yes,
HAVE_GTK_HANDLE_BOX=no, [AC_INCLUDES_DEFAULT
#include <gtk/gtk.h>])
if test "$HAVE_GTK_HANDLE_BOX" = yes; then
AC_CHECK_FUNCS(gtk_handle_box_new)
fi
dnl Same as above for gtk_tearoff_menu_item.
HAVE_GTK_TEAROFF_MENU_ITEM=no
AC_CHECK_DECL(GTK_TYPE_TEAROFF_MENU_ITEM, HAVE_GTK_TEAROFF_MENU_ITEM=yes,
HAVE_GTK_TEAROFF_MENU_ITEM=no, [AC_INCLUDES_DEFAULT
#include <gtk/gtk.h>])
if test "$HAVE_GTK_TEAROFF_MENU_ITEM" = yes; then
AC_CHECK_FUNCS(gtk_tearoff_menu_item_new)
fi
dnl Check for functions introduced in 2.14 and later.
AC_CHECK_FUNCS(gtk_widget_get_window gtk_widget_set_has_window \
gtk_dialog_get_action_area gtk_widget_get_sensitive \
gtk_widget_get_mapped gtk_adjustment_get_page_size \
gtk_orientable_set_orientation \
gtk_window_set_has_resize_grip)
dnl This procedure causes a bug on certain Ubuntu GTK+2 builds
AC_CHECK_FUNCS(gtk_window_set_has_resize_grip)
term_header=gtkutil.h
fi
......
......@@ -89,6 +89,10 @@ Options" in the Emacs manual for more information.
check that the portable dumper code has been updated to match the last
change to one of the data structures that it relies on.
---
** Emacs now requires GTK 2.24 and GTK 3.10 for the GTK 2 and GTK 3
builds respectively.
* Startup Changes in Emacs 27.1
......
This diff is collapsed.
......@@ -4496,7 +4496,7 @@ On MS Windows, this just returns nil. */)
Return false if and only if the workarea information cannot be
obtained via the _NET_WORKAREA root window property. */
#if ! GTK_CHECK_VERSION (3, 4, 0)
#ifndef HAVE_GTK3
static bool
x_get_net_workarea (struct x_display_info *dpyinfo, XRectangle *rect)
{
......@@ -4906,9 +4906,9 @@ Internal use only, use `display-monitor-attributes-list' instead. */)
Lisp_Object attributes_list = Qnil;
#ifdef USE_GTK
double mm_width_per_pixel, mm_height_per_pixel;
GdkDisplay *gdpy;
#if ! GTK_CHECK_VERSION (3, 22, 0)
double mm_width_per_pixel, mm_height_per_pixel;
GdkScreen *gscreen;
#endif
gint primary_monitor = 0, n_monitors, i;
......@@ -4917,19 +4917,18 @@ Internal use only, use `display-monitor-attributes-list' instead. */)
struct MonitorInfo *monitors;
block_input ();
mm_width_per_pixel = ((double) WidthMMOfScreen (dpyinfo->screen)
/ x_display_pixel_width (dpyinfo));
mm_height_per_pixel = ((double) HeightMMOfScreen (dpyinfo->screen)
/ x_display_pixel_height (dpyinfo));
gdpy = gdk_x11_lookup_xdisplay (dpyinfo->display);
#if GTK_CHECK_VERSION (3, 22, 0)
n_monitors = gdk_display_get_n_monitors (gdpy);
#else
gscreen = gdk_display_get_default_screen (gdpy);
#if GTK_CHECK_VERSION (2, 20, 0)
primary_monitor = gdk_screen_get_primary_monitor (gscreen);
#endif
n_monitors = gdk_screen_get_n_monitors (gscreen);
primary_monitor = gdk_screen_get_primary_monitor (gscreen);
/* Fallback if gdk_screen_get_monitor_{width,height}_mm fail */
mm_width_per_pixel = ((double) WidthMMOfScreen (dpyinfo->screen)
/ x_display_pixel_width (dpyinfo));
mm_height_per_pixel = ((double) HeightMMOfScreen (dpyinfo->screen)
/ x_display_pixel_height (dpyinfo));
#endif
monitor_frames = make_nil_vector (n_monitors);
monitors = xzalloc (n_monitors * sizeof *monitors);
......@@ -4958,7 +4957,7 @@ Internal use only, use `display-monitor-attributes-list' instead. */)
for (i = 0; i < n_monitors; ++i)
{
gint width_mm = -1, height_mm = -1;
gint width_mm, height_mm;
GdkRectangle rec, work;
struct MonitorInfo *mi = &monitors[i];
int scale = 1;
......@@ -4975,18 +4974,17 @@ Internal use only, use `display-monitor-attributes-list' instead. */)
#if GTK_CHECK_VERSION (3, 22, 0)
width_mm = gdk_monitor_get_width_mm (monitor);
height_mm = gdk_monitor_get_height_mm (monitor);
#elif GTK_CHECK_VERSION (2, 14, 0)
#else
width_mm = gdk_screen_get_monitor_width_mm (gscreen, i);
height_mm = gdk_screen_get_monitor_height_mm (gscreen, i);
#endif
if (width_mm < 0)
width_mm = rec.width * mm_width_per_pixel + 0.5;
if (height_mm < 0)
height_mm = rec.height * mm_height_per_pixel + 0.5;
#endif
#if GTK_CHECK_VERSION (3, 22, 0)
gdk_monitor_get_workarea (monitor, &work);
#elif GTK_CHECK_VERSION (3, 4, 0)
#elif defined HAVE_GTK3
gdk_screen_get_monitor_workarea (gscreen, i, &work);
#else
/* Emulate the behavior of GTK+ 3.4. */
......@@ -5010,7 +5008,7 @@ Internal use only, use `display-monitor-attributes-list' instead. */)
/* GTK returns scaled sizes for the workareas. */
#if GTK_CHECK_VERSION (3, 22, 0)
scale = gdk_monitor_get_scale_factor (monitor);
#elif GTK_CHECK_VERSION (3, 10, 0)
#elif defined HAVE_GTK3
scale = gdk_screen_get_monitor_scale_factor (gscreen, i);
#endif
rec.width *= scale;
......@@ -5031,7 +5029,7 @@ Internal use only, use `display-monitor-attributes-list' instead. */)
#if GTK_CHECK_VERSION (3, 22, 0)
dupstring (&mi->name, (gdk_monitor_get_model (monitor)));
#elif GTK_CHECK_VERSION (2, 14, 0)
#else
mi->name = gdk_screen_get_monitor_plug_name (gscreen, i);
#endif
}
......@@ -5041,11 +5039,7 @@ Internal use only, use `display-monitor-attributes-list' instead. */)
primary_monitor,
monitor_frames,
source);
#if GTK_CHECK_VERSION (2, 14, 0)
free_monitors (monitors, n_monitors);
#else
xfree (monitors);
#endif
unblock_input ();
#else /* not USE_GTK */
......@@ -5380,7 +5374,7 @@ Frames are listed from topmost (first) to bottommost (last). */)
static void
x_frame_restack (struct frame *f1, struct frame *f2, bool above_flag)
{
#if defined (USE_GTK) && GTK_CHECK_VERSION (2, 18, 0)
#ifdef USE_GTK
block_input ();
xg_frame_restack (f1, f2, above_flag);
unblock_input ();
......
......@@ -12514,7 +12514,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
dpy = DEFAULT_GDK_DISPLAY ();
#if ! GTK_CHECK_VERSION (2, 90, 0)
#ifndef HAVE_GTK3
/* Load our own gtkrc if it exists. */
{
const char *file = "~/.emacs.d/gtkrc";
......
......@@ -50,17 +50,8 @@ typedef Widget xt_or_gtk_widget;
#include <gdk/gdkx.h>
#endif /* USE_GTK */
/* True iff GTK's version is at least I.J.K. */
#ifndef GTK_CHECK_VERSION
# ifdef USE_GTK
# define GTK_CHECK_VERSION(i, j, k) \
((i) \
< GTK_MAJOR_VERSION + ((j) \
< GTK_MINOR_VERSION + ((k) \
<= GTK_MICRO_VERSION)))
# else
# define GTK_CHECK_VERSION(i, j, k) false
# endif
#ifndef USE_GTK
#define GTK_CHECK_VERSION(i, j, k) false
#endif
#ifdef USE_GTK
......@@ -76,11 +67,6 @@ typedef GtkWidget *xt_or_gtk_widget;
#endif
#endif /* USE_GTK */
/* The GtkTooltip API came in 2.12, but gtk-enable-tooltips in 2.14. */
#if GTK_CHECK_VERSION (2, 14, 0)
#define USE_GTK_TOOLTIP
#endif
#ifdef USE_CAIRO
#include <cairo-xlib.h>
#ifdef CAIRO_HAS_PDF_SURFACE
......@@ -594,12 +580,9 @@ struct x_output
GdkGeometry size_hints;
long hint_flags;
#ifdef USE_GTK_TOOLTIP
GtkTooltip *ttip_widget;
GtkWidget *ttip_lbl;
GtkWindow *ttip_window;
#endif /* USE_GTK_TOOLTIP */
#endif /* USE_GTK */
/* If >=0, a bitmap index. The indicated bitmap is used for the
......@@ -793,18 +776,6 @@ extern void x_mark_frame_dirty (struct frame *f);
FRAME_X_WINDOW (f))
#else
#ifdef USE_GTK
/* Functions not present in older Gtk+ */
#ifndef HAVE_GTK_WIDGET_GET_WINDOW
#define gtk_widget_get_window(w) ((w)->window)
#endif
#ifndef HAVE_GTK_WIDGET_GET_MAPPED
#define gtk_widget_get_mapped(w) (GTK_WIDGET_MAPPED (w))
#endif
#ifndef HAVE_GTK_ADJUSTMENT_GET_PAGE_SIZE
#define gtk_adjustment_get_page_size(w) ((w)->page_size)
#define gtk_adjustment_get_upper(w) ((w)->upper)
#endif
#ifdef HAVE_GTK3
#define DEFAULT_GDK_DISPLAY() \
......
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