[hackers] [surf] added apos p/y-patch, thanks :) || Enno Boland (Gottox)

From: <hg_AT_suckless.org>
Date: Tue, 9 Jun 2009 20:09:02 +0000 (UTC)

changeset: 38:1fb1ec3b8cd6
tag: tip
user: Enno Boland (Gottox) <gottox_AT_s01.de>
date: Tue Jun 09 22:08:59 2009 +0200
files: surf.c
description:
added apos p/y-patch, thanks :)

diff -r eca5668c9658 -r 1fb1ec3b8cd6 surf.c
--- a/surf.c Tue Jun 09 10:29:47 2009 +0200
+++ b/surf.c Tue Jun 09 22:08:59 2009 +0200
@@ -53,6 +53,7 @@
 static void loaduri(Client *c, const gchar *uri);
 static Client *newclient();
 static WebKitWebView *newwindow(WebKitWebView *v, WebKitWebFrame *f, Client *c);
+static void pasteurl(GtkClipboard *clipboard, const gchar *text, gpointer d);
 static GdkFilterReturn processx(GdkXEvent *xevent, GdkEvent *event, gpointer d);
 static void progresschange(WebKitWebView *view, gint p, Client *c);
 static void setup(void);
@@ -198,6 +199,12 @@
         }
         if(ev->state & GDK_CONTROL_MASK) {
                 switch(ev->keyval) {
+ case GDK_p:
+ gtk_clipboard_request_text(gtk_clipboard_get(GDK_SELECTION_PRIMARY), pasteurl, c);
+ return TRUE;
+ case GDK_y:
+ gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_PRIMARY), webkit_web_view_get_uri(c->view), -1);
+ return TRUE;
                 case GDK_r:
                 case GDK_R:
                         if((ev->state & GDK_SHIFT_MASK))
@@ -399,6 +406,13 @@
         return n->view;
 }
 
+
+void
+pasteurl(GtkClipboard *clipboard, const gchar *text, gpointer d) {
+ if(text!=NULL)
+ loaduri((Client *)d, text);
+}
+
 GdkFilterReturn
 processx(GdkXEvent *e, GdkEvent *event, gpointer d) {
         Client *c = (Client *)d;
Received on Tue Jun 09 2009 - 20:09:02 UTC

This archive was generated by hypermail 2.2.0 : Tue Jun 09 2009 - 20:12:06 UTC