Merge lp:~darcy-develin/midori/midori-reload-middle-click into lp:midori

Proposed by Darcy Luís Neves Brás da Silva
Status: Merged
Approved by: Paweł Forysiuk
Approved revision: 6716
Merged at revision: 6717
Proposed branch: lp:~darcy-develin/midori/midori-reload-middle-click
Merge into: lp:midori
Diff against target: 26 lines (+9/-0)
1 file modified
midori/midori-browser.c (+9/-0)
To merge this branch: bzr merge lp:~darcy-develin/midori/midori-reload-middle-click
Reviewer Review Type Date Requested Status
Paweł Forysiuk Approve
Review via email: mp+222159@code.launchpad.net

Commit message

Make middle clicking reload button duplicate the current tab, similar to other browsers

Description of the change

add support for middle click over reload button to duplicate the current page/tab
through addition of reload-middle-click data to toolitem which in turn allows
the invocation of TabDuplicate action.
this feature is present both in chromium and firefox.

To post a comment you must log in.
Revision history for this message
Paweł Forysiuk (tuxator) wrote :

Seems to work fine here.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'midori/midori-browser.c'
2--- midori/midori-browser.c 2014-05-08 22:42:41 +0000
3+++ midori/midori-browser.c 2014-06-05 10:45:47 +0000
4@@ -6335,6 +6335,12 @@
5 {
6 if (MIDORI_EVENT_NEW_TAB (event))
7 {
8+ /* check if the middle-click was performed over reload button */
9+ if (g_object_get_data (G_OBJECT (toolitem), "reload-middle-click"))
10+ {
11+ gtk_action_activate (_action_by_name (browser, "TabDuplicate"));
12+ }
13+
14 GtkWidget* parent = gtk_widget_get_parent (toolitem);
15 GtkAction* action = gtk_activatable_get_related_action (
16 GTK_ACTIVATABLE (parent));
17@@ -6472,6 +6478,9 @@
18 else if (g_str_has_suffix (*name, "Forward"))
19 g_object_set_data (G_OBJECT (gtk_bin_get_child (GTK_BIN (toolitem))),
20 "history-forward", (void*) 0xdeadbeef);
21+ else if (g_strcmp0 (*name, "Reload"))
22+ g_object_set_data (G_OBJECT (gtk_bin_get_child (GTK_BIN (toolitem))),
23+ "reload-middle-click", (void*) 0xdeadbeef);
24
25 g_signal_connect (gtk_bin_get_child (GTK_BIN (toolitem)),
26 "button-press-event",

Subscribers

People subscribed via source and target branches