Merge lp:~gero-bare/midori/midori-bug-1281211 into lp:midori

Proposed by Gero.Bare
Status: Work in progress
Proposed branch: lp:~gero-bare/midori/midori-bug-1281211
Merge into: lp:midori
Diff against target: 38 lines (+12/-2)
1 file modified
midori/midori-view.c (+12/-2)
To merge this branch: bzr merge lp:~gero-bare/midori/midori-bug-1281211
Reviewer Review Type Date Requested Status
gue5t gue5t Disapprove
Review via email: mp+243350@code.launchpad.net

Description of the change

Please check if this is a sane implementation.

It seems correct to me, but I could be wrong.

Not much to add. I simply added a check to verify if the user make a click with the middle button over a part of a document (document < image), if it is then ignore that.

To post a comment you must log in.
Revision history for this message
gue5t gue5t (gue5t) wrote :

I don't think this is the right way to fix this problem. It doesn't address other parts of the same bug, such as double-clicking the scrollbar also opening a new tab. I'll dig up the precise commit that caused these problems when I get a chance.

review: Disapprove
Revision history for this message
Gero.Bare (gero-bare) wrote :

@gue5t
Please could you update the bug description with all the relevant info.
That would be awesome, in case that anyone want to tackle this.

Unmerged revisions

6837. By Gero.Bare

Prevent to open new tab when a click over an image is issued.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'midori/midori-view.c'
2--- midori/midori-view.c 2014-11-22 18:28:09 +0000
3+++ midori/midori-view.c 2014-12-02 01:58:51 +0000
4@@ -1624,6 +1624,11 @@
5 view->button_press_handled = TRUE;
6 return TRUE;
7 }
8+
9+ #ifndef HAVE_WEBKIT2
10+ WebKitHitTestResult* result = webkit_web_view_get_hit_test_result (web_view, event);
11+ WebKitHitTestResultContext context = katze_object_get_int (result, "context");
12+ #endif
13 #if GTK_CHECK_VERSION (3, 4, 0)
14 if (katze_object_get_boolean (gtk_widget_get_settings (view->web_view), "gtk-enable-primary-paste"))
15 #else
16@@ -1631,8 +1636,6 @@
17 #endif
18 {
19 #ifndef HAVE_WEBKIT2
20- WebKitHitTestResult* result = webkit_web_view_get_hit_test_result (web_view, event);
21- WebKitHitTestResultContext context = katze_object_get_int (result, "context");
22 gboolean is_editable = context & WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE;
23 g_object_unref (result);
24 if (!is_editable)
25@@ -1693,6 +1696,13 @@
26 midori_view_set_zoom_level (MIDORI_VIEW (view), 1.0);
27 return FALSE; /* Allow Ctrl + Middle click */
28 }
29+#ifndef HAVE_WEBKIT2
30+ if (context & WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT )
31+ {
32+ return TRUE; /*To prevent open new tab if clicked with middle button over an image*/
33+ }
34+#endif
35+
36 return FALSE;
37 break;
38 case 3:

Subscribers

People subscribed via source and target branches

to all changes: