diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-11-30 02:12:41 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-11-30 02:24:24 +0800 |
commit | d2fb5ee1a86539e49f02c1fe9ea10cf55b0b351a (patch) | |
tree | 0a0da6f348d8c41ac3e7712a5c18abe78e23d891 /widgets/table/e-cell-combo.c | |
parent | 67024e23ee07266a7b9854648454739e1824f91c (diff) | |
download | gsoc2013-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/table/e-cell-combo.c')
-rw-r--r-- | widgets/table/e-cell-combo.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c index 48bf24724d..cc72e90a20 100644 --- a/widgets/table/e-cell-combo.c +++ b/widgets/table/e-cell-combo.c @@ -95,10 +95,10 @@ static void e_cell_combo_get_popup_pos (ECellCombo *ecc, static void e_cell_combo_selection_changed (GtkTreeSelection *selection, ECellCombo *ecc); static gint e_cell_combo_button_press (GtkWidget *popup_window, - GdkEvent *event, + GdkEvent *button_event, ECellCombo *ecc); static gint e_cell_combo_button_release (GtkWidget *popup_window, - GdkEventButton *event, + GdkEvent *button_event, ECellCombo *ecc); static gint e_cell_combo_key_press (GtkWidget *popup_window, GdkEventKey *event, @@ -575,12 +575,14 @@ e_cell_combo_selection_changed (GtkTreeSelection *selection, * which we ignore. */ static gint e_cell_combo_button_press (GtkWidget *popup_window, - GdkEvent *event, + GdkEvent *button_event, ECellCombo *ecc) { GtkWidget *event_widget; + guint32 event_time; - event_widget = gtk_get_event_widget (event); + event_time = gdk_event_get_time (button_event); + event_widget = gtk_get_event_widget (button_event); /* If the button press was for a widget inside the popup list, but * not the popup window itself, then we ignore the event and return @@ -595,8 +597,8 @@ e_cell_combo_button_press (GtkWidget *popup_window, } gtk_grab_remove (ecc->popup_window); - gdk_pointer_ungrab (event->button.time); - gdk_keyboard_ungrab (event->button.time); + gdk_pointer_ungrab (event_time); + gdk_keyboard_ungrab (event_time); gtk_widget_hide (ecc->popup_window); e_cell_popup_set_shown (E_CELL_POPUP (ecc), FALSE); @@ -618,12 +620,14 @@ e_cell_combo_button_press (GtkWidget *popup_window, * cell with the new selection. */ static gint e_cell_combo_button_release (GtkWidget *popup_window, - GdkEventButton *event, + GdkEvent *button_event, ECellCombo *ecc) { GtkWidget *event_widget; + guint32 event_time; - event_widget = gtk_get_event_widget ((GdkEvent *) event); + event_time = gdk_event_get_time (button_event); + event_widget = gtk_get_event_widget (button_event); /* See if the button was released in the list (or its children). */ while (event_widget && event_widget != ecc->popup_tree_view) @@ -636,8 +640,8 @@ e_cell_combo_button_release (GtkWidget *popup_window, /* The button was released inside the list, so we hide the popup and * update the cell to reflect the new selection. */ gtk_grab_remove (ecc->popup_window); - gdk_pointer_ungrab (event->time); - gdk_keyboard_ungrab (event->time); + gdk_pointer_ungrab (event_time); + gdk_keyboard_ungrab (event_time); gtk_widget_hide (ecc->popup_window); e_cell_popup_set_shown (E_CELL_POPUP (ecc), FALSE); |