summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hofmann <scm@uninformativ.de>2018-02-21 07:42:37 +0100
committerPeter Hofmann <scm@uninformativ.de>2018-02-21 07:42:37 +0100
commit64fa4dae2ba8a3f935d645ca01c3da55d0caf9c2 (patch)
tree4f4cadf40342f0bb7958b881ced7045ab6f7101a
parent9f62826769046b65845ffa1279da9d2101373f76 (diff)
downloadlariza-64fa4dae2ba8a3f935d645ca01c3da55d0caf9c2.tar.gz
Connect to button release events instead of button press
By default, WebKit only responds to release events. The old code listened for press events. That's probably not the right way to do things. We should properly "override" the release events. Closes #56.
-rw-r--r--CHANGES6
-rw-r--r--browser.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 630711a..5f17c72 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,11 @@
Release history for lariza
+next
+ [Fixed]
+ - Accidentally opening a context menu and then issuing a middle click
+ to open a new tab no longer changes the location of the original tab
+ (fixes #56). (This only happened under certain circumstances.)
+
v18.01 2018-01-27
[Fixed]
- Compilation warnings regarding deprecated API calls (GtkAction) have
diff --git a/browser.c b/browser.c
index 23a8418..68d190b 100644
--- a/browser.c
+++ b/browser.c
@@ -179,7 +179,7 @@ client_new(const gchar *uri, WebKitWebView *related_wv, gboolean show)
G_CALLBACK(decide_policy), NULL);
g_signal_connect(G_OBJECT(c->web_view), "key-press-event",
G_CALLBACK(key_web_view), c);
- g_signal_connect(G_OBJECT(c->web_view), "button-press-event",
+ g_signal_connect(G_OBJECT(c->web_view), "button-release-event",
G_CALLBACK(key_web_view), c);
g_signal_connect(G_OBJECT(c->web_view), "scroll-event",
G_CALLBACK(key_web_view), c);
@@ -814,7 +814,7 @@ key_web_view(GtkWidget *widget, GdkEvent *event, gpointer data)
gtk_entry_set_progress_fraction(GTK_ENTRY(c->location), 0);
}
}
- else if (event->type == GDK_BUTTON_PRESS)
+ else if (event->type == GDK_BUTTON_RELEASE)
{
switch (((GdkEventButton *)event)->button)
{