summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@freedesktop.org>2009-09-27 23:29:37 -0700
committerJeremy Huddleston <jeremyhu@freedesktop.org>2009-09-27 23:29:37 -0700
commit459ae6273a50f9fa110cd48b0bb7fbd83e66c00b (patch)
tree916dd565fe49b892085ab26a04cc7d7ef38dcd77
parentf7d5ab6cd287f55fadae24c366567b79b257f663 (diff)
XQuartz: Fix a bunch of compilation warnings about style
(cherry picked from commit 54000bdcbca52a2de31f7c1a1147de6d8e9dbbb8)
-rw-r--r--hw/xquartz/GL/visualConfigs.c2
-rw-r--r--hw/xquartz/X11Application.m17
-rw-r--r--hw/xquartz/X11Controller.m4
-rw-r--r--hw/xquartz/applewm.c19
-rw-r--r--hw/xquartz/darwinEvents.c5
-rw-r--r--hw/xquartz/mach-startup/bundle-main.c15
-rw-r--r--hw/xquartz/mach-startup/launchd_fd.c2
-rw-r--r--hw/xquartz/mach-startup/stub.c16
-rw-r--r--hw/xquartz/quartz.h2
-rw-r--r--hw/xquartz/quartzAudio.c2
-rw-r--r--hw/xquartz/xpr/appledri.c2
-rw-r--r--hw/xquartz/xpr/x-hash.h2
-rw-r--r--hw/xquartz/xpr/xprFrame.c8
-rw-r--r--hw/xquartz/xpr/xprScreen.c4
-rw-r--r--mi/miexpose.c21
-rw-r--r--mi/miwindow.c1
-rw-r--r--miext/rootless/rootlessWindow.c26
17 files changed, 100 insertions, 48 deletions
diff --git a/hw/xquartz/GL/visualConfigs.c b/hw/xquartz/GL/visualConfigs.c
index fee665d1d..f92677847 100644
--- a/hw/xquartz/GL/visualConfigs.c
+++ b/hw/xquartz/GL/visualConfigs.c
@@ -277,7 +277,7 @@ __GLXconfig *__glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber)
(c-1)->next = NULL;
if (c - visualConfigs != numConfigs) {
- FatalError("numConfigs calculation error in setVisualConfigs! numConfigs is %d i is %d\n", numConfigs, c - visualConfigs);
+ FatalError("numConfigs calculation error in setVisualConfigs! numConfigs is %d i is %d\n", numConfigs, (int)(c - visualConfigs));
}
freeGlCapabilities(&caps);
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index ad022c9ab..749a8932b 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -243,23 +243,26 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
if(!for_appkit) {
NSPoint NSlocation = [e locationInWindow];
NSWindow *window = [e window];
-
+ NSRect NSframe, NSvisibleFrame;
+ CGRect CGframe, CGvisibleFrame;
+ CGPoint CGlocation;
+
if (window != nil) {
NSRect frame = [window frame];
NSlocation.x += frame.origin.x;
NSlocation.y += frame.origin.y;
}
- NSRect NSframe = [[NSScreen mainScreen] frame];
- NSRect NSvisibleFrame = [[NSScreen mainScreen] visibleFrame];
+ NSframe = [[NSScreen mainScreen] frame];
+ NSvisibleFrame = [[NSScreen mainScreen] visibleFrame];
- CGRect CGframe = CGRectMake(NSframe.origin.x, NSframe.origin.y,
+ CGframe = CGRectMake(NSframe.origin.x, NSframe.origin.y,
NSframe.size.width, NSframe.size.height);
- CGRect CGvisibleFrame = CGRectMake(NSvisibleFrame.origin.x,
+ CGvisibleFrame = CGRectMake(NSvisibleFrame.origin.x,
NSvisibleFrame.origin.y,
NSvisibleFrame.size.width,
NSvisibleFrame.size.height);
- CGPoint CGlocation = CGPointMake(NSlocation.x, NSlocation.y);
+ CGlocation = CGPointMake(NSlocation.x, NSlocation.y);
if(CGRectContainsPoint(CGframe, CGlocation) &&
!CGRectContainsPoint(CGvisibleFrame, CGlocation))
@@ -334,6 +337,7 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
case NSApplicationActivatedEventType:
for_x = NO;
if ([self modalWindow] == nil) {
+ BOOL switch_on_activate, ok;
for_appkit = NO;
/* FIXME: hack to avoid having to pass the event to appkit,
@@ -344,7 +348,6 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
/* Get the Spaces preference for SwitchOnActivate */
(void)CFPreferencesAppSynchronize(CFSTR(".GlobalPreferences"));
- BOOL switch_on_activate, ok;
switch_on_activate = CFPreferencesGetAppBooleanValue(CFSTR("AppleSpacesSwitchOnActivate"), CFSTR(".GlobalPreferences"), &ok);
if(!ok)
switch_on_activate = YES;
diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m
index f58747e15..d8d23ec2f 100644
--- a/hw/xquartz/X11Controller.m
+++ b/hw/xquartz/X11Controller.m
@@ -632,6 +632,8 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row
- (IBAction)prefs_changed:sender
{
+ BOOL pbproxy_active;
+
darwinFakeButtons = [fake_buttons intValue];
quartzUseSysBeep = [use_sysbeep intValue];
X11EnableKeyEquivalents = [enable_keyequivs intValue];
@@ -653,7 +655,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row
[NSApp prefs_set_boolean:@PREFS_NO_TCP value:![enable_tcp intValue]];
[NSApp prefs_set_integer:@PREFS_DEPTH value:[depth selectedTag]];
- BOOL pbproxy_active = [sync_pasteboard intValue];
+ pbproxy_active = [sync_pasteboard intValue];
[NSApp prefs_set_boolean:@PREFS_SYNC_PB value:pbproxy_active];
[NSApp prefs_set_boolean:@PREFS_SYNC_PB_TO_CLIPBOARD value:[sync_pasteboard_to_clipboard intValue]];
diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c
index 200c0b301..0af0250ca 100644
--- a/hw/xquartz/applewm.c
+++ b/hw/xquartz/applewm.c
@@ -221,10 +221,7 @@ updateEventMask (WMEventPtr *pHead)
/*ARGSUSED*/
static int
-WMFreeClient (data, id)
- pointer data;
- XID id;
-{
+WMFreeClient (pointer data, XID id) {
WMEventPtr pEvent;
WMEventPtr *pHead, pCur, pPrev;
@@ -248,10 +245,7 @@ WMFreeClient (data, id)
/*ARGSUSED*/
static int
-WMFreeEvents (data, id)
- pointer data;
- XID id;
-{
+WMFreeEvents (pointer data, XID id) {
WMEventPtr *pHead, pCur, pNext;
pHead = (WMEventPtr *) data;
@@ -355,10 +349,7 @@ ProcAppleWMSelectInput (register ClientPtr client)
*/
void
-AppleWMSendEvent (type, mask, which, arg)
- int type, which, arg;
- unsigned int mask;
-{
+AppleWMSendEvent (int type, unsigned int mask, int which, int arg) {
WMEventPtr *pHead, pEvent;
ClientPtr client;
xAppleWMNotifyEvent se;
@@ -723,9 +714,7 @@ ProcAppleWMDispatch (
}
static void
-SNotifyEvent(from, to)
- xAppleWMNotifyEvent *from, *to;
-{
+SNotifyEvent(xAppleWMNotifyEvent *from, xAppleWMNotifyEvent *to) {
to->type = from->type;
to->kind = from->kind;
cpswaps (from->sequenceNumber, to->sequenceNumber);
diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index c6fd10c68..42a9f0a44 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -530,13 +530,14 @@ void DarwinSendProximityEvents(int ev_type, float pointer_x, float pointer_y) {
void DarwinSendScrollEvents(float count_x, float count_y,
float pointer_x, float pointer_y,
float pressure, float tilt_x, float tilt_y) {
+ int sign_x, sign_y;
if(!darwinEvents) {
DEBUG_LOG("DarwinSendScrollEvents called before darwinEvents was initialized\n");
return;
}
- int sign_x = count_x > 0.0f ? SCROLLWHEELLEFTFAKE : SCROLLWHEELRIGHTFAKE;
- int sign_y = count_y > 0.0f ? SCROLLWHEELUPFAKE : SCROLLWHEELDOWNFAKE;
+ sign_x = count_x > 0.0f ? SCROLLWHEELLEFTFAKE : SCROLLWHEELRIGHTFAKE;
+ sign_y = count_y > 0.0f ? SCROLLWHEELUPFAKE : SCROLLWHEELDOWNFAKE;
count_x = fabs(count_x);
count_y = fabs(count_y);
diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c
index e887c469d..917bbafbe 100644
--- a/hw/xquartz/mach-startup/bundle-main.c
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -149,15 +149,17 @@ static int accept_fd_handoff(int connected_fd) {
char databuf[] = "display";
struct iovec iov[1];
- iov[0].iov_base = databuf;
- iov[0].iov_len = sizeof(databuf);
-
union {
struct cmsghdr hdr;
char bytes[CMSG_SPACE(sizeof(int))];
} buf;
struct msghdr msg;
+ struct cmsghdr *cmsg;
+
+ iov[0].iov_base = databuf;
+ iov[0].iov_len = sizeof(databuf);
+
msg.msg_iov = iov;
msg.msg_iovlen = 1;
msg.msg_control = buf.bytes;
@@ -166,7 +168,7 @@ static int accept_fd_handoff(int connected_fd) {
msg.msg_namelen = 0;
msg.msg_flags = 0;
- struct cmsghdr *cmsg = CMSG_FIRSTHDR (&msg);
+ cmsg = CMSG_FIRSTHDR (&msg);
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_RIGHTS;
cmsg->cmsg_len = CMSG_LEN(sizeof(int));
@@ -197,6 +199,7 @@ static void socket_handoff_thread(void *arg) {
socket_handoff_t *handoff_data = (socket_handoff_t *)arg;
int launchd_fd = -1;
int connected_fd;
+ unsigned remain;
/* Now actually get the passed file descriptor from this connection
* If we encounter an error, keep listening.
@@ -229,7 +232,7 @@ static void socket_handoff_thread(void *arg) {
* into it.
*/
- unsigned remain = 3000000;
+ remain = 3000000;
fprintf(stderr, "X11.app: Received new $DISPLAY fd: %d ... sleeping to allow xinitrc to catchup.\n", launchd_fd);
while((remain = usleep(remain)) > 0);
@@ -626,11 +629,11 @@ static char *command_from_prefs(const char *key, const char *default_value) {
if ((PlistRef == NULL) || (CFGetTypeID(PlistRef) != CFStringGetTypeID())) {
CFStringRef cfDefaultValue = CFStringCreateWithCString(NULL, default_value, kCFStringEncodingASCII);
+ int len = strlen(default_value) + 1;
CFPreferencesSetAppValue(cfKey, cfDefaultValue, kCFPreferencesCurrentApplication);
CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
- int len = strlen(default_value) + 1;
command = (char *)malloc(len * sizeof(char));
if(!command)
return NULL;
diff --git a/hw/xquartz/mach-startup/launchd_fd.c b/hw/xquartz/mach-startup/launchd_fd.c
index fa623ea12..6dace8ea1 100644
--- a/hw/xquartz/mach-startup/launchd_fd.c
+++ b/hw/xquartz/mach-startup/launchd_fd.c
@@ -36,7 +36,7 @@
#include "launchd_fd.h"
-int launchd_display_fd() {
+int launchd_display_fd(void) {
launch_data_t sockets_dict, checkin_request, checkin_response;
launch_data_t listening_fd_array, listening_fd;
diff --git a/hw/xquartz/mach-startup/stub.c b/hw/xquartz/mach-startup/stub.c
index fd831a828..3d22db5d1 100644
--- a/hw/xquartz/mach-startup/stub.c
+++ b/hw/xquartz/mach-startup/stub.c
@@ -69,13 +69,12 @@ static char x11_path[PATH_MAX + 1];
static pid_t x11app_pid = 0;
-static void set_x11_path() {
+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);
- UInt32 ver;
switch (osstatus) {
case noErr:
@@ -148,15 +147,17 @@ static void send_fd_handoff(int connected_fd, int launchd_fd) {
char databuf[] = "display";
struct iovec iov[1];
- iov[0].iov_base = databuf;
- iov[0].iov_len = sizeof(databuf);
-
union {
struct cmsghdr hdr;
char bytes[CMSG_SPACE(sizeof(int))];
} buf;
struct msghdr msg;
+ struct cmsghdr *cmsg;
+
+ iov[0].iov_base = databuf;
+ iov[0].iov_len = sizeof(databuf);
+
msg.msg_iov = iov;
msg.msg_iovlen = 1;
msg.msg_control = buf.bytes;
@@ -165,7 +166,7 @@ static void send_fd_handoff(int connected_fd, int launchd_fd) {
msg.msg_namelen = 0;
msg.msg_flags = 0;
- struct cmsghdr *cmsg = CMSG_FIRSTHDR (&msg);
+ cmsg = CMSG_FIRSTHDR (&msg);
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_RIGHTS;
cmsg->cmsg_len = CMSG_LEN(sizeof(int));
@@ -231,10 +232,11 @@ int main(int argc, char **argv, char **envp) {
kr = bootstrap_look_up(bootstrap_port, server_bootstrap_name, &mp);
if(kr != KERN_SUCCESS) {
+ pid_t child;
set_x11_path();
/* This forking is ugly and will be cleaned up later */
- pid_t child = fork();
+ child = fork();
if(child == -1) {
fprintf(stderr, "Xquartz: Could not fork: %s\n", strerror(errno));
return EXIT_FAILURE;
diff --git a/hw/xquartz/quartz.h b/hw/xquartz/quartz.h
index c5da4c510..257055158 100644
--- a/hw/xquartz/quartz.h
+++ b/hw/xquartz/quartz.h
@@ -132,4 +132,6 @@ void QuartzSpaceChanged(uint32_t space_id);
void QuartzSetFullscreen(Bool state);
void QuartzSetRootless(Bool state);
+
+int server_main(int argc, char **argv, char **envp);
#endif
diff --git a/hw/xquartz/quartzAudio.c b/hw/xquartz/quartzAudio.c
index 8cf241738..af63d18f5 100644
--- a/hw/xquartz/quartzAudio.c
+++ b/hw/xquartz/quartzAudio.c
@@ -311,8 +311,10 @@ void QuartzAudioInit(void)
// Prepare for playback
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
+ {
AudioDeviceIOProcID sInputIOProcID = NULL;
status = AudioDeviceCreateIOProcID( outputDevice, QuartzAudioIOProc, &data, &sInputIOProcID );
+ }
#else
status = AudioDeviceAddIOProc(outputDevice, QuartzAudioIOProc, &data);
#endif
diff --git a/hw/xquartz/xpr/appledri.c b/hw/xquartz/xpr/appledri.c
index 7873bf29c..2ca8733d5 100644
--- a/hw/xquartz/xpr/appledri.c
+++ b/hw/xquartz/xpr/appledri.c
@@ -256,10 +256,10 @@ ProcAppleDRIDestroySurface(
register ClientPtr client
)
{
+ int rc;
REQUEST(xAppleDRIDestroySurfaceReq);
DrawablePtr pDrawable;
REQUEST_SIZE_MATCH(xAppleDRIDestroySurfaceReq);
- int rc;
rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
DixReadAccess);
diff --git a/hw/xquartz/xpr/x-hash.h b/hw/xquartz/xpr/x-hash.h
index 78bc7b317..f876b6b71 100644
--- a/hw/xquartz/xpr/x-hash.h
+++ b/hw/xquartz/xpr/x-hash.h
@@ -72,7 +72,7 @@ X_PFX (cvt_vptr_to_uint) (void * val) __attribute__((always_inline));
static __inline__ void *
X_PFX (cvt_uint_to_vptr) (unsigned int val)
{
- return (void*)((size_t)(val));
+ return (void*)((unsigned long)(val));
}
static __inline__ unsigned int
diff --git a/hw/xquartz/xpr/xprFrame.c b/hw/xquartz/xpr/xprFrame.c
index 6635f08d8..a3e207616 100644
--- a/hw/xquartz/xpr/xprFrame.c
+++ b/hw/xquartz/xpr/xprFrame.c
@@ -215,10 +215,10 @@ xprDestroyFrame(RootlessFrameID wid)
static void
xprMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY)
{
- TA_SERVER();
-
xp_window_changes wc;
+ TA_SERVER();
+
wc.x = newX;
wc.y = newY;
// ErrorF("xprMoveFrame(%d, %p, %d, %d)\n", wid, pScreen, newX, newY);
@@ -272,7 +272,7 @@ static void xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid) {
}
if(window_hash) {
- RootlessWindowRec *winRec = x_hash_table_lookup(window_hash, x_cvt_uint_to_vptr((xp_window_id)wid), NULL);
+ RootlessWindowRec *winRec = x_hash_table_lookup(window_hash, wid, NULL);
if(winRec) {
if(quartzEnableRootless)
@@ -566,8 +566,8 @@ xprHideWindows(Bool hide)
TA_SERVER();
for (screen = 0; screen < screenInfo.numScreens; screen++) {
- pRoot = WindowTable[screenInfo.screens[screen]->myNum];
RootlessFrameID prevWid = NULL;
+ pRoot = WindowTable[screenInfo.screens[screen]->myNum];
for (pWin = pRoot->firstChild; pWin; pWin = pWin->nextSib) {
RootlessWindowRec *winRec = WINREC(pWin);
diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index 3387ecf0a..22a727e67 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -317,11 +317,11 @@ xprAddScreen(int index, ScreenPtr pScreen)
if (noPseudoramiXExtension)
{
- ErrorF("Warning: noPseudoramiXExtension!\n");
-
CGDirectDisplayID dpy;
CGRect frame;
+ ErrorF("Warning: noPseudoramiXExtension!\n");
+
dpy = displayAtIndex(index);
frame = displayScreenBounds(dpy);
diff --git a/mi/miexpose.c b/mi/miexpose.c
index 961c35c38..d540a9f4a 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -531,6 +531,14 @@ miWindowExposures(pWin, prgn, other_exposed)
REGION_DESTROY( pWin->drawable.pScreen, exposures);
}
+#ifdef ROOTLESS
+/* Ugly, ugly, but we lost our hooks into miPaintWindow... =/ */
+void RootlessSetPixmapOfAncestors(WindowPtr pWin);
+void RootlessStartDrawing(WindowPtr pWin);
+void RootlessDamageRegion(WindowPtr pWin, RegionPtr prgn);
+Bool IsFramedWindow(WindowPtr pWin);
+#endif
+
_X_EXPORT void
miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
{
@@ -556,6 +564,19 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
Bool solid = TRUE;
DrawablePtr drawable = &pWin->drawable;
+#ifdef ROOTLESS
+ if(IsFramedWindow(pWin)) {
+ RootlessStartDrawing(pWin);
+ RootlessDamageRegion(pWin, prgn);
+
+ if(pWin->backgroundState == ParentRelative) {
+ if((what == PW_BACKGROUND) ||
+ (what == PW_BORDER && !pWin->borderIsPixel))
+ RootlessSetPixmapOfAncestors(pWin);
+ }
+ }
+#endif
+
if (what == PW_BACKGROUND)
{
while (pWin->backgroundState == ParentRelative)
diff --git a/mi/miwindow.c b/mi/miwindow.c
index cb8400c0c..ae7e139aa 100644
--- a/mi/miwindow.c
+++ b/mi/miwindow.c
@@ -1,3 +1,4 @@
+
/***********************************************************
Copyright 1987, 1998 The Open Group
diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index 3787e7e9e..2e5e84c2e 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -1692,3 +1692,29 @@ RootlessShowAllWindows (void)
RootlessScreenExpose (pScreen);
}
}
+
+/*
+ * SetPixmapOfAncestors
+ * Set the Pixmaps on all ParentRelative windows up the ancestor chain.
+ */
+void
+RootlessSetPixmapOfAncestors(WindowPtr pWin)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ WindowPtr topWin = TopLevelParent(pWin);
+ RootlessWindowRec *topWinRec = WINREC(topWin);
+
+ while (pWin->backgroundState == ParentRelative) {
+ if (pWin == topWin) {
+ // disallow ParentRelative background state on top level
+ XID pixel = 0;
+ ChangeWindowAttributes(pWin, CWBackPixel, &pixel, serverClient);
+ RL_DEBUG_MSG("Cleared ParentRelative on 0x%x.\n", pWin);
+ break;
+ }
+
+ pWin = pWin->parent;
+ pScreen->SetWindowPixmap(pWin, topWinRec->pixmap);
+ }
+}
+