summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-14 20:27:35 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-14 20:27:35 +0000
commit84dac073861918b2cc7e741e7ee1d5d7acc248e8 (patch)
tree9eb6fa34b0baa5e277656cd45dd9fd475cee991c /chrome
parent0f797ab2ae5ab16f1a99442046dcaeaf8dbe2bff (diff)
downloadchromium_src-84dac073861918b2cc7e741e7ee1d5d7acc248e8.zip
chromium_src-84dac073861918b2cc7e741e7ee1d5d7acc248e8.tar.gz
chromium_src-84dac073861918b2cc7e741e7ee1d5d7acc248e8.tar.bz2
Only call gtk_window_present on an alert dialog if the
activation state of the window is changing to active. The signal gets sent even when windows are going inactive (to make the frame light blue), but we only want to do anything if the window is trying to become active. This seems fvwm specific in that gtk_window_present actually changes focus in fvwm (in compiz/metacity, it just causes the window to throb in the taskbar). BUG=19292 Review URL: http://codereview.chromium.org/165502 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23452 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/gtk/browser_window_gtk.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc
index aa74070..6a171c2 100644
--- a/chrome/browser/gtk/browser_window_gtk.cc
+++ b/chrome/browser/gtk/browser_window_gtk.cc
@@ -1012,13 +1012,6 @@ void BrowserWindowGtk::Observe(NotificationType type,
if (!window_)
break;
- // If there's an app modal dialog (e.g., JS alert), try to redirect
- // the user's attention to the window owning the dialog.
- if (Singleton<AppModalDialogQueue>()->HasActiveDialog()) {
- Singleton<AppModalDialogQueue>()->ActivateModalDialog();
- break;
- }
-
// If we lose focus to an info bubble, we don't want to seem inactive.
// However we can only control this when we are painting a custom
// frame. So if we lose focus BUT it's to one of our info bubbles AND we
@@ -1030,6 +1023,16 @@ void BrowserWindowGtk::Observe(NotificationType type,
(window_ == info_bubble_toplevel &&
use_custom_frame_.GetValue()));
bool changed = (is_active != is_active_);
+
+ if (is_active && changed) {
+ // If there's an app modal dialog (e.g., JS alert), try to redirect
+ // the user's attention to the window owning the dialog.
+ if (Singleton<AppModalDialogQueue>()->HasActiveDialog()) {
+ Singleton<AppModalDialogQueue>()->ActivateModalDialog();
+ break;
+ }
+ }
+
is_active_ = is_active;
if (changed) {
SetBackgroundColor();