core/stack: Export meta_stack_ensure_sorted
We export stack_ensure_sorted as meta_stack_ensure_sorted; it will be needed in the next commit since the general comparison function will move to window.c Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4183>
This commit is contained in:
parent
e1cf5352a6
commit
a34b9276b4
@ -52,8 +52,6 @@ static void meta_window_set_stack_position_no_sync (MetaWindow *window,
|
|||||||
static void stack_do_relayer (MetaStack *stack);
|
static void stack_do_relayer (MetaStack *stack);
|
||||||
static void stack_do_constrain (MetaStack *stack);
|
static void stack_do_constrain (MetaStack *stack);
|
||||||
static void stack_do_resort (MetaStack *stack);
|
static void stack_do_resort (MetaStack *stack);
|
||||||
static void stack_ensure_sorted (MetaStack *stack);
|
|
||||||
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@ -180,7 +178,7 @@ meta_stack_changed (MetaStack *stack)
|
|||||||
|
|
||||||
COGL_TRACE_BEGIN_SCOPED (MetaStackChangedSort, "Meta::Stack::changed()");
|
COGL_TRACE_BEGIN_SCOPED (MetaStackChangedSort, "Meta::Stack::changed()");
|
||||||
|
|
||||||
stack_ensure_sorted (stack);
|
meta_stack_ensure_sorted (stack);
|
||||||
g_signal_emit (stack, signals[CHANGED], 0);
|
g_signal_emit (stack, signals[CHANGED], 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -274,7 +272,7 @@ meta_stack_raise (MetaStack *stack,
|
|||||||
int max_stack_position = window->stack_position;
|
int max_stack_position = window->stack_position;
|
||||||
MetaWorkspace *workspace;
|
MetaWorkspace *workspace;
|
||||||
|
|
||||||
stack_ensure_sorted (stack);
|
meta_stack_ensure_sorted (stack);
|
||||||
|
|
||||||
workspace = meta_window_get_workspace (window);
|
workspace = meta_window_get_workspace (window);
|
||||||
for (l = stack->sorted; l; l = l->next)
|
for (l = stack->sorted; l; l = l->next)
|
||||||
@ -303,7 +301,7 @@ meta_stack_lower (MetaStack *stack,
|
|||||||
int min_stack_position = window->stack_position;
|
int min_stack_position = window->stack_position;
|
||||||
MetaWorkspace *workspace;
|
MetaWorkspace *workspace;
|
||||||
|
|
||||||
stack_ensure_sorted (stack);
|
meta_stack_ensure_sorted (stack);
|
||||||
|
|
||||||
workspace = meta_window_get_workspace (window);
|
workspace = meta_window_get_workspace (window);
|
||||||
for (l = stack->sorted; l; l = l->next)
|
for (l = stack->sorted; l; l = l->next)
|
||||||
@ -835,7 +833,8 @@ stack_do_resort (MetaStack *stack)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stack_ensure_sorted:
|
* meta_stack_ensure_sorted:
|
||||||
|
* @stack: The stack to potentially sort
|
||||||
*
|
*
|
||||||
* Puts the stack into canonical form.
|
* Puts the stack into canonical form.
|
||||||
*
|
*
|
||||||
@ -845,8 +844,8 @@ stack_do_resort (MetaStack *stack)
|
|||||||
* and if it wasn't already it might have become so during all the previous
|
* and if it wasn't already it might have become so during all the previous
|
||||||
* activity).
|
* activity).
|
||||||
*/
|
*/
|
||||||
static void
|
void
|
||||||
stack_ensure_sorted (MetaStack *stack)
|
meta_stack_ensure_sorted (MetaStack *stack)
|
||||||
{
|
{
|
||||||
stack_do_relayer (stack);
|
stack_do_relayer (stack);
|
||||||
stack_do_constrain (stack);
|
stack_do_constrain (stack);
|
||||||
@ -856,7 +855,7 @@ stack_ensure_sorted (MetaStack *stack)
|
|||||||
MetaWindow *
|
MetaWindow *
|
||||||
meta_stack_get_top (MetaStack *stack)
|
meta_stack_get_top (MetaStack *stack)
|
||||||
{
|
{
|
||||||
stack_ensure_sorted (stack);
|
meta_stack_ensure_sorted (stack);
|
||||||
|
|
||||||
if (stack->sorted)
|
if (stack->sorted)
|
||||||
return stack->sorted->data;
|
return stack->sorted->data;
|
||||||
@ -872,7 +871,7 @@ meta_stack_get_above (MetaStack *stack,
|
|||||||
GList *link;
|
GList *link;
|
||||||
MetaWindow *above;
|
MetaWindow *above;
|
||||||
|
|
||||||
stack_ensure_sorted (stack);
|
meta_stack_ensure_sorted (stack);
|
||||||
|
|
||||||
link = g_list_find (stack->sorted, window);
|
link = g_list_find (stack->sorted, window);
|
||||||
if (link == NULL)
|
if (link == NULL)
|
||||||
@ -897,7 +896,7 @@ meta_stack_get_below (MetaStack *stack,
|
|||||||
GList *link;
|
GList *link;
|
||||||
MetaWindow *below;
|
MetaWindow *below;
|
||||||
|
|
||||||
stack_ensure_sorted (stack);
|
meta_stack_ensure_sorted (stack);
|
||||||
|
|
||||||
link = g_list_find (stack->sorted, window);
|
link = g_list_find (stack->sorted, window);
|
||||||
|
|
||||||
@ -922,7 +921,7 @@ meta_stack_list_windows (MetaStack *stack,
|
|||||||
GList *workspace_windows = NULL;
|
GList *workspace_windows = NULL;
|
||||||
GList *link;
|
GList *link;
|
||||||
|
|
||||||
stack_ensure_sorted (stack); /* do adds/removes */
|
meta_stack_ensure_sorted (stack); /* do adds/removes */
|
||||||
|
|
||||||
link = stack->sorted;
|
link = stack->sorted;
|
||||||
|
|
||||||
@ -950,7 +949,7 @@ meta_stack_windows_cmp (MetaStack *stack,
|
|||||||
{
|
{
|
||||||
/* -1 means a below b */
|
/* -1 means a below b */
|
||||||
|
|
||||||
stack_ensure_sorted (stack); /* update constraints, layers */
|
meta_stack_ensure_sorted (stack); /* update constraints, layers */
|
||||||
|
|
||||||
if (window_a->layer < window_b->layer)
|
if (window_a->layer < window_b->layer)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -296,3 +296,5 @@ void meta_window_set_stack_position (MetaWindow *window,
|
|||||||
|
|
||||||
void meta_stack_update_window_tile_matches (MetaStack *stack,
|
void meta_stack_update_window_tile_matches (MetaStack *stack,
|
||||||
MetaWorkspace *workspace);
|
MetaWorkspace *workspace);
|
||||||
|
|
||||||
|
void meta_stack_ensure_sorted (MetaStack *stack);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user