Ctrl + middle click is handled twice
Ctrl middle click set the zoom level to 0 but it is supposed to open a link (selected text) in a new tab, too If a link is selected it should open and otherwise set the zoom level to 1.0. So if you click on a link with Ctrl + middle click you get a new tab and your zoom isn't changed.
This commit is contained in:
parent
357187e264
commit
a695a91410
1 changed files with 51 additions and 49 deletions
|
@ -1782,12 +1782,7 @@ midori_view_web_view_button_press_event_cb (WebKitWebView* web_view,
|
||||||
view->button_press_handled = TRUE;
|
view->button_press_handled = TRUE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
else if (MIDORI_MOD_SCROLL (event->state))
|
if (view->middle_click_opens_selection)
|
||||||
{
|
|
||||||
midori_view_set_zoom_level (MIDORI_VIEW (view), 1.0);
|
|
||||||
return FALSE; /* Allow Ctrl + Middle click */
|
|
||||||
}
|
|
||||||
else if (view->middle_click_opens_selection)
|
|
||||||
{
|
{
|
||||||
gboolean is_editable;
|
gboolean is_editable;
|
||||||
WebKitHitTestResult* result;
|
WebKitHitTestResult* result;
|
||||||
|
@ -1797,9 +1792,8 @@ midori_view_web_view_button_press_event_cb (WebKitWebView* web_view,
|
||||||
context = katze_object_get_int (result, "context");
|
context = katze_object_get_int (result, "context");
|
||||||
is_editable = context & WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE;
|
is_editable = context & WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE;
|
||||||
g_object_unref (result);
|
g_object_unref (result);
|
||||||
if (is_editable)
|
if (!is_editable)
|
||||||
return FALSE;
|
{
|
||||||
|
|
||||||
clipboard = gtk_clipboard_get_for_display (
|
clipboard = gtk_clipboard_get_for_display (
|
||||||
gtk_widget_get_display (GTK_WIDGET (view)),
|
gtk_widget_get_display (GTK_WIDGET (view)),
|
||||||
GDK_SELECTION_PRIMARY);
|
GDK_SELECTION_PRIMARY);
|
||||||
|
@ -1824,12 +1818,8 @@ midori_view_web_view_button_press_event_cb (WebKitWebView* web_view,
|
||||||
}
|
}
|
||||||
katze_assign (uri, new_uri);
|
katze_assign (uri, new_uri);
|
||||||
}
|
}
|
||||||
else if (!midori_uri_is_location (uri))
|
else if (midori_uri_is_location (uri))
|
||||||
{
|
{
|
||||||
g_free (uri);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (MIDORI_MOD_NEW_TAB (event->state))
|
if (MIDORI_MOD_NEW_TAB (event->state))
|
||||||
{
|
{
|
||||||
background = view->open_tabs_in_the_background;
|
background = view->open_tabs_in_the_background;
|
||||||
|
@ -1846,7 +1836,19 @@ midori_view_web_view_button_press_event_cb (WebKitWebView* web_view,
|
||||||
view->button_press_handled = TRUE;
|
view->button_press_handled = TRUE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_free (uri);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (MIDORI_MOD_SCROLL (event->state))
|
||||||
|
{
|
||||||
|
midori_view_set_zoom_level (MIDORI_VIEW (view), 1.0);
|
||||||
|
return FALSE; /* Allow Ctrl + Middle click */
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (event->state & GDK_CONTROL_MASK)
|
if (event->state & GDK_CONTROL_MASK)
|
||||||
|
|
Loading…
Reference in a new issue