[Xfce4-commits] <midori:master> Re-introduce window flashing, except on Win32
Christian Dywan
noreply at xfce.org
Mon Jul 16 21:24:02 CEST 2012
Updating branch refs/heads/master
to 19f291d2be6f18dda3b50fca2e98bf3deec75025 (commit)
from ed2a7fea6f8be3945e63ab466410f3645d952a4b (commit)
commit 19f291d2be6f18dda3b50fca2e98bf3deec75025
Author: Christian Dywan <christian at twotoasts.de>
Date: Mon Jul 16 19:04:24 2012 +0200
Re-introduce window flashing, except on Win32
midori/midori-browser.c | 25 +++++++++++++++++++++++++
midori/midori-preferences.c | 4 ++++
midori/midori-websettings.c | 4 +---
3 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index a74f825..b6c7563 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -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
midori_view_new_tab_cb (GtkWidget* view,
const gchar* uri,
@@ -1332,6 +1353,8 @@ midori_view_new_tab_cb (GtkWidget* view,
if (!background)
midori_browser_set_current_page (browser, n);
+ else
+ midori_browser_notify_new_tab (browser);
}
static void
@@ -1368,6 +1391,8 @@ midori_view_new_view_cb (GtkWidget* view,
if (where != MIDORI_NEW_VIEW_BACKGROUND)
midori_browser_set_current_page (browser, n);
}
+ else
+ midori_browser_notify_new_tab (browser);
if (!user_initiated)
{
diff --git a/midori/midori-preferences.c b/midori/midori-preferences.c
index c291995..bcb5122 100644
--- a/midori/midori-preferences.c
+++ b/midori/midori-preferences.c
@@ -397,6 +397,10 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
button = katze_property_proxy (settings, "enable-webgl", NULL);
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);
button = katze_property_label (settings, "preferred-languages");
diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c
index 4862434..784f63a 100644
--- a/midori/midori-websettings.c
+++ b/midori/midori-websettings.c
@@ -842,9 +842,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
/**
* MidoriWebSettings::flash-window-on-new-bg-tabs
*
- * Doesn't do anything.
- *
- * Deprecated: 0.4.7
+ * Uses opacity to attract attention. Nothing on Windows.
*/
g_object_class_install_property (gobject_class,
PROP_FLASH_WINDOW_ON_BG_TABS,
More information about the Xfce4-commits
mailing list