gtk+3: fix dependencies for new gnome/accessibility/at-spi2-core
[oi-userland.git] / components / desktop / gksu / patches / gksu-04-a11y.patch
blob166be201c5281186c2fb9433ed7825837c48726e
1 --- gksu-2.0.2/gksu/gksu.c-orig 2011-01-05 16:53:59.322662397 -0600
2 +++ gksu-2.0.2/gksu/gksu.c 2011-01-05 16:54:01.300784043 -0600
3 @@ -27,7 +27,7 @@
5 /* GLOBALS */
6 gboolean print_pass = FALSE;
7 -gboolean force_grab = FALSE;
8 +gboolean force_grab = TRUE;
9 gboolean prompt = FALSE;
10 gboolean elevated_privilege = TRUE;
11 gboolean elevated_role = TRUE;
12 @@ -540,6 +540,11 @@ main (int argc, char **argv)
14 int c = 0;
16 + char **gconf_argv;
17 + char *gconf_cmd;
18 + char *std_output;
19 + char *std_error;
21 setlocale (LC_ALL, "");
22 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
23 bind_textdomain_codeset (PACKAGE_NAME, "UTF-8");
24 @@ -676,8 +681,42 @@ main (int argc, char **argv)
25 g_free (myname);
28 - if (force_grab)
29 - gksu_context_set_grab (context, TRUE);
30 + /*
31 + * Disable the grab if accessibility is on, since it causes issues
32 + * for GOK, dasher and other AT programs where the user may need to interact
33 + * with other GUI programs. Note that we call gconftool-2 instead of using
34 + * GConf interfaces since it seems using GConf in gksu causes problems for
35 + * a11y if you run a program with gksu that has a GUI. The launched program
36 + * will not work with a11y if gksu uses GConf, but calling gconftool-2 works.
37 + */
38 + gconf_cmd = g_strdup ("/usr/bin/gconftool-2 --get /desktop/gnome/interface/accessibility");
39 + error = NULL;
40 + std_output = NULL;
41 + std_error = NULL;
43 + g_shell_parse_argv (gconf_cmd, NULL, &gconf_argv, &error);
45 + error = NULL;
47 + g_spawn_sync (NULL,
48 + gconf_argv,
49 + NULL,
50 + 0,
51 + NULL,
52 + NULL,
53 + &std_output,
54 + &std_error,
55 + NULL,
56 + &error);
58 + g_strchomp (std_output);
60 + if (std_output != NULL && strcmp (std_output, "true") == 0)
61 + {
62 + force_grab = FALSE;
63 + }
65 + gksu_context_set_grab (context, force_grab);
67 if (prompt)