From 97d8d8df54de4c43ae914ebde538e9ca57a5eb81 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 5 May 2021 15:50:15 +0300 Subject: [PATCH 46/47] gtk3x: Drop gdk_seat_grab() and related calls No replacement functionality provided. gdk_seat_grab() API has been dropped from gtk-3.98. See osdn #42182 Signed-off-by: Marko Lindqvist --- client/gui-gtk-4.0/citydlg.c | 22 ---------------------- client/gui-gtk-4.0/gui_main.c | 24 +----------------------- client/gui-gtk-4.0/happiness.c | 25 ------------------------- client/gui-gtk-4.0/mapctrl.c | 20 -------------------- 4 files changed, 1 insertion(+), 90 deletions(-) diff --git a/client/gui-gtk-4.0/citydlg.c b/client/gui-gtk-4.0/citydlg.c index 530525c901..d81f410ee5 100644 --- a/client/gui-gtk-4.0/citydlg.c +++ b/client/gui-gtk-4.0/citydlg.c @@ -625,19 +625,6 @@ static gboolean keyboard_handler(GtkWidget *widget, GdkEvent *event, return FALSE; } -/***********************************************************************//** - Destroy info popup dialog when button released -***************************************************************************/ -static gboolean show_info_button_release(GtkWidget *w, GdkEvent *ev, - gpointer data) -{ - gtk_grab_remove(w); - gdk_seat_ungrab(gdk_device_get_seat(gdk_event_get_device(ev))); - gtk_widget_destroy(w); - - return FALSE; -} - /***********************************************************************//** Popup info dialog ***************************************************************************/ @@ -709,15 +696,6 @@ static gboolean show_info_popup(GtkWidget *w, GdkEvent *ev, gtk_widget_set_margin_bottom(label, 4); gtk_container_add(GTK_CONTAINER(frame), label); gtk_widget_show(p); - - gdk_seat_grab(gdk_device_get_seat(gdk_event_get_device(ev)), - gtk_widget_get_surface(p), - GDK_SEAT_CAPABILITY_ALL_POINTING, - TRUE, NULL, (GdkEvent *)ev, NULL, NULL); - gtk_grab_add(p); - - g_signal_connect_after(p, "button_release_event", - G_CALLBACK(show_info_button_release), NULL); } return TRUE; diff --git a/client/gui-gtk-4.0/gui_main.c b/client/gui-gtk-4.0/gui_main.c index ac269e2701..9fb607b1a4 100644 --- a/client/gui-gtk-4.0/gui_main.c +++ b/client/gui-gtk-4.0/gui_main.c @@ -179,7 +179,6 @@ static bool gui_up = FALSE; static struct video_mode vmode = { -1, -1 }; -static gboolean show_info_button_release(GtkWidget *w, GdkEvent *ev, gpointer data); static gboolean show_info_popup(GtkWidget *w, GdkEvent *ev, gpointer data); static void end_turn_callback(GtkWidget *w, gpointer data); @@ -363,6 +362,7 @@ gboolean map_canvas_focus(void) gtk_window_present(GTK_WINDOW(toplevel)); gtk_notebook_set_current_page(GTK_NOTEBOOK(top_notebook), 0); gtk_widget_grab_focus(map_canvas); + return TRUE; } @@ -2122,19 +2122,6 @@ static gboolean select_more_arrow_pixmap_callback(GtkWidget *w, GdkEvent *ev, return TRUE; } -/**********************************************************************//** - Button released when showing info popup -**************************************************************************/ -static gboolean show_info_button_release(GtkWidget *w, GdkEvent *ev, - gpointer data) -{ - gtk_grab_remove(w); - gdk_seat_ungrab(gdk_device_get_seat(gdk_event_get_device(ev))); - gtk_widget_destroy(w); - - return FALSE; -} - /**********************************************************************//** Popup info box **************************************************************************/ @@ -2158,15 +2145,6 @@ static gboolean show_info_popup(GtkWidget *w, GdkEvent *ev, gpointer data) "GtkWidget::visible", TRUE, NULL); gtk_widget_show(p); - - gdk_seat_grab(gdk_device_get_seat(gdk_event_get_device(ev)), - gtk_widget_get_surface(p), - GDK_SEAT_CAPABILITY_ALL_POINTING, - TRUE, NULL, (GdkEvent *)ev, NULL, NULL); - gtk_grab_add(p); - - g_signal_connect_after(p, "button_release_event", - G_CALLBACK(show_info_button_release), NULL); } return TRUE; diff --git a/client/gui-gtk-4.0/happiness.c b/client/gui-gtk-4.0/happiness.c index 7865e2b81a..d3cfde7963 100644 --- a/client/gui-gtk-4.0/happiness.c +++ b/client/gui-gtk-4.0/happiness.c @@ -76,9 +76,6 @@ static struct happiness_dialog *create_happiness_dialog(struct city *pcity, static gboolean show_happiness_popup(GtkWidget *w, GdkEvent *ev, gpointer data); -static gboolean show_happiness_button_release(GtkWidget *w, - GdkEvent *ev, - gpointer data); /**********************************************************************//** Create happiness dialog @@ -170,33 +167,11 @@ static gboolean show_happiness_popup(GtkWidget *w, gtk_widget_set_margin_bottom(label, 4); gtk_container_add(GTK_CONTAINER(frame), label); gtk_widget_show(p); - - gdk_seat_grab(gdk_device_get_seat(gdk_event_get_device(ev)), - gtk_widget_get_surface(p), - GDK_SEAT_CAPABILITY_ALL_POINTING, - TRUE, NULL, (GdkEvent *)ev, NULL, NULL); - gtk_grab_add(p); - - g_signal_connect_after(p, "button_release_event", - G_CALLBACK(show_happiness_button_release), NULL); } return TRUE; } -/**********************************************************************//** - Clear the happiness popup. -**************************************************************************/ -static gboolean show_happiness_button_release(GtkWidget *w, GdkEvent *ev, - gpointer data) -{ - gtk_grab_remove(w); - gdk_seat_ungrab(gdk_device_get_seat(gdk_event_get_device(ev))); - gtk_widget_destroy(w); - - return FALSE; -} - /**********************************************************************//** Create the happiness notebook page. **************************************************************************/ diff --git a/client/gui-gtk-4.0/mapctrl.c b/client/gui-gtk-4.0/mapctrl.c index 29d27586a5..80b0b44736 100644 --- a/client/gui-gtk-4.0/mapctrl.c +++ b/client/gui-gtk-4.0/mapctrl.c @@ -58,18 +58,6 @@ extern gint cur_x, cur_y; -/**********************************************************************//** - Button released when showing info label -**************************************************************************/ -static gboolean popit_button_release(GtkWidget *w, GdkEvent *ev) -{ - gtk_grab_remove(w); - gdk_seat_ungrab(gdk_device_get_seat(gdk_event_get_device(ev))); - gtk_widget_destroy(w); - - return FALSE; -} - /**********************************************************************//** Popup a label with information about the tile, unit, city, when the user used the middle mouse button on the map. @@ -107,14 +95,6 @@ static void popit(GdkEvent *ev, struct tile *ptile) gdk_event_get_position(ev, &e_x, &e_y); gtk_widget_show(p); - gdk_seat_grab(gdk_device_get_seat(gdk_event_get_device(ev)), - gtk_widget_get_surface(p), - GDK_SEAT_CAPABILITY_ALL_POINTING, - TRUE, NULL, (GdkEvent *)ev, NULL, NULL); - gtk_grab_add(p); - - g_signal_connect_after(p, "button_release_event", - G_CALLBACK(popit_button_release), NULL); } } -- 2.30.2