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

Author Topic: Window xlib event issue? Solus Linux  (Read 13654 times)

0 Members and 1 Guest are viewing this topic.

anthnich

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Long Division LLC
Window xlib event issue? Solus Linux
« on: January 28, 2016, 08:07:07 pm »
Just want to report an issue. I'm using the latest SFML.

I'm experiencing a similar thing this user ran into (since fixed for him):

http://en.sfml-dev.org/forums/index.php?topic=18803.0

I originally had this problem in Ubuntu but it was solved some time ago as you can see with the same patch:

http://en.sfml-dev.org/forums/index.php?topic=18799

A player of my game is having this problem on the Solus Linux OS. https://solus-project.com/

I was able to replicate it. When my game is launched, within 5 seconds I get the "Force Quit/Wait" dialog. Clicking "Wait" allows the game to played w/o problems and everything else seems to work fine. The "Force/Quit" will also popup intermittently for another user. I just experience on first launch.

I feel that this is possibly related to the original issue. No other Linux distro I tested (Ubuntu, Debian, ArchLinux) seems to have this problem. Thought I'd let you know.
« Last Edit: January 29, 2016, 03:23:37 pm by anthnich »

Rhimlock

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: Window xlib event issue? Solus Linux
« Reply #1 on: February 01, 2016, 10:29:51 am »
As far as I can see, Solus Linux uses Gnome_Desktip.

I rember having a problem like that with Gnome-Desktop under Debian while loading.

Been some time, so it might not be helpful to your problem.

I think the problem was, that loading all my assests took a few seconds, so Gnome though my application was not responding.
I fixed that issue by calling PollEvent() before I loaded the assests so Gnome saw my application was responding.


anthnich

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Long Division LLC
Re: Window xlib event issue? Solus Linux
« Reply #2 on: February 01, 2016, 05:46:12 pm »
The game is actually running fine when it happens.

Thanks for the suggestion, but I tried pollevents on startup and it didn't fix it.

Rhimlock

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: Window xlib event issue? Solus Linux
« Reply #3 on: February 02, 2016, 07:58:42 am »
AFAIK the problem lies with Mutter (Gnome's window manager).
If an application doesn't respond (for SFML this should be PollEvent()), Mutter shows your message.
So if you poll your events on startup, then load all your assests it might be already too long for Mutter.

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Window xlib event issue? Solus Linux
« Reply #4 on: February 02, 2016, 08:04:48 am »
Couldn't you just do a
while (pollEvent());
inbetween loading each individual asset so it gets called regularly and gets to empty the event queue regularly (and then of course once per frame as the game is running).
« Last Edit: February 02, 2016, 08:06:59 am by Jesper Juhl »

anthnich

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Long Division LLC
Re: Window xlib event issue? Solus Linux
« Reply #5 on: February 02, 2016, 03:08:55 pm »
I poll the event queue regularly, so it is not that.

That's what is strange. PollEvent is being run AS I get the "Force Quit" dialog. PollEvent, up to that point, had been running regularly leading up to the freeze.

My game takes maybe a second to first load. So the window manager sees it as a freeze that quickly?

AnotherSFMLUser

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Window xlib event issue? Solus Linux
« Reply #6 on: May 02, 2016, 04:17:27 pm »
Same issue, but Fedora 23 with Gnome3 Desktop.

Windowed apps don't trigger the 5 second warning, fullscreen apps do.



SFML-2.3.2-1.fc23.x86_64
Linux 4.4.8-300.fc23.x86_64 #1 SMP GNU/Linux
Fedora release 23 (Twenty Three)

What other information do you need?

AnotherSFMLUser

Ignore me.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11008
    • View Profile
    • development blog
    • Email
AW: Window xlib event issue? Solus Linux
« Reply #7 on: May 02, 2016, 08:04:13 pm »
And what code did you run?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

AnotherSFMLUser

  • Newbie
  • *
  • Posts: 4
    • View Profile
Mutter doesn't think SFML is responding well
« Reply #8 on: May 03, 2016, 12:14:08 am »
Exploiter, thank you for your rapid reply. The code I used is below:

Code: [Select]
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>

int main()
{
    // Create the main window
    sf::RenderWindow app(sf::VideoMode(1920, 1080), "SFML window", sf::Style::Fullscreen);
    //sf::RenderWindow app(sf::VideoMode(1920, 1080), "SFML window");
    //app.setFramerateLimit(30);

    // Load a sprite to display
    sf::Texture texture;
    if (!texture.loadFromFile("../../../assets/images/star.png")) return EXIT_FAILURE;
    sf::Sprite sprite(texture);
    sprite.setOrigin(sprite.getGlobalBounds().width / 2, sprite.getGlobalBounds().height / 2);

// Start the game loop
    while (app.isOpen())
    {
        //sf::sleep(sf::milliseconds(100));
        // Process events
        sf::Event event;
        while (app.pollEvent(event))
        {
            // Close window : exit
            if (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Escape) app.close();
            if (event.type == sf::Event::Closed) app.close();
        }

        // Clear screen
        app.clear();

        // Draw the sprite
        sprite.setPosition(sf::Mouse::getPosition(app).x, sf::Mouse::getPosition(app).y);
        app.draw(sprite);

        // Update the window
        app.display();
    }

    return EXIT_SUCCESS;
}

As you may see I tried sleep, framerates and a some odd solutions that had no ultimate effect.

Edit: As you can tell by my use of getGlobalBounds where I should have used getLocalBounds -- I'm comming back to tinker from a long break.

Edit2: Inserting
Code: [Select]
sf::sleep(sf::seconds(0)); after
Code: [Select]
app.display(); seems to prevent the supposed hang about half the time. It could be a clue!
« Last Edit: May 03, 2016, 12:43:29 am by AnotherSFMLUser »
AnotherSFMLUser

Ignore me.

victorlevasseur

  • Full Member
  • ***
  • Posts: 206
    • View Profile
Re: Window xlib event issue? Solus Linux
« Reply #9 on: May 03, 2016, 08:52:05 am »
I have the same problem with my game under Fedora 23 (Gnome 3.20).

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11008
    • View Profile
    • development blog
    • Email
Re: Window xlib event issue? Solus Linux
« Reply #10 on: May 03, 2016, 09:45:18 am »
Sounds like Gnome expects some other Xlib call that SFML isn't sending. Time to summon binary1248. :P
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

AnotherSFMLUser

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Window xlib event issue? Solus Linux
« Reply #11 on: May 03, 2016, 11:42:04 am »
I'm not familiar with binary1248, but if I can help to further resolve this issue in any fashion, I'm happy to help. I'll keep an eye on this thread. And thank you again Exploiter.
AnotherSFMLUser

Ignore me.

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Window xlib event issue? Solus Linux
« Reply #12 on: May 05, 2016, 07:17:57 pm »
Just tested the same code on:

Fedora 23
SFML-2.3.2-1.fc23.x86_64
Linux 4.4.8-300.fc23.x86_64
gnome-shell 3.18.5-1.fc23.x86_64

could not reproduce...

victorlevasseur, I'm interested, how did you manage to get 3.20 on Fedora 23? If it happens to be through some unofficial means, then it is possible that there might be some compatibility issues involved that are not related to SFML.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

victorlevasseur

  • Full Member
  • ***
  • Posts: 206
    • View Profile
Re: Window xlib event issue? Solus Linux
« Reply #13 on: May 05, 2016, 08:16:36 pm »
No, I made a mistake, I have gnome 3.18. ::)

victorlevasseur

  • Full Member
  • ***
  • Posts: 206
    • View Profile
Re: Window xlib event issue? Solus Linux
« Reply #14 on: May 08, 2016, 11:52:43 pm »
I can reproduce the problem in every SFML programs (tested with SFGUI examples).