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

Author Topic: Tabbing out  (Read 2427 times)

0 Members and 1 Guest are viewing this topic.

Aceeri

  • Newbie
  • *
  • Posts: 1
    • View Profile
Tabbing out
« on: June 11, 2015, 03:04:30 am »
I'm trying to figure out how to correctly handle minimizing the window when Alt-Tabbing out of the window when it is using sf::Style::Fullscreen. When I do it right now it stays the same resolution as the resolution of the window when I want it to go back to the default resolution. How could I achieve this?

Hapax

  • Hero Member
  • *****
  • Posts: 3351
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Tabbing out
« Reply #1 on: June 11, 2015, 09:26:20 pm »
Are you saying that the desktop resolution stays at the resolution of your application when ALT-TABbing from it and you want it to go back to the original desktop resolution?

If so, you could try intercepting the ALT+TAB key combination and switching it back from fullscreen to a window.

Could you try this code and let me know what results you get?:
(click to show/hide)

You can also use events to make this simpler. Just recreate the window without fullscreen when the window loses focus.
Restoring fullscreen on regaining window focus doesn't seem to work. Might be an SFML bug...


NOTE: You should be aware that this is rather Windows specific (the whole question). You'd want to test for other key combinations to make your code more portable.
« Last Edit: June 11, 2015, 10:58:31 pm by Hapax »
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

 

anything