Files
xserver_xsdl/hw/xquartz/pbproxy/app-main.m
George Peter Staplin 7bb73a9513 XQuartz: pbproxy: Possibly fix a memory leak by using an [NSApp run] loop,
instead of calling CFRunLoopRun() directly.  The leak wasn't reproducible on
this machine, but someone was able to produce a leak trace with Instruments
that indicates it was leaking in the CFRunLoopRun() path.

x-input.m: dequeue and ignore events when pbproxy_active is false.

x-selection.h: add an is_active method that is used by x-input.m to ignore
events.

x-selection.m: Handle nearly every preference, except for primary_on_grab,
which I don't really understand yet.
(cherry picked from commit 4d51ad851e64da83cbdfb0a4a22428418a7bcf75)
2008-10-03 11:14:49 -07:00

31 lines
612 B
Objective-C

/* app-main.m
$Id: main.m,v 1.29 2007-04-07 20:39:03 jharper Exp $
Copyright (c) 2002, 2008 Apple Computer, Inc. All rights reserved. */
#include "pbproxy.h"
#import "x-selection.h"
#include <pthread.h>
#include <unistd.h> /*for getpid*/
#include <Cocoa/Cocoa.h>
static void signal_handler (int sig) {
_exit(0);
}
int main (int argc, const char *argv[]) {
printf("pid: %u\n", getpid());
x_init ();
signal (SIGINT, signal_handler);
signal (SIGTERM, signal_handler);
signal (SIGPIPE, SIG_IGN);
[NSApplication sharedApplication];
[NSApp run];
return 0;
}