summaryrefslogtreecommitdiffstats
path: root/views/widget/widget_gtk.h
diff options
context:
space:
mode:
Diffstat (limited to 'views/widget/widget_gtk.h')
-rw-r--r--views/widget/widget_gtk.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/views/widget/widget_gtk.h b/views/widget/widget_gtk.h
index 8009f89..f91befa 100644
--- a/views/widget/widget_gtk.h
+++ b/views/widget/widget_gtk.h
@@ -7,6 +7,7 @@
#include <gtk/gtk.h>
+#include "app/active_window_watcher_x.h"
#include "base/message_loop.h"
#include "views/focus/focus_manager.h"
#include "views/widget/widget.h"
@@ -30,7 +31,8 @@ class WindowGtk;
class WidgetGtk
: public Widget,
public MessageLoopForUI::Observer,
- public FocusTraversable {
+ public FocusTraversable,
+ public ActiveWindowWatcherX::Observer {
public:
// Type of widget.
enum Type {
@@ -48,6 +50,17 @@ class WidgetGtk
explicit WidgetGtk(Type type);
virtual ~WidgetGtk();
+ // Marks this window as transient to its parent. A window that is transient
+ // to its parent results in the parent rendering active when the child is
+ // active.
+ // This must be invoked before Init. This is only used for types other than
+ // TYPE_CHILD. The default is false.
+ // See gtk_window_set_transient_for for details.
+ void make_transient_to_parent() {
+ DCHECK(!widget_);
+ transient_to_parent_ = true;
+ }
+
// Makes the background of the window totally transparent. This must be
// invoked before Init. This does a couple of checks and returns true if
// the window can be made transparent. The actual work of making the window
@@ -88,6 +101,12 @@ class WidgetGtk
// used for.
bool in_paint_now() const { return in_paint_now_; }
+ // Invoked when the active status changes.
+ virtual void IsActiveChanged();
+
+ // Overriden from ActiveWindowWatcherX::Observer.
+ virtual void ActiveWindowChanged(GdkWindow* active_window);
+
// Overridden from Widget:
virtual void Init(gfx::NativeView parent, const gfx::Rect& bounds);
virtual void SetContentsView(View* view);
@@ -384,6 +403,12 @@ class WidgetGtk
// See description above getter for details.
bool in_paint_now_;
+ // Are we active?
+ bool is_active_;
+
+ // See make_transient_to_parent for a description.
+ bool transient_to_parent_;
+
DISALLOW_COPY_AND_ASSIGN(WidgetGtk);
};