Commit e4f9cdc0 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

build: Increase GTK+ requirement to 3.22

Since 4.14 this is the minimum version for all of Xfce, which allows to
remove a bunch of dead code.

Refs !3Signed-off-by: default avatarDridi Boukelmoune <dridi@fedoraproject.org>
parent be5bfa2d
Pipeline #4848 passed with stages
in 2 minutes and 54 seconds
......@@ -52,7 +52,6 @@ xfwm_widget_reparent (GtkWidget *widget,
void
xfwm_get_screen_dimensions (gint *width, gint *height)
{
#if GTK_CHECK_VERSION(3, 22, 0)
GdkDisplay *display;
GdkMonitor *monitor;
GdkRectangle geometry;
......@@ -65,12 +64,6 @@ xfwm_get_screen_dimensions (gint *width, gint *height)
*width = geometry.width;
if (height != NULL)
*height = geometry.height;
#else
if (width != NULL)
*width = gdk_screen_width ();
if (height != NULL)
*height = gdk_screen_height ();
#endif
}
......@@ -97,7 +90,6 @@ xfwm_get_monitor_geometry (GdkScreen *screen,
gboolean scaled)
{
gint scale;
#if GTK_CHECK_VERSION(3, 22, 0)
GdkDisplay *display;
GdkMonitor *monitor;
......@@ -105,10 +97,6 @@ xfwm_get_monitor_geometry (GdkScreen *screen,
monitor = gdk_display_get_monitor (display, monitor_num);
scale = gdk_monitor_get_scale_factor (monitor);
gdk_monitor_get_geometry (monitor, geometry);
#else
scale = gdk_screen_get_monitor_scale_factor (screen, monitor_num);
gdk_screen_get_monitor_geometry (screen, monitor_num, geometry);
#endif
if (scaled && scale != 1)
xfwm_geometry_convert_to_device_pixels (geometry, scale);
......@@ -122,7 +110,6 @@ xfwm_get_primary_monitor_geometry (GdkScreen *screen,
gboolean scaled)
{
gint scale;
#if GTK_CHECK_VERSION(3, 22, 0)
GdkDisplay *display;
GdkMonitor *monitor;
......@@ -139,13 +126,6 @@ xfwm_get_primary_monitor_geometry (GdkScreen *screen,
scale = gdk_monitor_get_scale_factor (monitor);
gdk_monitor_get_geometry (monitor, geometry);
#else
gint monitor_num;
monitor_num = gdk_screen_get_primary_monitor (screen);
scale = gdk_screen_get_monitor_scale_factor (screen, monitor_num);
gdk_screen_get_monitor_geometry (screen, monitor_num, geometry);
#endif
if (scaled && scale != 1)
xfwm_geometry_convert_to_device_pixels (geometry, scale);
......@@ -158,7 +138,6 @@ xfwm_get_primary_monitor_geometry (GdkScreen *screen,
gint
xfwm_get_primary_refresh_rate (GdkScreen *screen)
{
#if GTK_CHECK_VERSION(3, 22, 0)
GdkDisplay *display;
GdkMonitor *monitor;
......@@ -166,9 +145,6 @@ xfwm_get_primary_refresh_rate (GdkScreen *screen)
monitor = gdk_display_get_primary_monitor (display);
return gdk_monitor_get_refresh_rate (monitor) / 1000;
#else
return 60;
#endif
}
......@@ -177,7 +153,6 @@ gboolean
xfwm_monitor_is_primary (GdkScreen *screen,
gint monitor_num)
{
#if GTK_CHECK_VERSION(3, 22, 0)
GdkDisplay *display;
GdkMonitor *monitor;
......@@ -185,9 +160,6 @@ xfwm_monitor_is_primary (GdkScreen *screen,
monitor = gdk_display_get_monitor (display, monitor_num);
return gdk_monitor_is_primary (monitor);
#else
return gdk_screen_get_primary_monitor (screen) == monitor_num;
#endif
}
......@@ -195,11 +167,7 @@ xfwm_monitor_is_primary (GdkScreen *screen,
gint
xfwm_get_n_monitors (GdkScreen *screen)
{
#if GTK_CHECK_VERSION(3, 22, 0)
return gdk_display_get_n_monitors (gdk_screen_get_display (screen));
#else
return gdk_screen_get_n_monitors (screen);
#endif
}
......
......@@ -10,7 +10,7 @@ m4_define([xfwm4_version_build], [@REVISION@])
m4_define([xfwm4_version_tag], [git])
m4_define([xfwm4_version], [xfwm4_version_major().xfwm4_version_minor().xfwm4_version_micro()ifelse(xfwm4_version_tag(), [git], [xfwm4_version_tag().xfwm4_version_build()], [xfwm4_version_tag()])])
m4_define([gtk_minimum_version], [3.20.0])
m4_define([gtk_minimum_version], [3.22.0])
m4_define([xfce_minimum_version], [4.8.0])
m4_define([libxfce4ui_minimum_version], [4.12.0])
m4_define([libxfce4kbd_private_minimum_version], [4.12.0])
......
......@@ -40,19 +40,11 @@ on_realize (GtkWidget *dialog,
Window xid;
xid = (Window) GPOINTER_TO_INT (data);
#if GTK_CHECK_VERSION(3, 22, 0)
gdk_x11_display_error_trap_push (gtk_widget_get_display (dialog));
#else
gdk_error_trap_push ();
#endif
XSetTransientForHint (gdk_x11_get_default_xdisplay (),
GDK_WINDOW_XID (gtk_widget_get_window (dialog)),
xid);
#if GTK_CHECK_VERSION(3, 22, 0)
gdk_x11_display_error_trap_pop_ignored (gtk_widget_get_display (dialog));
#else
gdk_error_trap_pop_ignored ();
#endif
}
int
......
......@@ -1039,49 +1039,29 @@ myDisplayTestXrender (DisplayInfo *display, gdouble min_time)
void
myDisplayErrorTrapPush (DisplayInfo *display_info)
{
#if GTK_CHECK_VERSION(3, 22, 0)
gdk_x11_display_error_trap_push (display_info->gdisplay);
#else
gdk_error_trap_push ();
#endif
}
gint
myDisplayErrorTrapPop (DisplayInfo *display_info)
{
#if GTK_CHECK_VERSION(3, 22, 0)
return gdk_x11_display_error_trap_pop (display_info->gdisplay);
#else
return gdk_error_trap_pop ();
#endif
}
void
myDisplayErrorTrapPopIgnored (DisplayInfo *display_info)
{
#if GTK_CHECK_VERSION(3, 22, 0)
gdk_x11_display_error_trap_pop_ignored (display_info->gdisplay);
#else
gdk_error_trap_pop_ignored ();
#endif
}
void
myDisplayBeep (DisplayInfo *display_info)
{
#if GTK_CHECK_VERSION(3, 22, 0)
gdk_display_beep (display_info->gdisplay);;
#else
gdk_beep ();
#endif
}
GdkKeymap *
myDisplayGetKeymap (DisplayInfo *display_info)
{
#if GTK_CHECK_VERSION(3, 22, 0)
return gdk_keymap_get_for_display (display_info->gdisplay);
#else
return gdk_keymap_get_default ();
#endif
}
......@@ -238,11 +238,7 @@ typeOfClick (ScreenInfo *screen_info, Window w, XfwmEventButton *event, gboolean
if (!g)
{
TRACE ("grab failed");
#if GTK_CHECK_VERSION(3, 22, 0)
gdk_display_beep (display_info->gdisplay);
#else
gdk_beep ();
#endif
myScreenUngrabPointer (screen_info, event->time);
return XFWM_BUTTON_UNDEFINED;
}
......@@ -2430,11 +2426,7 @@ menu_callback (Menu * menu, MenuOp op, Window xid, gpointer menu_data, gpointer
}
else
{
#if GTK_CHECK_VERSION(3, 22, 0)
gdk_display_beep (gdk_display_get_default ());
#else
gdk_beep ();
#endif
}
menu_free (menu);
}
......@@ -2472,9 +2464,7 @@ show_window_menu (Client *c, gint px, gint py, guint button, guint32 timestamp,
screen_info = c->screen_info;
display_info = screen_info->display_info;
is_transient = clientIsValidTransientOrModal (c);
#if GTK_CHECK_VERSION(3, 22, 0)
scale = gdk_window_get_scale_factor (gdk_screen_get_root_window (screen_info->gscr));
#endif
x = px;
y = py;
......@@ -2666,11 +2656,7 @@ show_window_menu (Client *c, gint px, gint py, guint button, guint32 timestamp,
if (!menu_popup (menu, x, y, button, timestamp))
{
TRACE ("cannot open menu");
#if GTK_CHECK_VERSION(3, 22, 0)
gdk_display_beep (display_info->gdisplay);
#else
gdk_beep ();
#endif
c->button_status[MENU_BUTTON] = BUTTON_STATE_NORMAL;
frameQueueDraw (c, FALSE);
xfwmWindowDelete (&menu_event_window);
......
......@@ -95,52 +95,6 @@ menu_filter (XfwmEvent *event, gpointer data)
return EVENT_FILTER_CONTINUE;
}
#if !GTK_CHECK_VERSION(3, 22, 0)
static void
popup_position_func (GtkMenu * menu, gint * x, gint * y, gboolean * push_in,
gpointer user_data)
{
GtkRequisition req;
GdkPoint *pos;
GdkScreen *screen;
gint monitor_num;
gint width;
gint height;
pos = user_data;
gtk_widget_get_preferred_size (GTK_WIDGET (menu), NULL, &req);
xfwm_get_screen_dimensions (&width, &height);
if (pos->x >= 0)
{
*x = pos->x;
*x = CLAMP (*x, 0, MAX (0, width - req.width));
}
else
{
*x = (width - req.width) / 2;
}
if (pos->x >= 0)
{
*y = pos->y;
*y = CLAMP (*y, 0, MAX (0, height - req.height));
}
else
{
*y = (height - req.height) / 2;
}
screen = gtk_widget_get_screen (GTK_WIDGET (menu));
monitor_num = gdk_screen_get_monitor_at_point (screen, *x, *y);
gtk_menu_set_monitor (GTK_MENU (menu), monitor_num);
g_free (user_data);
}
#endif
static gboolean
activate_cb (GtkWidget * menuitem, gpointer data)
{
......@@ -445,7 +399,6 @@ grab_available (GdkWindow *win, guint32 timestamp)
return (!grab_failed);
}
#if GTK_CHECK_VERSION(3, 22, 0)
static GdkEvent *
menu_popup_event (Menu *menu, gint root_x, gint root_y, guint button, guint32 timestamp,
GdkWindow *window)
......@@ -481,17 +434,14 @@ menu_popup_event (Menu *menu, gint root_x, gint root_y, guint button, guint32 ti
return event;
}
#endif
gboolean
menu_popup (Menu *menu, gint root_x, gint root_y, guint button, guint32 timestamp)
{
GdkPoint *pt;
GdkWindow *window;
#if GTK_CHECK_VERSION(3, 22, 0)
GdkEvent *event;
GdkRectangle rectangle;
#endif
g_return_val_if_fail (menu != NULL, FALSE);
g_return_val_if_fail (GTK_IS_MENU (menu->menu), FALSE);
......@@ -515,7 +465,6 @@ menu_popup (Menu *menu, gint root_x, gint root_y, guint button, guint32 timestam
menu_open = menu->menu;
eventFilterPush (menu->filter_setup, menu_filter, NULL);
#if GTK_CHECK_VERSION(3, 22, 0)
rectangle.x = root_x;
rectangle.y = root_y;
rectangle.width = 1;
......@@ -525,10 +474,6 @@ menu_popup (Menu *menu, gint root_x, gint root_y, guint button, guint32 timestam
gtk_menu_popup_at_rect (GTK_MENU (menu->menu), window, &rectangle,
GDK_GRAVITY_NORTH_WEST, GDK_GRAVITY_NORTH_WEST, event);
gdk_event_free (event);
#else
gtk_menu_popup (GTK_MENU (menu->menu), NULL, NULL,
popup_position_func, pt, 0, timestamp);
#endif
if (g_object_get_data (G_OBJECT (menu->menu), "gtk-menu-transfer-window") == NULL)
{
......
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