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
=== modified file 'midori/midori-view.c'
--- midori/midori-view.c 2014-11-22 18:28:09 +0000
+++ midori/midori-view.c 2014-12-02 01:58:51 +0000
@@ -1624,6 +1624,11 @@
1624 view->button_press_handled = TRUE;1624 view->button_press_handled = TRUE;
1625 return TRUE;1625 return TRUE;
1626 }1626 }
1627
1628 #ifndef HAVE_WEBKIT2
1629 WebKitHitTestResult* result = webkit_web_view_get_hit_test_result (web_view, event);
1630 WebKitHitTestResultContext context = katze_object_get_int (result, "context");
1631 #endif
1627 #if GTK_CHECK_VERSION (3, 4, 0)1632 #if GTK_CHECK_VERSION (3, 4, 0)
1628 if (katze_object_get_boolean (gtk_widget_get_settings (view->web_view), "gtk-enable-primary-paste"))1633 if (katze_object_get_boolean (gtk_widget_get_settings (view->web_view), "gtk-enable-primary-paste"))
1629 #else1634 #else
@@ -1631,8 +1636,6 @@
1631 #endif1636 #endif
1632 {1637 {
1633 #ifndef HAVE_WEBKIT21638 #ifndef HAVE_WEBKIT2
1634 WebKitHitTestResult* result = webkit_web_view_get_hit_test_result (web_view, event);
1635 WebKitHitTestResultContext context = katze_object_get_int (result, "context");
1636 gboolean is_editable = context & WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE;1639 gboolean is_editable = context & WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE;
1637 g_object_unref (result);1640 g_object_unref (result);
1638 if (!is_editable)1641 if (!is_editable)
@@ -1693,6 +1696,13 @@
1693 midori_view_set_zoom_level (MIDORI_VIEW (view), 1.0);1696 midori_view_set_zoom_level (MIDORI_VIEW (view), 1.0);
1694 return FALSE; /* Allow Ctrl + Middle click */1697 return FALSE; /* Allow Ctrl + Middle click */
1695 }1698 }
1699#ifndef HAVE_WEBKIT2
1700 if (context & WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT )
1701 {
1702 return TRUE; /*To prevent open new tab if clicked with middle button over an image*/
1703 }
1704#endif
1705
1696 return FALSE;1706 return FALSE;
1697 break;1707 break;
1698 case 3:1708 case 3:

Subscribers

People subscribed via source and target branches

to all changes: