XFree86 4.3.99.901 (RC 1)

This commit is contained in:
Kaleb Keithley 2003-12-04 22:03:38 +00:00
commit a84f16a9ad
25 changed files with 291 additions and 98 deletions

View file

@ -29,7 +29,7 @@
* sale, use or other dealings in this Software without prior written
* authorization.
*/
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.h,v 1.15 2003/11/14 20:27:58 torrey Exp $ */
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.h,v 1.17 2003/11/24 05:39:01 torrey Exp $ */
#define BOOL xBOOL
#include "Xproto.h"
@ -46,6 +46,7 @@
BOOL rootlessMenuBarVisible;
BOOL queueShowServer;
BOOL quitWithoutQuery;
BOOL pendingAppQuitReply;
UInt32 mouseState;
BOOL sendServerEvents;
BOOL x11Active;
@ -90,7 +91,7 @@
- (void)sendShowHide:(BOOL)show;
- (void)clientProcessDone:(int)clientStatus;
- (void)activateX11:(BOOL)state;
- (void)windowBecameKey:(NSWindow *)window;
- (void)windowBecameKey:(NSNotification *)notification;
- (void)setX11WindowList:(NSArray *)list;
- (void)setX11WindowCheck:(NSNumber *)nn;

View file

@ -34,7 +34,7 @@
* sale, use or other dealings in this Software without prior written
* authorization.
*/
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.17 2003/11/14 20:27:58 torrey Exp $ */
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.20 2003/11/27 01:59:53 torrey Exp $ */
#include "quartzCommon.h"
@ -126,6 +126,7 @@ static io_connect_t root_port;
rootlessMenuBarVisible = YES;
queueShowServer = YES;
quartzServerQuitting = NO;
pendingAppQuitReply = NO;
mouseState = 0;
// set up a port to safely send messages to main thread from server thread
@ -141,11 +142,6 @@ static io_connect_t root_port;
[[NSRunLoop currentRunLoop] addPort:signalPort
forMode:NSModalPanelRunLoopMode];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(windowBecameKey:)
name:NSWindowDidBecomeKeyNotification
object:nil];
return self;
}
@ -191,6 +187,7 @@ static io_connect_t root_port;
// At this point the X server is either running or starting.
if (serverState == server_Starting) {
// Quit will be queued later when server is running
pendingAppQuitReply = YES;
return NSTerminateLater;
} else if (serverState == server_Running) {
[self quitServer];
@ -490,6 +487,15 @@ static io_connect_t root_port;
if (![self loadDisplayBundle])
[NSApp terminate:nil];
// In rootless mode register to receive notification of key window changes
if (quartzRootless) {
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(windowBecameKey:)
name:NSWindowDidBecomeKeyNotification
object:nil];
}
// Start the X server thread
serverState = server_Starting;
[NSThread detachNewThreadSelector:@selector(run) toTarget:self
@ -537,7 +543,7 @@ static io_connect_t root_port;
// Finish starting the X server thread
// This includes anything that must be done after the X server is
// ready to process events.
// ready to process events after the first or subsequent generations.
- (void)finishStartX
{
sendServerEvents = YES;
@ -551,7 +557,8 @@ static io_connect_t root_port;
if (quartzServerQuitting) {
[self quitServer];
[NSApp replyToApplicationShouldTerminate:YES];
if (pendingAppQuitReply)
[NSApp replyToApplicationShouldTerminate:YES];
return;
}
@ -1001,21 +1008,6 @@ static io_connect_t root_port;
// This field should be filled in for every event
xe->u.keyButtonPointer.time = GetTimeInMillis();
#if 0
// FIXME: Really?
if (quartzRootless &&
(ev->type == NSLeftMouseDown || ev->type == NSLeftMouseUp ||
(ev->type == NSSystemDefined && ev->data.compound.subType == 7)))
{
// mouse button event - send mouseMoved to this position too
// X gets confused if it gets a click that isn't at the last
// reported mouse position.
xEvent moveEvent = *ev;
xe.u.u.type = NSMouseMoved;
[self sendXEvent:&moveEvent];
}
#endif
DarwinEQEnqueue(xe);
}
@ -1194,8 +1186,10 @@ static io_connect_t root_port;
}
// Some NSWindow became the key window
- (void)windowBecameKey:(NSWindow *)window
- (void)windowBecameKey:(NSNotification *)notification
{
NSWindow *window = [notification object];
if (quartzProcs->IsX11Window(window, [window windowNumber])) {
if (!x11Active)
[self activateX11:YES];
@ -1322,7 +1316,8 @@ static io_connect_t root_port;
QuartzMessageServerThread(kXDarwinControllerNotify, 1,
AppleWMHideAll);
} else {
// FIXME: We need to hide Xplugin windows here
if (quartzProcs->HideWindows)
quartzProcs->HideWindows(YES);
}
}
@ -1332,7 +1327,8 @@ static io_connect_t root_port;
QuartzMessageServerThread(kXDarwinControllerNotify, 1,
AppleWMShowAll);
} else {
[NSApp arrangeInFront:nil];
if (quartzProcs->HideWindows)
quartzProcs->HideWindows(NO);
}
}

View file

@ -27,7 +27,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crFrame.m,v 1.5 2003/11/13 20:26:31 torrey Exp $ */
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crFrame.m,v 1.7 2003/11/27 01:53:39 torrey Exp $ */
#include "quartzCommon.h"
#include "cr.h"
@ -163,7 +163,7 @@ CRResizeFrame(RootlessFrameID wid, ScreenPtr pScreen,
{
CRWindowPtr crWinPtr = (CRWindowPtr) wid;
NSRect bounds = NSMakeRect(newX, NSHeight([[NSScreen mainScreen] frame]) -
newY - newH, newW, newH);
newY - newH, newW, newH);
[crWinPtr->window setFrame:bounds display:NO];
}

View file

@ -27,7 +27,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crScreen.m,v 1.5 2003/11/12 20:21:52 torrey Exp $ */
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crScreen.m,v 1.6 2003/11/27 01:59:53 torrey Exp $ */
#include "quartzCommon.h"
#include "cr.h"
@ -300,6 +300,7 @@ static QuartzModeProcsRec crModeProcs = {
NULL, // No capture or release in rootless mode
NULL,
CRIsX11Window,
NULL, // Cocoa NSWindows hide themselves
RootlessFrameForWindow,
TopLevelParent,
NULL, // No support for DRI surfaces

View file

@ -25,7 +25,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/fullscreen/fullscreen.c,v 1.2 2003/11/12 20:21:52 torrey Exp $ */
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/fullscreen/fullscreen.c,v 1.3 2003/11/27 01:59:53 torrey Exp $ */
#include "quartzCommon.h"
#include "darwin.h"
@ -549,6 +549,7 @@ static QuartzModeProcsRec fsModeProcs = {
NULL, // No rootless code in fullscreen
NULL,
NULL,
NULL,
NULL, // No support for DRI surfaces
NULL
};

View file

@ -29,7 +29,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.c,v 1.13 2003/11/12 20:21:51 torrey Exp $ */
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.c,v 1.14 2003/11/24 05:39:02 torrey Exp $ */
#include "quartzCommon.h"
#include "quartz.h"
@ -156,9 +156,7 @@ void DarwinModeInitInput(
int argc,
char **argv )
{
if (serverGeneration == 1) {
QuartzMessageMainThread(kQuartzServerStarted, NULL, 0);
}
QuartzMessageMainThread(kQuartzServerStarted, NULL, 0);
// Do final display mode specific initialization before handling events
if (quartzProcs->InitInput)

View file

@ -30,7 +30,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.h,v 1.7 2003/11/12 20:21:51 torrey Exp $ */
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.h,v 1.8 2003/11/27 01:59:53 torrey Exp $ */
#ifndef _QUARTZ_H
#define _QUARTZ_H
@ -70,6 +70,7 @@ typedef void (*ReleaseScreensProc)(void);
* Rootless helper functions
*/
typedef Bool (*IsX11WindowProc)(void *nsWindow, int windowNumber);
typedef void (*HideWindowsProc)(Bool hide);
/*
* Rootless functions for optional export to GLX layer
@ -103,6 +104,7 @@ typedef struct _QuartzModeProcs {
ReleaseScreensProc ReleaseScreens; // Only called in fullscreen
IsX11WindowProc IsX11Window;
HideWindowsProc HideWindows;
FrameForWindowProc FrameForWindow;
TopLevelParentProc TopLevelParent;

View file

@ -26,7 +26,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xpr.h,v 1.4 2003/11/12 20:21:52 torrey Exp $ */
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xpr.h,v 1.5 2003/11/27 01:59:53 torrey Exp $ */
#ifndef XPR_H
#define XPR_H
@ -39,6 +39,7 @@ void AppleDRIExtensionInit(void);
void xprAppleWMInit(void);
Bool xprInit(ScreenPtr pScreen);
Bool xprIsX11Window(void *nsWindow, int windowNumber);
void xprHideWindows(Bool hide);
Bool QuartzInitCursor(ScreenPtr pScreen);
void QuartzSuspendXCursor(ScreenPtr pScreen);

View file

@ -27,10 +27,10 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c,v 1.4 2003/11/12 20:21:52 torrey Exp $ */
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c,v 1.5 2003/11/27 01:59:53 torrey Exp $ */
#include "xpr.h"
#include "rootless.h"
#include "rootlessCommon.h"
#include "Xplugin.h"
#include "x-hash.h"
#include "x-list.h"
@ -437,3 +437,45 @@ xprIsX11Window(void *nsWindow, int windowNumber)
return ret;
}
/*
* xprHideWindows
* Hide or unhide all top level windows. This is called for application hide/
* unhide events if the window manager is not Apple-WM aware. Xplugin windows
* do not hide or unhide themselves.
*/
void
xprHideWindows(Bool hide)
{
int screen;
WindowPtr pRoot, pWin;
for (screen = 0; screen < screenInfo.numScreens; screen++) {
pRoot = WindowTable[screenInfo.screens[screen]->myNum];
RootlessFrameID prevWid = NULL;
for (pWin = pRoot->firstChild; pWin; pWin = pWin->nextSib) {
RootlessWindowRec *winRec = WINREC(pWin);
if (winRec != NULL) {
if (hide) {
xprUnmapFrame(winRec->wid);
} else {
BoxRec box;
xprRestackFrame(winRec->wid, prevWid);
prevWid = winRec->wid;
box.x1 = 0;
box.y1 = 0;
box.x2 = winRec->width;
box.y2 = winRec->height;
xprDamageRects(winRec->wid, 1, &box, 0, 0);
RootlessQueueRedisplay(screenInfo.screens[screen]);
}
}
}
}
}

View file

@ -27,7 +27,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprScreen.c,v 1.8 2003/11/12 20:21:52 torrey Exp $ */
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprScreen.c,v 1.9 2003/11/27 01:59:53 torrey Exp $ */
#include "quartzCommon.h"
#include "quartz.h"
@ -358,6 +358,7 @@ static QuartzModeProcsRec xprModeProcs = {
NULL, // No capture or release in rootless mode
NULL,
xprIsX11Window,
xprHideWindows,
RootlessFrameForWindow,
TopLevelParent,
DRICreateSurface,