Merge lp:~mterry/unity-greeter/close-orca into lp:unity-greeter

Proposed by Michael Terry
Status: Merged
Approved by: Robert Ancell
Approved revision: 616
Merged at revision: 685
Proposed branch: lp:~mterry/unity-greeter/close-orca
Merge into: lp:unity-greeter
Diff against target: 78 lines (+34/-18)
1 file modified
src/menubar.vala (+34/-18)
To merge this branch: bzr merge lp:~mterry/unity-greeter/close-orca
Reviewer Review Type Date Requested Status
Unity Greeter Development Team Pending
Review via email: mp+128541@code.launchpad.net

Description of the change

During quantal, orca dropped the --quit argument. So without this patch, we actually launch orca a second time when the user tries to stop the screen reader (with splash and main window and everything). Very bad experience.

To post a comment you must log in.
Revision history for this message
Robert Ancell (robert-ancell) wrote :

I for one am opposed to "very bad experiences". So I support this patch!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/menubar.vala'
--- src/menubar.vala 2012-10-03 14:30:19 +0000
+++ src/menubar.vala 2012-10-08 16:26:20 +0000
@@ -132,6 +132,7 @@
132 private Gtk.CheckMenuItem high_contrast_item;132 private Gtk.CheckMenuItem high_contrast_item;
133 private Gtk.Label keyboard_label = null;133 private Gtk.Label keyboard_label = null;
134 private Pid keyboard_pid = 0;134 private Pid keyboard_pid = 0;
135 private Pid reader_pid = 0;
135 private Gtk.CheckMenuItem onscreen_keyboard_item;136 private Gtk.CheckMenuItem onscreen_keyboard_item;
136137
137 construct138 construct
@@ -170,15 +171,21 @@
170 UnityGreeter.singleton.starting_session.connect (cleanup);171 UnityGreeter.singleton.starting_session.connect (cleanup);
171 }172 }
172173
174 private void close_pid (ref Pid pid)
175 {
176 if (pid != 0)
177 {
178 Posix.kill (pid, Posix.SIGTERM);
179 int status;
180 Posix.waitpid (pid, out status, 0);
181 pid = 0;
182 }
183 }
184
173 public void cleanup ()185 public void cleanup ()
174 {186 {
175 if (keyboard_pid != 0)187 close_pid (ref keyboard_pid);
176 {188 close_pid (ref reader_pid);
177 Posix.kill (keyboard_pid, Posix.SIGTERM);
178 int status;
179 Posix.waitpid (keyboard_pid, out status, 0);
180 keyboard_pid = 0;
181 }
182 }189 }
183190
184 public override void get_preferred_height (out int min, out int nat)191 public override void get_preferred_height (out int min, out int nat)
@@ -468,17 +475,26 @@
468 UGSettings.set_boolean (UGSettings.KEY_SCREEN_READER, item.active);475 UGSettings.set_boolean (UGSettings.KEY_SCREEN_READER, item.active);
469476
470 /* Hardcoded orca: */477 /* Hardcoded orca: */
471 try478 if (item.active)
472 {479 {
473 if (item.active)480 try
474 Process.spawn_command_line_async ("orca --replace --no-setup --disable splash-window,main-window");481 {
475 else482 string[] argv;
476 Process.spawn_command_line_async ("orca --quit");483 Shell.parse_argv ("orca --replace --no-setup --disable splash-window,main-window", out argv);
477 }484 Process.spawn_async (null,
478 catch (Error e)485 argv,
479 {486 null,
480 warning ("Failed to run Orca: %s", e.message);487 SpawnFlags.SEARCH_PATH,
481 }488 null,
489 out reader_pid);
490 }
491 catch (Error e)
492 {
493 warning ("Failed to run Orca: %s", e.message);
494 }
495 }
496 else
497 close_pid (ref reader_pid);
482 }498 }
483499
484 private uint get_indicator_index (Indicator.Object object)500 private uint get_indicator_index (Indicator.Object object)

Subscribers

People subscribed via source and target branches