summaryrefslogtreecommitdiff
path: root/src/xtoq/XtoqController.m
diff options
context:
space:
mode:
authorJess VanDerwalker <washu@sonic.net>2012-04-04 15:23:50 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2012-04-05 11:42:20 -0700
commit2eef79da24856491c7fdbbeb33ef6c867c202cdb (patch)
tree986c9f417c04e2cdbf52c6e260b16118cd9b632e /src/xtoq/XtoqController.m
parent0d196b8b47ad5980b2cd40aa648bd38ede135967 (diff)
Hard coded path to executables - was not always able to find application. xcb connection was being made before server started.
Diffstat (limited to 'src/xtoq/XtoqController.m')
-rw-r--r--src/xtoq/XtoqController.m19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/xtoq/XtoqController.m b/src/xtoq/XtoqController.m
index 3e8e4f3..e74b1bf 100644
--- a/src/xtoq/XtoqController.m
+++ b/src/xtoq/XtoqController.m
@@ -61,7 +61,7 @@
}
-- (void)applicationWillFinishLaunching:(NSNotification *)aNotification {
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// setup X connection and get the initial image from the server
rootContext = xcwm_init(screen);
@@ -160,7 +160,9 @@
xcwmDispatchQueue = dispatch_queue_create("xcwm.dispatch.queue", NULL);
-
+
+ // Start the event loop and set the handler function
+ xcwm_start_event_loop(rootContext, (void *) eventHandler);
}
- (void)applicationWillTerminate:(NSNotification *)aNotification
@@ -178,10 +180,8 @@
posix_spawn(&child, spawn[0], NULL, NULL, (char * const*)spawn, environ);
}
-- (void) applicationDidFinishLaunching: (NSNotification *) aNotification
+- (void) applicationWillFinishLaunching: (NSNotification *) aNotification
{
- // Start the event loop and set the handler function
- xcwm_start_event_loop(rootContext, (void *) eventHandler);
}
- (void) mouseMovedInApp: (NSNotification *) aNotification {
@@ -389,6 +389,7 @@
pid_t child;
const char *file_name = [filename UTF8String];
const char *newargv[6];
+ char *exec_path;
// Xman Special case
if ([filename isEqualToString:@"xman"]) {
@@ -396,7 +397,10 @@
setenv("MANPATH", manpath, 1);
}
- newargv[0] = file_name;
+ // FIXME: Doesn't seem like we should be relying on an absolute path,
+ // but just sending the executable name doesn't always work.
+ asprintf(&exec_path, "/usr/X11/bin/%s", file_name);
+ newargv[0] = exec_path;
newargv[1] = "-display";
newargv[2] = screen;
@@ -409,7 +413,8 @@
newargv[3] = NULL;
}
- status = posix_spawnp(&child, newargv[0], NULL, NULL, (char * const *) newargv, environ);
+ status = posix_spawnp(&child, newargv[0], NULL, NULL,
+ (char * const *) newargv, environ);
if(status) {
NSLog(@"Error spawning file for launch.");
}