[gnome-shell] ShellApp: Use stable sequence for id, not pointer address



commit b0cc778c49fe7d0829b46e4236053d407a2a597c
Author: Colin Walters <walters verbum org>
Date:   Thu Aug 11 05:47:38 2011 -0400

    ShellApp: Use stable sequence for id, not pointer address
    
    As danw points out,
    
      "It's unique during the lifetime of the window, but reasonably likely to be
      reused by another window after this one is destroyed. Using
      meta_window_get_stable_sequence() might be better."
    
    https://bugzilla.gnome.org/show_bug.cgi?id=648149

 src/shell-app.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/src/shell-app.c b/src/shell-app.c
index b6ff31b..1ff9894 100644
--- a/src/shell-app.c
+++ b/src/shell-app.c
@@ -777,11 +777,7 @@ _shell_app_new_for_window (MetaWindow      *window)
 
   app = g_object_new (SHELL_TYPE_APP, NULL);
 
-  /* For windows, its id is simply its pointer address as a string.
-   * There are various other alternatives, but the address is unique
-   * and unchanging, which is pretty much the best we can do.
-   */
-  app->window_id_string = g_strdup_printf ("window:%p", window);
+  app->window_id_string = g_strdup_printf ("window:%d", meta_window_get_stable_sequence (window));
 
   _shell_app_add_window (app, window);
 



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