aboutsummaryrefslogtreecommitdiffstats
path: root/modules
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 /modules
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 'modules')
-rw-r--r--modules/addressbook/e-book-shell-view-private.c20
-rw-r--r--modules/calendar/e-cal-shell-view-private.c16
-rw-r--r--modules/calendar/e-memo-shell-view-private.c8
-rw-r--r--modules/calendar/e-task-shell-view-private.c8
-rw-r--r--modules/mail/e-mail-shell-view-private.c11
5 files changed, 33 insertions, 30 deletions
diff --git a/modules/addressbook/e-book-shell-view-private.c b/modules/addressbook/e-book-shell-view-private.c
index 360deb9bb9..947f680f6e 100644
--- a/modules/addressbook/e-book-shell-view-private.c
+++ b/modules/addressbook/e-book-shell-view-private.c
@@ -64,7 +64,7 @@ open_contact (EBookShellView *book_shell_view,
static void
popup_event (EBookShellView *book_shell_view,
- GdkEventButton *event)
+ GdkEvent *button_event)
{
EShellView *shell_view;
const gchar *widget_path;
@@ -72,7 +72,7 @@ popup_event (EBookShellView *book_shell_view,
widget_path = "/contact-popup";
shell_view = E_SHELL_VIEW (book_shell_view);
- e_shell_view_show_popup_menu (shell_view, widget_path, event);
+ e_shell_view_show_popup_menu (shell_view, widget_path, button_event);
}
static void
@@ -381,27 +381,31 @@ book_shell_view_activate_selected_source (EBookShellView *book_shell_view,
}
static gboolean
-book_shell_view_show_popup_menu (GdkEventButton *event,
+book_shell_view_show_popup_menu (GdkEvent *button_event,
EShellView *shell_view)
{
const gchar *widget_path;
widget_path = "/address-book-popup";
- e_shell_view_show_popup_menu (shell_view, widget_path, event);
+ e_shell_view_show_popup_menu (shell_view, widget_path, button_event);
return TRUE;
}
static gboolean
book_shell_view_selector_button_press_event_cb (EShellView *shell_view,
- GdkEventButton *event)
+ GdkEvent *button_event)
{
+ guint event_button = 0;
+
/* XXX Use ESourceSelector's "popup-event" signal instead. */
- if (event->button == 3 && event->type == GDK_BUTTON_PRESS)
- return book_shell_view_show_popup_menu (event, shell_view);
+ gdk_event_get_button (button_event, &event_button);
+
+ if (button_event->type != GDK_BUTTON_PRESS || event_button != 3)
+ return FALSE;
- return FALSE;
+ return book_shell_view_show_popup_menu (button_event, shell_view);
}
static gboolean
diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c
index 8d20cd974a..8159e3d22b 100644
--- a/modules/calendar/e-cal-shell-view-private.c
+++ b/modules/calendar/e-cal-shell-view-private.c
@@ -283,7 +283,7 @@ cal_shell_view_date_navigator_scroll_event_cb (ECalShellView *cal_shell_view,
static void
cal_shell_view_popup_event_cb (EShellView *shell_view,
- GdkEventButton *event)
+ GdkEvent *button_event)
{
GList *list;
GnomeCalendar *calendar;
@@ -309,18 +309,18 @@ cal_shell_view_popup_event_cb (EShellView *shell_view,
else
widget_path = "/calendar-event-popup";
- e_shell_view_show_popup_menu (shell_view, widget_path, event);
+ e_shell_view_show_popup_menu (shell_view, widget_path, button_event);
}
static gboolean
cal_shell_view_selector_popup_event_cb (EShellView *shell_view,
ESource *primary_source,
- GdkEventButton *event)
+ GdkEvent *button_event)
{
const gchar *widget_path;
widget_path = "/calendar-popup";
- e_shell_view_show_popup_menu (shell_view, widget_path, event);
+ e_shell_view_show_popup_menu (shell_view, widget_path, button_event);
return TRUE;
}
@@ -361,22 +361,22 @@ cal_shell_view_selector_client_removed_cb (ECalShellView *cal_shell_view,
static void
cal_shell_view_memopad_popup_event_cb (EShellView *shell_view,
- GdkEventButton *event)
+ GdkEvent *button_event)
{
const gchar *widget_path;
widget_path = "/calendar-memopad-popup";
- e_shell_view_show_popup_menu (shell_view, widget_path, event);
+ e_shell_view_show_popup_menu (shell_view, widget_path, button_event);
}
static void
cal_shell_view_taskpad_popup_event_cb (EShellView *shell_view,
- GdkEventButton *event)
+ GdkEvent *button_event)
{
const gchar *widget_path;
widget_path = "/calendar-taskpad-popup";
- e_shell_view_show_popup_menu (shell_view, widget_path, event);
+ e_shell_view_show_popup_menu (shell_view, widget_path, button_event);
}
static void
diff --git a/modules/calendar/e-memo-shell-view-private.c b/modules/calendar/e-memo-shell-view-private.c
index 5e7c7552cc..9f31e446ac 100644
--- a/modules/calendar/e-memo-shell-view-private.c
+++ b/modules/calendar/e-memo-shell-view-private.c
@@ -48,12 +48,12 @@ memo_shell_view_model_row_appended_cb (EMemoShellView *memo_shell_view,
static void
memo_shell_view_table_popup_event_cb (EShellView *shell_view,
- GdkEventButton *event)
+ GdkEvent *button_event)
{
const gchar *widget_path;
widget_path = "/memo-popup";
- e_shell_view_show_popup_menu (shell_view, widget_path, event);
+ e_shell_view_show_popup_menu (shell_view, widget_path, button_event);
}
static void
@@ -90,12 +90,12 @@ memo_shell_view_selector_client_removed_cb (EMemoShellView *memo_shell_view,
static gboolean
memo_shell_view_selector_popup_event_cb (EShellView *shell_view,
ESource *primary_source,
- GdkEventButton *event)
+ GdkEvent *button_event)
{
const gchar *widget_path;
widget_path = "/memo-list-popup";
- e_shell_view_show_popup_menu (shell_view, widget_path, event);
+ e_shell_view_show_popup_menu (shell_view, widget_path, button_event);
return TRUE;
}
diff --git a/modules/calendar/e-task-shell-view-private.c b/modules/calendar/e-task-shell-view-private.c
index b77317a1dd..ba66c59caa 100644
--- a/modules/calendar/e-task-shell-view-private.c
+++ b/modules/calendar/e-task-shell-view-private.c
@@ -92,12 +92,12 @@ task_shell_view_schedule_process_completed_tasks (ETaskShellView *task_shell_vie
static void
task_shell_view_table_popup_event_cb (EShellView *shell_view,
- GdkEventButton *event)
+ GdkEvent *button_event)
{
const gchar *widget_path;
widget_path = "/task-popup";
- e_shell_view_show_popup_menu (shell_view, widget_path, event);
+ e_shell_view_show_popup_menu (shell_view, widget_path, button_event);
}
static void
@@ -134,12 +134,12 @@ task_shell_view_selector_client_removed_cb (ETaskShellView *task_shell_view,
static gboolean
task_shell_view_selector_popup_event_cb (EShellView *shell_view,
ESource *primary_source,
- GdkEventButton *event)
+ GdkEvent *button_event)
{
const gchar *widget_path;
widget_path = "/task-list-popup";
- e_shell_view_show_popup_menu (shell_view, widget_path, event);
+ e_shell_view_show_popup_menu (shell_view, widget_path, button_event);
return TRUE;
}
diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c
index 9376f437ae..6bdbcb3adf 100644
--- a/modules/mail/e-mail-shell-view-private.c
+++ b/modules/mail/e-mail-shell-view-private.c
@@ -242,13 +242,12 @@ mail_shell_view_folder_tree_selection_done_cb (EMailShellView *mail_shell_view,
static void
mail_shell_view_folder_tree_popup_event_cb (EShellView *shell_view,
- GdkEventButton *event)
+ GdkEvent *button_event)
{
GtkWidget *menu;
- const gchar *widget_path;
- widget_path = "/mail-folder-popup";
- menu = e_shell_view_show_popup_menu (shell_view, widget_path, event);
+ menu = e_shell_view_show_popup_menu (
+ shell_view, "/mail-folder-popup", button_event);
g_signal_connect_object (
menu, "selection-done",
@@ -386,12 +385,12 @@ mail_shell_view_message_list_right_click_cb (EShellView *shell_view,
gint row,
ETreePath path,
gint col,
- GdkEventButton *event)
+ GdkEvent *button_event)
{
const gchar *widget_path;
widget_path = "/mail-message-popup";
- e_shell_view_show_popup_menu (shell_view, widget_path, event);
+ e_shell_view_show_popup_menu (shell_view, widget_path, button_event);
return TRUE;
}