diff options
| author | Shokara Kou <kou@13f0.net> | 2022-11-28 20:08:48 -0500 |
|---|---|---|
| committer | Shokara Kou <kou@13f0.net> | 2022-11-28 20:08:48 -0500 |
| commit | 1a1cc45e1ba91d4c23f23e0e105b0742ec3bed17 (patch) | |
| tree | 66fde280251d4530d915dc995a2361ec4799774c /x11/gtk+3/patches/patch-gtk_gtkplacessidebar_c | |
| parent | 69e92288e8c8a42d4599da557fbaf27e3a0add5c (diff) | |
add x11/gtk+3 with hyperbola patch to remove atk as dependency
Diffstat (limited to 'x11/gtk+3/patches/patch-gtk_gtkplacessidebar_c')
| -rw-r--r-- | x11/gtk+3/patches/patch-gtk_gtkplacessidebar_c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/x11/gtk+3/patches/patch-gtk_gtkplacessidebar_c b/x11/gtk+3/patches/patch-gtk_gtkplacessidebar_c new file mode 100644 index 0000000..ce97e17 --- /dev/null +++ b/x11/gtk+3/patches/patch-gtk_gtkplacessidebar_c | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | unveil(2): check if the XDG directories exist before showing them on the sidebar | ||
| 2 | |||
| 3 | Index: gtk/gtkplacessidebar.c | ||
| 4 | --- gtk/gtkplacessidebar.c.orig | ||
| 5 | +++ gtk/gtkplacessidebar.c | ||
| 6 | @@ -657,6 +657,7 @@ add_special_dirs (GtkPlacesSidebar *sidebar) | ||
| 7 | */ | ||
| 8 | if (path == NULL || | ||
| 9 | path_is_home_dir (path) || | ||
| 10 | + !g_file_test (path, G_FILE_TEST_IS_DIR) || | ||
| 11 | g_list_find_custom (dirs, path, (GCompareFunc) g_strcmp0) != NULL) | ||
| 12 | continue; | ||
| 13 | |||
| 14 | @@ -709,7 +710,8 @@ get_desktop_directory_uri (void) | ||
| 15 | /* "To disable a directory, point it to the homedir." | ||
| 16 | * See http://freedesktop.org/wiki/Software/xdg-user-dirs | ||
| 17 | */ | ||
| 18 | - if (path_is_home_dir (name)) | ||
| 19 | + if ((name == NULL) || path_is_home_dir (name) || | ||
| 20 | + !g_file_test (name, G_FILE_TEST_IS_DIR)) | ||
| 21 | return NULL; | ||
| 22 | |||
| 23 | return g_filename_to_uri (name, NULL, NULL); | ||
| 24 | @@ -1091,6 +1093,11 @@ update_places (GtkPlacesSidebar *sidebar) | ||
| 25 | |||
| 26 | /* home folder */ | ||
| 27 | home_uri = get_home_directory_uri (); | ||
| 28 | +#if defined(__OpenBSD__) | ||
| 29 | + if (!g_file_test (home_uri, G_FILE_TEST_IS_DIR)) | ||
| 30 | + goto skip_home; | ||
| 31 | +#endif | ||
| 32 | + | ||
| 33 | start_icon = g_themed_icon_new_with_default_fallbacks (ICON_NAME_HOME); | ||
| 34 | add_place (sidebar, PLACES_BUILT_IN, | ||
| 35 | SECTION_COMPUTER, | ||
| 36 | @@ -1100,6 +1107,9 @@ update_places (GtkPlacesSidebar *sidebar) | ||
| 37 | g_object_unref (start_icon); | ||
| 38 | g_free (home_uri); | ||
| 39 | |||
| 40 | +#if defined(__OpenBSD__) | ||
| 41 | +skip_home: | ||
| 42 | +#endif | ||
| 43 | /* desktop */ | ||
| 44 | if (sidebar->show_desktop) | ||
| 45 | { | ||
