File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,11 @@ ConfigVariableBool x_error_abort
40
40
" of an error from the X window system. This can make it easier "
41
41
" to discover where these errors are generated." ));
42
42
43
+ ConfigVariableBool x_init_threads
44
+ (" x-init-threads" , false ,
45
+ PRC_DESC (" Set this true to ask Panda3D to call XInitThreads() upon loading "
46
+ " the display module, which may help with some threading issues." ));
47
+
43
48
ConfigVariableInt x_wheel_up_button
44
49
(" x-wheel-up-button" , 4 ,
45
50
PRC_DESC (" This is the mouse button index of the wheel_up event: which "
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ extern EXPCL_PANDAX11 void init_libx11display();
26
26
27
27
extern ConfigVariableString display_cfg ;
28
28
extern ConfigVariableBool x_error_abort ;
29
+ extern ConfigVariableBool x_init_threads ;
29
30
30
31
extern ConfigVariableInt x_wheel_up_button ;
31
32
extern ConfigVariableInt x_wheel_down_button ;
Original file line number Diff line number Diff line change @@ -66,6 +66,12 @@ x11GraphicsPipe(const std::string &display) :
66
66
_im = (XIM)nullptr ;
67
67
_hidden_cursor = None;
68
68
69
+ // According to the documentation, we should call this before making any
70
+ // other Xlib calls if we wish to use the Xlib locking system.
71
+ if (x_init_threads) {
72
+ XInitThreads ();
73
+ }
74
+
69
75
install_error_handlers ();
70
76
71
77
_display = XOpenDisplay (display_spec.c_str ());
You can’t perform that action at this time.
0 commit comments