After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 595882 - Add meta_window_get_stable_sequence
Add meta_window_get_stable_sequence
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks: 582654
 
 
Reported: 2009-09-21 21:45 UTC by Colin Walters
Modified: 2009-09-22 16:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add meta_window_get_stable_sequence (3.38 KB, patch)
2009-09-21 21:45 UTC, Colin Walters
committed Details | Review

Description Colin Walters 2009-09-21 21:45:47 UTC
Useful for plugins which want to order windows in a stable
fashion.
Comment 1 Colin Walters 2009-09-21 21:45:48 UTC
Created attachment 143642 [details] [review]
Add meta_window_get_stable_sequence
Comment 2 Owen Taylor 2009-09-22 14:33:05 UTC
Review of attachment 143642 [details] [review]:

Hmm, it feels to me that there should be something already existing that can be used for this, but I can't think of what, so I'm fine with the addition. OK to commit with a few small tweaks noted below.

::: src/core/window.c
@@ +806,3 @@
+   * for sorting.
+   */
+  window->stable_sequence = display->window_sequence_counter++;

Suggest ++<...> so that the first window gets 1 not 0, which is more confusable with an uninitialized value.

@@ +8544,3 @@
+ *
+ * This number can be useful for sorting windows in a stable
+ * fashion/

'/' instead of '.' Should have a '@window: a #MetaWindow' and 'Return value: the sequence number for this window'

@@ +8549,3 @@
+meta_window_get_stable_sequence (MetaWindow *window)
+{
+  return window->stable_sequence;

Should have a g_return_val_if_fail
Comment 3 Colin Walters 2009-09-22 16:43:50 UTC
Attachment 143642 [details] pushed as d399141 - Add meta_window_get_stable_sequence