Author: cazfi
Date: Mon Feb  6 06:14:47 2017
New Revision: 34982

URL: http://svn.gna.org/viewcvs/freeciv?rev=34982&view=rev
Log:
Replaced deprecated uses of GdkDeviceManager with GdkSeat in gtk3.22-client

See gna patch #7221

Modified:
    branches/S3_0/INSTALL
    branches/S3_0/client/gui-gtk-3.22/citydlg.c
    branches/S3_0/client/gui-gtk-3.22/cityrep.c
    branches/S3_0/client/gui-gtk-3.22/gui_main.c
    branches/S3_0/client/gui-gtk-3.22/happiness.c
    branches/S3_0/client/gui-gtk-3.22/mapctrl.c
    branches/S3_0/m4/gtk3.22-client.m4

Modified: branches/S3_0/INSTALL
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S3_0/INSTALL?rev=34982&r1=34981&r2=34982&view=diff
==============================================================================
--- branches/S3_0/INSTALL       (original)
+++ branches/S3_0/INSTALL       Mon Feb  6 06:14:47 2017
@@ -275,7 +275,7 @@
    The "Glib" utility library provides non-graphical functions used by the
    "Gdk" and "Gtk+" libraries, like hash tables, single linked lists, etc.
 
-   Freeciv requires a version of "Glib" greater or equal to 2.46
+   Freeciv requires a version of "Glib" greater or equal to 2.48
 
    If the Freeciv configure process tells you that you don't have the
    Glib library installed, then it may be obtained from here:
@@ -315,7 +315,7 @@
        Provides an abstraction layer over X-Windows/LinuxFB/Win32 to implement
        basic drawing functions, windows, clipping, etc.
 
-   Freeciv requires a version of "Gtk+" greater or equal to 3.18.0.
+   Freeciv requires a version of "Gtk+" greater or equal to 3.20.0.
 
    If the Freeciv configure process tells you that you don't have the
    Gtk+ library installed, then it may be obtained from here:

Modified: branches/S3_0/client/gui-gtk-3.22/citydlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S3_0/client/gui-gtk-3.22/citydlg.c?rev=34982&r1=34981&r2=34982&view=diff
==============================================================================
--- branches/S3_0/client/gui-gtk-3.22/citydlg.c (original)
+++ branches/S3_0/client/gui-gtk-3.22/citydlg.c Mon Feb  6 06:14:47 2017
@@ -630,11 +630,12 @@
   Destroy info popup dialog when button released
 **************************************************************************/
 static gboolean show_info_button_release(GtkWidget *w, GdkEventButton *ev,
-                                        gpointer data)
+                                         gpointer data)
 {
   gtk_grab_remove(w);
-  gdk_device_ungrab(ev->device, ev->time);
+  gdk_seat_ungrab(gdk_device_get_seat(ev->device));
   gtk_widget_destroy(w);
+
   return FALSE;
 }
 
@@ -707,9 +708,9 @@
     gtk_container_add(GTK_CONTAINER(frame), label);
     gtk_widget_show_all(p);
 
-    gdk_device_grab(ev->device, gtk_widget_get_window(p),
-                    GDK_OWNERSHIP_NONE, TRUE, GDK_BUTTON_RELEASE_MASK, NULL,
-                    ev->time);
+    gdk_seat_grab(gdk_device_get_seat(ev->device), gtk_widget_get_window(p),
+                  GDK_SEAT_CAPABILITY_ALL_POINTING,
+                  TRUE, NULL, (GdkEvent *)ev, NULL, NULL);
     gtk_grab_add(p);
 
     g_signal_connect_after(p, "button_release_event",
@@ -3143,12 +3144,12 @@
  this is here because it's closely related to the sell stuff
 *****************************************************************/
 static void impr_callback(GtkTreeView *view, GtkTreePath *path,
-                         GtkTreeViewColumn *col, gpointer data)
+                          GtkTreeViewColumn *col, gpointer data)
 {
   GtkTreeModel *model;
   GtkTreeIter it;
   GdkWindow *win;
-  GdkDeviceManager *manager;
+  GdkSeat *seat;
   GdkModifierType mask;
   struct impr_type *pimprove;
 
@@ -3161,10 +3162,9 @@
   gtk_tree_model_get(model, &it, 0, &pimprove, -1);
 
   win = gdk_get_default_root_window();
-  manager = gdk_display_get_device_manager(gdk_window_get_display(win));
-
-  gdk_window_get_device_position(win, 
-                                 
gdk_device_manager_get_client_pointer(manager),
+  seat = gdk_display_get_default_seat(gdk_window_get_display(win));
+
+  gdk_window_get_device_position(win, gdk_seat_get_pointer(seat),
                                  NULL, NULL, &mask);
 
   if (!(mask & GDK_CONTROL_MASK)) {

Modified: branches/S3_0/client/gui-gtk-3.22/cityrep.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S3_0/client/gui-gtk-3.22/cityrep.c?rev=34982&r1=34981&r2=34982&view=diff
==============================================================================
--- branches/S3_0/client/gui-gtk-3.22/cityrep.c (original)
+++ branches/S3_0/client/gui-gtk-3.22/cityrep.c Mon Feb  6 06:14:47 2017
@@ -1419,12 +1419,12 @@
   User has selected city row from city report.
 *****************************************************************/
 static void city_activated_callback(GtkTreeView *view, GtkTreePath *path,
-                                   GtkTreeViewColumn *col, gpointer data)
+                                    GtkTreeViewColumn *col, gpointer data)
 {
   GtkTreeModel *model;
   GtkTreeIter iter;
   GdkWindow *win;
-  GdkDeviceManager *manager;
+  GdkSeat *seat;
   GdkModifierType mask;
 
   model = gtk_tree_view_get_model(view);
@@ -1434,10 +1434,9 @@
   }
 
   win = gdk_get_default_root_window();
-  manager = gdk_display_get_device_manager(gdk_window_get_display(win));
-
-  gdk_window_get_device_position(win,
-                                 
gdk_device_manager_get_client_pointer(manager),
+  seat = gdk_display_get_default_seat(gdk_window_get_display(win));
+
+  gdk_window_get_device_position(win, gdk_seat_get_pointer(seat),
                                  NULL, NULL, &mask);
 
   if (!(mask & GDK_CONTROL_MASK)) {

Modified: branches/S3_0/client/gui-gtk-3.22/gui_main.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S3_0/client/gui-gtk-3.22/gui_main.c?rev=34982&r1=34981&r2=34982&view=diff
==============================================================================
--- branches/S3_0/client/gui-gtk-3.22/gui_main.c        (original)
+++ branches/S3_0/client/gui-gtk-3.22/gui_main.c        Mon Feb  6 06:14:47 2017
@@ -2004,11 +2004,13 @@
 /**************************************************************************
   Button released when showing info popup
 **************************************************************************/
-static gboolean show_info_button_release(GtkWidget *w, GdkEventButton *ev, 
gpointer data)
+static gboolean show_info_button_release(GtkWidget *w, GdkEventButton *ev,
+                                         gpointer data)
 {
   gtk_grab_remove(w);
-  gdk_device_ungrab(ev->device, ev->time);
+  gdk_seat_ungrab(gdk_device_get_seat(ev->device));
   gtk_widget_destroy(w);
+
   return FALSE;
 }
 
@@ -2031,9 +2033,9 @@
                    NULL);
     gtk_widget_show(p);
 
-    gdk_device_grab(ev->device, gtk_widget_get_window(p),
-                    GDK_OWNERSHIP_NONE, TRUE, GDK_BUTTON_RELEASE_MASK, NULL,
-                    ev->time);
+    gdk_seat_grab(gdk_device_get_seat(ev->device), gtk_widget_get_window(p),
+                  GDK_SEAT_CAPABILITY_ALL_POINTING,
+                  TRUE, NULL, (GdkEvent *)ev, NULL, NULL);
     gtk_grab_add(p);
 
     g_signal_connect_after(p, "button_release_event",

Modified: branches/S3_0/client/gui-gtk-3.22/happiness.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S3_0/client/gui-gtk-3.22/happiness.c?rev=34982&r1=34981&r2=34982&view=diff
==============================================================================
--- branches/S3_0/client/gui-gtk-3.22/happiness.c       (original)
+++ branches/S3_0/client/gui-gtk-3.22/happiness.c       Mon Feb  6 06:14:47 2017
@@ -162,9 +162,9 @@
     gtk_container_add(GTK_CONTAINER(frame), label);
     gtk_widget_show_all(p);
 
-    gdk_device_grab(ev->device, gtk_widget_get_window(p),
-                    GDK_OWNERSHIP_NONE, TRUE, GDK_BUTTON_RELEASE_MASK, NULL,
-                    ev->time);
+    gdk_seat_grab(gdk_device_get_seat(ev->device), gtk_widget_get_window(p),
+                  GDK_SEAT_CAPABILITY_ALL_POINTING,
+                  TRUE, NULL, (GdkEvent *)ev, NULL, NULL);
     gtk_grab_add(p);
 
     g_signal_connect_after(p, "button_release_event",
@@ -177,13 +177,13 @@
 /**************************************************************************
   Clear the happiness popup.
 **************************************************************************/
-static gboolean show_happiness_button_release(GtkWidget *w,
-                                              GdkEventButton *ev,
+static gboolean show_happiness_button_release(GtkWidget *w, GdkEventButton *ev,
                                               gpointer data)
 {
   gtk_grab_remove(w);
-  gdk_device_ungrab(ev->device, ev->time);
+  gdk_seat_ungrab(gdk_device_get_seat(ev->device));
   gtk_widget_destroy(w);
+
   return FALSE;
 }
 

Modified: branches/S3_0/client/gui-gtk-3.22/mapctrl.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S3_0/client/gui-gtk-3.22/mapctrl.c?rev=34982&r1=34981&r2=34982&view=diff
==============================================================================
--- branches/S3_0/client/gui-gtk-3.22/mapctrl.c (original)
+++ branches/S3_0/client/gui-gtk-3.22/mapctrl.c Mon Feb  6 06:14:47 2017
@@ -62,11 +62,12 @@
 /**************************************************************************
   Button released when showing info label
 **************************************************************************/
-static gboolean popit_button_release(GtkWidget *w, GdkEventButton *event)
+static gboolean popit_button_release(GtkWidget *w, GdkEventButton *ev)
 {
   gtk_grab_remove(w);
-  gdk_device_ungrab(event->device, event->time);
+  gdk_seat_ungrab(gdk_device_get_seat(ev->device));
   gtk_widget_destroy(w);
+
   return FALSE;
 }
 
@@ -114,14 +115,14 @@
   Popup a label with information about the tile, unit, city, when the user
   used the middle mouse button on the map.
 **************************************************************************/
-static void popit(GdkEventButton *event, struct tile *ptile)
+static void popit(GdkEventButton *ev, struct tile *ptile)
 {
   GtkWidget *p;
   static struct tmousepos mousepos;
   struct unit *punit;
 
   if (TILE_UNKNOWN != client_tile_get_known(ptile)) {
-    p=gtk_window_new(GTK_WINDOW_POPUP);
+    p = gtk_window_new(GTK_WINDOW_POPUP);
     gtk_widget_set_app_paintable(p, TRUE);
     gtk_container_set_border_width(GTK_CONTAINER(p), 4);
     gtk_container_add(GTK_CONTAINER(p), gtk_label_new(popup_info_text(ptile)));
@@ -137,19 +138,19 @@
     mapdeco_set_crosshair(ptile, TRUE);
 
     g_signal_connect(p, "destroy",
-                    G_CALLBACK(popupinfo_popdown_callback), NULL);
-
-    mousepos.x = event->x;
-    mousepos.y = event->y;
+                     G_CALLBACK(popupinfo_popdown_callback), NULL);
+
+    mousepos.x = ev->x;
+    mousepos.y = ev->y;
 
     g_signal_connect(p, "size-allocate",
-                    G_CALLBACK(popupinfo_positioning_callback), 
-                    &mousepos);
+                     G_CALLBACK(popupinfo_positioning_callback),
+                     &mousepos);
 
     gtk_widget_show_all(p);
-    gdk_device_grab(event->device, gtk_widget_get_window(p),
-                    GDK_OWNERSHIP_NONE, TRUE, GDK_BUTTON_RELEASE_MASK, NULL,
-                    event->time);
+    gdk_seat_grab(gdk_device_get_seat(ev->device), gtk_widget_get_window(p),
+                  GDK_SEAT_CAPABILITY_ALL_POINTING,
+                  TRUE, NULL, (GdkEvent *)ev, NULL, NULL);
     gtk_grab_add(p);
 
     g_signal_connect_after(p, "button_release_event",
@@ -345,10 +346,9 @@
 void create_line_at_mouse_pos(void)
 {
   int x, y;
+  GdkSeat *seat = 
gdk_display_get_default_seat(gtk_widget_get_display(toplevel));
+  GdkDevice *pointer = gdk_seat_get_pointer(seat);
   GdkWindow *window;
-  GdkDeviceManager *manager =
-      gdk_display_get_device_manager(gtk_widget_get_display(toplevel));
-  GdkDevice *pointer = gdk_device_manager_get_client_pointer(manager);
 
   if (!pointer) {
     return;
@@ -365,8 +365,8 @@
 }
 
 /**************************************************************************
- The Area Selection rectangle. Called by center_tile_mapcanvas() and
- when the mouse pointer moves.
+  The Area Selection rectangle. Called by center_tile_mapcanvas() and
+  when the mouse pointer moves.
 **************************************************************************/
 void update_rect_at_mouse_pos(void)
 {
@@ -374,10 +374,9 @@
   GdkWindow *window;
   GdkDevice *pointer;
   GdkModifierType mask;
-  GdkDeviceManager *manager =
-      gdk_display_get_device_manager(gtk_widget_get_display(toplevel));
-
-  pointer = gdk_device_manager_get_client_pointer(manager);
+  GdkSeat *seat = 
gdk_display_get_default_seat(gtk_widget_get_display(toplevel));
+
+  pointer = gdk_seat_get_pointer(seat);
   if (!pointer) {
     return;
   }

Modified: branches/S3_0/m4/gtk3.22-client.m4
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S3_0/m4/gtk3.22-client.m4?rev=34982&r1=34981&r2=34982&view=diff
==============================================================================
--- branches/S3_0/m4/gtk3.22-client.m4  (original)
+++ branches/S3_0/m4/gtk3.22-client.m4  Mon Feb  6 06:14:47 2017
@@ -5,10 +5,9 @@
 
 AC_DEFUN([FC_GTK3_22_CLIENT],
 [
-  # Add check "x$client" = "xauto"  when this becomes supported client
   if test "x$gui_gtk3_22" = "xyes" ||
      test "x$client" = "xall" || test "x$client" = "xauto" ; then
-    PKG_CHECK_MODULES([GTK3X], [gtk+-3.0 >= 3.18.0],
+    PKG_CHECK_MODULES([GTK3X], [gtk+-3.0 >= 3.20.0],
       [
         GTK3X_CFLAGS="$GTK3X_CFLAGS 
-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_18"
         GTK3X_CFLAGS="$GTK3X_CFLAGS 
-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_46"


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to