Skip to content

Commit

Permalink
[linux] Always close frontend window when launching from fullscreen m…
Browse files Browse the repository at this point in the history
…ode linux
  • Loading branch information
mickelson committed Sep 6, 2018
1 parent 32e547c commit 7611f4a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 26 deletions.
17 changes: 10 additions & 7 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,25 @@ follows:

attract --font <font_name>

2. If you are running Attract-Mode for the first time, it will load directly
to its configuration mode. If you do not start in config mode, pressing "TAB"
2. If you are running Attract-Mode for the first time, you will be prompted to
select the language to use and then the frontend will load directly to its
configuration mode. If you do not start in config mode, pressing the "TAB" key
will get you there. By default, config mode can be navigated using the up/
down arrows, enter to select an option, and escape to go back.

3. Select the "Emulators" menu and edit/create a configuration for an
emulator that you wish to use. Default configurations are provided for some
popular emulators, however some settings will likely have to be customized
for your system (file locations etc).
3. Select the "Emulators" option, where you will be presented with the option
of editting the configuration for the emulators Attract-Mode auto-detected (if
any). Edit an existing emulator or select 'Add' to add a new emulator
configuration. Default configuration templates are provided for various
popular emulators to help you get started, however some settings will likely
have to be customized for your system (file locations etc).

4. Once you have an emulator configured correctly for your system, select
the "Generate Collection/Rom List" option from the emulator's configuration
menu. Attract-Mode will use the configured emulator settings to generate a
list of available games for the emulator. Next select the "Scrape Artwork"
option if you want to have Attract-Mode go and automatically download artwork
images for this emulator from thegamesdb.net and mamedb.com.
images for the emulator from the web.

5. Exit config mode by selecting the "Back" option a few times. You should
now have a usable front-end!
Expand Down
20 changes: 1 addition & 19 deletions src/fe_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,31 +227,13 @@ void launch_callback( void *o )
FeWindow *win = (FeWindow *)o;
if ( win->m_fes.get_window_mode() == FeSettings::Fullscreen )
{
#if defined(USE_XLIB)
//
// On X11 Linux, fullscreen mode is confirmed to block the emulator
// from running on some systems... So we wait 1 second and if we still
// have focus then we close our main window now (and then recreate it (!)
// when the emulator is done).
// from running on some systems...
//
sf::sleep( sf::milliseconds( 1000 ) );

// hasFocus() is only available as of SFML 2.2.
#if ( SFML_VERSION_INT >= FE_VERSION_INT( 2, 2, 0 ))
if ( win->hasFocus() )
{
FeDebug() << "Attract-Mode window still has focus, closing now" << std::endl;
win->close();
}
#else
FeDebug() << "Closing Attract-Mode window" << std::endl;
win->close();
#endif

#else
FeDebug() << "Closing Attract-Mode window" << std::endl;
win->close(); // this fixes raspi version (w/sfml-pi) obscuring daphne (and others?)
#endif
}
#endif
}
Expand Down

0 comments on commit 7611f4a

Please sign in to comment.