mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-24 10:10:05 +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",
|
.rules = "base", .model = "empty", .layout = "empty",
|
||||||
.variant = NULL, .options = NULL
|
.variant = NULL, .options = NULL
|
||||||
};
|
};
|
||||||
|
int result;
|
||||||
|
|
||||||
/* We need to really have rules... or something... */
|
/* We need to really have rules... or something... */
|
||||||
XkbSetRulesDflts(&rmlvo);
|
XkbSetRulesDflts(&rmlvo);
|
||||||
|
|
||||||
assert(Success == AllocDevicePair(serverClient, "xquartz virtual",
|
result = AllocDevicePair(serverClient, "xquartz virtual",
|
||||||
&darwinPointer, &darwinKeyboard,
|
&darwinPointer, &darwinKeyboard,
|
||||||
DarwinMouseProc, DarwinKeybdProc, FALSE));
|
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:
|
/* here's the snippet from the current gdk sources:
|
||||||
if (!strcmp (tmp_name, "pointer"))
|
if (!strcmp (tmp_name, "pointer"))
|
||||||
|
|
@ -542,15 +548,26 @@ InitInput(int argc, char **argv)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
darwinTabletStylus = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
|
darwinTabletStylus = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
|
||||||
assert(darwinTabletStylus);
|
if (!darwinTabletStylus) {
|
||||||
|
FatalError("InitInput: "
|
||||||
|
"AddInputDevice(serverClient, DarwinTabletProc, TRUE) "
|
||||||
|
"failed.\n");
|
||||||
|
}
|
||||||
|
|
||||||
darwinTabletStylus->name = strdup("pen");
|
darwinTabletStylus->name = strdup("pen");
|
||||||
|
|
||||||
darwinTabletCursor = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
|
darwinTabletCursor = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
|
||||||
assert(darwinTabletCursor);
|
if(!darwinTabletCursor) {
|
||||||
|
FatalError("InitInput: "
|
||||||
|
"AddInputDevice(serverClient, DarwinTabletProc, TRUE) "
|
||||||
|
"failed.\n");
|
||||||
|
}
|
||||||
darwinTabletCursor->name = strdup("cursor");
|
darwinTabletCursor->name = strdup("cursor");
|
||||||
|
|
||||||
darwinTabletEraser = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
|
darwinTabletEraser = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
|
||||||
assert(darwinTabletEraser);
|
if(!darwinTabletEraser) {
|
||||||
|
FatalError("InitInput: AddInputDevice(serverClient, DarwinTabletProc, TRUE) failed.\n");
|
||||||
|
}
|
||||||
darwinTabletEraser->name = strdup("eraser");
|
darwinTabletEraser->name = strdup("eraser");
|
||||||
|
|
||||||
DarwinEQInit();
|
DarwinEQInit();
|
||||||
|
|
@ -679,8 +696,18 @@ OsVendorInit(void)
|
||||||
if (serverGeneration == 1) {
|
if (serverGeneration == 1) {
|
||||||
char *lf;
|
char *lf;
|
||||||
char *home = getenv("HOME");
|
char *home = getenv("HOME");
|
||||||
assert(home);
|
int nbytes;
|
||||||
assert(0 < asprintf(&lf, "%s/Library/Logs/X11", home));
|
|
||||||
|
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,
|
/* Ignore errors. If EEXIST, we don't care. If anything else,
|
||||||
* LogInit will handle it for us.
|
* LogInit will handle it for us.
|
||||||
|
|
@ -688,9 +715,12 @@ OsVendorInit(void)
|
||||||
(void)mkdir(lf, S_IRWXU | S_IRWXG | S_IRWXO);
|
(void)mkdir(lf, S_IRWXU | S_IRWXG | S_IRWXO);
|
||||||
free(lf);
|
free(lf);
|
||||||
|
|
||||||
assert(0 <
|
nbytes = asprintf(&lf, "%s/Library/Logs/X11/%s.log", home,
|
||||||
asprintf(&lf, "%s/Library/Logs/X11/%s.log", home,
|
bundle_id_prefix);
|
||||||
bundle_id_prefix));
|
if (nbytes <= 0) {
|
||||||
|
FatalError("darwin OsVendorInit: "
|
||||||
|
"asprintf of log file name failed.\n");
|
||||||
|
}
|
||||||
LogInit(lf, ".old");
|
LogInit(lf, ".old");
|
||||||
free(lf);
|
free(lf);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue