aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--embed/ephy-embed.c11
-rw-r--r--embed/ephy-embed.h2
-rw-r--r--embed/mozilla/mozilla-embed.cpp26
4 files changed, 37 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index f91350626..946de2496 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-08-01 Christian Persch <chpe@cvs.gnome.org>
+
+ * embed/mozilla/mozilla-embed.cpp: (mozilla_embed_dom_mouse_down_cb):
+ * embed/ephy-embed.h:
+ * embed/ephy-embed.c: (ephy_embed_base_init):
+
+ Restore the "ge_dom_mouse_down" signal.
+
2003-07-31 Christian Persch <chpe@cvs.gnome.org>
* configure.in:
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index f20300bc5..f9bf0dc7b 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -42,6 +42,7 @@ enum
OPEN_URI,
SIZE_TO,
DOM_MOUSE_CLICK,
+ DOM_MOUSE_DOWN,
SECURITY_CHANGE,
ZOOM_CHANGE,
LAST_SIGNAL
@@ -230,6 +231,16 @@ ephy_embed_base_init (gpointer g_class)
G_TYPE_INT,
1,
G_TYPE_POINTER);
+ ephy_embed_signals[DOM_MOUSE_DOWN] =
+ g_signal_new ("ge_dom_mouse_down",
+ EPHY_EMBED_TYPE,
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EphyEmbedClass, dom_mouse_down),
+ NULL, NULL,
+ ephy_marshal_INT__OBJECT,
+ G_TYPE_INT,
+ 1,
+ G_TYPE_POINTER);
ephy_embed_signals[SECURITY_CHANGE] =
g_signal_new ("ge_security_change",
EPHY_EMBED_TYPE,
diff --git a/embed/ephy-embed.h b/embed/ephy-embed.h
index aec3d87a9..27fe2e504 100644
--- a/embed/ephy-embed.h
+++ b/embed/ephy-embed.h
@@ -184,6 +184,8 @@ struct EphyEmbedClass
gint height);
gint (* dom_mouse_click) (EphyEmbed *embed,
EphyEmbedEvent *event);
+ gint (* dom_mouse_down) (EphyEmbed *embed,
+ EphyEmbedEvent *event);
void (* security_change) (EphyEmbed *embed,
EmbedSecurityLevel level);
void (* zoom_change) (EphyEmbed *embed,
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp
index fa78a245b..f0d85ba59 100644
--- a/embed/mozilla/mozilla-embed.cpp
+++ b/embed/mozilla/mozilla-embed.cpp
@@ -1456,7 +1456,7 @@ mozilla_embed_dom_mouse_down_cb (GtkMozEmbed *embed, gpointer dom_event,
{
EphyEmbedEvent *info;
EventContext event_context;
- gint return_value = 0;
+ gint return_value = FALSE;
EphyWrapper *wrapper;
nsresult result;
EphyEmbedEventType type;
@@ -1474,24 +1474,30 @@ mozilla_embed_dom_mouse_down_cb (GtkMozEmbed *embed, gpointer dom_event,
event_context.Init (wrapper);
result = event_context.GetMouseEventInfo (static_cast<nsIDOMMouseEvent*>(dom_event), info);
+ if (NS_FAILED (result)) return FALSE;
ephy_embed_event_get_event_type (info, &type);
-
- if (NS_SUCCEEDED(result) && (type == EPHY_EMBED_EVENT_MOUSE_BUTTON3))
+
+ nsCOMPtr<nsIDOMDocument> domDoc;
+ result = event_context.GetTargetDocument (getter_AddRefs(domDoc));
+ if (NS_SUCCEEDED(result))
{
- nsCOMPtr<nsIDOMDocument> domDoc;
- result = event_context.GetTargetDocument (getter_AddRefs(domDoc));
+ result = wrapper->PushTargetDocument (domDoc);
+
if (NS_SUCCEEDED(result))
{
- result = wrapper->PushTargetDocument (domDoc);
- if (NS_SUCCEEDED(result))
+ g_signal_emit_by_name (membed, "ge_dom_mouse_down",
+ info, &return_value);
+
+ if (return_value == FALSE &&
+ type == EPHY_EMBED_EVENT_MOUSE_BUTTON3)
{
g_signal_emit_by_name (membed, "ge_context_menu",
- info, &return_value);
- wrapper->PopTargetDocument ();
+ info, &return_value);
}
- }
+ wrapper->PopTargetDocument ();
+ }
}
g_object_unref (info);