[epiphany] Don't use deprecated GtkButton API
- From: Diego Escalante Urrelo <diegoe src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [epiphany] Don't use deprecated GtkButton API
- Date: Sun, 6 Dec 2009 01:19:20 +0000 (UTC)
commit 7df0ef5da7881342298485eb88241695603d447c
Author: Diego Escalante Urrelo <diegoe gnome org>
Date: Fri Dec 4 14:34:01 2009 -0500
Don't use deprecated GtkButton API
In 82a5da33 we removed usage of gtk_button_pressed and gtk_button_released
however replacing those for g_signal_emit calls of button-press-event and
button-release-event. This however caused a crash on middle clicking of
elements in the toolbar.
To fix this we use g_signal_emit with pressed and released signals, these
two are deprecated signals, though.
There doesn't seem to be a way to trigger button pressed/released animation
without the pressed/released *deprecated* signals or functions, so this is our
best solution for now.
Bug #603450
src/bookmarks/ephy-bookmark-action.c | 4 ++--
src/ephy-link-action.c | 12 ++++++------
2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c
index 90af3b1..de59a14 100644
--- a/src/bookmarks/ephy-bookmark-action.c
+++ b/src/bookmarks/ephy-bookmark-action.c
@@ -431,7 +431,7 @@ button_press_cb (GtkWidget *widget,
{
if (event->button == 2)
{
- gtk_button_pressed (GTK_BUTTON (widget));
+ g_signal_emit_by_name (widget, "pressed");
}
return FALSE;
@@ -444,7 +444,7 @@ button_release_cb (GtkWidget *widget,
{
if (event->button == 2)
{
- gtk_button_released (GTK_BUTTON (widget));
+ g_signal_emit_by_name (widget, "released");
}
return FALSE;
diff --git a/src/ephy-link-action.c b/src/ephy-link-action.c
index 0447663..68ac2ff 100644
--- a/src/ephy-link-action.c
+++ b/src/ephy-link-action.c
@@ -34,20 +34,20 @@ G_DEFINE_TYPE_WITH_CODE (EphyLinkAction, ephy_link_action, GTK_TYPE_ACTION,
NULL))
static gboolean
-proxy_button_press_event_cb (GtkButton *button,
- GdkEventButton *event,
- EphyLinkAction *action)
+proxy_button_press_event_cb (GtkWidget *widget,
+ GdkEventButton *event,
+ EphyLinkAction *action)
{
if (event->button == 2)
{
- gtk_button_pressed(button);
+ g_signal_emit_by_name (widget, "pressed");
}
return FALSE;
}
static gboolean
-proxy_button_release_event_cb (GtkButton *button,
+proxy_button_release_event_cb (GtkWidget *widget,
GdkEventButton *event,
EphyLinkAction *action)
{
@@ -58,7 +58,7 @@ proxy_button_release_event_cb (GtkButton *button,
*/
if (event->button == 2)
{
- gtk_button_released(button);
+ g_signal_emit_by_name (widget, "released");
}
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]