aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/e-timezone-dialog/e-timezone-dialog.c
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 /widgets/e-timezone-dialog/e-timezone-dialog.c
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 'widgets/e-timezone-dialog/e-timezone-dialog.c')
-rw-r--r--widgets/e-timezone-dialog/e-timezone-dialog.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/widgets/e-timezone-dialog/e-timezone-dialog.c b/widgets/e-timezone-dialog/e-timezone-dialog.c
index 337cb0ad99..9fd6b91446 100644
--- a/widgets/e-timezone-dialog/e-timezone-dialog.c
+++ b/widgets/e-timezone-dialog/e-timezone-dialog.c
@@ -95,7 +95,7 @@ static gboolean on_map_visibility_changed (GtkWidget *w,
GdkEventVisibility *event,
gpointer data);
static gboolean on_map_button_pressed (GtkWidget *w,
- GdkEventButton *event,
+ GdkEvent *button_event,
gpointer data);
static icaltimezone * get_zone_from_point (ETimezoneDialog *etd,
@@ -591,21 +591,26 @@ on_map_visibility_changed (GtkWidget *w,
static gboolean
on_map_button_pressed (GtkWidget *w,
- GdkEventButton *event,
+ GdkEvent *button_event,
gpointer data)
{
ETimezoneDialog *etd;
ETimezoneDialogPrivate *priv;
+ guint event_button = 0;
+ gdouble event_x_win = 0;
+ gdouble event_y_win = 0;
gdouble longitude, latitude;
etd = E_TIMEZONE_DIALOG (data);
priv = etd->priv;
+ gdk_event_get_button (button_event, &event_button);
+ gdk_event_get_coords (button_event, &event_x_win, &event_y_win);
+
e_map_window_to_world (
- priv->map, (gdouble) event->x, (gdouble) event->y,
- &longitude, &latitude);
+ priv->map, event_x_win, event_y_win, &longitude, &latitude);
- if (event->button != 1) {
+ if (event_button != 1) {
e_map_zoom_out (priv->map);
} else {
if (e_map_get_magnification (priv->map) <= 1.0)