Skip to content

Commit

Permalink
BugFix: ctrl+t did not focus location bar
Browse files Browse the repository at this point in the history
  • Loading branch information
aarnt committed Nov 11, 2021
1 parent 38c341f commit fef9002
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 28 deletions.
17 changes: 14 additions & 3 deletions badwolf.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@ WebViewCb_load_changed(WebKitWebView *webView, WebKitLoadEvent load_event, gpoin
{
(void)webView;
(void)load_event;
struct Client *browser = (struct Client *)user_data;
struct Client *browser = (struct Client *)user_data;
gchar *location = NULL;

gtk_widget_set_sensitive(browser->back, webkit_web_view_can_go_back(browser->webView));
gtk_widget_set_sensitive(browser->forward, webkit_web_view_can_go_forward(browser->webView));
Expand All @@ -373,8 +374,18 @@ WebViewCb_load_changed(WebKitWebView *webView, WebKitLoadEvent load_event, gpoin
case WEBKIT_LOAD_REDIRECTED:
break;
case WEBKIT_LOAD_COMMITTED:
/* Load commited, we can now set the focus on webview */
gtk_widget_grab_focus(GTK_WIDGET(webView));
location = strdup(gtk_entry_get_text(GTK_ENTRY(browser->location)));

if (strcmp(location, "about:blank") == 0)
{
//There is no site being displayed, let's focus the location bar
gtk_widget_grab_focus(browser->location);
}
else
{
//There is a site being displayed, so we can set the focus on webview
gtk_widget_grab_focus(GTK_WIDGET(webView));
}
break;
case WEBKIT_LOAD_FINISHED:
break;
Expand Down
50 changes: 25 additions & 25 deletions po/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Badwolf 1.0.3+g412f694.main\n"
"Project-Id-Version: Badwolf 1.0.3+g38c341f.main\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2021-11-11 11:08-0300\n"
"POT-Creation-Date: 2021-11-11 12:29-0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -37,16 +37,16 @@ msgstr ""
msgid "%02i:%02i:%02i Downloading…"
msgstr ""

#: badwolf.c:1020
#: badwolf.c:1031
#, c-format
msgid "Buildtime WebKit version: %d.%d.%d\n"
msgstr ""

#: badwolf.c:440
#: badwolf.c:451
msgid "Continue"
msgstr ""

#: badwolf.c:390
#: badwolf.c:401
msgid ""
"Couldn't verify the TLS certificate to ensure a better security of the "
"connection. You might want to verify your machine and network.\n"
Expand All @@ -65,31 +65,31 @@ msgstr ""
msgid "Downloads"
msgstr ""

#: badwolf.c:413
#: badwolf.c:424
msgid "Error: Some unknown error occurred validating the certificate.\n"
msgstr ""

#: badwolf.c:394
#: badwolf.c:405
msgid "Error: The X509 Certificate Authority is unknown.\n"
msgstr ""

#: badwolf.c:407
#: badwolf.c:418
msgid "Error: The certificate has been revoked.\n"
msgstr ""

#: badwolf.c:404
#: badwolf.c:415
msgid "Error: The certificate has expired. Check your system's clock.\n"
msgstr ""

#: badwolf.c:410
#: badwolf.c:421
msgid "Error: The certificate is considered to be insecure.\n"
msgstr ""

#: badwolf.c:401
#: badwolf.c:412
msgid "Error: The certificate isn't valid yet. Check your system's clock.\n"
msgstr ""

#: badwolf.c:397
#: badwolf.c:408
msgid "Error: The given identity doesn't match the expected one.\n"
msgstr ""

Expand All @@ -104,58 +104,58 @@ msgid ""
"Runtime WebKit version: %d.%d.%d"
msgstr ""

#: badwolf.c:948
#: badwolf.c:959
msgid "New tab"
msgstr ""

#: badwolf.c:1069
#: badwolf.c:1080
msgid "Open new tab"
msgstr ""

#: badwolf.c:109
msgid "Out of Memory"
msgstr ""

#: badwolf.c:1018
#: badwolf.c:1029
#, c-format
msgid "Running Badwolf version: %s\n"
msgstr ""

#: badwolf.c:1025
#: badwolf.c:1036
#, c-format
msgid "Runtime WebKit version: %d.%d.%d\n"
msgstr ""

#: badwolf.c:437
#: badwolf.c:448
#, c-format
msgid "TLS Error for %s."
msgstr ""

#: badwolf.c:440
#: badwolf.c:451
msgid "Temporarily Add Exception"
msgstr ""

#: badwolf.c:723
#: badwolf.c:734
msgid "Toggle javascript"
msgstr ""

#: badwolf.c:728
#: badwolf.c:739
msgid "Toggle loading images automatically"
msgstr ""

#: badwolf.c:113
msgid "Unknown Crash"
msgstr ""

#: badwolf.c:726
#: badwolf.c:737
msgid "_IMG"
msgstr ""

#: badwolf.c:721
#: badwolf.c:732
msgid "_JS"
msgstr ""

#: badwolf.c:838
#: badwolf.c:849
msgid "search in current page"
msgstr ""

Expand All @@ -171,12 +171,12 @@ msgstr ""
msgid "the web process terminated for an unknown reason.\n"
msgstr ""

#: badwolf.c:1032
#: badwolf.c:1043
#, c-format
msgid "webkit-web-extension directory set to: %s\n"
msgstr ""

#. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext.
#: badwolf.c:1115
#: badwolf.c:1126
msgid "ø"
msgstr ""

0 comments on commit fef9002

Please sign in to comment.