Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit5d0681c28107c3a18b552f270743940da40808c8 (patch)
Author
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2019-04-26 21:15:06 +0200
Committer
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2019-04-26 21:15:06 +0200
Files7dfa3c39b378987a1627659e54c696b2d6e940e4
goodwolf-5d0681c28107c3a18b552f270743940da40808c8.tar
goodwolf-5d0681c28107c3a18b552f270743940da40808c8.tar.gz
goodwolf-5d0681c28107c3a18b552f270743940da40808c8.zip
Parent47c494da006c5a034f2cf3b26299c0edf46a840b (diff)
Hook browser->box to commonCb_key_press_event
2 files changed, 24 insertions, 10 deletions
-rw-r--r--badwolf.120
-rw-r--r--badwolf.c14
diff --git a/badwolf.1 b/badwolf.1
index bc82d74..e996fd1 100644
--- a/badwolf.1
+++ b/badwolf.1
@@ -22,20 +22,20 @@ For now it only has the default Webkit/GTK keybindings, which notably are (C for
.Bl -width Ds -tag
.It any C-PageUp / C-PageDown
Go to the previous/next tab
-.It search C-g / C-S-g
-When the search box is focused it goes to the Next/Previous search term.
-.It webview C-F4
+.It any C-t
+Creates a new tab (unrelated, similar as pressing the button)
+.It browser C-F4
Closes the current tab
-.It webview C-S-r / C-r
-Reloads the current tab (with/without clearing cache)
-.It webview C-f
+.It browser C-f
Focuses on the search entry
-.It webview C-l
+.It browser C-l
Focuses on the location(URL) entry
-.It window C-t, webview C-t
-Creates a new tab (unrelated, similar as pressing the button)
-.It webview C-[ / C-]
+.It browser C-S-r / C-r
+Reloads the current tab (with/without clearing cache)
+.It browser C-[ / C-]
Go back/forward in current tab’s history
+.It search C-g / C-S-g
+When the search box is focused it goes to the Next/Previous search term.
.El
.Sh BUGS
You can submit contributions or tickets to
diff --git a/badwolf.c b/badwolf.c
index aeca324..1fef34e 100644
--- a/badwolf.c
+++ b/badwolf.c
@@ -40,6 +40,7 @@ static gboolean
WebViewCb_key_press_event(WebKitWebView *webView, GdkEvent *event, gpointer user_data);
static gboolean
main_windowCb_key_press_event(GtkWidget *widget, GdkEvent *event, gpointer user_data);
+static gboolean boxCb_key_press_event(GtkWidget *widget, GdkEvent *event, gpointer user_data);
static gboolean WebViewCb_web_process_terminated(WebKitWebView *webView,
WebKitWebProcessTerminationReason reason,
gpointer user_data);
@@ -143,6 +144,17 @@ WebViewCb_key_press_event(WebKitWebView *webView, GdkEvent *event, gpointer user
}
static gboolean
+boxCb_key_press_event(GtkWidget *widget, GdkEvent *event, gpointer user_data)
+{
+ (void)widget;
+ struct Client *browser = (struct Client *)user_data;
+
+ if(commonCb_key_press_event(browser->window, event, browser)) return TRUE;
+
+ return FALSE;
+}
+
+static gboolean
main_windowCb_key_press_event(GtkWidget *widget, GdkEvent *event, gpointer user_data)
{
(void)widget;
@@ -513,6 +525,8 @@ new_browser(struct Window *window, gchar *target_url, WebKitWebView *related_web
browser->search, "search-changed", G_CALLBACK(SearchEntryCb_search__changed), browser);
g_signal_connect(browser->search, "stop-search", G_CALLBACK(SearchEntryCb_stop__search), browser);
+ g_signal_connect(browser->box, "key-press-event", G_CALLBACK(boxCb_key_press_event), browser);
+
if(related_web_view == NULL) webkit_web_view_load_uri(browser->webView, target_url);
return browser;