forked from AuroraMiddleware/gtk
gdk: Add a private api to find sandboxes
This will be used in more places in the future.
This commit is contained in:
parent
83a80ab866
commit
c83441ae4a
@ -39,5 +39,6 @@ void gdk_display_set_double_click_distance (GdkDisplay *display,
|
||||
void gdk_display_set_cursor_theme (GdkDisplay *display,
|
||||
const char *theme,
|
||||
int size);
|
||||
gboolean gdk_running_in_sandbox (void);
|
||||
|
||||
#endif /* __GDK__PRIVATE_H__ */
|
||||
|
14
gdk/gdk.c
14
gdk/gdk.c
@ -216,6 +216,19 @@ gdk_display_open_default (void)
|
||||
return display;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_running_in_sandbox (void)
|
||||
{
|
||||
char *path;
|
||||
gboolean ret;
|
||||
|
||||
path = g_build_filename (g_get_user_runtime_dir (), "flatpak-info", NULL);
|
||||
ret = g_file_test (path, G_FILE_TEST_EXISTS);
|
||||
g_free (path);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* SECTION:threads
|
||||
* @Short_description: Functions for using GDK in multi-threaded programs
|
||||
@ -266,3 +279,4 @@ gdk_display_open_default (void)
|
||||
* expensive tasks from worker threads, and will handle thread
|
||||
* management for you.
|
||||
*/
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user