Re-introduce window flashing, except on Win32

This commit is contained in:
Christian Dywan 2012-07-16 19:04:24 +02:00
parent ed2a7fea6f
commit 19f291d2be
3 changed files with 30 additions and 3 deletions

View file

@ -1320,6 +1320,27 @@ midori_browser_view_copy_history (GtkWidget* view_to,
} }
} }
static gboolean
midori_browser_notify_new_tab_timeout_cb (MidoriBrowser *browser)
{
#ifndef G_OS_WIN32
gtk_window_set_opacity (GTK_WINDOW (browser), 1);
#endif
return G_SOURCE_REMOVE;
}
static void
midori_browser_notify_new_tab (MidoriBrowser* browser)
{
if (katze_object_get_boolean (browser->settings, "flash-window-on-new-bg-tabs"))
{
#ifndef G_OS_WIN32
gtk_window_set_opacity (GTK_WINDOW (browser), 0.8);
#endif
g_timeout_add (100, (GSourceFunc) midori_browser_notify_new_tab_timeout_cb, browser);
}
}
static void static void
midori_view_new_tab_cb (GtkWidget* view, midori_view_new_tab_cb (GtkWidget* view,
const gchar* uri, const gchar* uri,
@ -1332,6 +1353,8 @@ midori_view_new_tab_cb (GtkWidget* view,
if (!background) if (!background)
midori_browser_set_current_page (browser, n); midori_browser_set_current_page (browser, n);
else
midori_browser_notify_new_tab (browser);
} }
static void static void
@ -1368,6 +1391,8 @@ midori_view_new_view_cb (GtkWidget* view,
if (where != MIDORI_NEW_VIEW_BACKGROUND) if (where != MIDORI_NEW_VIEW_BACKGROUND)
midori_browser_set_current_page (browser, n); midori_browser_set_current_page (browser, n);
} }
else
midori_browser_notify_new_tab (browser);
if (!user_initiated) if (!user_initiated)
{ {

View file

@ -397,6 +397,10 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
button = katze_property_proxy (settings, "enable-webgl", NULL); button = katze_property_proxy (settings, "enable-webgl", NULL);
SPANNED_ADD (button); SPANNED_ADD (button);
} }
#ifndef G_OS_WIN32
button = katze_property_proxy (settings, "flash-window-on-new-bg-tabs", NULL);
INDENTED_ADD (button);
#endif
FRAME_NEW (NULL); FRAME_NEW (NULL);
button = katze_property_label (settings, "preferred-languages"); button = katze_property_label (settings, "preferred-languages");

View file

@ -842,9 +842,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
/** /**
* MidoriWebSettings::flash-window-on-new-bg-tabs * MidoriWebSettings::flash-window-on-new-bg-tabs
* *
* Doesn't do anything. * Uses opacity to attract attention. Nothing on Windows.
*
* Deprecated: 0.4.7
*/ */
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_FLASH_WINDOW_ON_BG_TABS, PROP_FLASH_WINDOW_ON_BG_TABS,