Index: chrome/browser/ui/gtk/apps/native_app_window_gtk.cc |
diff --git a/chrome/browser/ui/gtk/apps/native_app_window_gtk.cc b/chrome/browser/ui/gtk/apps/native_app_window_gtk.cc |
index d86e490884ceb258c1176dff184c5b7ce5ddf1ae..9560d66c32c6a4f35ba4736a9057e03fe4ecfacd 100644 |
--- a/chrome/browser/ui/gtk/apps/native_app_window_gtk.cc |
+++ b/chrome/browser/ui/gtk/apps/native_app_window_gtk.cc |
@@ -48,6 +48,7 @@ NativeAppWindowGtk::NativeAppWindowGtk(ShellWindow* shell_window, |
is_active_(false), |
content_thinks_its_fullscreen_(false), |
frameless_(params.frame == ShellWindow::FRAME_NONE), |
+ always_on_top_(params.always_on_top), |
frame_cursor_(NULL), |
atom_cache_(base::MessagePumpGtk::GetDefaultXDisplay(), kAtomsToCache), |
is_x_event_listened_(false) { |
@@ -91,6 +92,9 @@ NativeAppWindowGtk::NativeAppWindowGtk(ShellWindow* shell_window, |
if (frameless_) |
gtk_window_set_decorated(window_, false); |
+ if (always_on_top_) |
+ gtk_window_set_keep_above(window_, TRUE); |
+ |
int min_width = params.minimum_size.width(); |
int min_height = params.minimum_size.height(); |
int max_width = params.maximum_size.width(); |
@@ -339,7 +343,7 @@ void NativeAppWindowGtk::FlashFrame(bool flash) { |
} |
bool NativeAppWindowGtk::IsAlwaysOnTop() const { |
- return false; |
+ return always_on_top_; |
} |
void NativeAppWindowGtk::RenderViewHostChanged( |
@@ -381,6 +385,16 @@ bool NativeAppWindowGtk::IsVisible() const { |
void NativeAppWindowGtk::HideWithApp() {} |
void NativeAppWindowGtk::ShowWithApp() {} |
+void NativeAppWindowGtk::SetAlwaysOnTop(bool always_on_top) { |
+ if (always_on_top_ != always_on_top) { |
+ // gdk_window_get_state() does not give us the correct value for the |
+ // GDK_WINDOW_STATE_ABOVE bit. Cache the current state. |
+ always_on_top_ = always_on_top; |
+ gtk_window_set_keep_above(window_, always_on_top_ ? TRUE : FALSE); |
+ shell_window_->OnNativeWindowChanged(); |
+ } |
+} |
+ |
gfx::NativeView NativeAppWindowGtk::GetHostView() const { |
NOTIMPLEMENTED(); |
return NULL; |