Merge remote branch 'jeremyhu/master'
This commit is contained in:
commit
b29220dc76
|
@ -120,7 +120,7 @@
|
||||||
/* Tiger PPC doesn't have the associated symbols, but glext.h says it does. Liars!
|
/* Tiger PPC doesn't have the associated symbols, but glext.h says it does. Liars!
|
||||||
* http://trac.macports.org/ticket/20638
|
* http://trac.macports.org/ticket/20638
|
||||||
*/
|
*/
|
||||||
#if defined(__ppc__) && MAC_OS_X_VERSION_MIN_REQUIRED == 1040
|
#if defined(__ppc__) && MAC_OS_X_VERSION_MIN_REQUIRED < 1050
|
||||||
#undef GL_EXT_gpu_program_parameters
|
#undef GL_EXT_gpu_program_parameters
|
||||||
#define GL_EXT_gpu_program_parameters 0
|
#define GL_EXT_gpu_program_parameters 0
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
#include <Xplugin.h>
|
#include <Xplugin.h>
|
||||||
|
|
||||||
// pbproxy/pbproxy.h
|
// pbproxy/pbproxy.h
|
||||||
extern BOOL xpbproxy_init (void);
|
extern int xpbproxy_run (void);
|
||||||
|
|
||||||
#define DEFAULTS_FILE X11LIBDIR"/X11/xserver/Xquartz.plist"
|
#define DEFAULTS_FILE X11LIBDIR"/X11/xserver/Xquartz.plist"
|
||||||
|
|
||||||
|
@ -908,6 +908,26 @@ environment the next time you start X11?", @"Startup xinitrc dialog");
|
||||||
[X11App prefs_synchronize];
|
[X11App prefs_synchronize];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline pthread_t create_thread(void *func, void *arg) {
|
||||||
|
pthread_attr_t attr;
|
||||||
|
pthread_t tid;
|
||||||
|
|
||||||
|
pthread_attr_init(&attr);
|
||||||
|
pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
|
||||||
|
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
|
||||||
|
pthread_create(&tid, &attr, func, arg);
|
||||||
|
pthread_attr_destroy(&attr);
|
||||||
|
|
||||||
|
return tid;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void *xpbproxy_x_thread(void *args) {
|
||||||
|
xpbproxy_run();
|
||||||
|
|
||||||
|
fprintf(stderr, "xpbproxy thread is terminating unexpectedly.\n");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
void X11ApplicationMain (int argc, char **argv, char **envp) {
|
void X11ApplicationMain (int argc, char **argv, char **envp) {
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
|
|
||||||
|
@ -962,8 +982,7 @@ void X11ApplicationMain (int argc, char **argv, char **envp) {
|
||||||
*/
|
*/
|
||||||
check_xinitrc();
|
check_xinitrc();
|
||||||
|
|
||||||
if(!xpbproxy_init())
|
create_thread(xpbproxy_x_thread, NULL);
|
||||||
fprintf(stderr, "Error initializing xpbproxy\n");
|
|
||||||
|
|
||||||
#if XQUARTZ_SPARKLE
|
#if XQUARTZ_SPARKLE
|
||||||
[[X11App controller] setup_sparkle];
|
[[X11App controller] setup_sparkle];
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
AM_CPPFLAGS=-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks
|
AM_CPPFLAGS=-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks \
|
||||||
AM_CFLAGS=$(XPBPROXY_CFLAGS)
|
-DLAUNCHD_ID_PREFIX=\"$(LAUNCHD_ID_PREFIX)\"
|
||||||
|
|
||||||
|
AM_CFLAGS=$(XPBPROXY_CFLAGS)
|
||||||
|
|
||||||
noinst_LTLIBRARIES = libxpbproxy.la
|
noinst_LTLIBRARIES = libxpbproxy.la
|
||||||
libxpbproxy_la_SOURCES = \
|
libxpbproxy_la_SOURCES = \
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#include <unistd.h> /*for getpid*/
|
#include <unistd.h> /*for getpid*/
|
||||||
#include <Cocoa/Cocoa.h>
|
#include <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
static const char *app_prefs_domain = "org.x.X11";
|
static const char *app_prefs_domain = LAUNCHD_ID_PREFIX".xpbproxy";
|
||||||
CFStringRef app_prefs_domain_cfstr;
|
CFStringRef app_prefs_domain_cfstr;
|
||||||
|
|
||||||
/* Stubs */
|
/* Stubs */
|
||||||
|
@ -73,7 +73,7 @@ int main (int argc, const char *argv[]) {
|
||||||
printf("usage: xpbproxy OPTIONS\n"
|
printf("usage: xpbproxy OPTIONS\n"
|
||||||
"Pasteboard proxying for X11.\n\n"
|
"Pasteboard proxying for X11.\n\n"
|
||||||
"--prefs-domain <domain> Change the domain used for reading preferences\n"
|
"--prefs-domain <domain> Change the domain used for reading preferences\n"
|
||||||
" (default: org.x.X11)\n");
|
" (default: %s)\n", app_prefs_domain);
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "usage: xpbproxy OPTIONS...\n"
|
fprintf(stderr, "usage: xpbproxy OPTIONS...\n"
|
||||||
|
@ -84,16 +84,10 @@ int main (int argc, const char *argv[]) {
|
||||||
|
|
||||||
app_prefs_domain_cfstr = CFStringCreateWithCString(NULL, app_prefs_domain, kCFStringEncodingUTF8);
|
app_prefs_domain_cfstr = CFStringCreateWithCString(NULL, app_prefs_domain, kCFStringEncodingUTF8);
|
||||||
|
|
||||||
if(!xpbproxy_init())
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
|
|
||||||
signal (SIGINT, signal_handler);
|
signal (SIGINT, signal_handler);
|
||||||
signal (SIGTERM, signal_handler);
|
signal (SIGTERM, signal_handler);
|
||||||
signal (SIGHUP, signal_handler);
|
signal (SIGHUP, signal_handler);
|
||||||
signal (SIGPIPE, SIG_IGN);
|
signal (SIGPIPE, SIG_IGN);
|
||||||
|
|
||||||
[NSApplication sharedApplication];
|
return xpbproxy_run();
|
||||||
[NSApp run];
|
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,25 +82,12 @@ static int x_error_handler (Display *dpy, XErrorEvent *errevent) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline pthread_t create_thread(void *func, void *arg) {
|
int xpbproxy_run (void) {
|
||||||
pthread_attr_t attr;
|
|
||||||
pthread_t tid;
|
|
||||||
|
|
||||||
pthread_attr_init(&attr);
|
|
||||||
pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
|
|
||||||
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
|
|
||||||
pthread_create(&tid, &attr, func, arg);
|
|
||||||
pthread_attr_destroy(&attr);
|
|
||||||
|
|
||||||
return tid;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void *xpbproxy_x_thread(void *args) {
|
|
||||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
wait_for_server_init();
|
wait_for_server_init();
|
||||||
|
|
||||||
for(i=0, xpbproxy_dpy=NULL; !xpbproxy_dpy && i<5; i++) {
|
for(i=0, xpbproxy_dpy=NULL; !xpbproxy_dpy && i<5; i++) {
|
||||||
xpbproxy_dpy = XOpenDisplay(NULL);
|
xpbproxy_dpy = XOpenDisplay(NULL);
|
||||||
|
|
||||||
|
@ -108,7 +95,7 @@ static void *xpbproxy_x_thread(void *args) {
|
||||||
char _display[32];
|
char _display[32];
|
||||||
snprintf(_display, sizeof(_display), ":%s", display);
|
snprintf(_display, sizeof(_display), ":%s", display);
|
||||||
setenv("DISPLAY", _display, TRUE);
|
setenv("DISPLAY", _display, TRUE);
|
||||||
|
|
||||||
xpbproxy_dpy=XOpenDisplay(_display);
|
xpbproxy_dpy=XOpenDisplay(_display);
|
||||||
}
|
}
|
||||||
if(!xpbproxy_dpy)
|
if(!xpbproxy_dpy)
|
||||||
|
@ -118,7 +105,7 @@ static void *xpbproxy_x_thread(void *args) {
|
||||||
if (xpbproxy_dpy == NULL) {
|
if (xpbproxy_dpy == NULL) {
|
||||||
fprintf (stderr, "xpbproxy: can't open default display\n");
|
fprintf (stderr, "xpbproxy: can't open default display\n");
|
||||||
[pool release];
|
[pool release];
|
||||||
return NULL;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
XSetIOErrorHandler (x_io_error_handler);
|
XSetIOErrorHandler (x_io_error_handler);
|
||||||
|
@ -128,11 +115,11 @@ static void *xpbproxy_x_thread(void *args) {
|
||||||
&xpbproxy_apple_wm_error_base)) {
|
&xpbproxy_apple_wm_error_base)) {
|
||||||
fprintf (stderr, "xpbproxy: can't open AppleWM server extension\n");
|
fprintf (stderr, "xpbproxy: can't open AppleWM server extension\n");
|
||||||
[pool release];
|
[pool release];
|
||||||
return NULL;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
xpbproxy_have_xfixes = XFixesQueryExtension(xpbproxy_dpy, &xpbproxy_xfixes_event_base, &xpbproxy_xfixes_error_base);
|
xpbproxy_have_xfixes = XFixesQueryExtension(xpbproxy_dpy, &xpbproxy_xfixes_event_base, &xpbproxy_xfixes_error_base);
|
||||||
|
|
||||||
XAppleWMSelectInput (xpbproxy_dpy, AppleWMActivationNotifyMask |
|
XAppleWMSelectInput (xpbproxy_dpy, AppleWMActivationNotifyMask |
|
||||||
AppleWMPasteboardNotifyMask);
|
AppleWMPasteboardNotifyMask);
|
||||||
|
|
||||||
|
@ -140,18 +127,14 @@ static void *xpbproxy_x_thread(void *args) {
|
||||||
|
|
||||||
if(!xpbproxy_input_register()) {
|
if(!xpbproxy_input_register()) {
|
||||||
[pool release];
|
[pool release];
|
||||||
return NULL;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
[pool release];
|
[pool release];
|
||||||
|
|
||||||
xpbproxy_input_loop();
|
CFRunLoopRun();
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL xpbproxy_init (void) {
|
return EXIT_SUCCESS;
|
||||||
create_thread(xpbproxy_x_thread, NULL);
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
id xpbproxy_selection_object (void) {
|
id xpbproxy_selection_object (void) {
|
||||||
|
|
|
@ -67,7 +67,7 @@ extern void xpbproxy_set_is_active (BOOL state);
|
||||||
extern BOOL xpbproxy_get_is_active (void);
|
extern BOOL xpbproxy_get_is_active (void);
|
||||||
extern id xpbproxy_selection_object (void);
|
extern id xpbproxy_selection_object (void);
|
||||||
extern Time xpbproxy_current_timestamp (void);
|
extern Time xpbproxy_current_timestamp (void);
|
||||||
extern BOOL xpbproxy_init (void);
|
extern int xpbproxy_run (void);
|
||||||
|
|
||||||
extern Display *xpbproxy_dpy;
|
extern Display *xpbproxy_dpy;
|
||||||
extern int xpbproxy_apple_wm_event_base, xpbproxy_apple_wm_error_base;
|
extern int xpbproxy_apple_wm_event_base, xpbproxy_apple_wm_error_base;
|
||||||
|
@ -76,7 +76,6 @@ extern BOOL xpbproxy_have_xfixes;
|
||||||
|
|
||||||
/* from x-input.m */
|
/* from x-input.m */
|
||||||
extern BOOL xpbproxy_input_register (void);
|
extern BOOL xpbproxy_input_register (void);
|
||||||
extern void xpbproxy_input_loop();
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
/* BEWARE: this can cause a string memory leak, according to the leaks program. */
|
/* BEWARE: this can cause a string memory leak, according to the leaks program. */
|
||||||
|
|
|
@ -39,17 +39,12 @@
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <pthread.h>
|
|
||||||
|
|
||||||
static CFRunLoopSourceRef xpbproxy_dpy_source;
|
static CFRunLoopSourceRef xpbproxy_dpy_source;
|
||||||
|
|
||||||
#ifdef STANDALONE_XPBPROXY
|
#ifdef STANDALONE_XPBPROXY
|
||||||
BOOL xpbproxy_prefs_reload = NO;
|
BOOL xpbproxy_prefs_reload = NO;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static pthread_mutex_t xpbproxy_dpy_rdy_lock = PTHREAD_MUTEX_INITIALIZER;
|
|
||||||
static pthread_cond_t xpbproxy_dpy_rdy_cond = PTHREAD_COND_INITIALIZER;
|
|
||||||
|
|
||||||
/* Timestamp when the X server last told us it's active */
|
/* Timestamp when the X server last told us it's active */
|
||||||
static Time last_activation_time;
|
static Time last_activation_time;
|
||||||
|
|
||||||
|
@ -88,58 +83,51 @@ static void x_event_apple_wm_notify(XAppleWMNotifyEvent *e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void xpbproxy_input_loop() {
|
static void xpbproxy_process_xevents(void) {
|
||||||
pthread_mutex_lock(&xpbproxy_dpy_rdy_lock);
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||||
while(true) {
|
|
||||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
if(pool == nil) {
|
||||||
|
fprintf(stderr, "unable to allocate/init auto release pool!\n");
|
||||||
if(pool == nil) {
|
return;
|
||||||
fprintf(stderr, "unable to allocate/init auto release pool!\n");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (XPending(xpbproxy_dpy) != 0) {
|
|
||||||
XEvent e;
|
|
||||||
|
|
||||||
pthread_mutex_unlock(&xpbproxy_dpy_rdy_lock);
|
|
||||||
XNextEvent (xpbproxy_dpy, &e);
|
|
||||||
|
|
||||||
switch (e.type) {
|
|
||||||
case SelectionClear:
|
|
||||||
if([xpbproxy_selection_object() is_active])
|
|
||||||
[xpbproxy_selection_object () clear_event:&e.xselectionclear];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SelectionRequest:
|
|
||||||
[xpbproxy_selection_object () request_event:&e.xselectionrequest];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SelectionNotify:
|
|
||||||
[xpbproxy_selection_object () notify_event:&e.xselection];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PropertyNotify:
|
|
||||||
[xpbproxy_selection_object () property_event:&e.xproperty];
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
if(e.type >= xpbproxy_apple_wm_event_base &&
|
|
||||||
e.type < xpbproxy_apple_wm_event_base + AppleWMNumberEvents) {
|
|
||||||
x_event_apple_wm_notify((XAppleWMNotifyEvent *) &e);
|
|
||||||
} else if(e.type == xpbproxy_xfixes_event_base + XFixesSelectionNotify) {
|
|
||||||
[xpbproxy_selection_object() xfixes_selection_notify:(XFixesSelectionNotifyEvent *)&e];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
XFlush(xpbproxy_dpy);
|
|
||||||
pthread_mutex_lock(&xpbproxy_dpy_rdy_lock);
|
|
||||||
}
|
|
||||||
|
|
||||||
[pool release];
|
|
||||||
|
|
||||||
pthread_cond_wait(&xpbproxy_dpy_rdy_cond, &xpbproxy_dpy_rdy_lock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (XPending(xpbproxy_dpy) != 0) {
|
||||||
|
XEvent e;
|
||||||
|
|
||||||
|
XNextEvent (xpbproxy_dpy, &e);
|
||||||
|
|
||||||
|
switch (e.type) {
|
||||||
|
case SelectionClear:
|
||||||
|
if([xpbproxy_selection_object() is_active])
|
||||||
|
[xpbproxy_selection_object () clear_event:&e.xselectionclear];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SelectionRequest:
|
||||||
|
[xpbproxy_selection_object () request_event:&e.xselectionrequest];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SelectionNotify:
|
||||||
|
[xpbproxy_selection_object () notify_event:&e.xselection];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PropertyNotify:
|
||||||
|
[xpbproxy_selection_object () property_event:&e.xproperty];
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
if(e.type >= xpbproxy_apple_wm_event_base &&
|
||||||
|
e.type < xpbproxy_apple_wm_event_base + AppleWMNumberEvents) {
|
||||||
|
x_event_apple_wm_notify((XAppleWMNotifyEvent *) &e);
|
||||||
|
} else if(e.type == xpbproxy_xfixes_event_base + XFixesSelectionNotify) {
|
||||||
|
[xpbproxy_selection_object() xfixes_selection_notify:(XFixesSelectionNotifyEvent *)&e];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
XFlush(xpbproxy_dpy);
|
||||||
|
}
|
||||||
|
|
||||||
|
[pool release];
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL add_input_socket (int sock, CFOptionFlags callback_types,
|
static BOOL add_input_socket (int sock, CFOptionFlags callback_types,
|
||||||
|
@ -161,7 +149,7 @@ static BOOL add_input_socket (int sock, CFOptionFlags callback_types,
|
||||||
if (*cf_source == NULL)
|
if (*cf_source == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
CFRunLoopAddSource (CFRunLoopGetMain (),
|
CFRunLoopAddSource (CFRunLoopGetCurrent (),
|
||||||
*cf_source, kCFRunLoopDefaultMode);
|
*cf_source, kCFRunLoopDefaultMode);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -175,10 +163,8 @@ static void x_input_callback (CFSocketRef sock, CFSocketCallBackType type,
|
||||||
xpbproxy_prefs_reload = NO;
|
xpbproxy_prefs_reload = NO;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pthread_mutex_lock(&xpbproxy_dpy_rdy_lock);
|
xpbproxy_process_xevents();
|
||||||
pthread_cond_broadcast(&xpbproxy_dpy_rdy_cond);
|
|
||||||
pthread_mutex_unlock(&xpbproxy_dpy_rdy_lock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL xpbproxy_input_register(void) {
|
BOOL xpbproxy_input_register(void) {
|
||||||
|
|
|
@ -166,6 +166,11 @@ void QuartzInitOutput(
|
||||||
FatalError("Could not register block and wakeup handlers.");
|
FatalError("Could not register block and wakeup handlers.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(RANDR) && !defined(FAKE_RANDR)
|
||||||
|
if(!QuartzRandRInit(pScreen))
|
||||||
|
FatalError("Failed to init RandR extension.\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
// Do display mode specific initialization
|
// Do display mode specific initialization
|
||||||
quartzProcs->DisplayInit();
|
quartzProcs->DisplayInit();
|
||||||
}
|
}
|
||||||
|
@ -236,6 +241,7 @@ void QuartzUpdateScreens(void) {
|
||||||
WindowPtr pRoot;
|
WindowPtr pRoot;
|
||||||
int x, y, width, height, sx, sy;
|
int x, y, width, height, sx, sy;
|
||||||
xEvent e;
|
xEvent e;
|
||||||
|
BoxRec bounds;
|
||||||
|
|
||||||
if (noPseudoramiXExtension || screenInfo.numScreens != 1)
|
if (noPseudoramiXExtension || screenInfo.numScreens != 1)
|
||||||
{
|
{
|
||||||
|
@ -259,16 +265,11 @@ void QuartzUpdateScreens(void) {
|
||||||
pScreen->width = width;
|
pScreen->width = width;
|
||||||
pScreen->height = height;
|
pScreen->height = height;
|
||||||
|
|
||||||
#ifndef FAKE_RANDR
|
|
||||||
if(!QuartzRandRInit(pScreen))
|
|
||||||
FatalError("Failed to init RandR extension.\n");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
DarwinAdjustScreenOrigins(&screenInfo);
|
DarwinAdjustScreenOrigins(&screenInfo);
|
||||||
quartzProcs->UpdateScreen(pScreen);
|
quartzProcs->UpdateScreen(pScreen);
|
||||||
|
|
||||||
sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX;
|
sx = x + darwinMainScreenX;
|
||||||
sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY;
|
sy = y + darwinMainScreenY;
|
||||||
|
|
||||||
/* Adjust the root window. */
|
/* Adjust the root window. */
|
||||||
pRoot = WindowTable[pScreen->myNum];
|
pRoot = WindowTable[pScreen->myNum];
|
||||||
|
@ -277,8 +278,16 @@ void QuartzUpdateScreens(void) {
|
||||||
//pScreen->PaintWindowBackground (pRoot, &pRoot->borderClip, PW_BACKGROUND);
|
//pScreen->PaintWindowBackground (pRoot, &pRoot->borderClip, PW_BACKGROUND);
|
||||||
miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND);
|
miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND);
|
||||||
|
|
||||||
// TODO: This is a noop in 1.6 and nuked in master... we may need to do something else now to handle it
|
/* <rdar://problem/7770779> pointer events are clipped to old display region after display reconfiguration
|
||||||
// DefineInitialRootWindow(pRoot);
|
* http://xquartz.macosforge.org/trac/ticket/346
|
||||||
|
*/
|
||||||
|
bounds.x1 = 0;
|
||||||
|
bounds.x2 = width;
|
||||||
|
bounds.y1 = 0;
|
||||||
|
bounds.y2 = height;
|
||||||
|
pScreen->ConstrainCursor(inputInfo.pointer, pScreen, &bounds);
|
||||||
|
inputInfo.pointer->spriteInfo->sprite->physLimits = bounds;
|
||||||
|
inputInfo.pointer->spriteInfo->sprite->hotLimits = bounds;
|
||||||
|
|
||||||
DEBUG_LOG("Root Window: %dx%d @ (%d, %d) darwinMainScreen (%d, %d) xy (%d, %d) dixScreenOrigins (%d, %d)\n", width, height, x - sx, y - sy, darwinMainScreenX, darwinMainScreenY, x, y, dixScreenOrigins[pScreen->myNum].x, dixScreenOrigins[pScreen->myNum].y);
|
DEBUG_LOG("Root Window: %dx%d @ (%d, %d) darwinMainScreen (%d, %d) xy (%d, %d) dixScreenOrigins (%d, %d)\n", width, height, x - sx, y - sy, darwinMainScreenX, darwinMainScreenY, x, y, dixScreenOrigins[pScreen->myNum].x, dixScreenOrigins[pScreen->myNum].y);
|
||||||
|
|
||||||
|
|
|
@ -184,12 +184,6 @@ static void DarwinChangeKeyboardControl(DeviceIntPtr device, KeybdCtrl *ctrl) {
|
||||||
// keyclick, bell volume / pitch, autorepead, LED's
|
// keyclick, bell volume / pitch, autorepead, LED's
|
||||||
}
|
}
|
||||||
|
|
||||||
static void DarwinKeyboardBell(int volume, DeviceIntPtr pDev, pointer arg, int something) {
|
|
||||||
KeybdCtrl *ctrl = arg;
|
|
||||||
|
|
||||||
DDXRingBell(volume, ctrl->bell_pitch, ctrl->bell_duration);
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Utility functions to help parse Darwin keymap
|
// Utility functions to help parse Darwin keymap
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -301,7 +295,7 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) {
|
||||||
// for a kIOHIDParamConnectType connection.
|
// for a kIOHIDParamConnectType connection.
|
||||||
assert(darwinParamConnect = NXOpenEventStatus());
|
assert(darwinParamConnect = NXOpenEventStatus());
|
||||||
|
|
||||||
InitKeyboardDeviceStruct(pDev, NULL, DarwinKeyboardBell, DarwinChangeKeyboardControl);
|
InitKeyboardDeviceStruct(pDev, NULL, NULL, DarwinChangeKeyboardControl);
|
||||||
|
|
||||||
DarwinKeyboardReloadHandler();
|
DarwinKeyboardReloadHandler();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user