diff options
author | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-25 19:09:53 +0000 |
---|---|---|
committer | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-25 19:09:53 +0000 |
commit | d968fdab62374a2fce2811a9b631f89d7ce30e96 (patch) | |
tree | 7c620dc6d6eba881ca7bc1e6c1cbdfbedb51ec8c /views/window/window_gtk.cc | |
parent | 1ffc48b3e1a9ebff5c1020798536a5dd9f974662 (diff) | |
download | chromium_src-d968fdab62374a2fce2811a9b631f89d7ce30e96.zip chromium_src-d968fdab62374a2fce2811a9b631f89d7ce30e96.tar.gz chromium_src-d968fdab62374a2fce2811a9b631f89d7ce30e96.tar.bz2 |
Implement IsMinimized() and IsMaximized() for view gtk
Review URL: http://codereview.chromium.org/115745
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16859 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/window/window_gtk.cc')
-rw-r--r-- | views/window/window_gtk.cc | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/views/window/window_gtk.cc b/views/window/window_gtk.cc index 8363a66..5455239 100644 --- a/views/window/window_gtk.cc +++ b/views/window/window_gtk.cc @@ -105,13 +105,11 @@ bool WindowGtk::IsVisible() const { } bool WindowGtk::IsMaximized() const { - NOTIMPLEMENTED(); - return false; + return window_maximized_; } bool WindowGtk::IsMinimized() const { - NOTIMPLEMENTED(); - return false; + return window_minimized_; } void WindowGtk::SetFullscreen(bool fullscreen) { @@ -208,6 +206,12 @@ void WindowGtk::Init(const gfx::Rect& bounds) { UpdateWindowTitle(); + GtkWindow* gtk_window = GetNativeWindow(); + g_signal_connect(G_OBJECT(gtk_window), + "window-state-event", + G_CALLBACK(CallWindowStateEvent), + NULL); + // SetInitialBounds(bounds); // if (!IsAppWindow()) { @@ -228,4 +232,14 @@ void WindowGtk::SaveWindowPosition() { NOTIMPLEMENTED(); } +// static +void WindowGtk::CallWindowStateEvent(GtkWidget* widget, + GdkEventWindowState* window_state) { + WindowGtk* window_gtk = GetWindowForNative(widget); + window_gtk->window_maximized_ = + window_state->new_window_state & GDK_WINDOW_STATE_MAXIMIZED; + window_gtk->window_minimized_ = + window_state->new_window_state & GDK_WINDOW_STATE_ICONIFIED; +} + } // namespace views |