[mutter] window: Fix meta_window_set_alive() not working if first ping fails



commit b39c00f3441c8adc7f826a3191c655d371e7b946
Author: Rui Matos <tiagomatos gmail com>
Date:   Fri May 22 15:37:31 2015 +0200

    window: Fix meta_window_set_alive() not working if first ping fails
    
    window->is_alive isn't initialized explicitly so it defaults to FALSE
    meaning that if the first ping fails we'd short circuit and not show
    the delete dialog as we should.
    
    We could initialize the variable to TRUE but in fact we don't even
    need the variable at all since our dialog management is enough to
    manage all the state we need, i.e. we're only interested in knowing
    whether we're already displaying a delete dialog.
    
    This does change our behavior here since previously we wouldn't
    display the dialog again if the next ping failed after the dialog is
    dismissed but this was arguably a bug too since in that case there
    wouldn't be a way to kill the window after waiting for a while and the
    window kept being unresponsive.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=749711

 src/core/delete.c         |    7 +------
 src/core/window-private.h |    1 -
 2 files changed, 1 insertions(+), 7 deletions(-)
---
diff --git a/src/core/delete.c b/src/core/delete.c
index 0403056..d72f8f0 100644
--- a/src/core/delete.c
+++ b/src/core/delete.c
@@ -160,12 +160,7 @@ void
 meta_window_set_alive (MetaWindow *window,
                        gboolean    is_alive)
 {
-  if (window->is_alive == is_alive)
-    return;
-
-  window->is_alive = is_alive;
-
-  if (window->is_alive)
+  if (is_alive)
     kill_delete_dialog (window);
   else
     show_delete_dialog (window, CurrentTime);
diff --git a/src/core/window-private.h b/src/core/window-private.h
index 136635c..9487dbf 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -434,7 +434,6 @@ struct _MetaWindow
 
   /* Managed by delete.c */
   int dialog_pid;
-  guint is_alive : 1;
 
   /* maintained by group.c */
   MetaGroup *group;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]