summaryrefslogtreecommitdiffstats
path: root/views/window
diff options
context:
space:
mode:
Diffstat (limited to 'views/window')
-rw-r--r--views/window/window.h13
-rw-r--r--views/window/window_gtk.cc26
-rw-r--r--views/window/window_gtk.h16
3 files changed, 10 insertions, 45 deletions
diff --git a/views/window/window.h b/views/window/window.h
index dc7a8e3..8983972 100644
--- a/views/window/window.h
+++ b/views/window/window.h
@@ -82,6 +82,13 @@ class Window {
// Decrements the force hidden count, showing the window if we have reached
// the top of the stack. See PushForceHidden.
virtual void PopForceHidden() = 0;
+
+ // Prevents the window from being rendered as deactivated the next time it is.
+ // This state is reset automatically as soon as the window becomes activated
+ // again. There is no ability to control the state through this API as this
+ // leads to sync problems.
+ // For Gtk use WidgetGtk::make_transient_to_parent.
+ virtual void DisableInactiveRendering() = 0;
#endif
// Activate the window, assuming it already exists and is visible.
@@ -121,12 +128,6 @@ class Window {
// the system menu).
virtual void EnableClose(bool enable) = 0;
- // Prevents the window from being rendered as deactivated the next time it is.
- // This state is reset automatically as soon as the window becomes activated
- // again. There is no ability to control the state through this API as this
- // leads to sync problems.
- virtual void DisableInactiveRendering() = 0;
-
// Tell the window to update its title from the delegate.
virtual void UpdateWindowTitle() = 0;
diff --git a/views/window/window_gtk.cc b/views/window/window_gtk.cc
index 2a9fd97..9c3cba6 100644
--- a/views/window/window_gtk.cc
+++ b/views/window/window_gtk.cc
@@ -76,7 +76,6 @@ GdkCursorType HitTestCodeToGdkCursorType(int hittest_code) {
namespace views {
WindowGtk::~WindowGtk() {
- ActiveWindowWatcherX::RemoveObserver(this);
}
// static
@@ -159,7 +158,7 @@ void WindowGtk::Restore() {
}
bool WindowGtk::IsActive() const {
- return is_active_;
+ return WidgetGtk::IsActive();
}
bool WindowGtk::IsVisible() const {
@@ -189,11 +188,6 @@ void WindowGtk::EnableClose(bool enable) {
gtk_window_set_deletable(GetNativeWindow(), enable);
}
-void WindowGtk::DisableInactiveRendering() {
- // TODO(sky): this doesn't make sense as bubbles are popups, which don't
- // trigger a change in active status.
-}
-
void WindowGtk::UpdateWindowTitle() {
// If the non-client view is rendering its own title, it'll need to relayout
// now.
@@ -338,19 +332,6 @@ gboolean WindowGtk::OnWindowStateEvent(GtkWidget* widget,
return FALSE;
}
-void WindowGtk::ActiveWindowChanged(GdkWindow* active_window) {
- if (!GetNativeWindow())
- return;
-
- bool was_active = IsActive();
- is_active_ = (active_window == GTK_WIDGET(GetNativeWindow())->window);
- if (was_active != IsActive())
- IsActiveChanged();
-}
-
-void WindowGtk::IsActiveChanged() {
-}
-
////////////////////////////////////////////////////////////////////////////////
// WindowGtk, protected:
@@ -360,12 +341,9 @@ WindowGtk::WindowGtk(WindowDelegate* window_delegate)
window_delegate_(window_delegate),
non_client_view_(new NonClientView(this)),
window_state_(GDK_WINDOW_STATE_WITHDRAWN),
- window_closed_(false),
- is_active_(false) {
+ window_closed_(false) {
is_window_ = true;
window_delegate_->window_.reset(this);
-
- ActiveWindowWatcherX::AddObserver(this);
}
void WindowGtk::Init(GtkWindow* parent, const gfx::Rect& bounds) {
diff --git a/views/window/window_gtk.h b/views/window/window_gtk.h
index 5149f60..0f496c4 100644
--- a/views/window/window_gtk.h
+++ b/views/window/window_gtk.h
@@ -5,7 +5,6 @@
#ifndef VIEWS_WINDOW_WINDOW_GTK_H_
#define VIEWS_WINDOW_WINDOW_GTK_H_
-#include "app/active_window_watcher_x.h"
#include "base/basictypes.h"
#include "views/widget/widget_gtk.h"
#include "views/window/window.h"
@@ -21,9 +20,7 @@ class Client;
class WindowDelegate;
// Window implementation for GTK.
-class WindowGtk : public WidgetGtk,
- public Window,
- public ActiveWindowWatcherX::Observer {
+class WindowGtk : public WidgetGtk, public Window {
public:
virtual ~WindowGtk();
@@ -46,7 +43,6 @@ class WindowGtk : public WidgetGtk,
virtual void SetFullscreen(bool fullscreen);
virtual bool IsFullscreen() const;
virtual void EnableClose(bool enable);
- virtual void DisableInactiveRendering();
virtual void UpdateWindowTitle();
virtual void UpdateWindowIcon();
virtual void SetIsAlwaysOnTop(bool always_on_top);
@@ -71,13 +67,6 @@ class WindowGtk : public WidgetGtk,
virtual gboolean OnWindowStateEvent(GtkWidget* widget,
GdkEventWindowState* event);
- // Overriden from ActiveWindowWatcherX::Observer.
- virtual void ActiveWindowChanged(GdkWindow* active_window);
-
- // WindowGtk specific.
- // Invoked when the active status changes.
- virtual void IsActiveChanged();
-
protected:
// For the constructor.
friend class Window;
@@ -122,9 +111,6 @@ class WindowGtk : public WidgetGtk,
// Set to true if the window is in the process of closing.
bool window_closed_;
- // Are we active?
- bool is_active_;
-
DISALLOW_COPY_AND_ASSIGN(WindowGtk);
};