Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SOLVED [SFML2.4/Qt5/Linux] sf::RenderWindow::create(winId()) -> infinite loop  (Read 2592 times)

0 Members and 1 Guest are viewing this topic.

daijin12

  • Newbie
  • *
  • Posts: 16
    • View Profile
Hello everyone,

I have a problem to integrate a SFML renderwindow inside a Qt widget, since the new SFML 2.4 is released.
The problem happens only on my linux (on windows everything's fine).

My config :
 - Ubuntu 16.04
 - Qt 5.7.0
 - gcc 6.1.1 (tried with 5.3 and 4.9)
 - SFML 2.4 from github up to date

It seems that sf::RenderWindow::create(winId());  "create" an infinite loop...
The result is a Qt widget with a transparent inside...

Looking a bit more inside the SFML code, it appears that it comes from the lines 927 and 928 of the file src/SFML/Window/Unix/WindowImplX11.cpp in the function setVisible(bool visible):

void WindowImplX11::setVisible(bool visible)
{
    if (visible)
    {
        .........
        .........

        // Before continuing, make sure the WM has
        // internally marked the window as viewable
        while (!m_windowMapped)
            processEvents();
    }
 


Removing this while loop solves the problem.

I put in attachments a simplest code reproducing the bug.

If you've any idea of what's going on, please let me now.

Cheers,
daijin12

« Last Edit: August 21, 2016, 07:07:03 pm by daijin12 »

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

daijin12

  • Newbie
  • *
  • Posts: 16
    • View Profile
I seems to work well! Thank you!!