[gtk/wip/matthiasc/popup4] popover: Use gdk_surface_show_with_auto_dismissal
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/matthiasc/popup4] popover: Use gdk_surface_show_with_auto_dismissal
- Date: Mon, 22 Apr 2019 21:40:44 +0000 (UTC)
commit 3ca53ac0a43919dcd69cbfe7569a0341f5c97630
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Apr 22 21:33:26 2019 +0000
popover: Use gdk_surface_show_with_auto_dismissal
The new api is made for this case.
gtk/gtkpopover.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index 0d8a884bc3..8cad426d1d 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -145,7 +145,6 @@ typedef struct {
guint position_changed_cb;
GtkPositionType position;
gboolean modal;
- gboolean has_grab;
GtkWidget *contents_widget;
} GtkPopoverPrivate;
@@ -552,12 +551,10 @@ gtk_popover_map (GtkWidget *widget)
if (priv->modal)
{
- gdk_seat_grab (gdk_display_get_default_seat (priv->display),
- priv->surface,
- GDK_SEAT_CAPABILITY_ALL,
- TRUE,
- NULL, NULL, grab_prepare_func, NULL);
- priv->has_grab = TRUE;
+ GdkSeat *seat;
+
+ seat = gdk_display_get_default_seat (priv->display),
+ gdk_surface_show_with_auto_dismissal (priv->surface, seat);
}
gtk_widget_get_surface_allocation (priv->relative_to, &parent_rect);
@@ -585,11 +582,6 @@ gtk_popover_unmap (GtkWidget *widget)
GTK_WIDGET_CLASS (gtk_popover_parent_class)->unmap (widget);
gdk_surface_hide (priv->surface);
- if (priv->has_grab)
- {
- gdk_seat_ungrab (gdk_display_get_default_seat (priv->display));
- priv->has_grab = FALSE;
- }
child = gtk_bin_get_child (GTK_BIN (widget));
if (child != NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]