aboutsummaryrefslogtreecommitdiff
path: root/hildon/hildon-window-stack.c
diff options
context:
space:
mode:
authorAlberto Garcia <agarcia@igalia.com>2009-10-13 15:43:09 +0200
committerXabier Rodriguez Calvar <xrcalvar@igalia.com>2009-10-14 11:33:24 +0200
commitec59e26097011486873d33302aa41407ca5df224 (patch)
tree1defdd4516f1a12f104416cf89c304a4cccfc4d7 /hildon/hildon-window-stack.c
parenta04d2da9777ed49222b573861183d42139d37df4 (diff)
Make sure that HildonStackableWindow is unrealized before setting transiency and changed pop and push algorithm in hildon stackable window to just pop and push
Fixes: NB#134010 (Device not usable after opening the image from external application when image viewer contains edited and unsaved image)
Diffstat (limited to 'hildon/hildon-window-stack.c')
-rw-r--r--hildon/hildon-window-stack.c46
1 files changed, 6 insertions, 40 deletions
diff --git a/hildon/hildon-window-stack.c b/hildon/hildon-window-stack.c
index 681265d..f690cd2 100644
--- a/hildon/hildon-window-stack.c
+++ b/hildon/hildon-window-stack.c
@@ -297,6 +297,9 @@ _hildon_window_stack_do_push (HildonWindowStack *stack,
/* Make the window part of the same group as its parent */
if (parent) {
+ if (GTK_WIDGET_REALIZED (win)) {
+ gtk_widget_unrealize (GTK_WIDGET (win));
+ }
gtk_window_set_transient_for (GTK_WINDOW (win), GTK_WINDOW (parent));
} else {
gtk_window_group_add_window (stack->priv->group, GTK_WINDOW (win));
@@ -511,53 +514,16 @@ hildon_window_stack_pop_and_push_list (HildonWindowStack *stack,
GList **popped_windows,
GList *list)
{
- gint i, topmost_index;
- GList *l;
GList *popped = NULL;
- GList *pushed = NULL;
- HildonStackableWindowPrivate *priv;
g_return_if_fail (HILDON_IS_WINDOW_STACK (stack));
g_return_if_fail (nwindows > 0);
g_return_if_fail (g_list_length (stack->priv->list) >= nwindows);
- /* Store the index of the topmost window */
- priv = HILDON_STACKABLE_WINDOW_GET_PRIVATE (hildon_window_stack_peek (stack));
- topmost_index = priv->stack_position;
-
- /* Pop windows */
- for (i = 0; i < nwindows; i++) {
- GtkWidget *win = _hildon_window_stack_do_pop (stack);
- popped = g_list_prepend (popped, win);
- }
-
- /* Push windows */
- for (l = list; l != NULL; l = g_list_next (l)) {
- HildonStackableWindow *win = HILDON_STACKABLE_WINDOW (l->data);
- if (win) {
- _hildon_window_stack_do_push (stack, win);
- pushed = g_list_prepend (pushed, win);
- } else {
- g_warning ("Trying to stack a non-stackable window!");
- }
- }
-
- if (pushed != NULL) {
- /* The WM will be confused if the old topmost window and the new
- * one have the same index, so make sure that they're different */
- priv = HILDON_STACKABLE_WINDOW_GET_PRIVATE (hildon_window_stack_peek (stack));
- if (priv->stack_position == topmost_index) {
- priv->stack_position++;
- }
- }
-
- /* Show windows in reverse order (topmost first) */
- g_list_foreach (pushed, (GFunc) gtk_widget_show, NULL);
-
- /* Hide windows in reverse order (topmost last) */
- g_list_foreach (popped, (GFunc) gtk_widget_hide, NULL);
+ /* Pop windows then push new windows */
+ hildon_window_stack_pop (stack, nwindows, &popped);
+ hildon_window_stack_push_list (stack, list);
- g_list_free (pushed);
if (popped_windows) {
*popped_windows = popped;
} else {