diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-04 18:27:27 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-04 18:27:27 +0000 |
commit | 03c3b1e4170e845842833ad64cf36676043a357a (patch) | |
tree | 6d215da94ba60e53c6023a5b0ace750bd4a0e3ff /views/window/window_gtk.h | |
parent | 6254686d113f977626e824b02e8cb676556734ec (diff) | |
download | chromium_src-03c3b1e4170e845842833ad64cf36676043a357a.zip chromium_src-03c3b1e4170e845842833ad64cf36676043a357a.tar.gz chromium_src-03c3b1e4170e845842833ad64cf36676043a357a.tar.bz2 |
Implement window state restoration for the views-gtk window.
Allows the window to be resized smaller than its current size by setting a minimum size before initiating the drag.
Fixes a crash in TabContentsViewGtk due to a NULL delegate deref.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/118227
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17641 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/window/window_gtk.h')
-rw-r--r-- | views/window/window_gtk.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/views/window/window_gtk.h b/views/window/window_gtk.h index 5012718..c996ce5 100644 --- a/views/window/window_gtk.h +++ b/views/window/window_gtk.h @@ -63,8 +63,12 @@ class WindowGtk : public WidgetGtk, public Window { // Overridden from WidgetGtk: virtual gboolean OnButtonPress(GtkWidget* widget, GdkEventButton* event); + virtual gboolean OnConfigureEvent(GtkWidget* widget, + GdkEventConfigure* event); virtual gboolean OnMotionNotify(GtkWidget* widget, GdkEventMotion* event); virtual void OnSizeAllocate(GtkWidget* widget, GtkAllocation* allocation); + virtual gboolean OnWindowStateEvent(GtkWidget* widget, + GdkEventWindowState* event); protected: // For the constructor. @@ -77,9 +81,12 @@ class WindowGtk : public WidgetGtk, public Window { void Init(const gfx::Rect& bounds); private: - // Used to track window state changes - static void CallWindowStateEvent(GtkWidget* widget, - GdkEventWindowState* window_state); + static gboolean CallConfigureEvent(GtkWidget* widget, + GdkEventConfigure* event, + WindowGtk* window_gtk); + static gboolean CallWindowStateEvent(GtkWidget* widget, + GdkEventWindowState* event, + WindowGtk* window_gtk); // Asks the delegate if any to save the window's location and size. void SaveWindowPosition(); |