Commit f67241c5 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Fix bug where if CENTER_ON_PARENT was set, but there was no parent,

Wed Jun 12 17:13:13 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkwindow.c (gtk_window_move_resize): Fix bug
        where if CENTER_ON_PARENT was set, but there was
        no parent, GDK_HINT_POS would be set, resulting
        in a dialog at 0,0. (#83479, Havoc Pennington)
parent a01645c8
Wed Jun 12 17:13:13 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Fix bug
where if CENTER_ON_PARENT was set, but there was
no parent, GDK_HINT_POS would be set, resulting
in a dialog at 0,0. (#83479, Havoc Pennington)
Wed Jun 12 16:34:13 2002 Owen Taylor <otaylor@redhat.com> Wed Jun 12 16:34:13 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenubar.c: When fetching the menubars for * gtk/gtkmenubar.c: When fetching the menubars for
......
Wed Jun 12 17:13:13 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Fix bug
where if CENTER_ON_PARENT was set, but there was
no parent, GDK_HINT_POS would be set, resulting
in a dialog at 0,0. (#83479, Havoc Pennington)
Wed Jun 12 16:34:13 2002 Owen Taylor <otaylor@redhat.com> Wed Jun 12 16:34:13 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenubar.c: When fetching the menubars for * gtk/gtkmenubar.c: When fetching the menubars for
......
Wed Jun 12 17:13:13 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Fix bug
where if CENTER_ON_PARENT was set, but there was
no parent, GDK_HINT_POS would be set, resulting
in a dialog at 0,0. (#83479, Havoc Pennington)
Wed Jun 12 16:34:13 2002 Owen Taylor <otaylor@redhat.com> Wed Jun 12 16:34:13 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenubar.c: When fetching the menubars for * gtk/gtkmenubar.c: When fetching the menubars for
......
Wed Jun 12 17:13:13 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Fix bug
where if CENTER_ON_PARENT was set, but there was
no parent, GDK_HINT_POS would be set, resulting
in a dialog at 0,0. (#83479, Havoc Pennington)
Wed Jun 12 16:34:13 2002 Owen Taylor <otaylor@redhat.com> Wed Jun 12 16:34:13 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenubar.c: When fetching the menubars for * gtk/gtkmenubar.c: When fetching the menubars for
......
Wed Jun 12 17:13:13 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Fix bug
where if CENTER_ON_PARENT was set, but there was
no parent, GDK_HINT_POS would be set, resulting
in a dialog at 0,0. (#83479, Havoc Pennington)
Wed Jun 12 16:34:13 2002 Owen Taylor <otaylor@redhat.com> Wed Jun 12 16:34:13 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenubar.c: When fetching the menubars for * gtk/gtkmenubar.c: When fetching the menubars for
......
Wed Jun 12 17:13:13 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Fix bug
where if CENTER_ON_PARENT was set, but there was
no parent, GDK_HINT_POS would be set, resulting
in a dialog at 0,0. (#83479, Havoc Pennington)
Wed Jun 12 16:34:13 2002 Owen Taylor <otaylor@redhat.com> Wed Jun 12 16:34:13 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenubar.c: When fetching the menubars for * gtk/gtkmenubar.c: When fetching the menubars for
......
...@@ -4092,6 +4092,18 @@ gtk_window_compute_configure_request_size (GtkWindow *window, ...@@ -4092,6 +4092,18 @@ gtk_window_compute_configure_request_size (GtkWindow *window,
} }
} }
static GtkWindowPosition
get_effective_position (GtkWindow *window)
{
GtkWindowPosition pos = window->position;
if (pos == GTK_WIN_POS_CENTER_ON_PARENT &&
(window->transient_parent == NULL ||
!GTK_WIDGET_MAPPED (window->transient_parent)))
pos = GTK_WIN_POS_NONE;
return pos;
}
static void static void
gtk_window_compute_configure_request (GtkWindow *window, gtk_window_compute_configure_request (GtkWindow *window,
GdkRectangle *request, GdkRectangle *request,
...@@ -4120,12 +4132,7 @@ gtk_window_compute_configure_request (GtkWindow *window, ...@@ -4120,12 +4132,7 @@ gtk_window_compute_configure_request (GtkWindow *window,
parent_widget = (GtkWidget*) window->transient_parent; parent_widget = (GtkWidget*) window->transient_parent;
pos = window->position; pos = get_effective_position (window);
if (pos == GTK_WIN_POS_CENTER_ON_PARENT &&
(parent_widget == NULL ||
!GTK_WIDGET_MAPPED (parent_widget)))
pos = GTK_WIN_POS_NONE;
info = gtk_window_get_geometry_info (window, TRUE); info = gtk_window_get_geometry_info (window, TRUE);
/* by default, don't change position requested */ /* by default, don't change position requested */
...@@ -4452,7 +4459,7 @@ gtk_window_move_resize (GtkWindow *window) ...@@ -4452,7 +4459,7 @@ gtk_window_move_resize (GtkWindow *window)
if ((configure_request_pos_changed || if ((configure_request_pos_changed ||
info->initial_pos_set || info->initial_pos_set ||
(window->need_default_position && (window->need_default_position &&
window->position != GTK_WIN_POS_NONE)) && get_effective_position (window) != GTK_WIN_POS_NONE)) &&
(new_flags & GDK_HINT_POS) == 0) (new_flags & GDK_HINT_POS) == 0)
{ {
new_flags |= GDK_HINT_POS; new_flags |= GDK_HINT_POS;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment