aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBrendan Taylor <whateley@gmail.com>2012-04-02 19:51:27 -0600
committerBrendan Taylor <whateley@gmail.com>2012-04-02 19:51:27 -0600
commiteba0f53e6f6a3a387ebd498387962a8fdfc8f3d8 (patch)
tree61a592e86243818f407272a5865316dd42eb9642
parenta2cca9828f17a6133ba6214a7e460eb31f8b8418 (diff)
parent8af7c05ab0213029c0e5a0d015bbbcfe3f257e62 (diff)
Merge branch 'master' of github.com:Dieterbe/uzbl
-rw-r--r--src/callbacks.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/callbacks.c b/src/callbacks.c
index 0a0d45a..5b66905 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -165,13 +165,15 @@ button_press_cb (GtkWidget* window, GdkEventButton* event) {
gboolean propagate = FALSE,
sendev = FALSE;
- context = get_click_context(NULL);
+ // Save last button click for use in menu
+ if(uzbl.state.last_button)
+ gdk_event_free((GdkEvent *)uzbl.state.last_button);
+ uzbl.state.last_button = (GdkEventButton *)gdk_event_copy((GdkEvent *)event);
- if(event->type == GDK_BUTTON_PRESS) {
- if(uzbl.state.last_button)
- gdk_event_free((GdkEvent *)uzbl.state.last_button);
- uzbl.state.last_button = (GdkEventButton *)gdk_event_copy((GdkEvent *)event);
+ // Grab context from last click
+ context = get_click_context();
+ if(event->type == GDK_BUTTON_PRESS) {
/* left click */
if(event->button == 1) {
if((context & WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE))
@@ -222,7 +224,7 @@ button_release_cb (GtkWidget* window, GdkEventButton* event) {
gboolean propagate = FALSE,
sendev = FALSE;
- context = get_click_context(NULL);
+ context = get_click_context();
if(event->type == GDK_BUTTON_RELEASE) {
if(event->button == 2 && !(context & WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE)) {
sendev = TRUE;
@@ -620,7 +622,7 @@ populate_popup_cb(WebKitWebView *v, GtkMenu *m, void *c) {
return;
/* check context */
- if((context = get_click_context(NULL)) == -1)
+ if((context = get_click_context()) == -1)
return;
for(i=0; i < uzbl.gui.menu_items->len; i++) {