aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-11-30 02:12:41 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-11-30 02:24:24 +0800
commitd2fb5ee1a86539e49f02c1fe9ea10cf55b0b351a (patch)
tree0a0da6f348d8c41ac3e7712a5c18abe78e23d891 /addressbook
parent67024e23ee07266a7b9854648454739e1824f91c (diff)
downloadgsoc2013-evolution-d2fb5ee1a86539e49f02c1fe9ea10cf55b0b351a.tar
gsoc2013-evolution-d2fb5ee1a86539e49f02c1fe9ea10cf55b0b351a.tar.gz
gsoc2013-evolution-d2fb5ee1a86539e49f02c1fe9ea10cf55b0b351a.tar.bz2
gsoc2013-evolution-d2fb5ee1a86539e49f02c1fe9ea10cf55b0b351a.tar.lz
gsoc2013-evolution-d2fb5ee1a86539e49f02c1fe9ea10cf55b0b351a.tar.xz
gsoc2013-evolution-d2fb5ee1a86539e49f02c1fe9ea10cf55b0b351a.tar.zst
gsoc2013-evolution-d2fb5ee1a86539e49f02c1fe9ea10cf55b0b351a.zip
Avoid using GdkEventButton directly in certain places.
Prefer dealing with GdkEvent pointers and using accessor functions like gdk_event_get_button(). This is complicated by the fact that some GtkWidget method declarations still use GdkEventButton pointers, and synthesizing button events pretty much requires direct GdkEventButton access. But GDK seems to be nudging itself toward sealing the GdkEvent union. Likely to happen in GDK4. Mainly clean up signal handlers and leave method overrides alone for now.
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c6
-rw-r--r--addressbook/gui/widgets/e-minicard-view.c8
2 files changed, 9 insertions, 5 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index 4d6aea77ae..9d7b1826c7 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -230,9 +230,11 @@ table_white_space_event (ETable *table,
GdkEvent *event,
EAddressbookView *view)
{
- gint button = ((GdkEventButton *) event)->button;
+ guint event_button = 0;
- if (event->type == GDK_BUTTON_PRESS && button == 3) {
+ gdk_event_get_button (event, &event_button);
+
+ if (event->type == GDK_BUTTON_PRESS && event_button == 3) {
addressbook_view_emit_popup_event (view, event);
return TRUE;
}
diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c
index 88633d4492..1889399f3d 100644
--- a/addressbook/gui/widgets/e-minicard-view.c
+++ b/addressbook/gui/widgets/e-minicard-view.c
@@ -404,12 +404,14 @@ e_minicard_view_event (GnomeCanvasItem *item,
GdkEvent *event)
{
EMinicardView *view;
+ guint event_button = 0;
view = E_MINICARD_VIEW (item);
switch (event->type) {
case GDK_2BUTTON_PRESS:
- if (((GdkEventButton *) event)->button == 1) {
+ gdk_event_get_button (event, &event_button);
+ if (event_button == 1) {
gboolean editable;
g_object_get (view->adapter, "editable", &editable, NULL);
@@ -419,9 +421,9 @@ e_minicard_view_event (GnomeCanvasItem *item,
return TRUE;
}
case GDK_BUTTON_PRESS:
- if (event->button.button == 3) {
+ gdk_event_get_button (event, &event_button);
+ if (event_button == 3)
e_minicard_view_right_click (view, event);
- }
break;
case GDK_KEY_PRESS:
if (event->key.keyval & GDK_SHIFT_MASK &&