From a6c53acc2efd64fa9348d961088d80eda47c8987 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sat, 18 Aug 2001 17:03:27 +0000 Subject: [PATCH] constrain position on hints_changed in addition to the other cases. 2001-08-18 Havoc Pennington * gtk/gtkwindow.c (gtk_window_move_resize): constrain position on hints_changed in addition to the other cases. (gtk_window_move_resize): include last position from configure notify in debug spew --- ChangeLog | 7 +++ ChangeLog.pre-2-0 | 7 +++ ChangeLog.pre-2-10 | 7 +++ ChangeLog.pre-2-2 | 7 +++ ChangeLog.pre-2-4 | 7 +++ ChangeLog.pre-2-6 | 7 +++ ChangeLog.pre-2-8 | 7 +++ docs/reference/gtk/tmpl/gtkrc.sgml | 1 - gtk/gtkwindow.c | 73 ++++++++++++++++++------------ 9 files changed, 92 insertions(+), 31 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7b3eda5f26..58dd61394f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-08-18 Havoc Pennington + + * gtk/gtkwindow.c (gtk_window_move_resize): constrain position on + hints_changed in addition to the other cases. + (gtk_window_move_resize): include last position from configure + notify in debug spew + 2001-08-18 James Henstridge * gtk/gtkaccelgroup.c (gtk_accel_group_object_destroy): use the diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 7b3eda5f26..58dd61394f 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,10 @@ +2001-08-18 Havoc Pennington + + * gtk/gtkwindow.c (gtk_window_move_resize): constrain position on + hints_changed in addition to the other cases. + (gtk_window_move_resize): include last position from configure + notify in debug spew + 2001-08-18 James Henstridge * gtk/gtkaccelgroup.c (gtk_accel_group_object_destroy): use the diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 7b3eda5f26..58dd61394f 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +2001-08-18 Havoc Pennington + + * gtk/gtkwindow.c (gtk_window_move_resize): constrain position on + hints_changed in addition to the other cases. + (gtk_window_move_resize): include last position from configure + notify in debug spew + 2001-08-18 James Henstridge * gtk/gtkaccelgroup.c (gtk_accel_group_object_destroy): use the diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 7b3eda5f26..58dd61394f 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,10 @@ +2001-08-18 Havoc Pennington + + * gtk/gtkwindow.c (gtk_window_move_resize): constrain position on + hints_changed in addition to the other cases. + (gtk_window_move_resize): include last position from configure + notify in debug spew + 2001-08-18 James Henstridge * gtk/gtkaccelgroup.c (gtk_accel_group_object_destroy): use the diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 7b3eda5f26..58dd61394f 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,10 @@ +2001-08-18 Havoc Pennington + + * gtk/gtkwindow.c (gtk_window_move_resize): constrain position on + hints_changed in addition to the other cases. + (gtk_window_move_resize): include last position from configure + notify in debug spew + 2001-08-18 James Henstridge * gtk/gtkaccelgroup.c (gtk_accel_group_object_destroy): use the diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 7b3eda5f26..58dd61394f 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,10 @@ +2001-08-18 Havoc Pennington + + * gtk/gtkwindow.c (gtk_window_move_resize): constrain position on + hints_changed in addition to the other cases. + (gtk_window_move_resize): include last position from configure + notify in debug spew + 2001-08-18 James Henstridge * gtk/gtkaccelgroup.c (gtk_accel_group_object_destroy): use the diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 7b3eda5f26..58dd61394f 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,10 @@ +2001-08-18 Havoc Pennington + + * gtk/gtkwindow.c (gtk_window_move_resize): constrain position on + hints_changed in addition to the other cases. + (gtk_window_move_resize): include last position from configure + notify in debug spew + 2001-08-18 James Henstridge * gtk/gtkaccelgroup.c (gtk_accel_group_object_destroy): use the diff --git a/docs/reference/gtk/tmpl/gtkrc.sgml b/docs/reference/gtk/tmpl/gtkrc.sgml index cc0b23b6d2..30ffca8235 100644 --- a/docs/reference/gtk/tmpl/gtkrc.sgml +++ b/docs/reference/gtk/tmpl/gtkrc.sgml @@ -495,7 +495,6 @@ This can later be composited together with other #GtkRcStyle structures to form a #GtkStyle. -@parent_instance: @name: @bg_pixmap_name: @font_desc: diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index a708a0e1be..7b4f92ad7e 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -3514,8 +3514,15 @@ gtk_window_move_resize (GtkWindow *window) * app author is thinking. */ + /* This condition should be kept in sync with the condition later on + * that determines whether we send a configure request. i.e. we + * should do this position constraining anytime we were going to + * send a configure request anyhow, plus when constraints have + * changed. + */ if (configure_request_pos_changed || configure_request_size_changed || + hints_changed || info->position_constraints_changed) { /* We request the constrained position if: @@ -3548,36 +3555,42 @@ gtk_window_move_resize (GtkWindow *window) } #if 0 - g_print ("--- %s ---\n" - "last : %d,%d\t%d x %d\n" - "this : %d,%d\t%d x %d\n" - "alloc: %d,%d\t%d x %d\n" - "req : \t%d x %d\n" - "size_changed: %d pos_changed: %d hints_changed: %d\n" - "configure_notify_received: %d\n" - "configure_request_count: %d\n" - "position_constraints_changed: %d\n", - window->title ? window->title : "(no title)", - info->last.configure_request.x, - info->last.configure_request.y, - info->last.configure_request.width, - info->last.configure_request.height, - new_request.x, - new_request.y, - new_request.width, - new_request.height, - widget->allocation.x, - widget->allocation.y, - widget->allocation.width, - widget->allocation.height, - widget->requisition.width, - widget->requisition.height, - configure_request_pos_changed, - configure_request_size_changed, - hints_changed, - window->configure_notify_received, - window->configure_request_count, - info->position_constraints_changed); + { + int notify_x, notify_y; + + /* this is the position from the last configure notify */ + gdk_window_get_position (widget->window, ¬ify_x, ¬ify_y); + + g_print ("--- %s ---\n" + "last : %d,%d\t%d x %d\n" + "this : %d,%d\t%d x %d\n" + "alloc: %d,%d\t%d x %d\n" + "req : \t%d x %d\n" + "size_changed: %d pos_changed: %d hints_changed: %d\n" + "configure_notify_received: %d\n" + "configure_request_count: %d\n" + "position_constraints_changed: %d\n", + window->title ? window->title : "(no title)", + info->last.configure_request.x, + info->last.configure_request.y, + info->last.configure_request.width, + info->last.configure_request.height, + new_request.x, + new_request.y, + new_request.width, + new_request.height, + notify_x, notify_y, + widget->allocation.width, + widget->allocation.height, + widget->requisition.width, + widget->requisition.height, + configure_request_pos_changed, + configure_request_size_changed, + hints_changed, + window->configure_notify_received, + window->configure_request_count, + info->position_constraints_changed); + } #endif saved_last_info = info->last;