diff options
author | Quentin Rameau <quinq@fifth.space> | 2015-11-22 02:10:18 +0100 |
---|---|---|
committer | Quentin Rameau <quinq@fifth.space> | 2015-11-22 02:10:18 +0100 |
commit | 6e68af115d24a11ca4135b7a620b68743eff2aa7 (patch) | |
tree | ba7b9a61b7421d29bfe8ff7feb9212c8017e0c20 | |
parent | fef80cd56ccca7e0816d39e85cf6c0f3f09b8c3c (diff) | |
download | surf-6e68af115d24a11ca4135b7a620b68743eff2aa7.tar.gz surf-6e68af115d24a11ca4135b7a620b68743eff2aa7.tar.bz2 surf-6e68af115d24a11ca4135b7a620b68743eff2aa7.zip |
Correct and simplify buttonreleased() gdk event
The passed event is a GdkEvent (or GdkEventButton), but not a
GdkEventKey.
Access the struct directly.
-rw-r--r-- | surf.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -130,7 +130,7 @@ static void cleanup(void); static WebKitWebView *newview(Client *c, WebKitWebView *rv); static GtkWidget *createview(WebKitWebView *v, WebKitNavigationAction *a, Client *c); -static gboolean buttonreleased(GtkWidget *w, GdkEventKey *e, Client *c); +static gboolean buttonreleased(GtkWidget *w, GdkEvent *e, Client *c); static gboolean keypress(GtkAccelGroup *group, GObject *obj, guint key, GdkModifierType mods, Client *c); static GdkFilterReturn processx(GdkXEvent *xevent, GdkEvent *event, @@ -813,18 +813,17 @@ createview(WebKitWebView *v, WebKitNavigationAction *a, Client *c) } gboolean -buttonreleased(GtkWidget *w, GdkEventKey *e, Client *c) +buttonreleased(GtkWidget *w, GdkEvent *e, Client *c) { WebKitHitTestResultContext element; - GdkEventButton *eb = (GdkEventButton*)e; int i; element = webkit_hit_test_result_get_context(c->mousepos); for (i = 0; i < LENGTH(buttons); ++i) { if (element & buttons[i].target && - eb->button == buttons[i].button && - CLEANMASK(eb->state) == CLEANMASK(buttons[i].mask) && + e->button.button == buttons[i].button && + CLEANMASK(e->button.state) == CLEANMASK(buttons[i].mask) && buttons[i].func) { buttons[i].func(c, &buttons[i].arg, c->mousepos); return buttons[i].stopevent; |