| 4526 | } |
| 4527 | |
| 4528 | void NetHackQtBind::qt_init_nhwindows(int* argc, char** argv) |
| 4529 | { |
| 4530 | #ifdef UNIX |
| 4531 | // Userid control |
| 4532 | // |
| 4533 | // Michael Hohmuth <hohmuth@inf.tu-dresden.de>... |
| 4534 | // |
| 4535 | // As the game runs setuid games, it must seteuid(getuid()) before |
| 4536 | // calling XOpenDisplay(), and reset the euid afterwards. |
| 4537 | // Otherwise, it can't read the $HOME/.Xauthority file and whines about |
| 4538 | // not being able to open the X display (if a magic-cookie |
| 4539 | // authorization mechanism is being used). |
| 4540 | |
| 4541 | uid_t gamesuid=geteuid(); |
| 4542 | seteuid(getuid()); |
| 4543 | #endif |
| 4544 | |
| 4545 | QApplication::setColorSpec(ManyColor); |
| 4546 | instance=new NetHackQtBind(*argc,argv); |
| 4547 | |
| 4548 | #ifdef UNIX |
| 4549 | seteuid(gamesuid); |
| 4550 | #endif |
| 4551 | |
| 4552 | #ifdef _WS_WIN_ |
| 4553 | // This nethack engine feature should be moved into windowport API |
| 4554 | nt_kbhit = NetHackQtBind::qt_kbhit; |
| 4555 | #endif |
| 4556 | } |
| 4557 | |
| 4558 | int NetHackQtBind::qt_kbhit() |
| 4559 | { |