mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 04:40:02 +01:00
Merge branch 'master' into 'master'
xquartz: In darwin.c, replace assert calls with tests that call FatalError on failure See merge request xorg/xserver!198
This commit is contained in:
commit
4e068725a0
1 changed files with 41 additions and 11 deletions
|
|
@ -519,13 +519,19 @@ InitInput(int argc, char **argv)
|
|||
.rules = "base", .model = "empty", .layout = "empty",
|
||||
.variant = NULL, .options = NULL
|
||||
};
|
||||
int result;
|
||||
|
||||
/* We need to really have rules... or something... */
|
||||
XkbSetRulesDflts(&rmlvo);
|
||||
|
||||
assert(Success == AllocDevicePair(serverClient, "xquartz virtual",
|
||||
&darwinPointer, &darwinKeyboard,
|
||||
DarwinMouseProc, DarwinKeybdProc, FALSE));
|
||||
result = AllocDevicePair(serverClient, "xquartz virtual",
|
||||
&darwinPointer, &darwinKeyboard,
|
||||
DarwinMouseProc, DarwinKeybdProc, FALSE);
|
||||
if (result != Success) {
|
||||
FatalError("InitInput: AllocDevicePair (...,\"xquartz virtual\",...) "
|
||||
"returned X windows error %d.\n",
|
||||
result);
|
||||
}
|
||||
|
||||
/* here's the snippet from the current gdk sources:
|
||||
if (!strcmp (tmp_name, "pointer"))
|
||||
|
|
@ -542,15 +548,26 @@ InitInput(int argc, char **argv)
|
|||
*/
|
||||
|
||||
darwinTabletStylus = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
|
||||
assert(darwinTabletStylus);
|
||||
if (!darwinTabletStylus) {
|
||||
FatalError("InitInput: "
|
||||
"AddInputDevice(serverClient, DarwinTabletProc, TRUE) "
|
||||
"failed.\n");
|
||||
}
|
||||
|
||||
darwinTabletStylus->name = strdup("pen");
|
||||
|
||||
darwinTabletCursor = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
|
||||
assert(darwinTabletCursor);
|
||||
if(!darwinTabletCursor) {
|
||||
FatalError("InitInput: "
|
||||
"AddInputDevice(serverClient, DarwinTabletProc, TRUE) "
|
||||
"failed.\n");
|
||||
}
|
||||
darwinTabletCursor->name = strdup("cursor");
|
||||
|
||||
darwinTabletEraser = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
|
||||
assert(darwinTabletEraser);
|
||||
if(!darwinTabletEraser) {
|
||||
FatalError("InitInput: AddInputDevice(serverClient, DarwinTabletProc, TRUE) failed.\n");
|
||||
}
|
||||
darwinTabletEraser->name = strdup("eraser");
|
||||
|
||||
DarwinEQInit();
|
||||
|
|
@ -679,8 +696,18 @@ OsVendorInit(void)
|
|||
if (serverGeneration == 1) {
|
||||
char *lf;
|
||||
char *home = getenv("HOME");
|
||||
assert(home);
|
||||
assert(0 < asprintf(&lf, "%s/Library/Logs/X11", home));
|
||||
int nbytes;
|
||||
|
||||
if (!home) {
|
||||
FatalError("darwin OsVendorInit: "
|
||||
"getenv(\"HOME\") returned NULL.\n");
|
||||
}
|
||||
|
||||
nbytes = asprintf(&lf, "%s/Library/Logs/X11", home);
|
||||
if (nbytes <= 0) {
|
||||
FatalError("darwin OsVendorInit: "
|
||||
"asprintf of log directory name failed.\n");
|
||||
}
|
||||
|
||||
/* Ignore errors. If EEXIST, we don't care. If anything else,
|
||||
* LogInit will handle it for us.
|
||||
|
|
@ -688,9 +715,12 @@ OsVendorInit(void)
|
|||
(void)mkdir(lf, S_IRWXU | S_IRWXG | S_IRWXO);
|
||||
free(lf);
|
||||
|
||||
assert(0 <
|
||||
asprintf(&lf, "%s/Library/Logs/X11/%s.log", home,
|
||||
bundle_id_prefix));
|
||||
nbytes = asprintf(&lf, "%s/Library/Logs/X11/%s.log", home,
|
||||
bundle_id_prefix);
|
||||
if (nbytes <= 0) {
|
||||
FatalError("darwin OsVendorInit: "
|
||||
"asprintf of log file name failed.\n");
|
||||
}
|
||||
LogInit(lf, ".old");
|
||||
free(lf);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue