mirror of
https://github.com/brl/mutter.git
synced 2025-06-23 05:21:17 +00:00
wayland/xdg-foreign: Move out ID generation helper to util.c
It'll be used to generate ID in the same way in other places later. https://bugzilla.gnome.org/show_bug.cgi?id=784199
This commit is contained in:
@ -34,4 +34,7 @@ void meta_set_syncing (gboolean setting);
|
||||
void meta_set_replace_current_wm (gboolean setting);
|
||||
void meta_set_is_wayland_compositor (gboolean setting);
|
||||
|
||||
char * meta_generate_random_id (GRand *rand,
|
||||
int length);
|
||||
|
||||
#endif
|
||||
|
@ -994,5 +994,21 @@ meta_get_locale_direction (void)
|
||||
}
|
||||
}
|
||||
|
||||
char *
|
||||
meta_generate_random_id (GRand *rand,
|
||||
int length)
|
||||
{
|
||||
char *id;
|
||||
int i;
|
||||
|
||||
/* Generate a random string of printable ASCII characters. */
|
||||
|
||||
id = g_new0 (char, length + 1);
|
||||
for (i = 0; i < length; i++)
|
||||
id[i] = (char) g_rand_int_range (rand, 32, 127);
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
/* eof util.c */
|
||||
|
||||
|
Reference in New Issue
Block a user