summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-07 03:30:22 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-07 03:30:22 +0000
commit2cb5b91effa942fa165eb847c295ddc883ab70df (patch)
tree724dc900ea6f2dbfe0299506ad940bff146717df /chrome/browser/views
parent6d8d0e083f750fda6da6edcf8949c9d4c59a16aa (diff)
downloadchromium_src-2cb5b91effa942fa165eb847c295ddc883ab70df.zip
chromium_src-2cb5b91effa942fa165eb847c295ddc883ab70df.tar.gz
chromium_src-2cb5b91effa942fa165eb847c295ddc883ab70df.tar.bz2
Converts info bubbles on views/gtk from popups to normal windows to
avoid the focus problems. BUG=none TEST=none Review URL: http://codereview.chromium.org/246099 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28228 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r--chrome/browser/views/frame/browser_frame_gtk.cc3
-rw-r--r--chrome/browser/views/frame/browser_view.cc2
-rw-r--r--chrome/browser/views/info_bubble.cc10
-rw-r--r--chrome/browser/views/info_bubble.h3
4 files changed, 14 insertions, 4 deletions
diff --git a/chrome/browser/views/frame/browser_frame_gtk.cc b/chrome/browser/views/frame/browser_frame_gtk.cc
index c977c74..953f4a6 100644
--- a/chrome/browser/views/frame/browser_frame_gtk.cc
+++ b/chrome/browser/views/frame/browser_frame_gtk.cc
@@ -89,6 +89,5 @@ views::RootView* BrowserFrameGtk::CreateRootView() {
void BrowserFrameGtk::IsActiveChanged() {
GetRootView()->SchedulePaint();
browser_view_->ActivationChanged(IsActive());
- views::WindowGtk::IsActiveChanged();
+ views::WidgetGtk::IsActiveChanged();
}
-
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc
index a626250..32ab509 100644
--- a/chrome/browser/views/frame/browser_view.cc
+++ b/chrome/browser/views/frame/browser_view.cc
@@ -958,7 +958,9 @@ gfx::Rect BrowserView::GetRootWindowResizerRect() const {
}
void BrowserView::DisableInactiveFrame() {
+#if defined(OS_WIN)
frame_->GetWindow()->DisableInactiveRendering();
+#endif // No tricks are needed to get the right behavior on Linux.
}
void BrowserView::ConfirmAddSearchProvider(const TemplateURL* template_url,
diff --git a/chrome/browser/views/info_bubble.cc b/chrome/browser/views/info_bubble.cc
index 91a41a4..bba77a9f3 100644
--- a/chrome/browser/views/info_bubble.cc
+++ b/chrome/browser/views/info_bubble.cc
@@ -211,7 +211,7 @@ void InfoBubble::Close() {
InfoBubble::InfoBubble()
:
#if defined(OS_LINUX)
- WidgetGtk(TYPE_POPUP),
+ WidgetGtk(TYPE_WINDOW),
#endif
delegate_(NULL),
parent_(NULL),
@@ -223,16 +223,17 @@ void InfoBubble::Init(views::Window* parent,
views::View* contents,
InfoBubbleDelegate* delegate) {
parent_ = parent;
- parent_->DisableInactiveRendering();
delegate_ = delegate;
// Create the main window.
#if defined(OS_WIN)
+ parent_->DisableInactiveRendering();
set_window_style(WS_POPUP | WS_CLIPCHILDREN);
set_window_ex_style(WS_EX_TOOLWINDOW);
WidgetWin::Init(parent->GetNativeWindow(), gfx::Rect());
#elif defined(OS_LINUX)
MakeTransparent();
+ make_transient_to_parent();
WidgetGtk::Init(GTK_WIDGET(parent->GetNativeWindow()), gfx::Rect());
#endif
@@ -306,6 +307,11 @@ void InfoBubble::OnActivate(UINT action, BOOL minimized, HWND window) {
GetRootView()->GetChildViewAt(0)->RequestFocus();
}
}
+#elif defined(OS_LINUX)
+void InfoBubble::IsActiveChanged() {
+ if (!IsActive())
+ Close();
+}
#endif
void InfoBubble::Close(bool closed_by_escape) {
diff --git a/chrome/browser/views/info_bubble.h b/chrome/browser/views/info_bubble.h
index fc5f671..5ee23f5 100644
--- a/chrome/browser/views/info_bubble.h
+++ b/chrome/browser/views/info_bubble.h
@@ -116,6 +116,9 @@ class InfoBubble : public views::WidgetGtk {
#if defined(OS_WIN)
// Overridden from WidgetWin:
virtual void OnActivate(UINT action, BOOL minimized, HWND window);
+#elif defined(OS_LINUX)
+ // Overridden from WidgetGtk:
+ virtual void IsActiveChanged();
#endif
private: