comparison system/Init.cpp @ 722:b0fde2a60188

Remove X11 stuff from svcore
author Chris Cannam
date Wed, 18 Jan 2012 18:13:08 +0000
parents 29efe322ab47
children 23d3a6eca5c3
comparison
equal deleted inserted replaced
721:0696d02f0f3f 722:b0fde2a60188
14 */ 14 */
15 15
16 #include <iostream> 16 #include <iostream>
17 17
18 #include <qglobal.h> 18 #include <qglobal.h>
19
20 #ifdef Q_WS_X11
21 #include <X11/Xlib.h>
22 #include <X11/Xutil.h>
23 #include <X11/Xatom.h>
24 #include <X11/SM/SMlib.h>
25
26 static int handle_x11_error(Display *dpy, XErrorEvent *err)
27 {
28 char errstr[256];
29 XGetErrorText(dpy, err->error_code, errstr, 256);
30 if (err->error_code != BadWindow) {
31 std::cerr << "Sonic Visualiser: X Error: "
32 << errstr << " " << int(err->error_code)
33 << "\nin major opcode: "
34 << int(err->request_code) << std::endl;
35 }
36 return 0;
37 }
38 #endif
39 19
40 #ifdef Q_WS_WIN32 20 #ifdef Q_WS_WIN32
41 21
42 #include <fcntl.h> 22 #include <fcntl.h>
43 23
75 55
76 #endif 56 #endif
77 57
78 extern void svSystemSpecificInitialisation() 58 extern void svSystemSpecificInitialisation()
79 { 59 {
80 #ifdef Q_WS_X11
81 XSetErrorHandler(handle_x11_error);
82 #endif
83
84 #ifdef Q_WS_WIN32 60 #ifdef Q_WS_WIN32
85 redirectStderr(); 61 redirectStderr();
86 62
87 // Remove the CWD from the DLL search path, just in case 63 // Remove the CWD from the DLL search path, just in case
88 SetDllDirectory(L""); 64 SetDllDirectory(L"");