pulling more patches over from xorg-xserver-1.2-apple branch

This commit is contained in:
Ben Byer 2007-11-05 05:44:54 -08:00
parent 10fde62fc8
commit b1764ddf13
14 changed files with 98 additions and 51 deletions

View File

@ -141,6 +141,7 @@ enum {
kXDarwinQuit, // kill the X server and release the display kXDarwinQuit, // kill the X server and release the display
kXDarwinReadPasteboard, // copy Mac OS X pasteboard into X cut buffer kXDarwinReadPasteboard, // copy Mac OS X pasteboard into X cut buffer
kXDarwinWritePasteboard, // copy X cut buffer onto Mac OS X pasteboard kXDarwinWritePasteboard, // copy X cut buffer onto Mac OS X pasteboard
kXDarwinBringAllToFront, // bring all X windows to front
/* /*
* AppleWM events * AppleWM events
*/ */

View File

@ -1,4 +1,3 @@
.\" $XFree86: xc/programs/Xserver/hw/darwin/bundle/XDarwinStartup.man,v 1.1 2002/02/05 19:16:14 torrey Exp $
.TH XDarwinStartup 1 .TH XDarwinStartup 1
.SH NAME .SH NAME
XDarwinStartup - Startup program for the XDarwin X window server XDarwinStartup - Startup program for the XDarwin X window server

View File

@ -1,6 +1,6 @@
/************************************************************************** /**************************************************************************
Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved. Copyright (c) 2002-2007 Apple Inc. All Rights Reserved.
Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a Permission is hereby granted, free of charge, to any person obtaining a

View File

@ -2,8 +2,7 @@
* quartzCursor.h * quartzCursor.h
* *
* External interface for Quartz hardware cursor * External interface for Quartz hardware cursor
*/ *
/*
* Copyright (c) 2001 Torrey T. Lyons and Greg Parker. * Copyright (c) 2001 Torrey T. Lyons and Greg Parker.
* All Rights Reserved. * All Rights Reserved.
* *

View File

@ -1,4 +1,5 @@
/* /*
*
* This module converts keysym values into the corresponding ISO 10646 * This module converts keysym values into the corresponding ISO 10646
* (UCS, Unicode) values. * (UCS, Unicode) values.
* *

View File

@ -1,9 +1,7 @@
/************************************************************** /*
* *
* Quartz-specific support for the Darwin X Server * Quartz-specific support for the Darwin X Server
* *
**************************************************************/
/*
* Copyright (c) 2001-2004 Greg Parker and Torrey T. Lyons. * Copyright (c) 2001-2004 Greg Parker and Torrey T. Lyons.
* All Rights Reserved. * All Rights Reserved.
* *
@ -64,7 +62,7 @@ int quartzServerVisible = TRUE;
int quartzServerQuitting = FALSE; int quartzServerQuitting = FALSE;
int quartzScreenIndex = 0; int quartzScreenIndex = 0;
int aquaMenuBarHeight = 0; int aquaMenuBarHeight = 0;
int noPseudoramiXExtension = TRUE; int noPseudoramiXExtension = FALSE;
QuartzModeProcsPtr quartzProcs = NULL; QuartzModeProcsPtr quartzProcs = NULL;
const char *quartzOpenGLBundle = NULL; const char *quartzOpenGLBundle = NULL;
@ -397,11 +395,22 @@ void DarwinModeProcessEvent(
QuartzUpdateScreens(); QuartzUpdateScreens();
break; break;
case kXDarwinWindowState: case kXDarwinBringAllToFront:
case kXDarwinWindowMoved: RootlessOrderAllWindows();
// FIXME: Not implemented yet
break; break;
case kXDarwinWindowState:
ErrorF("kXDarwinWindowState\n");
break;
case kXDarwinWindowMoved: {
WindowPtr pWin = (WindowPtr)xe->u.clientMessage.u.l.longs0;
short x = xe->u.clientMessage.u.l.longs1,
y = xe->u.clientMessage.u.l.longs2;
ErrorF("kXDarwinWindowMoved(%p, %hd, %hd)\n", pWin, x, y);
RootlessMoveWindow(pWin, x, y, pWin->nextSib, VTMove);
}
break;
default: default:
ErrorF("Unknown application defined event type %d.\n", ErrorF("Unknown application defined event type %d.\n",
xe->u.u.type); xe->u.u.type);

View File

@ -3,8 +3,7 @@
* *
* External interface of the Quartz display modes seen by the generic, mode * External interface of the Quartz display modes seen by the generic, mode
* independent parts of the Darwin X server. * independent parts of the Darwin X server.
*/ *
/*
* Copyright (c) 2001-2003 Greg Parker and Torrey T. Lyons. * Copyright (c) 2001-2003 Greg Parker and Torrey T. Lyons.
* All Rights Reserved. * All Rights Reserved.
* *

View File

@ -42,14 +42,16 @@
#include <Cocoa/Cocoa.h> #include <Cocoa/Cocoa.h>
#ifndef INXQUARTZ
#import "Preferences.h" #import "Preferences.h"
#endif
#include "pseudoramiX.h" #include "pseudoramiX.h"
extern void FatalError(const char *, ...); extern void FatalError(const char *, ...);
extern char *display; extern char *display;
extern int noPanoramiXExtension; extern int noPanoramiXExtension;
#ifndef INXQUARTZ
/* /*
* QuartzReadPreferences * QuartzReadPreferences
* Read the user preferences from the Cocoa front end. * Read the user preferences from the Cocoa front end.
@ -95,7 +97,7 @@ void QuartzReadPreferences(void)
darwinDesiredDepth = [Preferences depth] - 1; darwinDesiredDepth = [Preferences depth] - 1;
} }
#endif
/* /*
* QuartzWriteCocoaPasteboard * QuartzWriteCocoaPasteboard
@ -160,6 +162,7 @@ char *QuartzReadCocoaPasteboard(void)
int QuartzFSUseQDCursor( int QuartzFSUseQDCursor(
int depth) // screen depth int depth) // screen depth
{ {
#ifndef INXQUARTZ
switch ([Preferences useQDCursor]) { switch ([Preferences useQDCursor]) {
case qdCursor_Always: case qdCursor_Always:
return TRUE; return TRUE;
@ -171,6 +174,7 @@ int QuartzFSUseQDCursor(
else else
return FALSE; return FALSE;
} }
#endif
return TRUE; return TRUE;
} }

View File

@ -2,8 +2,7 @@
* quartzCursor.h * quartzCursor.h
* *
* External interface for Quartz hardware cursor * External interface for Quartz hardware cursor
*/ *
/*
* Copyright (c) 2001 Torrey T. Lyons and Greg Parker. * Copyright (c) 2001 Torrey T. Lyons and Greg Parker.
* All Rights Reserved. * All Rights Reserved.
* *

View File

@ -217,42 +217,41 @@ DarwinModeReadSystemKeymap (darwinKeyboardInfo *info)
const void *chr_data = NULL; const void *chr_data = NULL;
int num_keycodes = NUM_KEYCODES; int num_keycodes = NUM_KEYCODES;
UInt32 keyboard_type = 0; UInt32 keyboard_type = 0;
int is_uchr, i, j; int is_uchr = 1, i, j;
OSStatus err; OSStatus err;
KeySym *k; KeySym *k;
TISInputSourceRef currentKeyLayoutRef = TISCopyCurrentKeyboardLayoutInputSource(); TISInputSourceRef currentKeyLayoutRef = TISCopyCurrentKeyboardLayoutInputSource();
if (currentKeyLayoutRef) if (currentKeyLayoutRef)
{
CFDataRef currentKeyLayoutDataRef = (CFDataRef )TISGetInputSourceProperty(currentKeyLayoutRef, kTISPropertyUnicodeKeyLayoutData);
if (currentKeyLayoutDataRef)
chr_data = CFDataGetBytePtr(currentKeyLayoutDataRef);
}
if (chr_data != NULL)
{
KLGetCurrentKeyboardLayout (&key_layout);
KLGetKeyboardLayoutProperty (key_layout, kKLuchrData, &chr_data);
if (chr_data != NULL)
{ {
is_uchr = 1; CFDataRef currentKeyLayoutDataRef = (CFDataRef )TISGetInputSourceProperty(currentKeyLayoutRef, kTISPropertyUnicodeKeyLayoutData);
keyboard_type = LMGetKbdType (); if (currentKeyLayoutDataRef)
chr_data = CFDataGetBytePtr(currentKeyLayoutDataRef);
}
if(chr_data == NULL) {
KLGetCurrentKeyboardLayout (&key_layout);
KLGetKeyboardLayoutProperty (key_layout, kKLuchrData, &chr_data);
if (chr_data != NULL)
{
is_uchr = 1;
keyboard_type = LMGetKbdType ();
}
else
{
KLGetKeyboardLayoutProperty (key_layout, kKLKCHRData, &chr_data);
if (chr_data == NULL)
{
ErrorF ( "Couldn't get uchr or kchr resource\n");
return FALSE;
}
is_uchr = 0;
num_keycodes = 128;
}
} }
else
{
KLGetKeyboardLayoutProperty (key_layout, kKLKCHRData, &chr_data);
if (chr_data == NULL)
{
ErrorF ( "Couldn't get uchr or kchr resource\n");
return FALSE;
}
is_uchr = 0;
num_keycodes = 128;
}
}
/* Scan the keycode range for the Unicode character that each /* Scan the keycode range for the Unicode character that each
key produces in the four shift states. Then convert that to key produces in the four shift states. Then convert that to
@ -376,8 +375,7 @@ DarwinModeReadSystemKeymap (darwinKeyboardInfo *info)
} }
} }
} }
if(currentKeyLayoutRef) CFRelease(currentKeyLayoutRef);
if(currentKeyLayoutRef) CFRelease(currentKeyLayoutRef);
return TRUE; return TRUE;
} }

View File

@ -236,7 +236,7 @@ DRIFinishScreenInit(ScreenPtr pScreen)
pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify; pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify;
pScreen->ClipNotify = DRIClipNotify; pScreen->ClipNotify = DRIClipNotify;
ErrorF("[DRI] screen %d installation complete\n", pScreen->myNum); // ErrorF("[DRI] screen %d installation complete\n", pScreen->myNum);
return TRUE; return TRUE;
} }

View File

@ -45,6 +45,10 @@
# include "damage.h" # include "damage.h"
#endif #endif
/* 10.4's deferred update makes X slower.. have to live with the tearing
for now.. */
#define XP_NO_DEFERRED_UPDATES 8
// Name of GLX bundle for native OpenGL // Name of GLX bundle for native OpenGL
static const char *xprOpenGLBundle = "glxCGL.bundle"; static const char *xprOpenGLBundle = "glxCGL.bundle";
@ -59,10 +63,12 @@ eventHandler(unsigned int type, const void *arg,
switch (type) switch (type)
{ {
case XP_EVENT_DISPLAY_CHANGED: case XP_EVENT_DISPLAY_CHANGED:
// ErrorF("XP_EVENT_DISPLAY_MOVED\n");
QuartzMessageServerThread(kXDarwinDisplayChanged, 0); QuartzMessageServerThread(kXDarwinDisplayChanged, 0);
break; break;
case XP_EVENT_WINDOW_STATE_CHANGED: case XP_EVENT_WINDOW_STATE_CHANGED:
// ErrorF("XP_EVENT_WINDOW_STATE_CHANGED\n");
if (arg_size >= sizeof(xp_window_state_event)) if (arg_size >= sizeof(xp_window_state_event))
{ {
const xp_window_state_event *ws_arg = arg; const xp_window_state_event *ws_arg = arg;
@ -73,6 +79,7 @@ eventHandler(unsigned int type, const void *arg,
break; break;
case XP_EVENT_WINDOW_MOVED: case XP_EVENT_WINDOW_MOVED:
// ErrorF("XP_EVENT_WINDOW_MOVED\n");
if (arg_size == sizeof(xp_window_id)) if (arg_size == sizeof(xp_window_id))
{ {
xp_window_id id = * (xp_window_id *) arg; xp_window_id id = * (xp_window_id *) arg;
@ -89,6 +96,7 @@ eventHandler(unsigned int type, const void *arg,
case XP_EVENT_SURFACE_DESTROYED: case XP_EVENT_SURFACE_DESTROYED:
case XP_EVENT_SURFACE_CHANGED: case XP_EVENT_SURFACE_CHANGED:
// ErrorF("XP_EVENT_SURFACE_MOVED\n");
if (arg_size == sizeof(xp_surface_id)) if (arg_size == sizeof(xp_surface_id))
{ {
int kind; int kind;

View File

@ -432,4 +432,8 @@ void RootlessUpdateScreenPixmap(ScreenPtr pScreen);
*/ */
void RootlessRepositionWindows(ScreenPtr pScreen); void RootlessRepositionWindows(ScreenPtr pScreen);
/*
* Bring all windows to the front of the Aqua stack
*/
void RootlessOrderAllWindows (void);
#endif /* _ROOTLESS_H */ #endif /* _ROOTLESS_H */

View File

@ -1376,3 +1376,29 @@ RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width)
RL_DEBUG_MSG("change border width end\n"); RL_DEBUG_MSG("change border width end\n");
} }
/*
* RootlessOrderAllWindows
* Brings all X11 windows to the top of the window stack
* (i.e in front of Aqua windows) -- called when X11.app is given focus
*/
void
RootlessOrderAllWindows (void)
{
int i;
WindowPtr pWin;
RL_DEBUG_MSG("RootlessOrderAllWindows() ");
for (i = 0; i < screenInfo.numScreens; i++) {
if (screenInfo.screens[i] == NULL) continue;
pWin = WindowTable[i];
if (pWin == NULL) continue;
for (pWin = pWin->firstChild; pWin != NULL; pWin = pWin->nextSib) {
if (!pWin->realized) continue;
if (RootlessEnsureFrame(pWin) == NULL) continue;
RootlessReorderWindow (pWin);
}
}
RL_DEBUG_MSG("RootlessOrderAllWindows() done");
}