aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xquartz
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-02-24 18:34:17 +0000
committermarha <marha@users.sourceforge.net>2010-02-24 18:34:17 +0000
commit24bc15a386e37908396c3f6088f6fc98ceaa0f46 (patch)
treec66f27ec96c869f10ef53d73ed7dd5e5e0860605 /xorg-server/hw/xquartz
parent6f0a8e51f20073ea01ac5dae8e5c4d49076fc65e (diff)
downloadvcxsrv-24bc15a386e37908396c3f6088f6fc98ceaa0f46.tar.gz
vcxsrv-24bc15a386e37908396c3f6088f6fc98ceaa0f46.tar.bz2
vcxsrv-24bc15a386e37908396c3f6088f6fc98ceaa0f46.zip
Git update 24/2/2010"
Diffstat (limited to 'xorg-server/hw/xquartz')
-rw-r--r--xorg-server/hw/xquartz/GL/capabilities.c2
-rw-r--r--xorg-server/hw/xquartz/GL/indirect.c2
-rw-r--r--xorg-server/hw/xquartz/GL/visualConfigs.c3
-rw-r--r--xorg-server/hw/xquartz/X11Application.m18
-rw-r--r--xorg-server/hw/xquartz/darwinXinput.c6
-rw-r--r--xorg-server/hw/xquartz/mach-startup/bundle-main.c30
-rw-r--r--xorg-server/hw/xquartz/mach-startup/stub.c7
-rw-r--r--xorg-server/hw/xquartz/pbproxy/x-selection.h9
-rw-r--r--xorg-server/hw/xquartz/quartzAudio.c35
-rw-r--r--xorg-server/hw/xquartz/quartzKeyboard.c2
10 files changed, 61 insertions, 53 deletions
diff --git a/xorg-server/hw/xquartz/GL/capabilities.c b/xorg-server/hw/xquartz/GL/capabilities.c
index 43064044c..5f1f87013 100644
--- a/xorg-server/hw/xquartz/GL/capabilities.c
+++ b/xorg-server/hw/xquartz/GL/capabilities.c
@@ -522,7 +522,7 @@ bool getGlCapabilities(struct glCapabilities *cap) {
conf = malloc(sizeof(*conf));
if(NULL == conf) {
perror("malloc");
- abort();
+ OsAbort();
}
/* Copy the struct. */
diff --git a/xorg-server/hw/xquartz/GL/indirect.c b/xorg-server/hw/xquartz/GL/indirect.c
index 176282532..44380ffa0 100644
--- a/xorg-server/hw/xquartz/GL/indirect.c
+++ b/xorg-server/hw/xquartz/GL/indirect.c
@@ -548,7 +548,7 @@ static CGLPixelFormatObj makeFormat(__GLXconfig *conf) {
attr[i++] = conf->samples;
}
- attr[i++] = 0;
+ attr[i + 1] = 0;
error = CGLChoosePixelFormat(attr, &fobj, &formats);
if(error) {
diff --git a/xorg-server/hw/xquartz/GL/visualConfigs.c b/xorg-server/hw/xquartz/GL/visualConfigs.c
index f92677847..bef27f048 100644
--- a/xorg-server/hw/xquartz/GL/visualConfigs.c
+++ b/xorg-server/hw/xquartz/GL/visualConfigs.c
@@ -62,7 +62,7 @@ __GLXconfig *__glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber)
int numConfigs = 0;
__GLXconfig *visualConfigs, *c;
struct glCapabilities caps;
- struct glCapabilitiesConfig *conf = NULL;
+ struct glCapabilitiesConfig *conf;
int stereo, depth, aux, buffers, stencil, accum, color, msample;
if(getGlCapabilities(&caps)) {
@@ -94,7 +94,6 @@ __GLXconfig *__glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber)
*/
assert(NULL != caps.configurations);
- conf = caps.configurations;
numConfigs = 0;
diff --git a/xorg-server/hw/xquartz/X11Application.m b/xorg-server/hw/xquartz/X11Application.m
index f3c8a307a..3faa1cb84 100644
--- a/xorg-server/hw/xquartz/X11Application.m
+++ b/xorg-server/hw/xquartz/X11Application.m
@@ -482,7 +482,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
return out;
}
-- (CFPropertyListRef) prefs_get:(NSString *)key {
+- (CFPropertyListRef) prefs_get_copy:(NSString *)key {
CFPropertyListRef value;
value = CFPreferencesCopyAppValue ((CFStringRef) key, app_prefs_domain_cfstr);
@@ -543,7 +543,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
CFPropertyListRef value;
int ret;
- value = [self prefs_get:key];
+ value = [self prefs_get_copy:key];
if (value != NULL && CFGetTypeID (value) == CFNumberGetTypeID ())
CFNumberGetValue (value, kCFNumberIntType, &ret);
@@ -561,7 +561,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
CFPropertyListRef value;
const char *ret = NULL;
- value = [self prefs_get:key];
+ value = [self prefs_get_copy:key];
if (value != NULL && CFGetTypeID (value) == CFStringGetTypeID ()) {
NSString *s = (NSString *) value;
@@ -578,12 +578,13 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
CFPropertyListRef value;
NSURL *ret = NULL;
- value = [self prefs_get:key];
+ value = [self prefs_get_copy:key];
if (value != NULL && CFGetTypeID (value) == CFStringGetTypeID ()) {
NSString *s = (NSString *) value;
ret = [NSURL URLWithString:s];
+ [ret retain];
}
if (value != NULL) CFRelease (value);
@@ -595,7 +596,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
CFPropertyListRef value;
float ret = def;
- value = [self prefs_get:key];
+ value = [self prefs_get_copy:key];
if (value != NULL
&& CFGetTypeID (value) == CFNumberGetTypeID ()
@@ -613,7 +614,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
CFPropertyListRef value;
int ret = def;
- value = [self prefs_get:key];
+ value = [self prefs_get_copy:key];
if (value != NULL) {
if (CFGetTypeID (value) == CFNumberGetTypeID ())
@@ -637,7 +638,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
NSArray *ret = nil;
CFPropertyListRef value;
- value = [self prefs_get:key];
+ value = [self prefs_get_copy:key];
if (value != NULL) {
if (CFGetTypeID (value) == CFArrayGetTypeID ())
@@ -757,7 +758,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
NSURL *url = [self prefs_copy_url:@PREFS_UPDATE_FEED default:nil];
if(url) {
[[SUUpdater sharedUpdater] setFeedURL:url];
- CFRelease(url);
+ [url release];
}
#endif
}
@@ -970,6 +971,7 @@ void X11ApplicationMain (int argc, char **argv, char **envp) {
// [[SUUpdater sharedUpdater] checkForUpdates:X11App];
#endif
+ [pool release];
[NSApp run];
/* not reached */
}
diff --git a/xorg-server/hw/xquartz/darwinXinput.c b/xorg-server/hw/xquartz/darwinXinput.c
index 43aea6140..90e440e54 100644
--- a/xorg-server/hw/xquartz/darwinXinput.c
+++ b/xorg-server/hw/xquartz/darwinXinput.c
@@ -249,3 +249,9 @@ DeleteInputDeviceRequest(DeviceIntPtr dev)
{
DEBUG_LOG("DeleteInputDeviceRequest(%p)\n", dev);
}
+
+void
+CloseInput (void)
+{
+}
+
diff --git a/xorg-server/hw/xquartz/mach-startup/bundle-main.c b/xorg-server/hw/xquartz/mach-startup/bundle-main.c
index 0366f3ba2..4872ff59b 100644
--- a/xorg-server/hw/xquartz/mach-startup/bundle-main.c
+++ b/xorg-server/hw/xquartz/mach-startup/bundle-main.c
@@ -641,30 +641,46 @@ static int execute(const char *command) {
static char *command_from_prefs(const char *key, const char *default_value) {
char *command = NULL;
- CFStringRef cfKey = CFStringCreateWithCString(NULL, key, kCFStringEncodingASCII);
- CFPropertyListRef PlistRef = CFPreferencesCopyAppValue(cfKey, kCFPreferencesCurrentApplication);
+ CFStringRef cfKey;
+ CFPropertyListRef PlistRef;
+
+ if(!key)
+ return NULL;
+
+ cfKey = CFStringCreateWithCString(NULL, key, kCFStringEncodingASCII);
+
+ if(!cfKey)
+ return NULL;
+
+ PlistRef = CFPreferencesCopyAppValue(cfKey, kCFPreferencesCurrentApplication);
if ((PlistRef == NULL) || (CFGetTypeID(PlistRef) != CFStringGetTypeID())) {
CFStringRef cfDefaultValue = CFStringCreateWithCString(NULL, default_value, kCFStringEncodingASCII);
int len = strlen(default_value) + 1;
+ if(!cfDefaultValue)
+ goto command_from_prefs_out;
+
CFPreferencesSetAppValue(cfKey, cfDefaultValue, kCFPreferencesCurrentApplication);
CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
+ CFRelease(cfDefaultValue);
command = (char *)malloc(len * sizeof(char));
if(!command)
- return NULL;
+ goto command_from_prefs_out;
strcpy(command, default_value);
} else {
int len = CFStringGetLength((CFStringRef)PlistRef) + 1;
command = (char *)malloc(len * sizeof(char));
if(!command)
- return NULL;
+ goto command_from_prefs_out;
CFStringGetCString((CFStringRef)PlistRef, command, len, kCFStringEncodingASCII);
- }
-
+ }
+
+command_from_prefs_out:
if (PlistRef)
CFRelease(PlistRef);
-
+ if(cfKey)
+ CFRelease(cfKey);
return command;
}
diff --git a/xorg-server/hw/xquartz/mach-startup/stub.c b/xorg-server/hw/xquartz/mach-startup/stub.c
index 89f9e1058..ccf5ab426 100644
--- a/xorg-server/hw/xquartz/mach-startup/stub.c
+++ b/xorg-server/hw/xquartz/mach-startup/stub.c
@@ -73,7 +73,6 @@ static void set_x11_path(void) {
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
CFURLRef appURL = NULL;
- CFBundleRef bundle = NULL;
OSStatus osstatus = LSFindApplicationForInfo(kLSUnknownCreator, CFSTR(kX11AppBundleId), nil, nil, &appURL);
switch (osstatus) {
@@ -84,12 +83,6 @@ static void set_x11_path(void) {
exit(1);
}
- bundle = CFBundleCreate(NULL, appURL);
- if(!bundle) {
- fprintf(stderr, "Xquartz: Null value returned from CFBundleCreate().\n");
- exit(2);
- }
-
if (!CFURLGetFileSystemRepresentation(appURL, true, (unsigned char *)x11_path, sizeof(x11_path))) {
fprintf(stderr, "Xquartz: Error resolving URL for %s\n", kX11AppBundleId);
exit(3);
diff --git a/xorg-server/hw/xquartz/pbproxy/x-selection.h b/xorg-server/hw/xquartz/pbproxy/x-selection.h
index fc903d0af..614c8b091 100644
--- a/xorg-server/hw/xquartz/pbproxy/x-selection.h
+++ b/xorg-server/hw/xquartz/pbproxy/x-selection.h
@@ -58,15 +58,6 @@ struct atom_list {
/* The unmapped window we use for fetching selections. */
Window _selection_window;
- /* Last time we declared anything on the pasteboard. */
- int _my_last_change;
-
- /* Name of the selection we're proxying onto the pasteboard. */
- Atom _proxied_selection;
-
- /* When true, we're expecting a SelectionNotify event. */
- unsigned int _pending_notify :1;
-
Atom request_atom;
struct {
diff --git a/xorg-server/hw/xquartz/quartzAudio.c b/xorg-server/hw/xquartz/quartzAudio.c
index af63d18f5..708202b5b 100644
--- a/xorg-server/hw/xquartz/quartzAudio.c
+++ b/xorg-server/hw/xquartz/quartzAudio.c
@@ -62,7 +62,6 @@ typedef struct QuartzAudioRec {
UInt32 curFrame;
UInt32 remainingFrames;
UInt32 totalFrames;
- UInt32 bytesPerFrame;
double sampleRate;
UInt32 fadeLength;
@@ -117,9 +116,9 @@ static void QuartzFillBuffer(
unsigned int bufferFrameCount;
float multiplier, v;
int i;
-
+
buffer = (float *)audiobuffer->mData;
- bufferFrameCount = audiobuffer->mDataByteSize / data->bytesPerFrame;
+ bufferFrameCount = audiobuffer->mDataByteSize / (sizeof(float) * audiobuffer->mNumberChannels);
frameCount = min(bufferFrameCount, data->remainingFrames);
@@ -141,7 +140,7 @@ static void QuartzFillBuffer(
data->prevFrame = 0;
// adjust for space eaten by prev fade
- buffer += audiobuffer->mNumberChannels*frame;
+ b += audiobuffer->mNumberChannels*frame;
bufferFrameCount -= frame;
frameCount = min(bufferFrameCount, data->remainingFrames);
}
@@ -204,6 +203,8 @@ QuartzAudioIOProc(
if (wasPlaying && !data->playing) {
OSStatus err;
err = AudioDeviceStop(inDevice, QuartzAudioIOProc);
+ if(err != noErr)
+ fprintf(stderr, "Error stopping audio device: %ld\n", (long int)err);
}
pthread_mutex_unlock(&data->lock);
return 0;
@@ -262,16 +263,17 @@ void QuartzAudioInit(void)
UInt32 propertySize;
OSStatus status;
AudioDeviceID outputDevice;
- AudioStreamBasicDescription outputStreamDescription;
double sampleRate;
-
+ AudioObjectPropertyAddress devicePropertyAddress = { kAudioHardwarePropertyDefaultOutputDevice, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };
+ AudioObjectPropertyAddress sampleRatePropertyAddress = { kAudioDevicePropertyNominalSampleRate, kAudioDevicePropertyScopeOutput, kAudioObjectPropertyElementMaster };
+
// Get the default output device
propertySize = sizeof(outputDevice);
- status = AudioHardwareGetProperty(
- kAudioHardwarePropertyDefaultOutputDevice,
- &propertySize, &outputDevice);
+ status = AudioObjectGetPropertyData(kAudioObjectSystemObject, &devicePropertyAddress,
+ 0, NULL,
+ &propertySize, &outputDevice);
if (status) {
- ErrorF("QuartzAudioInit: AudioHardwareGetProperty returned %ld\n",
+ ErrorF("QuartzAudioInit: AudioObjectGetPropertyData(output device) returned %ld\n",
(long)status);
return;
}
@@ -281,23 +283,22 @@ void QuartzAudioInit(void)
}
// Get the basic device description
- propertySize = sizeof(outputStreamDescription);
- status = AudioDeviceGetProperty(outputDevice, 0, FALSE,
- kAudioDevicePropertyStreamFormat,
- &propertySize, &outputStreamDescription);
+ sampleRate = 0.;
+ propertySize = sizeof(sampleRate);
+ status = AudioObjectGetPropertyData(outputDevice, &sampleRatePropertyAddress,
+ 0, NULL,
+ &propertySize, &sampleRate);
if (status) {
- ErrorF("QuartzAudioInit: GetProperty(stream format) returned %ld\n",
+ ErrorF("QuartzAudioInit: AudioObjectGetPropertyData(sample rate) returned %ld\n",
(long)status);
return;
}
- sampleRate = outputStreamDescription.mSampleRate;
// Fill in the playback data
data.frequency = 0;
data.amplitude = 0;
data.curFrame = 0;
data.remainingFrames = 0;
- data.bytesPerFrame = outputStreamDescription.mBytesPerFrame;
data.sampleRate = sampleRate;
// data.bufferByteCount = bufferByteCount;
data.playing = FALSE;
diff --git a/xorg-server/hw/xquartz/quartzKeyboard.c b/xorg-server/hw/xquartz/quartzKeyboard.c
index 96b5fa5b6..3b4eac31c 100644
--- a/xorg-server/hw/xquartz/quartzKeyboard.c
+++ b/xorg-server/hw/xquartz/quartzKeyboard.c
@@ -368,7 +368,7 @@ void DarwinKeyboardReloadHandler(void) {
KeySymsRec keySyms;
CFIndex initialKeyRepeatValue, keyRepeatValue;
BOOL ok;
- DeviceIntPtr pDev = darwinKeyboard;
+ DeviceIntPtr pDev;
const char *xmodmap = PROJECTROOT "/bin/xmodmap";
const char *sysmodmap = PROJECTROOT "/lib/X11/xinit/.Xmodmap";
const char *homedir = getenv("HOME");