[gtk+] appchooserwidget: Update to using GdkEvent API
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] appchooserwidget: Update to using GdkEvent API
- Date: Tue, 19 Sep 2017 17:11:53 +0000 (UTC)
commit 96e7777198ea4272a09bcfb7ea4891b09b94c5cd
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Aug 25 16:42:39 2017 +0200
appchooserwidget: Update to using GdkEvent API
gtk/gtkappchooserwidget.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkappchooserwidget.c b/gtk/gtkappchooserwidget.c
index 1cd3b14..54b22a2 100644
--- a/gtk/gtkappchooserwidget.c
+++ b/gtk/gtkappchooserwidget.c
@@ -188,9 +188,13 @@ get_app_info_for_event (GtkAppChooserWidget *self,
GtkTreeModel *model;
GAppInfo *info;
gboolean recommended;
+ gdouble x, y;
+
+ if (!gdk_event_get_coords ((GdkEvent *) event, &x, &y))
+ return GDK_EVENT_PROPAGATE;
if (!gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (self->priv->program_list),
- event->x, event->y,
+ x, y,
&path,
NULL, NULL, NULL))
return NULL;
@@ -230,8 +234,11 @@ widget_button_press_event_cb (GtkWidget *widget,
gpointer user_data)
{
GtkAppChooserWidget *self = user_data;
+ guint button;
- if (event->button == GDK_BUTTON_SECONDARY && event->type == GDK_BUTTON_PRESS)
+ if (gdk_event_get_button ((GdkEvent *) event, &button) &&
+ button == GDK_BUTTON_SECONDARY &&
+ gdk_event_get_event_type ((GdkEvent *) event) == GDK_BUTTON_PRESS)
{
GAppInfo *info;
GtkWidget *menu;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]