Open selection in new tab via Control.

This commit is contained in:
Przemek Sitek 2008-04-07 06:54:02 +02:00 committed by Christian Dywan
parent ef7113caca
commit 616b43004c

View file

@ -396,7 +396,7 @@ gtk_widget_button_press_event (MidoriWebView* web_view,
if (state & GDK_CONTROL_MASK)
{
// FIXME: Reset font multiplier or zoom level
return TRUE;
return FALSE; // Allow Ctrl + Middle click
}
else
{
@ -421,10 +421,14 @@ gtk_widget_button_press_event_after (MidoriWebView* web_view,
if (event->button == 2 && priv->middle_click_goto)
{
GdkModifierType state = (GdkModifierType) event->state;
GtkClipboard* clipboard = gtk_clipboard_get (GDK_SELECTION_PRIMARY);
gchar* uri = gtk_clipboard_wait_for_text (clipboard);
if (uri && strchr (uri, '.') && !strchr (uri, ' '))
{
if (state & GDK_CONTROL_MASK)
g_signal_emit (web_view, signals[NEW_TAB], 0, uri);
else
g_object_set (web_view, "uri", uri, NULL);
g_free (uri);
return TRUE;