[Xfce4-commits] [xfce/xfdesktop] 01/01: Tell Gtk what version we're targeting

noreply at xfce.org noreply at xfce.org
Sat Apr 22 20:02:13 CEST 2017


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository xfce/xfdesktop.

commit d167fea87e8443f13ef1c220464de182cf742e8b
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Sat Apr 22 11:33:29 2017 +0300

    Tell Gtk what version we're targeting
    
    This is awesome. Now Gtk will ignore stuff newer than 3.20 and
    not nag about it and warn if we use something too new. The previous
    3.22 ifdef code has been disabled for now.
---
 common/xfdesktop-common.c |  2 +-
 configure.ac.in           |  5 +++++
 settings/main.c           | 10 +++++-----
 src/xfce-workspace.c      | 16 ++++++++--------
 src/xfdesktop-icon-view.c | 12 ++++++------
 5 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/common/xfdesktop-common.c b/common/xfdesktop-common.c
index af6198d..0e06ccd 100644
--- a/common/xfdesktop-common.c
+++ b/common/xfdesktop-common.c
@@ -57,7 +57,7 @@
 gchar*
 xfdesktop_get_monitor_name_from_gtk_widget(GtkWidget *widget, gint monitor_num)
 {
-#if GTK_CHECK_VERSION (3, 22, 0)
+#if 0 /* GTK_CHECK_VERSION (3, 22, 0) */
     GdkWindow     *window = NULL;
     GdkDisplay    *display = NULL;
     GdkMonitor    *monitor = NULL;
diff --git a/configure.ac.in b/configure.ac.in
index a7cc17d..6d9e717 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -94,6 +94,11 @@ XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [xfconf_minimum_version])
 XDT_CHECK_PACKAGE([LIBEXO], [exo-2], [exo_minimum_version])
 XDT_CHECK_PACKAGE([CAIRO], [cairo], [cairo_minimum_version])
 
+AC_DEFINE(GLIB_VERSION_MIN_REQUIRED, GLIB_VERSION_2_42, [Ignore post 2.42 deprecations])
+AC_DEFINE(GLIB_VERSION_MAX_ALLOWED, GLIB_VERSION_2_42, [Prevent post 2.42 APIs])
+
+AC_DEFINE(GDK_VERSION_MIN_REQUIRED, GDK_VERSION_3_20, [Ignore post 3.20 deprecations])
+AC_DEFINE(GDK_VERSION_MAX_ALLOWED, GDK_VERSION_3_20, [Prevent post 3.20 APIs])
 
 dnl do we want desktop icons at all?
 AC_ARG_ENABLE([desktop-icons],
diff --git a/settings/main.c b/settings/main.c
index 529fc0d..8389ced 100644
--- a/settings/main.c
+++ b/settings/main.c
@@ -721,7 +721,7 @@ xfdesktop_settings_update_iconview_frame_name(AppearancePanel *panel,
 
     workspace_name = g_strdup(wnck_workspace_get_name(workspace));
 
-#if GTK_CHECK_VERSION (3, 22, 0)
+#if 0 /* GTK_CHECK_VERSION (3, 22, 0) */
     if(gdk_display_get_n_monitors(gtk_widget_get_display(panel->chk_apply_to_all)) > 1) {
 #else
     if(gdk_screen_get_n_monitors(gtk_widget_get_screen(panel->chk_apply_to_all)) > 1) {
@@ -1483,7 +1483,7 @@ suboptions_set_sensitive(GtkToggleButton *btn,
     gtk_widget_set_sensitive(box, gtk_toggle_button_get_active(btn));
 }
 
-#if GTK_CHECK_VERSION (3, 22, 0)
+#if 0 /* GTK_CHECK_VERSION (3, 22, 0) */
 static gint
 display_get_monitor_num(GdkDisplay *display, GdkMonitor *monitor)
 {
@@ -1512,7 +1512,7 @@ cb_update_background_tab(WnckWindow *wnck_window,
     WnckWorkspace *wnck_workspace = NULL;
     WnckScreen    *wnck_screen = NULL;
     GdkWindow     *window = NULL;
-#if GTK_CHECK_VERSION (3, 22, 0)
+#if 0 /* GTK_CHECK_VERSION (3, 22, 0) */
     GdkDisplay    *display = NULL;
     GdkMonitor    *monitor = NULL;
 #endif
@@ -1528,7 +1528,7 @@ cb_update_background_tab(WnckWindow *wnck_window,
     workspace_num = xfdesktop_settings_get_active_workspace(panel, wnck_window);
     screen_num = wnck_screen_get_number(wnck_screen);
     window = gtk_widget_get_window(panel->image_iconview);
-#if GTK_CHECK_VERSION (3, 22, 0)
+#if 0 /* GTK_CHECK_VERSION (3, 22, 0) */
     display = gdk_window_get_display(window);
     monitor = gdk_display_get_monitor_at_window(display, window);
     monitor_num = display_get_monitor_num(display, monitor);
@@ -1578,7 +1578,7 @@ cb_update_background_tab(WnckWindow *wnck_window,
      */
     gtk_combo_box_text_remove(GTK_COMBO_BOX_TEXT(panel->image_style_combo),
                               XFCE_BACKDROP_IMAGE_SPANNING_SCREENS);
-#if GTK_CHECK_VERSION (3, 22, 0)
+#if 0 /* GTK_CHECK_VERSION (3, 22, 0) */
     if(panel->monitor == 0 && gdk_display_get_n_monitors(gtk_widget_get_display(panel->image_style_combo)) > 1) {
         gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(panel->image_style_combo),
                                        _("Spanning screens"));
diff --git a/src/xfce-workspace.c b/src/xfce-workspace.c
index 579525e..7657f9b 100644
--- a/src/xfce-workspace.c
+++ b/src/xfce-workspace.c
@@ -144,14 +144,14 @@ xfce_workspace_set_xfconf_property_string(XfceWorkspace *workspace,
 {
     XfconfChannel *channel = workspace->priv->channel;
     char buf[1024];
-#if GTK_CHECK_VERSION (3, 22, 0)
+#if 0 /* GTK_CHECK_VERSION (3, 22, 0) */
     GdkDisplay *display;
 #endif
     gchar *monitor_name = NULL;
 
     TRACE("entering");
 
-#if GTK_CHECK_VERSION (3, 22, 0)
+#if 0 /* GTK_CHECK_VERSION (3, 22, 0) */
     display = gdk_display_manager_get_default_display(gdk_display_manager_get());
     monitor_name = g_strdup(gdk_monitor_get_model(gdk_display_get_monitor(display, monitor_num)));
 #else
@@ -183,7 +183,7 @@ xfce_workspace_set_xfconf_property_value(XfceWorkspace *workspace,
     XfconfChannel *channel = workspace->priv->channel;
     char buf[1024];
     gchar *monitor_name = NULL;
-#if GTK_CHECK_VERSION (3, 22, 0)
+#if 0 /* GTK_CHECK_VERSION (3, 22, 0) */
     GdkDisplay *display;
 #endif
 #ifdef G_ENABLE_DEBUG
@@ -192,7 +192,7 @@ xfce_workspace_set_xfconf_property_value(XfceWorkspace *workspace,
 
     TRACE("entering");
 
-#if GTK_CHECK_VERSION (3, 22, 0)
+#if 0 /* GTK_CHECK_VERSION (3, 22, 0) */
     display = gdk_display_manager_get_default_display(gdk_display_manager_get());
     monitor_name = g_strdup(gdk_monitor_get_model(gdk_display_get_monitor(display, monitor_num)));
 #else
@@ -319,7 +319,7 @@ xfce_workspace_monitors_changed(XfceWorkspace *workspace,
         /* When spanning screens we only need one backdrop */
         n_monitors = 1;
     } else {
-#if GTK_CHECK_VERSION (3, 22, 0)
+#if 0 /* GTK_CHECK_VERSION (3, 22, 0) */
         n_monitors = gdk_display_get_n_monitors(gdk_screen_get_display(workspace->priv->gscreen));
 #else
         n_monitors = gdk_screen_get_n_monitors(workspace->priv->gscreen);
@@ -628,14 +628,14 @@ xfce_workspace_connect_backdrop_settings(XfceWorkspace *workspace,
     XfconfChannel *channel = workspace->priv->channel;
     char buf[1024];
     gint pp_len;
-#if GTK_CHECK_VERSION (3, 22, 0)
+#if 0 /* GTK_CHECK_VERSION (3, 22, 0) */
     GdkDisplay *display;
 #endif
     gchar *monitor_name = NULL;
 
     TRACE("entering");
 
-#if GTK_CHECK_VERSION (3, 22, 0)
+#if 0 /* GTK_CHECK_VERSION (3, 22, 0) */
     display = gdk_display_manager_get_default_display(gdk_display_manager_get());
     monitor_name = g_strdup(gdk_monitor_get_model(gdk_display_get_monitor(display, monitor)));
 #else
@@ -740,7 +740,7 @@ xfce_workspace_remove_backdrops(XfceWorkspace *workspace)
 
     g_return_if_fail(XFCE_IS_WORKSPACE(workspace));
 
-#if GTK_CHECK_VERSION (3, 22, 0)
+#if 0 /* GTK_CHECK_VERSION (3, 22, 0) */
     n_monitors = gdk_display_get_n_monitors(gdk_screen_get_display(workspace->priv->gscreen));
 #else
     n_monitors = gdk_screen_get_n_monitors(workspace->priv->gscreen);
diff --git a/src/xfdesktop-icon-view.c b/src/xfdesktop-icon-view.c
index 655226b..caf59b4 100644
--- a/src/xfdesktop-icon-view.c
+++ b/src/xfdesktop-icon-view.c
@@ -2488,7 +2488,7 @@ xfdesktop_rectangle_is_bounded_by(GdkRectangle *rect,
 static void
 xfdesktop_icon_view_setup_grids_xinerama(XfdesktopIconView *icon_view)
 {
-#if GTK_CHECK_VERSION (3, 22, 0)
+#if 0 /* GTK_CHECK_VERSION (3, 22, 0) */
     GdkDisplay *display;
 #else
     GdkScreen *gscreen;
@@ -2498,7 +2498,7 @@ xfdesktop_icon_view_setup_grids_xinerama(XfdesktopIconView *icon_view)
     
     DBG("entering");
 
-#if GTK_CHECK_VERSION (3, 22, 0)
+#if 0 /* GTK_CHECK_VERSION (3, 22, 0) */
     display = gtk_widget_get_display(GTK_WIDGET(icon_view));
     nmonitors = gdk_display_get_n_monitors(display);
 #else
@@ -2510,7 +2510,7 @@ xfdesktop_icon_view_setup_grids_xinerama(XfdesktopIconView *icon_view)
     
     monitor_geoms = g_new0(GdkRectangle, nmonitors);
 
-#if GTK_CHECK_VERSION (3, 22, 0)
+#if 0 /* GTK_CHECK_VERSION (3, 22, 0) */
     for(i = 0; i < nmonitors; ++i) {
         gdk_monitor_get_geometry(gdk_display_get_monitor(display, i), &monitor_geoms[i]);
     }
@@ -3598,7 +3598,7 @@ xfdesktop_icon_view_add_item_internal(XfdesktopIconView *icon_view,
 {
     gint16 row, col;
     cairo_rectangle_int_t fake_area;
-#if GTK_CHECK_VERSION (3, 22, 0)
+#if 0 /* GTK_CHECK_VERSION (3, 22, 0) */
     GdkDrawingContext *gdc;
 #endif
     cairo_region_t *region;
@@ -3631,7 +3631,7 @@ xfdesktop_icon_view_add_item_internal(XfdesktopIconView *icon_view,
 
     /* Pack it into a cairo region to tell gdk that's where we will be painting */
     region = cairo_region_create_rectangle(&fake_area);
-#if GTK_CHECK_VERSION (3, 22, 0)
+#if 0 /* GTK_CHECK_VERSION (3, 22, 0) */
     gdc = gdk_window_begin_draw_frame(gdkwindow, region);
     cr = gdk_drawing_context_get_cairo_context(gdc);
 #else
@@ -3641,7 +3641,7 @@ xfdesktop_icon_view_add_item_internal(XfdesktopIconView *icon_view,
     /* paint the icon */
     xfdesktop_icon_view_paint_icon(icon_view, icon, &fake_area, cr);
 
-#if GTK_CHECK_VERSION (3, 22, 0)
+#if 0 /* GTK_CHECK_VERSION (3, 22, 0) */
     /* we're done drawing */
     gdk_window_end_draw_frame(gdkwindow, gdc);
 #else

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list