core: Drop meta_stack_windows_cmp and derived functions

Since these will not be used from now on, we can finally clean up
meta_stack_windows_cmp, window_stack_cmp and meta_display_stack_cmp.
Now the only comparison function is meta_window_stack_position_compare.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4183>
This commit is contained in:
Mattia Formichetti 2024-12-16 22:19:08 +01:00 committed by Marge Bot
parent cddfd875bc
commit 02e3eb8de8
4 changed files with 0 additions and 69 deletions

View File

@ -196,10 +196,6 @@ MetaDisplay * meta_display_new (MetaContext *context,
void meta_display_manage_all_xwindows (MetaDisplay *display);
#endif
/* Utility function to compare the stacking of two windows */
int meta_display_stack_cmp (const void *a,
const void *b);
/* Each MetaWindow is uniquely identified by a 64-bit "stamp"; unlike a
* a MetaWindow *, a stamp will never be recycled
*/

View File

@ -2383,16 +2383,6 @@ meta_display_unmanage_windows (MetaDisplay *display,
g_slist_free (winlist);
}
int
meta_display_stack_cmp (const void *a,
const void *b)
{
MetaWindow *aw = (void*) a;
MetaWindow *bw = (void*) b;
return meta_stack_windows_cmp (aw->display->stack, aw, bw);
}
/**
* meta_display_sort_windows_by_stacking:
* @display: a #MetaDisplay
@ -3552,17 +3542,6 @@ static const char* meta_window_queue_names[META_N_QUEUE_TYPES] =
};
#endif
static int
window_stack_cmp (gconstpointer a,
gconstpointer b)
{
MetaWindow *aw = (gpointer) a;
MetaWindow *bw = (gpointer) b;
return meta_stack_windows_cmp (aw->display->stack,
aw, bw);
}
static void
warn_on_incorrectly_unmanaged_window (MetaWindow *window)
{

View File

@ -942,27 +942,6 @@ meta_stack_list_windows (MetaStack *stack,
return workspace_windows;
}
int
meta_stack_windows_cmp (MetaStack *stack,
MetaWindow *window_a,
MetaWindow *window_b)
{
/* -1 means a below b */
meta_stack_ensure_sorted (stack); /* update constraints, layers */
if (window_a->layer < window_b->layer)
return -1;
else if (window_a->layer > window_b->layer)
return 1;
else if (window_a->stack_position < window_b->stack_position)
return -1;
else if (window_a->stack_position > window_b->stack_position)
return 1;
else
return 0; /* not reached */
}
void
meta_window_set_stack_position_no_sync (MetaWindow *window,
int position)

View File

@ -257,29 +257,6 @@ MetaWindow * meta_stack_get_below (MetaStack *stack,
GList * meta_stack_list_windows (MetaStack *stack,
MetaWorkspace *workspace);
/**
* meta_stack_windows_cmp:
* @stack: A stack containing both window_a and window_b
* @window_a: A window
* @window_b Another window
*
* Comparison function for windows within a stack. This is not directly
* suitable for use within a standard comparison routine, because it takes
* an extra parameter; you will need to wrap it.
*
* (FIXME: We could remove the stack parameter and use the stack of
* the screen of window A, and complain if the stack of the screen of
* window B differed; then this would be a usable general comparison function.)
*
* (FIXME: Apparently identical to compare_window_position(). Merge them.)
*
* \return -1 if window_a is below window_b, honouring layers; 1 if it's
* above it; 0 if you passed in the same window twice!
*/
int meta_stack_windows_cmp (MetaStack *stack,
MetaWindow *window_a,
MetaWindow *window_b);
/**
* meta_window_set_stack_position:
* @window: The window which is moving.