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

Author Topic: Strange behavior with borderless windowed fullscreen  (Read 3861 times)

0 Members and 1 Guest are viewing this topic.

underww

  • Newbie
  • *
  • Posts: 34
    • View Profile
Strange behavior with borderless windowed fullscreen
« on: April 12, 2017, 12:42:14 pm »
Recently I realized there's a strange difference between these codes.
I tested the codes on Windows 10, Visual Studio 2015/2017, with SFML 2.4.2
(also in my desktop and laptop)

// I assume 1920x1080 is your desktop resolution.
1. window.create(sf::VideoMode(1920, 1080), "title", sf::Style::None);
2. window.create(sf::VideoMode(1920, 1079), "title", sf::Style::None);
3. window.setPosition(1, 1); // after code #1

First, #1 is flickered a little when the window is created while #2 is not flickered.
It also flickers when you try alt+tab or the window gains/loses focus.
(it's also delayed when you gain the window focus in some case)

Windows default screen capture doesn't work after you gain focus the SFML window in #1.
(I could capture the screen after alt+tab twice)

Second, #2 is drawn behind the taskbar while #1 is drawn in front of the taskbar.
(You can also check the same behavior if you change position after you create #1 window) - #3

#3 is the same as #2

So, what's the reason of these strange behaviors?
Thanks in advance.

Edit: In my opinion, this seems to be handled the same as real fullscreen when the window size is the desktop resolution.
« Last Edit: April 12, 2017, 12:46:16 pm by underww »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Strange behavior with borderless windowed fullscreen
« Reply #1 on: April 12, 2017, 01:01:18 pm »
We've heard of similar reports in the past. While SFML hasn't changed anything in its implementation, it seems or at least feels like it, that Windows 10 has changed the behavior for the widow styling SFML uses with a borderless window at the display resolution.
That means, even though SFML isn't telling Windows to go "fullscreen", Windows 10 will do a hard switch to fullscreen mode when sf::Style::None is used and the whole window covers the screen.

I once tried to track the issue, but didn't find the cause for it. Might have to pick it up again.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

underww

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Strange behavior with borderless windowed fullscreen
« Reply #2 on: April 12, 2017, 02:44:06 pm »
I found few more things about this.

The problem doesn't happen if I don't use console window on my laptop. (/SUBSYSTEM:CONSOLE -> WINDOWS)
However, this still happens on my desktop computer.

I thought it's kind of video card problems at first but both machines have GeForce. (Models are different of course)
So, I tried it with Intel HD graphics and GeForce on my laptop. but there's no difference.

Another reason I'm guessing is only my desktop computer has dual monitors.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Strange behavior with borderless windowed fullscreen
« Reply #3 on: April 12, 2017, 03:02:14 pm »
That's for the additional info. I hope to take a look at this soon. I too have a dual monitor setup, so this might indeed be connected in some way.
I wasn't certain, did you say that it doesn't happen at all on your notebook? Or just in console "mode"?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

underww

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Strange behavior with borderless windowed fullscreen
« Reply #4 on: April 12, 2017, 03:26:54 pm »
I have only two PCs, one desktop, and one laptop.
So, I can't find the exact reason yet.

I usually use SFML with a default windows console for debugging (without sfml-main.lib or sfml-main-d.lib file)
While I was trying this and that, I added those main lib files and switched SUBSYSTEM from CONSOLE to WINDOWS.
then flicking and other problems disappeared on my laptop.

After that, I tried the same thing on my desktop, but it still happens there.
I also built the program on my laptop and moved it to the desktop and tested it. (the opposite too)

The problem doesn't happen at all only on my laptop when I don't use a console.
So it's still mysterious... :P

 

anything