summaryrefslogtreecommitdiffstats
path: root/views/widget
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-07 18:20:48 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-07 18:20:48 +0000
commit139fe522a7eb4f85dc77e67821bcc45806c48c0c (patch)
tree78a775ac87eca12f66acc4b7b8ea08836cd78835 /views/widget
parentec5120fcc2984701f19a5c6a24a1e9fc80697eac (diff)
downloadchromium_src-139fe522a7eb4f85dc77e67821bcc45806c48c0c.zip
chromium_src-139fe522a7eb4f85dc77e67821bcc45806c48c0c.tar.gz
chromium_src-139fe522a7eb4f85dc77e67821bcc45806c48c0c.tar.bz2
Allow SetAlwaysOnTop() before GtkWidget creation.
like WidgetWin does. BUG=none TEST=manual: web notification in linux/toolkitview build will work. Review URL: http://codereview.chromium.org/1628006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43855 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r--views/widget/widget_gtk.cc11
-rw-r--r--views/widget/widget_gtk.h4
2 files changed, 12 insertions, 3 deletions
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc
index 8898306..329ceb3 100644
--- a/views/widget/widget_gtk.cc
+++ b/views/widget/widget_gtk.cc
@@ -114,7 +114,8 @@ WidgetGtk::WidgetGtk(Type type)
transient_to_parent_(false),
got_initial_focus_in_(false),
has_focus_(false),
- delegate_(NULL) {
+ delegate_(NULL),
+ always_on_top_(false) {
static bool installed_message_loop_observer = false;
if (!installed_message_loop_observer) {
installed_message_loop_observer = true;
@@ -539,8 +540,10 @@ void WidgetGtk::SetOpacity(unsigned char opacity) {
}
void WidgetGtk::SetAlwaysOnTop(bool on_top) {
- DCHECK(widget_);
- gtk_window_set_keep_above(GTK_WINDOW(widget_), on_top);
+ DCHECK(type_ != TYPE_CHILD);
+ always_on_top_ = on_top;
+ if (widget_)
+ gtk_window_set_keep_above(GTK_WINDOW(widget_), on_top);
}
RootView* WidgetGtk::GetRootView() {
@@ -1149,6 +1152,8 @@ void WidgetGtk::CreateGtkWidget(GtkWidget* parent, const gfx::Rect& bounds) {
if (ignore_events_)
ConfigureWidgetForIgnoreEvents();
+
+ SetAlwaysOnTop(always_on_top_);
}
// The widget needs to be realized before handlers like size-allocate can
diff --git a/views/widget/widget_gtk.h b/views/widget/widget_gtk.h
index 075d873..d10237d 100644
--- a/views/widget/widget_gtk.h
+++ b/views/widget/widget_gtk.h
@@ -421,6 +421,10 @@ class WidgetGtk
// being used.
WidgetDelegate* delegate_;
+ // If true, the window stays on top of the screen. This is only used
+ // for types other than TYPE_CHILD.
+ bool always_on_top_;
+
DISALLOW_COPY_AND_ASSIGN(WidgetGtk);
};