Hi Dear SFML users!
I experienced a problem while creating a fullscreen styled window with SFML 2.0.
I cloned the repo from github compiled with clang++, and using a fresh install of Xubuntu 12.04 stable.
I have the following simple code:
#include "SFML/Window.hpp"
int main( int argc, char** argv ) {
sf::ContextSettings settings;
settings.antialiasingLevel = 2;
settings.depthBits = 24;
settings.stencilBits = 8;
sf::Window win;
win.create( sf::VideoMode(1024,768), "Hello World", sf::Style::Fullscreen, settings );
while ( win.isOpen() ) {
sf::Event event;
while ( win.pollEvent(event) ) {
if (event.type == sf::Event::Closed) {
win.close();
}
}
win.display( );
}
return 0;
}
This application crashes (SEGFAULT) when trying to create a sf::Style::FullScreen window.
It disables my secondary monitor and changes my primary monitors resolution to the desired one specified in the application.
I need to recover my whole desktop after the crash.
Here is my callstack:
?? ()
XCreateIC ()
sf::priv::WindowImplX11::initialize (this=0xe71c00)
sf::priv::WindowImplX11::WindowImplX11 (this=0xe71c00, mode={width = 1024, height = 768, bitsPerPixel = 32}, title=@0x7fffffffe538: {_M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x8a8e18 \"Hello World\"}, static npos = <optimized out>}, style=8)
sf::priv::WindowImpl::create (mode={width = 1024, height = 768, bitsPerPixel = 32}, title=@0x7fffffffe538: {_M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x8a8e18 \"Hello World\"}, static npos = <optimized out>}, style=8)
sf::Window::create (this=0x7fffffffe560, mode={width = 1024, height = 768, bitsPerPixel = 32}, title=@0x7fffffffe538: {_M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x8a8e18 \"Hello World\"}, static npos = <optimized out>}, style=8, settings=@0x7fffffffe588: {depthBits = 24, stencilBits = 8, antialiasingLevel = 2, majorVersion = 2, minorVersion = 0})
main (argc=1, argv=0x7fffffffe698)
The problem arises when calling WindowImplX11.cpp's initialize function especially on line 476:
m_inputMethod = XOpenIM(m_display, NULL, NULL, NULL);
m_inputContext = XCreateIC(m_inputMethod,
XNClientWindow, m_window,
XNFocusWindow, m_window,
XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
NULL);
Has anyone experienced the same?
Maybe it's not an SFML issue rather than a issue related to X11 or maybe a specific distro Xubuntu, but I'm not experienced in linux window management and couldn't figure it out myself.
If you have any ideas, please share with me
Thanks for your input in advance!