Dear Texus !

First of all, thanks for your TGUI, it is simple and useful - very fit for educational purposes.
And second - i'm experiencing strange bug with widget coodinates with your sample program "full sample"
In windowed mode it works just fine, but in fullscreen everything get shifted.  (see pic).
But the mouse thinks, that widgets are right in place.

My code is the same as in "full sample" , except fullscreen
I'm on linux 64 bit with gcc

#include <TGUI/TGUI.hpp>

int main()
{

    sf::VideoMode desktop = sf::VideoMode::getDesktopMode();
    sf::RenderWindow window(desktop, "TGUI window", sf::Style::Fullscreen);

    window.setFramerateLimit(60);

    tgui::Gui gui(window);

.....
« Last Edit: 23 June 2016, 16:06:06 by Vasily »

*

texus

  • *****
  • 1143
    • View Profile
    • Texus's Blog
Re: Strange bug with widgets coordinates in fullscreen mode
« Reply #1 on: 23 June 2016, 16:10:12 »
Could you add some sfml rendering to it and see where it renders? Just load an sf::Texture and draw the corresponding sf::Sprite between gui.draw and window.display. Is it shifted as well? If it is also shifted, then try creating a simple example with only sfml and see if it still occurs.

Re: Strange bug with widgets coordinates in fullscreen mode
« Reply #2 on: 23 June 2016, 16:52:05 »
Sorry - this is probably SFML bug.
I draw the sprite over GUI with 50 pixel step,
starting with 0,0 and it is also shifted.
 ...
   window.clear();
        gui.draw();
        for (int i=0;i<1000;i=i+50)
        {
            spr->setPosition(sf::Vector2f(i,i));
           window.draw(*spr);
        }

        window.display();
...

*

texus

  • *****
  • 1143
    • View Profile
    • Texus's Blog
Re: Strange bug with widgets coordinates in fullscreen mode
« Reply #3 on: 28 June 2016, 18:47:52 »
This is indeed an SFML bug, fullscreen windows in SFML seems to be pretty broken on linux.
http://en.sfml-dev.org/forums/index.php?topic=20482
https://github.com/SFML/SFML/issues/921

Replacing line 504 in src/SFML/Window/Unix/WindowImplX11.cpp from "if ((!m_fullscreen || (windowManagerName == "Openbox")) && !(style & Style::Resize))" to "if (!(style & Style::Resize))" seems to fix the issue for me, you should check if it fixes it for you as well.
« Last Edit: 28 June 2016, 19:42:11 by texus »

Re: Strange bug with widgets coordinates in fullscreen mode
« Reply #4 on: 07 July 2016, 13:17:30 »
Thanks a lot! Its worked for me too.