core: Trace various window management actions

https://gitlab.gnome.org/GNOME/mutter/merge_requests/765
This commit is contained in:
Jonas Ådahl 2019-08-29 20:34:18 +03:00 committed by Georges Basile Stavracas Neto
parent 2f072af02b
commit 908203c735
4 changed files with 31 additions and 1 deletions

View File

@ -52,6 +52,7 @@
#include "clutter/x11/clutter-x11.h"
#include "compositor/compositor-private.h"
#include "compositor/meta-compositor-x11.h"
#include "cogl/cogl-trace.h"
#include "core/bell.h"
#include "core/boxes-private.h"
#include "core/display-private.h"
@ -1481,6 +1482,8 @@ void
meta_display_notify_window_created (MetaDisplay *display,
MetaWindow *window)
{
COGL_TRACE_BEGIN_SCOPED (MetaDisplayNotifyWindowCreated,
"Display (notify window created)");
g_signal_emit (display, display_signals[WINDOW_CREATED], 0, window);
}

View File

@ -30,6 +30,7 @@
#include "core/stack.h"
#include "backends/meta-logical-monitor.h"
#include "cogl/cogl-trace.h"
#include "core/frame.h"
#include "core/meta-workspace-manager-private.h"
#include "core/window-private.h"
@ -275,6 +276,9 @@ meta_stack_add (MetaStack *stack,
{
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
COGL_TRACE_BEGIN_SCOPED (MetaStackAdd,
"Stack (add window)");
g_return_if_fail (meta_window_is_stackable (window));
meta_topic (META_DEBUG_STACK, "Adding window %s to the stack\n", window->desc);
@ -305,6 +309,9 @@ meta_stack_remove (MetaStack *stack,
{
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
COGL_TRACE_BEGIN_SCOPED (MetaStackRemove,
"Stack (remove window)");
meta_topic (META_DEBUG_STACK, "Removing window %s from the stack\n", window->desc);
/* Set window to top position, so removing it will not leave gaps

View File

@ -67,6 +67,7 @@
#include "backends/meta-backend-private.h"
#include "backends/meta-logical-monitor.h"
#include "cogl/cogl-trace.h"
#include "core/boxes-private.h"
#include "core/constraints.h"
#include "core/core.h"
@ -947,6 +948,15 @@ meta_window_calculate_main_logical_monitor (MetaWindow *window)
&window_rect);
}
static void
meta_window_manage (MetaWindow *window)
{
COGL_TRACE_BEGIN_SCOPED (MetaWindowManage,
"Window (manage)");
META_WINDOW_GET_CLASS (window)->manage (window);
}
MetaWindow *
_meta_window_shared_new (MetaDisplay *display,
MetaWindowClientType client_type,
@ -959,6 +969,9 @@ _meta_window_shared_new (MetaDisplay *display,
MetaWorkspaceManager *workspace_manager = display->workspace_manager;
MetaWindow *window;
COGL_TRACE_BEGIN_SCOPED (MetaWindowSharedNew,
"Window (new)");
g_assert (attrs != NULL);
meta_verbose ("attrs->map_state = %d (%s)\n",
@ -1171,7 +1184,7 @@ _meta_window_shared_new (MetaDisplay *display,
window->id = meta_display_generate_window_id (display);
META_WINDOW_GET_CLASS (window)->manage (window);
meta_window_manage (window);
if (!window->override_redirect)
meta_window_update_icon_now (window, TRUE);

View File

@ -40,6 +40,7 @@
#include "backends/meta-backend-private.h"
#include "backends/meta-logical-monitor.h"
#include "cogl/cogl-trace.h"
#include "core/boxes-private.h"
#include "core/meta-workspace-manager-private.h"
#include "core/workspace-private.h"
@ -359,6 +360,9 @@ void
meta_workspace_add_window (MetaWorkspace *workspace,
MetaWindow *window)
{
COGL_TRACE_BEGIN_SCOPED (MetaWorkspaceAddWindow,
"Workspace (add window)");
g_assert (g_list_find (workspace->mru_list, window) == NULL);
workspace->mru_list = g_list_prepend (workspace->mru_list, window);
@ -380,6 +384,9 @@ void
meta_workspace_remove_window (MetaWorkspace *workspace,
MetaWindow *window)
{
COGL_TRACE_BEGIN_SCOPED (MetaWorkspaceRemoveWindow,
"Workspace (remove window)");
workspace->windows = g_list_remove (workspace->windows, window);
workspace->mru_list = g_list_remove (workspace->mru_list, window);