mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-29 02:31:18 +00:00
Darwin: Added a lightweight debugging facility to support troubleshooting
(for example) the stuck modifier key issue (cherry picked from commit 0e0b452d10c0af55497c3299b5f3db45d5b381cb)
This commit is contained in:
parent
74214a9f42
commit
8486f8af91
2 changed files with 28 additions and 0 deletions
|
|
@ -75,6 +75,10 @@
|
|||
#include "darwin.h"
|
||||
#include "darwinClut8.h"
|
||||
|
||||
#ifdef ENABLE_DEBUG_LOG
|
||||
FILE *debug_log_fp = NULL;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* X server shared global variables
|
||||
*/
|
||||
|
|
@ -652,6 +656,20 @@ void OsVendorInit(void)
|
|||
{
|
||||
if (serverGeneration == 1) {
|
||||
DarwinPrintBanner();
|
||||
#ifdef ENABLE_DEBUG_LOG
|
||||
{
|
||||
char *home_dir=NULL, *log_file_path=NULL;
|
||||
home_dir = getenv("HOME");
|
||||
if (home_dir) asprintf(&log_file_path, "%s/%s", home_dir, DEBUG_LOG_NAME);
|
||||
if (log_file_path) {
|
||||
if (!access(log_file_path, F_OK)) {
|
||||
debug_log_fp = fopen(log_file_path, "a");
|
||||
if (debug_log_fp) ErrorF("Debug logging enabled to %s\n", log_file_path);
|
||||
}
|
||||
free(log_file_path);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Find the full path to the keymapping file.
|
||||
|
|
|
|||
Loading…
Reference in a new issue