Hi.
I recently started using SFML and it's been a pure pleasure.
One thing I noticed is that windows in full screen mode doesn't seem to fire window close events. Is this the intended behavior?
In the following example it is possible to close the application using the escape key, but it isn't possible to close it using [alt]+[f4]. Notice that using [alt]+[f4] works just fine for windowed applications on the same system.
#include <SFML/Graphics.hpp>
int main(int argc, char **argv) {
// Open window.
sf::RenderWindow window(sf::VideoMode(1024, 768), "untitled", sf::Style::Fullscreen);
// Render and event loop.
while (window.isOpen()) {
// Poll events until the event queue is empty.
sf::Event event;
while (window.pollEvent(event)) {
// Window close event.
if (event.type == sf::Event::Closed) {
window.close();
}
// The escape key was pressed.
if (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Escape) {
window.close();
}
}
// Clear the window with black color.
window.clear(sf::Color::Black);
// Display window updates.
window.display();
}
return 0;
}
Cheers /u