commit: ec3bb620f155109c7646252500c8638a472d359c
parent: f25fc898af62389579deb66fb313ee4e036bb474
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Mon, 18 May 2020 04:00:53 +0200
badwolf.c: drop unbinded right-click on toolbox
This is because of a GtkNotebook bug, which I'm not sure is even gonna get
fixed in GTK3.
Related: https://gitlab.gnome.org/GNOME/gtk/-/issues/2758
Diffstat:
2 files changed, 53 insertions(+), 17 deletions(-)
diff --git a/badwolf.c b/badwolf.c
@@ -570,6 +570,16 @@ SearchEntryCb_stop__search(GtkSearchEntry *search, gpointer user_data)
return TRUE;
}
+static gboolean
+widgetCb_drop_button3_event(GtkWidget *widget, GdkEvent *event, gpointer user_data)
+{
+ (void)widget;
+ (void)user_data;
+
+ // Button3 being right-click on right-handed mode, left-click on left-handed mode
+ return ((GdkEventButton *)event)->button == 3;
+}
+
struct Client *
new_browser(struct Window *window, const gchar *target_url, WebKitWebView *related_web_view)
{
@@ -720,19 +730,45 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat
/* signals for back/forward buttons */
g_signal_connect(browser->back, "clicked", G_CALLBACK(backCb_clicked), browser);
g_signal_connect(browser->forward, "clicked", G_CALLBACK(forwardCb_clicked), browser);
-
- /* signals for location entry widget */
- g_signal_connect(browser->location, "activate", G_CALLBACK(locationCb_activate), browser);
+ /* prevents GtkNotebook from spawning it's context-menu */
+ g_signal_connect(
+ browser->back, "button-press-event", G_CALLBACK(widgetCb_drop_button3_event), NULL);
+ g_signal_connect(
+ browser->back, "button-release-event", G_CALLBACK(widgetCb_drop_button3_event), NULL);
+ g_signal_connect(
+ browser->forward, "button-press-event", G_CALLBACK(widgetCb_drop_button3_event), NULL);
+ g_signal_connect(
+ browser->forward, "button-release-event", G_CALLBACK(widgetCb_drop_button3_event), NULL);
/* signals for javacript toggle widget */
g_signal_connect(browser->javascript, "toggled", G_CALLBACK(javascriptCb_toggled), browser);
+ /* prevents GtkNotebook from spawning it's context-menu */
+ g_signal_connect(
+ browser->javascript, "button-press-event", G_CALLBACK(widgetCb_drop_button3_event), NULL);
+ g_signal_connect(
+ browser->javascript, "button-release-event", G_CALLBACK(widgetCb_drop_button3_event), NULL);
/* signals for auto_load_images toggle widget */
g_signal_connect(
browser->auto_load_images, "toggled", G_CALLBACK(auto_load_imagesCb_toggled), browser);
+ /* prevents GtkNotebook from spawning it's context-menu */
+ g_signal_connect(browser->auto_load_images,
+ "button-press-event",
+ G_CALLBACK(widgetCb_drop_button3_event),
+ NULL);
+ g_signal_connect(browser->auto_load_images,
+ "button-release-event",
+ G_CALLBACK(widgetCb_drop_button3_event),
+ NULL);
+
+ /* signals for location entry widget */
+ g_signal_connect(browser->location, "activate", G_CALLBACK(locationCb_activate), browser);
/* signals for print button */
g_signal_connect(print, "clicked", G_CALLBACK(printCb_clicked), browser);
+ /* prevents GtkNotebook from spawning it's context-menu */
+ g_signal_connect(print, "button-press-event", G_CALLBACK(widgetCb_drop_button3_event), NULL);
+ g_signal_connect(print, "button-release-event", G_CALLBACK(widgetCb_drop_button3_event), NULL);
/* signals for WebView widget */
g_signal_connect(browser->webView,
diff --git a/po/messages.pot b/po/messages.pot
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: Badwolf 0.5.1+g46ea951.develop\n"
+"Project-Id-Version: Badwolf 0.5.1+gf25fc89.HEAD\n"
"Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n"
-"POT-Creation-Date: 2020-05-18 03:06+0200\n"
+"POT-Creation-Date: 2020-05-18 04:14+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -41,7 +41,7 @@ msgstr ""
msgid "Badwolf Downloads"
msgstr ""
-#: badwolf.c:874
+#: badwolf.c:910
#, c-format
msgid "Buildtime WebKit version: %d.%d.%d\n"
msgstr ""
@@ -100,11 +100,11 @@ msgid ""
"Runtime WebKit version: %d.%d.%d"
msgstr ""
-#: badwolf.c:803
+#: badwolf.c:839
msgid "New tab"
msgstr ""
-#: badwolf.c:923
+#: badwolf.c:959
msgid "Open new tab"
msgstr ""
@@ -112,12 +112,12 @@ msgstr ""
msgid "Out of Memory"
msgstr ""
-#: badwolf.c:872
+#: badwolf.c:908
#, c-format
msgid "Running Badwolf version: %s\n"
msgstr ""
-#: badwolf.c:879
+#: badwolf.c:915
#, c-format
msgid "Runtime WebKit version: %d.%d.%d\n"
msgstr ""
@@ -131,11 +131,11 @@ msgstr ""
msgid "Temporarily Add Exception"
msgstr ""
-#: badwolf.c:600
+#: badwolf.c:610
msgid "Toggle javascript"
msgstr ""
-#: badwolf.c:605
+#: badwolf.c:615
msgid "Toggle loading images automatically"
msgstr ""
@@ -143,15 +143,15 @@ msgstr ""
msgid "Unknown Crash"
msgstr ""
-#: badwolf.c:603
+#: badwolf.c:613
msgid "_IMG"
msgstr ""
-#: badwolf.c:598
+#: badwolf.c:608
msgid "_JS"
msgstr ""
-#: badwolf.c:718
+#: badwolf.c:728
msgid "search in current page"
msgstr ""
@@ -167,12 +167,12 @@ msgstr ""
msgid "the web process terminated for an unknown reason.\n"
msgstr ""
-#: badwolf.c:886
+#: badwolf.c:922
#, c-format
msgid "webkit-web-extension directory set to: %s\n"
msgstr ""
#. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext.
-#: badwolf.c:957
+#: badwolf.c:993
msgid "ΓΈ"
msgstr ""