xserver: Branch 'xorg-server-1.5-apple' - 4 commits
Jeremy Huddleston
jeremyhu at kemper.freedesktop.org
Thu Oct 1 13:33:53 PDT 2009
configure.ac | 6 -
hw/xquartz/Makefile.am | 2
hw/xquartz/darwinEvents.c | 2
hw/xquartz/darwinEvents.h | 2
hw/xquartz/quartz.h | 2
hw/xquartz/quartzCocoa.m | 57 ----------------
hw/xquartz/quartzKeyboard.c | 48 +++++++++++--
hw/xquartz/quartzPasteboard.c | 147 ------------------------------------------
hw/xquartz/quartzPasteboard.h | 44 ------------
include/inputstr.h | 2
10 files changed, 46 insertions(+), 266 deletions(-)
New commits:
commit 972c53d00e63aca906cc25475e11187b88df3603
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date: Thu Oct 1 12:54:33 2009 -0700
1.5.3-apple17
diff --git a/configure.ac b/configure.ac
index a0b96f7..51842b4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,9 +26,9 @@ dnl
dnl Process this file with autoconf to create configure.
AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.5.3-apple16, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="4 Sept 2009"
-REMEMBER_REMEMBER="The Fourth of September"
+AC_INIT([xorg-server], 1.5.3-apple17, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="1 Oct 2009"
+REMEMBER_REMEMBER="The First of October"
AC_CONFIG_SRCDIR([Makefile.am])
AM_INIT_AUTOMAKE([dist-bzip2 foreign])
AM_MAINTAINER_MODE
commit 9936b5b188dd85f169c41ef8ec46c9a210528c3f
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date: Thu Oct 1 12:57:55 2009 -0700
XQuartz: Dead code removal: quartzPasteboard.[hc]
diff --git a/hw/xquartz/Makefile.am b/hw/xquartz/Makefile.am
index ae8aa7f..65c70b0 100644
--- a/hw/xquartz/Makefile.am
+++ b/hw/xquartz/Makefile.am
@@ -33,7 +33,6 @@ libXquartz_la_SOURCES = \
quartzAudio.c \
quartzCocoa.m \
quartzKeyboard.c \
- quartzPasteboard.c \
quartzStartup.c \
threadSafety.c
@@ -50,7 +49,6 @@ EXTRA_DIST = \
quartzAudio.h \
quartzCommon.h \
quartzKeyboard.h \
- quartzPasteboard.h \
sanitizedCarbon.h \
sanitizedCocoa.h \
threadSafety.h
diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index 143eb95..bf72d05 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -331,8 +331,6 @@ Bool DarwinEQInit(void) {
mieqSetHandler(kXquartzReloadPreferences, DarwinEventHandler);
mieqSetHandler(kXquartzSetRootClip, DarwinEventHandler);
mieqSetHandler(kXquartzQuit, DarwinEventHandler);
- mieqSetHandler(kXquartzReadPasteboard, QuartzReadPasteboard);
- mieqSetHandler(kXquartzWritePasteboard, QuartzWritePasteboard);
mieqSetHandler(kXquartzToggleFullscreen, DarwinEventHandler);
mieqSetHandler(kXquartzSetRootless, DarwinEventHandler);
mieqSetHandler(kXquartzSpaceChanged, DarwinEventHandler);
diff --git a/hw/xquartz/darwinEvents.h b/hw/xquartz/darwinEvents.h
index 1268514..e1585fe 100644
--- a/hw/xquartz/darwinEvents.h
+++ b/hw/xquartz/darwinEvents.h
@@ -54,8 +54,6 @@ enum {
kXquartzDeactivate, // clip X drawing and switch to Aqua cursor
kXquartzSetRootClip, // enable or disable drawing to the X screen
kXquartzQuit, // kill the X server and release the display
- kXquartzReadPasteboard, // copy Mac OS X pasteboard into X cut buffer
- kXquartzWritePasteboard, // copy X cut buffer onto Mac OS X pasteboard
kXquartzBringAllToFront, // bring all X windows to front
kXquartzToggleFullscreen, // Enable/Disable fullscreen mode
kXquartzSetRootless, // Set rootless mode
diff --git a/hw/xquartz/quartz.h b/hw/xquartz/quartz.h
index 2570551..c1169b1 100644
--- a/hw/xquartz/quartz.h
+++ b/hw/xquartz/quartz.h
@@ -33,8 +33,6 @@
#ifndef _QUARTZ_H
#define _QUARTZ_H
-#include "quartzPasteboard.h"
-
#include "screenint.h"
#include "window.h"
diff --git a/hw/xquartz/quartzCocoa.m b/hw/xquartz/quartzCocoa.m
index 0ab9493..4501472 100644
--- a/hw/xquartz/quartzCocoa.m
+++ b/hw/xquartz/quartzCocoa.m
@@ -40,67 +40,10 @@
#include "quartzCommon.h"
#include "inputstr.h"
-#include "quartzPasteboard.h"
#include "darwin.h"
/*
- * QuartzWriteCocoaPasteboard
- * Write text to the Mac OS X pasteboard.
- */
-void QuartzWriteCocoaPasteboard(
- char *text)
-{
- NSPasteboard *pasteboard;
- NSArray *pasteboardTypes;
- NSString *string;
-
- if (! text) return;
- pasteboard = [NSPasteboard generalPasteboard];
- if (! pasteboard) return;
- string = [NSString stringWithCString:text];
- if (! string) return;
- pasteboardTypes = [NSArray arrayWithObject:NSStringPboardType];
-
- // nil owner because we don't provide type translations
- [pasteboard declareTypes:pasteboardTypes owner:nil];
- [pasteboard setString:string forType:NSStringPboardType];
-}
-
-
-/*
- * QuartzReadCocoaPasteboard
- * Read text from the Mac OS X pasteboard and return it as a heap string.
- * The caller must free the string.
- */
-char *QuartzReadCocoaPasteboard(void)
-{
- NSPasteboard *pasteboard;
- NSArray *pasteboardTypes;
- NSString *existingType;
- char *text = NULL;
-
- pasteboardTypes = [NSArray arrayWithObject:NSStringPboardType];
- pasteboard = [NSPasteboard generalPasteboard];
- if (! pasteboard) return NULL;
-
- existingType = [pasteboard availableTypeFromArray:pasteboardTypes];
- if (existingType) {
- NSString *string = [pasteboard stringForType:existingType];
- char *buffer;
-
- if (! string) return NULL;
- buffer = (char *) [string UTF8String];
- text = (char *) malloc(strlen(buffer)+1);
- if (text)
- strcpy(text, buffer);
- }
-
- return text;
-}
-
-
-/*
* QuartzFSUseQDCursor
* Return whether the screen should use a QuickDraw cursor.
*/
diff --git a/hw/xquartz/quartzPasteboard.c b/hw/xquartz/quartzPasteboard.c
deleted file mode 100644
index d47047c..0000000
--- a/hw/xquartz/quartzPasteboard.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/**************************************************************
- * quartzPasteboard.c
- *
- * Aqua pasteboard <-> X cut buffer
- * Greg Parker gparker at cs.stanford.edu March 8, 2001
- **************************************************************/
-/*
- * Copyright (c) 2001 Greg Parker. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "misc.h"
-#include "inputstr.h"
-#include "quartzPasteboard.h"
-
-#include <X11/Xatom.h>
-#include "windowstr.h"
-#include "propertyst.h"
-#include "scrnintstr.h"
-#include "selection.h"
-#include "globals.h"
-
-
-// Helper function to read the X11 cut buffer
-// FIXME: What about multiple screens? Currently, this reads the first
-// CUT_BUFFER0 from the first screen where the buffer content is a string.
-// Returns a string on the heap that the caller must free.
-// Returns NULL if there is no cut text or there is not enough memory.
-static char * QuartzReadCutBuffer(void)
-{
- int rc, i;
- char *text = NULL;
-
- for (i = 0; i < screenInfo.numScreens; i++) {
- ScreenPtr pScreen = screenInfo.screens[i];
- PropertyPtr pProp;
-
- rc = dixLookupProperty(&pProp, WindowTable[pScreen->myNum],
- XA_CUT_BUFFER0, serverClient, DixReadAccess);
- if (rc != Success) continue;
- if (pProp->type != XA_STRING) continue;
- if (pProp->format != 8) continue;
-
- text = xalloc(1 + pProp->size);
- if (! text) continue;
- memcpy(text, pProp->data, pProp->size);
- text[pProp->size] = '\0';
- return text;
- }
-
- // didn't find any text
- return NULL;
-}
-
-// Write X cut buffer to Mac OS X pasteboard
-// Called by mieqProcessInputEvents() in response to request from X server thread.
-void QuartzWritePasteboard(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nevents)
-{
- char *text;
- text = QuartzReadCutBuffer();
- if (text) {
- QuartzWriteCocoaPasteboard(text);
- free(text);
- }
-}
-
-#define strequal(a, b) (0 == strcmp((a), (b)))
-
-// Read Mac OS X pasteboard into X cut buffer
-// Called by mieqProcessInputEvents() in response to request from X server thread.
-void QuartzReadPasteboard(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nevents)
-{
- char *oldText = QuartzReadCutBuffer();
- char *text = QuartzReadCocoaPasteboard();
-
- // Compare text with current cut buffer contents.
- // Change the buffer if both exist and are different
- // OR if there is new text but no old text.
- // Otherwise, don't clear the selection unnecessarily.
-
- if ((text && oldText && !strequal(text, oldText)) ||
- (text && !oldText)) {
- int scrn, rc;
- Selection *pSel;
-
- for (scrn = 0; scrn < screenInfo.numScreens; scrn++) {
- ScreenPtr pScreen = screenInfo.screens[scrn];
- // Set the cut buffers on each screen
- // fixme really on each screen?
- dixChangeWindowProperty(serverClient, WindowTable[pScreen->myNum],
- XA_CUT_BUFFER0, XA_STRING, 8, PropModeReplace,
- strlen(text), (pointer)text, TRUE);
- }
-
- // Undo any current X selection (similar to code in dispatch.c)
- // FIXME: what about secondary selection?
- // FIXME: only touch first XA_PRIMARY selection?
- rc = dixLookupSelection(&pSel, XA_PRIMARY, serverClient,
- DixSetAttrAccess);
- if (rc == Success) {
- // Notify client if necessary
- if (pSel->client) {
- xEvent event;
-
- event.u.u.type = SelectionClear;
- event.u.selectionClear.time = GetTimeInMillis();
- event.u.selectionClear.window = pSel->window;
- event.u.selectionClear.atom = pSel->selection;
- TryClientEvents(pSel->client, &event, 1, NoEventMask,
- NoEventMask /*CantBeFiltered*/, NullGrab);
- }
-
- // Erase it
- pSel->pWin = NullWindow;
- pSel->window = None;
- pSel->client = NullClient;
- }
- }
-
- if (text) free(text);
- if (oldText) free(oldText);
-}
diff --git a/hw/xquartz/quartzPasteboard.h b/hw/xquartz/quartzPasteboard.h
deleted file mode 100644
index b51cd88..0000000
--- a/hw/xquartz/quartzPasteboard.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- QuartzPasteboard.h
-
- Mac OS X pasteboard <-> X cut buffer
- Greg Parker gparker at cs.stanford.edu March 8, 2001
-*/
-/*
- * Copyright (c) 2001 Greg Parker. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-
-#ifndef _QUARTZPASTEBOARD_H
-#define _QUARTZPASTEBOARD_H
-
-// Aqua->X
-void QuartzReadPasteboard(int, xEventPtr, DeviceIntPtr, int);
-char * QuartzReadCocoaPasteboard(void); // caller must free string
-
-// X->Aqua
-void QuartzWritePasteboard(int, xEventPtr, DeviceIntPtr, int);
-void QuartzWriteCocoaPasteboard(char *text);
-
-#endif /* _QUARTZPASTEBOARD_H */
commit 8bca86c2025dd8b71ba813acd0ba5cad170480c0
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date: Wed Sep 30 00:22:02 2009 -0700
XQuartz: Set the proper bitmap for key repeats...
XkbSetRepeatKeys lies and doesn't do what it says it will...
(cherry picked from commit 873467adad479be02cd9cc6b43685919f5612d91)
diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index d54782b..d284b93 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -317,19 +317,53 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) {
/* Set the repeat rates based on global preferences and keycodes for modifiers.
* Precondition: Has the keyInfo_mutex lock.
*/
-static void DarwinKeyboardSetRepeat(DeviceIntPtr pDev, CFIndex initialKeyRepeatValue, CFIndex keyRepeatValue) {
+static void DarwinKeyboardSetRepeat(DeviceIntPtr pDev, int initialKeyRepeatValue, int keyRepeatValue) {
if(initialKeyRepeatValue == 300000) { // off
+ /* Turn off repeats globally */
XkbSetRepeatKeys(pDev, -1, AutoRepeatModeOff);
} else {
- pDev->key->xkbInfo->desc->ctrls->repeat_delay = initialKeyRepeatValue * 15;
- pDev->key->xkbInfo->desc->ctrls->repeat_interval = keyRepeatValue * 15;
+ int i;
+ XkbControlsPtr ctrl;
+ XkbControlsRec old;
+ /* Turn on repeats globally */
XkbSetRepeatKeys(pDev, -1, AutoRepeatModeOn);
+
+ /* Setup the bit mask for individual key repeats */
+ ctrl = pDev->key->xkbInfo->desc->ctrls;
+ old= *ctrl;
+
+ ctrl->repeat_delay = initialKeyRepeatValue * 15;
+ ctrl->repeat_interval = keyRepeatValue * 15;
+
+ /* Turn off key-repeat for modifier keys, on for others */
+ /* First set them all on */
+ for(i=0; i < XkbPerKeyBitArraySize; i++)
+ ctrl->per_key_repeat[i] = -1;
+
+ /* Now turn off the modifiers */
+ for(i=0; i < 32; i++) {
+ unsigned char keycode;
+
+ keycode = keyInfo.modifierKeycodes[i][0];
+ if(keycode)
+ ClearBit(ctrl->per_key_repeat, keycode + MIN_KEYCODE);
+
+ keycode = keyInfo.modifierKeycodes[i][1];
+ if(keycode)
+ ClearBit(ctrl->per_key_repeat, keycode + MIN_KEYCODE);
+ }
+
+ /* Hurray for data duplication */
+ if (pDev->kbdfeed)
+ memcpy(pDev->kbdfeed->ctrl.autoRepeats, ctrl->per_key_repeat, XkbPerKeyBitArraySize);
+
+ //fprintf(stderr, "per_key_repeat =\n");
+ //for(i=0; i < XkbPerKeyBitArraySize; i++)
+ // fprintf(stderr, "%02x%s", ctrl->per_key_repeat[i], (i + 1) & 7 ? "" : "\n");
- /* TODO: Turn off key-repeat for modifier keys, on for others */
- // Test: Shouldn't this turn off all the key repeats???
- //for(i=MIN_KEYCODE; i <= MAX_KEYCODE; i++)
- // XkbSetRepeatKeys(pDev, i, AutoRepeatModeOff);
+ /* And now we notify the puppies about the changes */
+ XkbDDXChangeControls(pDev, &old, ctrl);
}
}
commit 022846f7fbb5a705746754d112a523259bdf7ee8
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date: Fri Dec 12 10:49:53 2008 +1000
dix: add SetBit(arr, bit) and ClearBit(arr, bit) to include/inputstr.h
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
(cherry picked from commit 5e0967f5fc2e0fcf2a55128eb03931cf6f5709e9)
diff --git a/include/inputstr.h b/include/inputstr.h
index b1f9856..6b55704 100644
--- a/include/inputstr.h
+++ b/include/inputstr.h
@@ -55,6 +55,8 @@ SOFTWARE.
#include "privates.h"
#define BitIsOn(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7)))
+#define SetBit(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7)))
+#define ClearBit(ptr, bit) (((BYTE *)(ptr))[(bit)>>3] &= ~(1 << ((bit) & 7)))
#define SameClient(obj,client) \
(CLIENT_BITS((obj)->resource) == (client)->clientAsMask)
More information about the xorg-commit
mailing list