[mutter] display: Optionally sort window list
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] display: Optionally sort window list
- Date: Mon, 29 Sep 2014 22:24:42 +0000 (UTC)
commit 9f8b6414721a94856000553313bcb247de18378b
Author: Florian Müllner <fmuellner gnome org>
Date: Tue Sep 30 00:01:17 2014 +0200
display: Optionally sort window list
https://bugzilla.gnome.org/show_bug.cgi?id=737581
src/core/display-private.h | 1 +
src/core/display.c | 6 ++++++
2 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/core/display-private.h b/src/core/display-private.h
index 1c8e225..a4c7959 100644
--- a/src/core/display-private.h
+++ b/src/core/display-private.h
@@ -57,6 +57,7 @@ typedef struct MetaEdgeResistanceData MetaEdgeResistanceData;
typedef enum {
META_LIST_DEFAULT = 0, /* normal windows */
META_LIST_INCLUDE_OVERRIDE_REDIRECT = 1 << 0, /* normal and O-R */
+ META_LIST_SORTED = 1 << 1, /* sort list by mru */
} MetaListWindowsFlags;
#define _NET_WM_STATE_REMOVE 0 /* remove/unset property */
diff --git a/src/core/display.c b/src/core/display.c
index 79720ed..57423ee 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -150,6 +150,9 @@ static void update_cursor_theme (void);
static void prefs_changed_callback (MetaPreference pref,
void *data);
+static int mru_cmp (gconstpointer a,
+ gconstpointer b);
+
static void
meta_display_get_property(GObject *object,
guint prop_id,
@@ -1061,6 +1064,9 @@ meta_display_list_windows (MetaDisplay *display,
tmp = next;
}
+ if (flags & META_LIST_SORTED)
+ winlist = g_slist_sort (winlist, mru_cmp);
+
return winlist;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]