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
This commit is contained in:
Colin Walters 2011-08-11 05:47:38 -04:00
parent ff840db708
commit b0cc778c49

View File

@ -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);