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

Author Topic: Window is only visible on the toolbar/taskbar, but NOT otherwise.  (Read 13478 times)

0 Members and 1 Guest are viewing this topic.

Legion

  • Newbie
  • *
  • Posts: 4
    • View Profile
SFML-version: 2.0 (release candidate) / dynamic linking
OS: Windows 7 64-bit
Graphics card: ATI Mobillity Radeon HD 4650 / fully updated drivers
IDE: Microsoft Visual Studio 2010 Ultimate

Screenshot of my problem

So the problem is that the window refuses to show itself. The closest thing I get to it, is that when I hover my mouse over the program icon on the taskbar/toolbar (see above screenshot), I get some sort of "preview" of the window, but that's it. I find this ordeal odd, because it was working all fine for a while, then it just refused to one day. I'd love to share some code with you, but I'm not sure what to give you, because the whole project is big. The odd thing is that this problem does not occur on my stationary computer, but only on my laptop. The details for my stationary are:

SFML-version: 2.0 (release candidate) / dynamic linking
OS: Windows 7 64-bit
Graphics card: ATI Radeon HD 5770 (Sapphire/PCPartner) / fully updated drivers
IDE: Microsoft Visual Studio 2010 Ultimate

So... any ideas, guys? Also if you need more information, please let me know.

Thank you in advance for your answers.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Window is only visible on the toolbar/taskbar, but NOT otherwise.
« Reply #1 on: April 23, 2012, 10:30:24 pm »
Quote
I'd love to share some code with you, but I'm not sure what to give you, because the whole project is big.
So let's try to reproduce it with a very short code ;)
If it's SFML, or something really stupid in your code, it should be reproductible (?) with less than 20 lines of code. If not, then the cause is complex and there's nothing we would be able to do anyway because we can't have a look at your big project.
Laurent Gomila - SFML developer

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Window is only visible on the toolbar/taskbar, but NOT otherwise.
« Reply #2 on: April 24, 2012, 12:46:32 am »
The problem is fairly stupid and the solution fairly easy.

Your window is too big for your screen size, either too high or too wide.
Changing the window size or getting a bigger screen will 'resolve' the problem.

One migth also call it a bug, but who wants a bigger window that his screen?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Window is only visible on the toolbar/taskbar, but NOT otherwise.
« Reply #3 on: April 24, 2012, 01:46:42 am »
I think its even more simple. In your render loop make sure you call RenderWinow.DispatchEvents().

While (RenderWindow.IsOpen())
{
renderwindow.DispatchEvents();
}
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Re: Window is only visible on the toolbar/taskbar, but NOT otherwise.
« Reply #4 on: April 24, 2012, 03:16:00 am »
I think its even more simple. In your render loop make sure you call RenderWinow.DispatchEvents().

While (RenderWindow.IsOpen())
{
renderwindow.DispatchEvents();
}
There is no DispatchEvents() function in SFML.
I use the latest build of SFML2

Senzin

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Window is only visible on the toolbar/taskbar, but NOT otherwise.
« Reply #5 on: April 25, 2012, 09:07:56 am »
I've also noticed that if the size of the RenderWindow is set too high that the window simply does not show up. It was very confusing for a good ten minutes because I was doing most of my development on my desktop, then switched to my laptop when I was out and about: "It was just working! What happened!?!?"

While it's true that it's difficult to work with a window larger than your screen, if the window at least shows up, you can resize it. But if the window does not show up at all, it results in the astonishment of the programmer. So I'm gonna have to call this a bug.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Window is only visible on the toolbar/taskbar, but NOT otherwise.
« Reply #6 on: April 25, 2012, 09:15:46 am »
This is how the OS behaves. All I could do is to add a warning if I detect that the window is bigger than the desktop, and/or resize the window accordingly. But then you'd wonder why the window is smaller than what you requested (because people never check for warnings on the standard output when using windows), and that would be a new "bug".
Laurent Gomila - SFML developer

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
Re: Window is only visible on the toolbar/taskbar, but NOT otherwise.
« Reply #7 on: April 25, 2012, 05:08:52 pm »
It's not a bug, as Laurent says, it's the way the OS behaves.

You also get this problem if your window is opened at some XY position that doesn't exist (maybe you had a 2nd monitor connected and your window is set to open at -1680 or whatever).

SFML 2.1

Legion

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Window is only visible on the toolbar/taskbar, but NOT otherwise.
« Reply #8 on: April 25, 2012, 09:43:06 pm »
I've also noticed that if the size of the RenderWindow is set too high that the window simply does not show up.
This. This was the problem.

My laptop's resolution was set at 1366 x 768. And the window's height was set at 900, which is way higher than my screen resolution. This caused indeed my window to disappear. I could also use the flag sf::Style::Fullscreen while instantiating the RenderWindow to "fix" the problem, but that wouldn't be too good of a solution. What I found odd was that I connected my laptop to my TV, which had 1920 x 1080 in resolution, and that still didn't work.

Anyhow, I got it solved due to Senzin's and eXpl0it3r's earlier experience with the same issue, so thanks, guys. I also wanna thank you others too, because I did learn something new in addition to solving my problem. :) And it would be indeed kinda nice to throw some kind of warning if the RenderWindow's width/height were to exceed the screen's resolution. Maybe you could add a warning message in the debug/console window? It wouldn't exactly be the best solution, seeing how not all people use it, but I'm putting it out there.

Senzin

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Window is only visible on the toolbar/taskbar, but NOT otherwise.
« Reply #9 on: April 28, 2012, 04:38:12 am »
When you say "this is how the OS behaves," are you saying that the OS is refusing to display the window?

Either way, it seems like if the currently set size for an SFML window is such that no window will appear at all, then the most reasonable thing to do is to shrink it to a size so that the window will at least appear. Yes, the programmer may be upset that the window is not the size they expected, but hopefully noticing that the window exactly fits the width and/or height of their monitor will be a pretty big hint as to what happened. But for no window to appear at all, that's just baffling.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Window is only visible on the toolbar/taskbar, but NOT otherwise.
« Reply #10 on: April 28, 2012, 09:10:30 am »
Quote
When you say "this is how the OS behaves," are you saying that the OS is refusing to display the window?
Yes.

Quote
Either way, it seems like if the currently set size for an SFML window is such that no window will appear at all, then the most reasonable thing to do is to shrink it to a size so that the window will at least appear. Yes, the programmer may be upset that the window is not the size they expected, but hopefully noticing that the window exactly fits the width and/or height of their monitor will be a pretty big hint as to what happened. But for no window to appear at all, that's just baffling.
Agreed. You can open an issue in the tracker so that I don't foget it :)
Laurent Gomila - SFML developer

Senzin

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Window is only visible on the toolbar/taskbar, but NOT otherwise.
« Reply #11 on: April 29, 2012, 04:42:26 am »
Opened as issue 215 by malpert... that's me.  :)

 

anything