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

Author Topic: Tabbing out  (Read 1832 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: 3050
  • My number of posts is shown in hexadecimal.
    • View Profile
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
Kairos - Timing Library
Rectangular Boundary Collision - Rectangular SAT Collision

@Hapaxiation - Hapaxia on Twitter

 

anything