[gtk+/gtk-3-8] window: Remember current size
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-8] window: Remember current size
- Date: Tue, 9 Apr 2013 10:32:43 +0000 (UTC)
commit 6fad3b1b0dfec101c03431a38a5b1dd6c84547ec
Author: Benjamin Otte <otte redhat com>
Date: Tue Apr 9 12:08:08 2013 +0200
window: Remember current size
Don't just look at previously remembered sizes, also look at the current
size.
This is useful for cases where the window was resized by the user or WM
and not by the application itself.
https://bugzilla.gnome.org/show_bug.cgi?id=696882
gtk/gtkwindow.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index f5470db..605bb97 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -5127,10 +5127,19 @@ gtk_window_get_remembered_size (GtkWindow *window,
int *height)
{
GtkWindowGeometryInfo *info;
+ GdkWindow *gdk_window;
*width = 0;
*height = 0;
+ gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
+ if (gdk_window)
+ {
+ *width = gdk_window_get_width (gdk_window);
+ *height = gdk_window_get_height (gdk_window);
+ return;
+ }
+
info = gtk_window_get_geometry_info (window, FALSE);
if (info)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]