mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
call XInitThreads() before creating our cef Display* object
This commit is contained in:
parent
09aba1f9de
commit
e5a274b467
1 changed files with 5 additions and 2 deletions
|
@ -33,7 +33,7 @@ use std::sync::mpsc::{Sender, channel};
|
|||
#[cfg(target_os="linux")]
|
||||
extern crate x11;
|
||||
#[cfg(target_os="linux")]
|
||||
use self::x11::xlib::XOpenDisplay;
|
||||
use self::x11::xlib::{XInitThreads,XOpenDisplay};
|
||||
|
||||
#[cfg(target_os="linux")]
|
||||
pub static mut DISPLAY: *mut c_void = 0 as *mut c_void;
|
||||
|
@ -383,7 +383,10 @@ impl CompositorProxy for CefCompositorProxy {
|
|||
|
||||
#[cfg(target_os="linux")]
|
||||
pub fn init_window() {
|
||||
unsafe { DISPLAY = XOpenDisplay(ptr::null()) as *mut c_void ; }
|
||||
unsafe {
|
||||
assert!(XInitThreads() != 0);
|
||||
DISPLAY = XOpenDisplay(ptr::null()) as *mut c_void;
|
||||
}
|
||||
}
|
||||
#[cfg(not(target_os="linux"))]
|
||||
pub fn init_window() {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue