[metacity] screen: use stack tracker for initial window query
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] screen: use stack tracker for initial window query
- Date: Sun, 5 Mar 2017 23:39:49 +0000 (UTC)
commit 064405000ccf85f272c9b29370e1433f90e73cb6
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sun Mar 5 17:37:59 2017 +0200
screen: use stack tracker for initial window query
https://git.gnome.org/browse/mutter/commit/?id=39d26be94159f5c03ebdeeb27006f9b69f3867dd
src/core/screen.c | 37 ++++++++++++++-----------------------
1 files changed, 14 insertions(+), 23 deletions(-)
---
diff --git a/src/core/screen.c b/src/core/screen.c
index 27ea507..1ac602f 100644
--- a/src/core/screen.c
+++ b/src/core/screen.c
@@ -749,35 +749,26 @@ list_windows (MetaScreen *screen)
void
meta_screen_manage_all_windows (MetaScreen *screen)
{
- GList *windows;
- GList *list;
-
- windows = list_windows (screen);
+ Window *windows;
+ int n_windows;
+ Window *xwindows;
+ int i;
meta_stack_freeze (screen->stack);
- for (list = windows; list != NULL; list = list->next)
- {
- WindowInfo *info = list->data;
- MetaWindow *window;
+ meta_stack_tracker_get_stack (screen->stack_tracker, &windows, &n_windows);
- window = meta_window_new (screen->display, info->xwindow, TRUE,
- META_EFFECT_TYPE_NONE);
+ /* Copy the stack as it will be modified as part of the loop */
+ xwindows = g_memdup (windows, sizeof (Window) * n_windows);
- if (info->xwindow == screen->no_focus_window ||
- info->xwindow == screen->flash_window ||
- info->xwindow == screen->wm_cm_selection_window ||
- info->xwindow == screen->wm_sn_selection_window) {
- meta_verbose ("Not managing our own windows\n");
- continue;
- }
-
- meta_compositor_add_window (screen->display->compositor, window,
- info->xwindow);
+ for (i = 0; i < n_windows; i++)
+ {
+ meta_window_new (screen->display, xwindows[i], TRUE,
+ META_EFFECT_TYPE_NONE);
}
- meta_stack_thaw (screen->stack);
- g_list_foreach (windows, (GFunc)g_free, NULL);
- g_list_free (windows);
+ g_free (xwindows);
+
+ meta_stack_thaw (screen->stack);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]