forked from AuroraMiddleware/gtk
broadway: Make /dev/shm names nicer
This commit is contained in:
parent
da8ff82df5
commit
ada20f475d
@ -56,6 +56,9 @@ get_democodedir (void)
|
||||
|
||||
#endif
|
||||
|
||||
#undef DEMOCODEDIR
|
||||
#define DEMOCODEDIR getenv ("GTK_DEMO_DATA_DIR")
|
||||
|
||||
/**
|
||||
* demo_find_file:
|
||||
* @base: base filename
|
||||
|
@ -8,3 +8,4 @@ Send reset events on client disconnect (button up, normal state. Maybe grab stat
|
||||
rgba suport
|
||||
shift-select in gedit doesn't work
|
||||
backdrop mode
|
||||
clean up /dev/shm on abrupt client exit
|
||||
|
@ -504,9 +504,9 @@ _gdk_broadway_server_window_translate (GdkBroadwayServer *server,
|
||||
static char
|
||||
make_valid_fs_char (char c)
|
||||
{
|
||||
if (c == 0 || c == '/')
|
||||
return c + 1;
|
||||
return c;
|
||||
char chars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890";
|
||||
|
||||
return chars[c % sizeof (chars)];
|
||||
}
|
||||
|
||||
/* name must have at least space for 34 bytes */
|
||||
@ -520,7 +520,11 @@ create_random_shm (char *name)
|
||||
{
|
||||
o = 0;
|
||||
name[o++] = '/';
|
||||
for (i = 0; i < 32/4; i++)
|
||||
name[o++] = 'b';
|
||||
name[o++] = 'd';
|
||||
name[o++] = 'w';
|
||||
name[o++] = '-';
|
||||
for (i = 0; i < 32/4 - 1; i++)
|
||||
{
|
||||
r = g_random_int ();
|
||||
name[o++] = make_valid_fs_char ((r >> 0) & 0xff);
|
||||
|
Loading…
Reference in New Issue
Block a user