Commit ec9ea401 authored by Keith Packard's avatar Keith Packard

Merge remote-tracking branch 'jeremyhu/master'

parents c6cb70be 6f29dbf5
......@@ -1110,12 +1110,7 @@ XvdiMatchPort(
while (nf--)
{
if ((pf->depth == pDraw->depth)
#if 0
&& ((pDraw->type == DRAWABLE_PIXMAP) ||
(wVisual(((WindowPtr)pDraw)) == pf->visual))
#endif
)
if (pf->depth == pDraw->depth)
return Success;
pf++;
}
......
......@@ -84,7 +84,6 @@ SOFTWARE.
#include "closedev.h"
#include "devbell.h"
#include "getbmap.h"
#include "getbmap.h"
#include "getdctl.h"
#include "getfctl.h"
#include "getfocus.h"
......@@ -93,7 +92,6 @@ SOFTWARE.
#include "getprop.h"
#include "getselev.h"
#include "getvers.h"
#include "getvers.h"
#include "grabdev.h"
#include "grabdevb.h"
#include "grabdevk.h"
......
......@@ -562,11 +562,14 @@ AC_ARG_WITH(apple-application-name,AS_HELP_STRING([--with-apple-application-name
[ APPLE_APPLICATION_NAME="${withval}" ],
[ APPLE_APPLICATION_NAME="X11" ])
AC_SUBST([APPLE_APPLICATION_NAME])
AC_ARG_WITH(launchd-id-prefix, AS_HELP_STRING([--with-launchd-id-prefix=PATH], [Prefix to use for launchd identifiers (default: org.x)]),
[ LAUNCHD_ID_PREFIX="${withval}" ],
[ LAUNCHD_ID_PREFIX="org.x" ])
AC_SUBST([LAUNCHD_ID_PREFIX])
AC_DEFINE_UNQUOTED(LAUNCHD_ID_PREFIX, "$LAUNCHD_ID_PREFIX", [Prefix to use for launchd identifiers])
AC_ARG_WITH(launchd-id-prefix, AS_HELP_STRING([--with-launchd-id-prefix=PATH], [Deprecated: Use --with-bundle-id-prefix.]),
[ BUNDLE_ID_PREFIX="${withval}" ],
[ BUNDLE_ID_PREFIX="org.x" ])
AC_ARG_WITH(bundle-id-prefix, AS_HELP_STRING([--with-bundle-id-prefix=PATH], [Prefix to use for bundle identifiers (default: org.x)]),
[ BUNDLE_ID_PREFIX="${withval}" ],
[ BUNDLE_ID_PREFIX="org.x" ])
AC_SUBST([BUNDLE_ID_PREFIX])
AC_DEFINE_UNQUOTED(BUNDLE_ID_PREFIX, "$BUNDLE_ID_PREFIX", [Prefix to use for bundle identifiers])
AC_ARG_ENABLE(sparkle,AS_HELP_STRING([--enable-sparkle], [Enable updating of X11.app using the Sparkle Framework (default: disabled)]),
[ XQUARTZ_SPARKLE="${enableval}" ],
[ XQUARTZ_SPARKLE="no" ])
......@@ -587,7 +590,7 @@ dnl GLX build options
AC_ARG_ENABLE(aiglx, AS_HELP_STRING([--enable-aiglx], [Build accelerated indirect GLX (default: enabled)]),
[AIGLX=$enableval],
[AIGLX=yes])
AX_TLS
XORG_TLS
AC_ARG_ENABLE(glx-tls, AS_HELP_STRING([--enable-glx-tls], [Build GLX with TLS support (default: auto)]),
[GLX_USE_TLS=$enableval
if test "x$GLX_USE_TLS" = "xyes" && test "${ac_cv_tls}" = "none" ; then
......
......@@ -138,7 +138,6 @@ typedef const char *string;
#include <X11/extensions/XI2.h>
#include "exglobals.h"
#include "exevents.h"
#include "exglobals.h"
#include "extnsionst.h"
#include "dixevents.h"
......
......@@ -61,7 +61,6 @@
#include <pixman.h>
#include "exglobals.h"
#include "exevents.h"
#include "exglobals.h"
#include "extnsionst.h"
#include "listdev.h" /* for sizing up DeviceClassesChangedEvent */
......
......@@ -26,6 +26,11 @@
#include "fb.h"
#ifdef __clang__
/* shift overflow is intentional */
#pragma clang diagnostic ignored "-Wshift-overflow"
#endif
/*
* Example: srcX = 13 dstX = 8 (FB unit 32 dstBpp 8)
*
......
......@@ -160,7 +160,7 @@ create_bits_picture (PicturePtr pict,
fbGetPixmapBitsData(pixmap, bits, stride, bpp);
image = pixman_image_create_bits (
pict->format,
(pixman_format_code_t)pict->format,
pixmap->drawable.width, pixmap->drawable.height,
(uint32_t *)bits, stride * sizeof (FbStride));
......
......@@ -78,11 +78,9 @@ static void init_glapi_relocs(void);
/*@{*/
#if defined(GLX_USE_TLS)
PUBLIC TLS struct _glapi_table * _glapi_tls_Dispatch
__attribute__((tls_model("initial-exec"))) = NULL;
PUBLIC TLS struct _glapi_table * _glapi_tls_Dispatch = NULL;
PUBLIC TLS void * _glapi_tls_Context
__attribute__((tls_model("initial-exec")));
PUBLIC TLS void * _glapi_tls_Context;
PUBLIC const struct _glapi_table *_glapi_Dispatch = NULL;
PUBLIC const void *_glapi_Context = NULL;
......
......@@ -83,8 +83,7 @@ typedef void (*_glapi_warning_func)(void *ctx, const char *str, ...);
const extern void *_glapi_Context;
const extern struct _glapi_table *_glapi_Dispatch;
extern TLS void * _glapi_tls_Context
__attribute__((tls_model("initial-exec")));
extern TLS void * _glapi_tls_Context;
# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_tls_Context
......
......@@ -233,8 +233,7 @@ _glthread_SetTSD(_glthread_TSD *, void *);
#if defined(GLX_USE_TLS)
extern TLS struct _glapi_table * _glapi_tls_Dispatch
__attribute__((tls_model("initial-exec")));
extern TLS struct _glapi_table * _glapi_tls_Dispatch;
#define GET_DISPATCH() _glapi_tls_Dispatch
......
......@@ -30,7 +30,6 @@
#include <X11/Xatom.h>
#include "property.h"
#include "propertyst.h"
#include "xf86DDC.h"
#include <string.h>
#define EDID1_ATOM_NAME "XFree86_DDC_EDID1_RAWDATA"
......
......@@ -63,8 +63,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "dri.h"
#include "sarea.h"
#include "dristruct.h"
#include "xf86.h"
#include "xf86drm.h"
#include "mi.h"
#include "mipointer.h"
#include "xf86_OSproc.h"
......
......@@ -58,7 +58,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "dri.h"
#include "sarea.h"
#include "dristruct.h"
#include "xf86.h"
#include "xf86drm.h"
#include "protocol-versions.h"
......
......@@ -48,7 +48,6 @@ _X_EXPORT XF86ModuleData fbdevhwModuleData = {
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
/* -------------------------------------------------------------------- */
/* our private data, and two functions to allocate/free this */
......
......@@ -31,7 +31,6 @@
#include "xf86.h"
#include "os.h"
#include "globals.h"
#include "xf86.h"
#include "xf86Priv.h"
#include "xf86DDC.h"
#include "mipointer.h"
......
......@@ -21,7 +21,6 @@ is" without express or implied warranty.
#include "regionstr.h"
#include "pixmapstr.h"
#include "scrnintstr.h"
#include "regionstr.h"
#include "gc.h"
#include "servermd.h"
#include "privates.h"
......
......@@ -507,7 +507,7 @@ bool getGlCapabilities(struct glCapabilities *cap) {
err = CGLQueryRendererInfo((GLuint)-1, &info, &numRenderers);
if(err) {
fprintf(stderr, "CGLQueryRendererInfo error: %s\n", CGLErrorString(err));
ErrorF("CGLQueryRendererInfo error: %s\n", CGLErrorString(err));
return err;
}
......@@ -518,8 +518,8 @@ bool getGlCapabilities(struct glCapabilities *cap) {
err = handleRendererDescriptions(info, r, &tmpconf);
if(err) {
fprintf(stderr, "handleRendererDescriptions returned error: %s\n", CGLErrorString(err));
fprintf(stderr, "trying to continue...\n");
ErrorF("handleRendererDescriptions returned error: %s\n", CGLErrorString(err));
ErrorF("trying to continue...\n");
continue;
}
......
......@@ -139,7 +139,6 @@
#include <glxcontext.h>
#include <glxext.h>
#include <glxutil.h>
#include <glxscreens.h>
#include <GL/internal/glcore.h>
#include "x-hash.h"
#include "x-list.h"
......
......@@ -51,7 +51,6 @@
#include <glxcontext.h>
#include <glxext.h>
#include <glxutil.h>
#include <glxscreens.h>
#include <GL/internal/glcore.h>
#include "capabilities.h"
......
......@@ -33,8 +33,7 @@ libXquartz_la_SOURCES = \
quartzCocoa.m \
quartzKeyboard.c \
quartzStartup.c \
quartzRandR.c \
threadSafety.c
quartzRandR.c
EXTRA_DIST = \
X11Application.h \
......@@ -50,5 +49,4 @@ EXTRA_DIST = \
quartzKeyboard.h \
quartzRandR.h \
sanitizedCarbon.h \
sanitizedCocoa.h \
threadSafety.h
sanitizedCocoa.h
......@@ -41,7 +41,6 @@
#include "quartz.h"
#include "darwinEvents.h"
#include "quartzKeyboard.h"
#include "quartz.h"
#include <X11/extensions/applewmconst.h>
#include "micmap.h"
#include "exglobals.h"
......@@ -237,8 +236,7 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
if ([self isActive]) {
[self deactivate];
if (!_x_active && quartzProcs->IsX11Window([e window],
[e windowNumber]))
if (!_x_active && quartzProcs->IsX11Window([e windowNumber]))
[self activateX:YES];
}
}
......@@ -980,7 +978,7 @@ static inline pthread_t create_thread(void *(*func)(void *), void *arg) {
static void *xpbproxy_x_thread(void *args) {
xpbproxy_run();
fprintf(stderr, "xpbproxy thread is terminating unexpectedly.\n");
ErrorF("xpbproxy thread is terminating unexpectedly.\n");
return NULL;
}
......@@ -1014,7 +1012,7 @@ void X11ApplicationMain (int argc, char **argv, char **envp) {
NSMaxY([[NSScreen mainScreen] visibleFrame]);
#ifdef HAVE_LIBDISPATCH
eventTranslationQueue = dispatch_queue_create(LAUNCHD_ID_PREFIX".X11.NSEventsToX11EventsQueue", NULL);
eventTranslationQueue = dispatch_queue_create(BUNDLE_ID_PREFIX".X11.NSEventsToX11EventsQueue", NULL);
assert(eventTranslationQueue != NULL);
#endif
......@@ -1023,15 +1021,15 @@ void X11ApplicationMain (int argc, char **argv, char **envp) {
last_key_layout = TISCopyCurrentKeyboardLayoutInputSource();
if(!last_key_layout)
fprintf(stderr, "X11ApplicationMain: Unable to determine TISCopyCurrentKeyboardLayoutInputSource() at startup.\n");
ErrorF("X11ApplicationMain: Unable to determine TISCopyCurrentKeyboardLayoutInputSource() at startup.\n");
#else
KLGetCurrentKeyboardLayout(&last_key_layout);
if(!last_key_layout)
fprintf(stderr, "X11ApplicationMain: Unable to determine KLGetCurrentKeyboardLayout() at startup.\n");
ErrorF("X11ApplicationMain: Unable to determine KLGetCurrentKeyboardLayout() at startup.\n");
#endif
if (!QuartsResyncKeymap(FALSE)) {
fprintf(stderr, "X11ApplicationMain: Could not build a valid keymap.\n");
ErrorF("X11ApplicationMain: Could not build a valid keymap.\n");
}
/* Tell the server thread that it can proceed */
......@@ -1372,7 +1370,7 @@ static const char *untrusted_str(NSEvent *e) {
#endif
/* Update keyInfo */
if (!QuartsResyncKeymap(TRUE)) {
fprintf(stderr, "sendX11NSEvent: Could not build a valid keymap.\n");
ErrorF("sendX11NSEvent: Could not build a valid keymap.\n");
}
}
}
......
......@@ -32,10 +32,12 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define _APPLEWMEXT_H_
#include "window.h"
#include <Xplugin.h>
typedef int (*DisableUpdateProc)(void);
typedef int (*EnableUpdateProc)(void);
typedef int (*SetWindowLevelProc)(WindowPtr pWin, int level);
#if XPLUGIN_VERSION < 4
typedef int (*FrameGetRectProc)(int type, int class, const BoxRec *outer,
const BoxRec *inner, BoxRec *ret);
typedef int (*FrameHitTestProc)(int class, int x, int y,
......@@ -45,6 +47,17 @@ typedef int (*FrameDrawProc)(WindowPtr pWin, int class, unsigned int attr,
const BoxRec *outer, const BoxRec *inner,
unsigned int title_len,
const unsigned char *title_bytes);
#else
typedef int (*FrameGetRectProc)(xp_frame_rect type, xp_frame_class class, const BoxRec *outer,
const BoxRec *inner, BoxRec *ret);
typedef int (*FrameHitTestProc)(xp_frame_class class, int x, int y,
const BoxRec *outer,
const BoxRec *inner, int *ret);
typedef int (*FrameDrawProc)(WindowPtr pWin, xp_frame_class class, xp_frame_attr attr,
const BoxRec *outer, const BoxRec *inner,
unsigned int title_len,
const unsigned char *title_bytes);
#endif
typedef int (*SendPSNProc)(uint32_t hi, uint32_t lo);
typedef int (*AttachTransientProc)(WindowPtr pWinChild, WindowPtr pWinParent);
......
......@@ -7,11 +7,11 @@
<key>CFBundleExecutable</key>
<string>X11</string>
<key>CFBundleGetInfoString</key>
<string>LAUNCHD_ID_PREFIX.X11</string>
<string>BUNDLE_ID_PREFIX.X11</string>
<key>CFBundleIconFile</key>
<string>X11.icns</string>
<key>CFBundleIdentifier</key>
<string>LAUNCHD_ID_PREFIX.X11</string>
<string>BUNDLE_ID_PREFIX.X11</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
......@@ -19,9 +19,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.6.1</string>
<string>2.7.0</string>
<key>CFBundleVersion</key>
<string>2.6.1</string>
<string>2.7.0</string>
<key>CFBundleSignature</key>
<string>x11a</string>
<key>CSResourcesFileMapped</key>
......
include cpprules.in
CPP_FILES_FLAGS = \
-DLAUNCHD_ID_PREFIX="$(LAUNCHD_ID_PREFIX)" \
-DBUNDLE_ID_PREFIX="$(BUNDLE_ID_PREFIX)" \
-DAPPLE_APPLICATION_NAME="$(APPLE_APPLICATION_NAME)"
if XQUARTZ_SPARKLE
......
......@@ -133,28 +133,12 @@ static PixmapFormatRec formats[] = {
};
const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]);
#ifndef OSNAME
#define OSNAME " Darwin"
#endif
#ifndef OSVENDOR
#define OSVENDOR ""
#endif
#ifndef PRE_RELEASE
#define PRE_RELEASE XORG_VERSION_SNAP
#endif
#ifndef BUILD_DATE
#define BUILD_DATE ""
#endif
#ifndef XORG_RELEASE
#define XORG_RELEASE "?"
#endif
void
DarwinPrintBanner(void)
{
// this should change depending on which specific server we are building
ErrorF("Xquartz starting:\n");
ErrorF("X.Org X Server %s\nBuild Date: %s\n", XSERVER_VERSION, BUILD_DATE );
ErrorF("X.Org X Server %s\n", XSERVER_VERSION);
ErrorF("Build Date: %s\n", BUILD_DATE );
}
......@@ -605,6 +589,13 @@ void OsVendorFatalError( void )
void OsVendorInit(void)
{
if (serverGeneration == 1) {
char *lf;
char *home = getenv("HOME");
assert(home);
assert(0 < asprintf(&lf, "%s/Library/Logs/X11.%s.log", home, bundle_id_prefix));
LogInit(lf, ".old");
free(lf);
DarwinPrintBanner();
#ifdef ENABLE_DEBUG_LOG
{
......
......@@ -34,8 +34,6 @@
#include <X11/extensions/XKB.h>
#include <assert.h>
#include "threadSafety.h"
#include "darwinfb.h"
// From darwin.c
......@@ -75,12 +73,15 @@ extern int darwinDesiredDepth;
extern int darwinMainScreenX;
extern int darwinMainScreenY;
// bundle-main.c
extern char *bundle_id_prefix;
#define ENABLE_DEBUG_LOG 1
#ifdef ENABLE_DEBUG_LOG
extern FILE *debug_log_fp;
#define DEBUG_LOG_NAME "x11-debug.txt"
#define DEBUG_LOG(msg, args...) if (debug_log_fp) fprintf(debug_log_fp, "%s:%s:%s:%d " msg, threadSafetyID(pthread_self()), __FILE__, __FUNCTION__, __LINE__, ##args ); fflush(debug_log_fp);
#define DEBUG_LOG(msg, args...) if (debug_log_fp) fprintf(debug_log_fp, "%s:%s:%d " msg, __FILE__, __FUNCTION__, __LINE__, ##args ); fflush(debug_log_fp);
#else
#define DEBUG_LOG(msg, args...)
#endif
......
......@@ -113,7 +113,7 @@ void darwinEvents_lock(void) {
if((err = pthread_mutex_lock(&mieq_lock))) {
ErrorF("%s:%s:%d: Failed to lock mieq_lock: %d\n",
__FILE__, __FUNCTION__, __LINE__, err);
spewCallStack();
xorg_backtrace();
}
if(darwinEvents == NULL) {
pthread_cond_wait(&mieq_ready_cond, &mieq_lock);
......@@ -126,7 +126,7 @@ void darwinEvents_unlock(void) {
if((err = pthread_mutex_unlock(&mieq_lock))) {
ErrorF("%s:%s:%d: Failed to unlock mieq_lock: %d\n",
__FILE__, __FUNCTION__, __LINE__, err);
spewCallStack();
xorg_backtrace();
}
}
......@@ -197,8 +197,6 @@ static void DarwinUpdateModifiers(
static void DarwinEventHandler(int screenNum, InternalEvent *ie, DeviceIntPtr dev) {
XQuartzEvent *e = &(ie->xquartz_event);
TA_SERVER();
switch(e->subtype) {
case kXquartzControllerNotify:
DEBUG_LOG("kXquartzControllerNotify\n");
......@@ -381,8 +379,6 @@ void ProcessInputEvents(void) {
char nullbyte;
int x = sizeof(nullbyte);
TA_SERVER();
mieqProcessInputEvents();
// Empty the signaling pipe
......
This diff is collapsed.
......@@ -69,11 +69,11 @@ int launchd_display_fd(void) {
return ERROR_FD;
}
listening_fd_array = launch_data_dict_lookup(sockets_dict, LAUNCHD_ID_PREFIX":0");
listening_fd_array = launch_data_dict_lookup(sockets_dict, BUNDLE_ID_PREFIX":0");
if (NULL == listening_fd_array) {
listening_fd_array = launch_data_dict_lookup(sockets_dict, ":0");
if (NULL == listening_fd_array) {
fprintf(stderr,"launchd check-in: No known sockets found to answer requests on! \"%s:0\" and \":0\" failed.\n", LAUNCHD_ID_PREFIX);
fprintf(stderr,"launchd check-in: No known sockets found to answer requests on! \"%s:0\" and \":0\" failed.\n", BUNDLE_ID_PREFIX);
return ERROR_FD;
}
}
......
......@@ -40,7 +40,7 @@
#include <sys/socket.h>
#include <sys/un.h>
#define kX11AppBundleId LAUNCHD_ID_PREFIX".X11"
#define kX11AppBundleId BUNDLE_ID_PREFIX".X11"
#define kX11AppBundlePath "/Contents/MacOS/X11"
static char *server_bootstrap_name = kX11AppBundleId;
......@@ -56,15 +56,6 @@ static char *server_bootstrap_name = kX11AppBundleId;
#include "launchd_fd.h"
#ifndef BUILD_DATE
#define BUILD_DATE "?"
#endif
#ifndef XSERVER_VERSION
#define XSERVER_VERSION "?"
#endif
#define DEBUG 1
static char x11_path[PATH_MAX + 1];
static pid_t x11app_pid = 0;
......@@ -197,13 +188,6 @@ int main(int argc, char **argv, char **envp) {
string_t handoff_socket_filename;
sig_t handler;
if(argc == 2 && !strcmp(argv[1], "-version")) {
fprintf(stderr, "X.org Release 7.5\n");
fprintf(stderr, "X.Org X Server %s\n", XSERVER_VERSION);
fprintf(stderr, "Build Date: %s\n", BUILD_DATE);
return EXIT_SUCCESS;
}
if(getenv("X11_PREFS_DOMAIN"))
server_bootstrap_name = getenv("X11_PREFS_DOMAIN");
......@@ -300,8 +284,8 @@ int main(int argc, char **argv, char **envp) {
/* We have fixed-size string lengths due to limitations in IPC,
* so we need to copy our argv and envp.
*/
newargv = (string_array_t)malloc(argc * sizeof(string_t));
newenvp = (string_array_t)malloc(envpc * sizeof(string_t));
newargv = (string_array_t)calloc((1 + argc), sizeof(string_t));
newenvp = (string_array_t)calloc((1 + envpc), sizeof(string_t));
if(!newargv || !newenvp) {
fprintf(stderr, "Xquartz: Memory allocation failure\n");
......
AM_CPPFLAGS=-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks \
-DLAUNCHD_ID_PREFIX=\"$(LAUNCHD_ID_PREFIX)\"
-DBUNDLE_ID_PREFIX=\"$(BUNDLE_ID_PREFIX)\"
AM_CFLAGS=$(XPBPROXY_CFLAGS)
......
......@@ -34,7 +34,7 @@
#include <unistd.h> /*for getpid*/
#include <Cocoa/Cocoa.h>
static const char *app_prefs_domain = LAUNCHD_ID_PREFIX".xpbproxy";
static const char *app_prefs_domain = BUNDLE_ID_PREFIX".xpbproxy";
CFStringRef app_prefs_domain_cfstr;
/* Stubs */
......@@ -53,12 +53,22 @@ static void signal_handler (int sig) {
}
}
void
ErrorF(const char * f, ...)
{
va_list args;
va_start(args, f);
vfprintf(stderr, f, args);
va_end(args);
}
int main (int argc, const char *argv[]) {
const char *s;
int i;
#ifdef DEBUG
printf("pid: %u\n", getpid());
ErrorF("pid: %u\n", getpid());
#endif
xpbproxy_is_standalone = YES;
......@@ -70,13 +80,13 @@ int main (int argc, const char *argv[]) {
if(strcmp (argv[i], "--prefs-domain") == 0 && i+1 < argc) {
app_prefs_domain = argv[++i];
} else if (strcmp (argv[i], "--help") == 0) {
printf("usage: xpbproxy OPTIONS\n"
ErrorF("usage: xpbproxy OPTIONS\n"
"Pasteboard proxying for X11.\n\n"
"--prefs-domain <domain> Change the domain used for reading preferences\n"
" (default: %s)\n", app_prefs_domain);
return 0;
} else {
fprintf(stderr, "usage: xpbproxy OPTIONS...\n"
ErrorF("usage: xpbproxy OPTIONS...\n"
"Try 'xpbproxy --help' for more information.\n");
return 1;
}
......
......@@ -105,7 +105,7 @@ int xpbproxy_run (void) {
}
if (xpbproxy_dpy == NULL) {
fprintf (stderr, "xpbproxy: can't open default display\n");
ErrorF("xpbproxy: can't open default display\n");
[pool release];
return EXIT_FAILURE;
}
......@@ -115,7 +115,7 @@ int xpbproxy_run (void) {
if (!XAppleWMQueryExtension (xpbproxy_dpy, &xpbproxy_apple_wm_event_base,
&xpbproxy_apple_wm_error_base)) {
fprintf (stderr, "xpbproxy: can't open AppleWM server extension\n");
ErrorF("xpbproxy: can't open AppleWM server extension\n");
[pool release];
return EXIT_FAILURE;
}
......@@ -147,19 +147,3 @@ Time xpbproxy_current_timestamp (void) {
/* FIXME: may want to fetch a timestamp from the server.. */
return CurrentTime;
}
void debug_printf (const char *fmt, ...) {
static int spew = -1;
if (spew == -1) {
char *x = getenv ("DEBUG");
spew = (x != NULL && atoi (x) != 0);
}
if (spew) {
va_list args;
va_start(args, fmt);
vfprintf (stderr, fmt, args);
va_end(args);
}
}
......@@ -77,14 +77,16 @@ extern BOOL xpbproxy_have_xfixes;
/* from x-input.m */
extern BOOL xpbproxy_input_register (void);
/* os/log.c or app-main.m */
extern void ErrorF(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2);
#ifdef DEBUG
/* BEWARE: this can cause a string memory leak, according to the leaks program. */
# define DB(msg, args...) debug_printf("%s:%s:%d " msg, __FILE__, __FUNCTION__, __LINE__, ##args)
# define DebugF(msg, args...) ErrorF("%s:%s:%d " msg, __FILE__, __FUNCTION__, __LINE__, ##args)
#else
# define DB(msg, args...) do {} while (0)
# define DebugF(...) /* */
#endif
#define TRACE() DB("TRACE\n")
extern void debug_printf (const char *fmt, ...);
#define TRACE() DebugF("TRACE\n")
#endif /* PBPROXY_H */
......@@ -87,7 +87,7 @@ static void xpbproxy_process_xevents(void) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
if(pool == nil) {
fprintf(stderr, "unable to allocate/init auto release pool!\n");
ErrorF("unable to allocate/init auto release pool!\n");
return;
}
......
This diff is collapsed.
......@@ -62,7 +62,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <IOKit/pwr_mgt/IOPMLib.h>
#include <pthread.h>
#include <libkern/OSAtomic.h>
#include <signal.h>
#include <rootlessCommon.h>
......@@ -279,10 +279,10 @@ static void pokeActivityCallback(CFRunLoopTimerRef timer, void *info) {
static void QuartzScreenSaver(int state) {
static CFRunLoopTimerRef pokeActivityTimer = NULL;
static CFRunLoopTimerContext pokeActivityContext = { 0, NULL, NULL, NULL, NULL };
static pthread_mutex_t pokeActivityMutex = PTHREAD_MUTEX_INITIALIZER;
static OSSpinLock pokeActivitySpinLock = OS_SPINLOCK_INIT;
OSSpinLockLock(&pokeActivitySpinLock);
pthread_mutex_lock(&pokeActivityMutex);
if(state) {
if(pokeActivityTimer == NULL)
goto QuartzScreenSaverEnd;
......@@ -303,7 +303,7 @@ static void QuartzScreenSaver(int state) {
CFRunLoopAddTimer(CFRunLoopGetMain(), pokeActivityTimer, kCFRunLoopCommonModes);
}
QuartzScreenSaverEnd:
pthread_mutex_unlock(&pokeActivityMutex);
OSSpinLockUnlock(&pokeActivitySpinLock);
}
void QuartzShowFullscreen(int state) {
......
......@@ -70,7 +70,7 @@ typedef void (*UpdateScreenProc)(ScreenPtr pScreen);
/*
* Rootless helper functions
*/
typedef Bool (*IsX11WindowProc)(void *nsWindow, int windowNumber);
typedef Bool (*IsX11WindowProc)(int windowNumber);
typedef void (*HideWindowsProc)(Bool hide);
/*
......
......@@ -56,8 +56,6 @@
#include "X11Application.h"
#include "threadSafety.h"
#ifdef NDEBUG
#undef NDEBUG
#include <assert.h>
......@@ -369,9 +367,9 @@ static void DarwinKeyboardSetRepeat(DeviceIntPtr pDev, int initialKeyRepeatValue
if (pDev->kbdfeed)
memcpy(pDev->kbdfeed->ctrl.autoRepeats, ctrl->per_key_repeat, XkbPerKeyBitArraySize);
//fprintf(stderr, "per_key_repeat =\n");
//ErrorF("per_key_repeat =\n");
//for(i=0; i < XkbPerKeyBitArraySize; i++)
// fprintf(stderr, "%02x%s", ctrl->per_key_repeat[i], (i + 1) & 7 ? "" : "\n");