[Xquartz-changes] xserver: Branch 'server-1.4-apple' - 4 commits
Jeremy Huddleston
jeremyhu at freedesktop.org
Thu Nov 5 11:09:41 PST 2009
hw/xquartz/X11Application.h | 1 +
hw/xquartz/X11Application.m | 19 +++++++++++++------
hw/xquartz/X11Controller.h | 4 ++--
hw/xquartz/X11Controller.m | 16 ++++++++--------
hw/xquartz/applewm.c | 20 +++++++++++---------
hw/xquartz/quartzKeyboard.c | 18 +++++++++++-------
6 files changed, 46 insertions(+), 32 deletions(-)
New commits:
commit c72f53d55a9b8da9760f0f199d21a92d2bc55774
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date: Wed Nov 4 18:39:16 2009 -0800
XQuartz: Cleanup X11Controller.m compilation warnings.
Declare X11Controller as implementing NSTableViewDataSource.
Use selectRowIndexes:byExtendingSelection instead of selectRow:byExtendingSelection
(cherry picked from commit 0ea1a15cb779f2b52ef25413c75e419f76a4149d)
diff --git a/hw/xquartz/X11Controller.h b/hw/xquartz/X11Controller.h
index 88f50a1..bb28447 100644
--- a/hw/xquartz/X11Controller.h
+++ b/hw/xquartz/X11Controller.h
@@ -55,7 +55,7 @@ typedef unsigned int NSUInteger;
#endif
#endif
- at interface X11Controller : NSObject
+ at interface X11Controller : NSObject <NSTableViewDataSource>
{
IBOutlet NSPanel *prefs_panel;
diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m
index b95414e..6effcca 100644
--- a/hw/xquartz/X11Controller.m
+++ b/hw/xquartz/X11Controller.m
@@ -427,8 +427,8 @@
[[columns objectAtIndex:2] setIdentifier:@"2"];
[apps_table setDataSource:self];
- [apps_table selectRow:0 byExtendingSelection:NO];
-
+ [apps_table selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO];
+
[[apps_table window] makeKeyAndOrderFront:sender];
[apps_table reloadData];
if(oldapps != nil)
@@ -475,7 +475,7 @@
[item release];
[apps_table reloadData];
- [apps_table selectRow:row byExtendingSelection:NO];
+ [apps_table selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
}
- (IBAction) apps_table_duplicate:sender
@@ -498,7 +498,7 @@
[item release];
[apps_table reloadData];
- [apps_table selectRow:row+1 byExtendingSelection:NO];
+ [apps_table selectRowIndexes:[NSIndexSet indexSetWithIndex:row+1] byExtendingSelection:NO];
}
- (IBAction) apps_table_delete:sender
@@ -520,10 +520,10 @@
row = MIN (row, [table_apps count] - 1);
if (row >= 0)
- [apps_table selectRow:row byExtendingSelection:NO];
+ [apps_table selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
}
-- (int) numberOfRowsInTableView:(NSTableView *)tableView
+- (NSInteger) numberOfRowsInTableView:(NSTableView *)tableView
{
if (table_apps == nil) return 0;
@@ -531,7 +531,7 @@
}
- (id) tableView:(NSTableView *)tableView
-objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row
+objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
{
NSArray *item;
int col;
@@ -548,7 +548,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row
}
- (void) tableView:(NSTableView *)tableView setObjectValue:(id)object
- forTableColumn:(NSTableColumn *)tableColumn row:(int)row
+ forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
{
NSMutableArray *item;
int col;
commit 66a03081bdbc06c75e286aab4d92d4be0d566f11
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date: Wed Nov 4 18:15:08 2009 -0800
XQuartz: Use dixLookupResourceByType instead of LookupIDByType
(cherry picked from commit 4e1f12e032595ccf1bd14693c35ca42e79b09fe3)
diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c
index 1d72bde..b7dded5 100644
--- a/hw/xquartz/applewm.c
+++ b/hw/xquartz/applewm.c
@@ -224,10 +224,11 @@ static int
WMFreeClient (pointer data, XID id) {
WMEventPtr pEvent;
WMEventPtr *pHead, pCur, pPrev;
+ int i;
pEvent = (WMEventPtr) data;
- pHead = (WMEventPtr *) LookupIDByType(eventResource, EventType);
- if (pHead) {
+ i = dixLookupResourceByType((pointer *)&pHead, eventResource, EventType, serverClient, DixReadAccess | DixWriteAccess | DixDestroyAccess);
+ if (i == Success && pHead) {
pPrev = 0;
for (pCur = *pHead; pCur && pCur != pEvent; pCur=pCur->next)
pPrev = pCur;
@@ -265,12 +266,12 @@ ProcAppleWMSelectInput (register ClientPtr client)
REQUEST(xAppleWMSelectInputReq);
WMEventPtr pEvent, pNewEvent, *pHead;
XID clientResource;
+ int i;
REQUEST_SIZE_MATCH (xAppleWMSelectInputReq);
- pHead = (WMEventPtr *)SecurityLookupIDByType(client,
- eventResource, EventType, DixWriteAccess);
+ i = dixLookupResourceByType((pointer *)&pHead, eventResource, EventType, client, DixWriteAccess);
if (stuff->mask != 0) {
- if (pHead) {
+ if (i == Success && pHead) {
/* check for existing entry. */
for (pEvent = *pHead; pEvent; pEvent = pEvent->next)
{
@@ -304,7 +305,7 @@ ProcAppleWMSelectInput (register ClientPtr client)
* the list may be arbitrarily rearranged which cannot be
* done through the resource database.
*/
- if (!pHead)
+ if (i != Success || !pHead)
{
pHead = (WMEventPtr *) xalloc (sizeof (WMEventPtr));
if (!pHead ||
@@ -320,7 +321,7 @@ ProcAppleWMSelectInput (register ClientPtr client)
updateEventMask (pHead);
} else if (stuff->mask == 0) {
/* delete the interest */
- if (pHead) {
+ if (i == Success && pHead) {
pNewEvent = 0;
for (pEvent = *pHead; pEvent; pEvent = pEvent->next) {
if (pEvent->client == client)
@@ -353,9 +354,10 @@ AppleWMSendEvent (int type, unsigned int mask, int which, int arg) {
WMEventPtr *pHead, pEvent;
ClientPtr client;
xAppleWMNotifyEvent se;
+ int i;
- pHead = (WMEventPtr *) LookupIDByType(eventResource, EventType);
- if (!pHead)
+ i = dixLookupResourceByType((pointer *)&pHead, eventResource, EventType, serverClient, DixReadAccess);
+ if (i != Success || !pHead)
return;
for (pEvent = *pHead; pEvent; pEvent = pEvent->next) {
client = pEvent->client;
commit 83faccd1ece2d51617c6a5b286f0bf869af71562
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date: Wed Nov 4 16:18:06 2009 -0800
XQuartz: Don't weed out duplicates in generated keymap
There seems to be an issue in the 1.5+ server where shift-space does not
produce a space when 'keycode 57 = space' but it does when 'keycode 57 = space
space'
Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>
(cherry picked from commit 7f919e0c0eae51a81ed5ec502a02cc8c324aafe9)
diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index 0eb0623..1b54014 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -400,6 +400,7 @@ void DarwinKeyboardReloadHandler(void) {
keySyms.minKeyCode = MIN_KEYCODE;
keySyms.maxKeyCode = MAX_KEYCODE;
+ // TODO: We should build the entire XkbDescRec and use XkbCopyKeymap
/* Apply the mappings to darwinKeyboard */
SetKeySymsMap(&darwinKeyboard->key->curKeySyms, &keySyms);
memcpy(darwinKeyboard->key->modifierMap, keyInfo.modMap, sizeof(keyInfo.modMap));
@@ -785,9 +786,12 @@ Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) {
#endif
}
- if (k[3] == k[2]) k[3] = NoSymbol;
- if (k[1] == k[0]) k[1] = NoSymbol;
- if (k[0] == k[2] && k[1] == k[3]) k[2] = k[3] = NoSymbol;
+ // There seems to be an issue with this in 1.5+, shift-space is not
+ // producing space, it's sending NoSymbol... ?
+ //if (k[3] == k[2]) k[3] = NoSymbol;
+ //if (k[1] == k[0]) k[1] = NoSymbol;
+ //if (k[0] == k[2] && k[1] == k[3]) k[2] = k[3] = NoSymbol;
+ //if (k[3] == k[0] && k[2] == k[1] && k[2] == NoSymbol) k[3] = NoSymbol;
}
/* Fix up some things that are normally missing.. */
@@ -798,7 +802,7 @@ Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) {
if (k[0] == NoSymbol && k[1] == NoSymbol
&& k[2] == NoSymbol && k[3] == NoSymbol)
- k[0] = known_keys[i].keysym;
+ k[0] = k[1] = k[2] = k[3] = known_keys[i].keysym;
}
}
@@ -811,7 +815,7 @@ Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) {
k = info->keyMap + known_numeric_keys[i].keycode * GLYPHS_PER_KEY;
if (k[0] == known_numeric_keys[i].normal)
- k[0] = known_numeric_keys[i].keypad;
+ k[0] = k[1] = k[2] = k[3] = known_numeric_keys[i].keypad;
}
}
commit 2fdee6817a76189426bf69c4e7dedb18aec029dd
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date: Wed Nov 4 13:34:20 2009 -0800
XQuartz: Controller thread launches clients
This avoids a memory leak due to no active auto-release pool on the server thread.
Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>
(cherry picked from commit e33f640c2ae10f225eeb486c141266f85f8367ae)
diff --git a/hw/xquartz/X11Application.h b/hw/xquartz/X11Application.h
index 5e828a4..d7e9a5f 100644
--- a/hw/xquartz/X11Application.h
+++ b/hw/xquartz/X11Application.h
@@ -71,6 +71,7 @@ void X11ApplicationSetFrontProcess (void);
void X11ApplicationSetCanQuit (int state);
void X11ApplicationServerReady (void);
void X11ApplicationShowHideMenubar (int state);
+void X11ApplicationLaunchClient (const char *cmd);
void X11ApplicationMain(int argc, char **argv, char **envp);
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index bff8415..bc6543e 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -412,6 +412,9 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
SetSystemUIMode(kUIModeAllHidden, quartzFullscreenMenu ? kUIOptionAutoShowMenuBar : 0); // kUIModeAllSuppressed or kUIOptionAutoShowMenuBar can be used to allow "mouse-activation"
}
+- (void) launch_client:(NSString *)cmd {
+ (void)[_controller application:self openFile:cmd];
+}
/* user preferences */
@@ -857,6 +860,16 @@ void X11ApplicationShowHideMenubar (int state) {
[n release];
}
+void X11ApplicationLaunchClient (const char *cmd) {
+ NSString *string;
+
+ string = [[NSString alloc] initWithUTF8String:cmd];
+
+ message_kit_thread (@selector (launch_client:), string);
+
+ [string release];
+}
+
static void check_xinitrc (void) {
char *tem, buf[1024];
NSString *msg;
@@ -962,12 +975,6 @@ void X11ApplicationMain (int argc, char **argv, char **envp) {
/* not reached */
}
-void launch_client(const char *cmd) {
- NSString *string = [[NSString alloc] initWithUTF8String:cmd];
- [[X11App controller] launch_client:string];
- [string release];
-}
-
@implementation X11Application (Private)
#ifdef NX_DEVICELCMDKEYMASK
diff --git a/hw/xquartz/X11Controller.h b/hw/xquartz/X11Controller.h
index 3d8e007..88f50a1 100644
--- a/hw/xquartz/X11Controller.h
+++ b/hw/xquartz/X11Controller.h
@@ -120,6 +120,7 @@ typedef unsigned int NSUInteger;
#endif
- (void) set_can_quit:(OSX_BOOL)state;
- (void) server_ready;
+- (OSX_BOOL) application:(NSApplication *)app openFile:(NSString *)filename;
- (IBAction) apps_table_show:(id)sender;
- (IBAction) apps_table_done:(id)sender;
@@ -144,6 +145,5 @@ typedef unsigned int NSUInteger;
#endif /* __OBJC__ */
void X11ControllerMain(int argc, char **argv, char **envp);
-void launch_client(const char *cmd);
#endif /* X11CONTROLLER_H */
diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index 6f8b383..0eb0623 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -426,7 +426,7 @@ void DarwinKeyboardReloadHandler(void) {
if (access(xmodmap, F_OK) == 0) {
if (access(sysmodmap, F_OK) == 0) {
snprintf (cmd, sizeof(cmd), "%s %s", xmodmap, sysmodmap);
- launch_client(cmd);
+ X11ApplicationLaunchClient(cmd);
}
}
@@ -435,7 +435,7 @@ void DarwinKeyboardReloadHandler(void) {
snprintf (usermodmap, sizeof(usermodmap), "%s/.Xmodmap", homedir);
if (access(usermodmap, F_OK) == 0) {
snprintf (cmd, sizeof(cmd), "%s %s", xmodmap, usermodmap);
- launch_client(cmd);
+ X11ApplicationLaunchClient(cmd);
}
}
}
More information about the Xquartz-changes
mailing list