Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leaving full-screen on Linux deactivates second monitor #436

Closed
Oberon00 opened this issue Jul 24, 2013 · 13 comments
Closed

Leaving full-screen on Linux deactivates second monitor #436

Oberon00 opened this issue Jul 24, 2013 · 13 comments

Comments

@Oberon00
Copy link
Contributor

When leaving full-screen (either by closing the window or calling create() with a non-full-screen mode), the resolution of the primary monitor is correctly restored but the second one is left deactivated, even after logging out and in again. I have to manually reactivate it in System Settings -> Display and Monitors. (Relative) screen positions are also lost.

This minimal program is enough to (always) reproduce the bug on my Kubuntu 13.04 system with two monitors (notebook monitor and external one set as primary) and SFML commit 6c1899d (aka 2.1):

#include <SFML/Window/Window.hpp>

int main()
{
    sf::Window w(sf::VideoMode(800, 600), "My window", sf::Style::Fullscreen);
}

The issue also appears when leaving the full-screen mode with Window::create().

(As a side note, the window is also created in the top-left corner of the primary screen instead of the center.)

Additional system information

ATI Mobility Radeon 5650 with open source drivers.
Output of X -version:

X.Org X Server 1.13.3
Release Date: 2013-03-07
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.2.0-37-generic x86_64 Ubuntu
Current Operating System: Linux cn-0-u 3.8.0-27-generic #40-Ubuntu SMP Tue Jul 9 00:17:05 UTC 2013 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.8.0-27-generic root=UUID=(left out) ro quiet splash vt.handoff=7
Build Date: 17 April 2013  10:43:13PM
xorg-server 2:1.13.3-0ubuntu6 (For technical support please see http://www.ubuntu.com/support) 
Current version of pixman: 0.28.2
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.

I'm not an experienced Linux user but if you give me pointers, I would be happy to provide you with more relevant information.

@ghost ghost assigned LaurentGomila Jul 24, 2013
@dabbertorres
Copy link
Contributor

If another system/confirmation is wanted, I experience the same (similar?) issue.

I create a SFML Window with sf::Style::Fullscreen, and my external (secondary) monitor is deactivated and the program runs full screen on my primary monitor. Monitor continues to stay deactivated after program termination. I must re-enable it with xrandr.

This is on SFML 2.1 as well (2.1-1 to be exact? That is the version of the package at least.).

Code:
window.create(sf::VideoMode(800, 600, 32), "SFML", sf::Style::Fullscreen);
vs
window.create(sf::VideoMode(800, 600, 32), "SFML", sf::Style::Titlebar | sf::Style::Close);

Out of curiosity, I ran the following code:

std::vector<sf::VideoMode> modes = sf::VideoMode::getFullscreenModes();
for(std::size_t i = 0; i < modes.size(); ++i)
{
    sf::VideoMode mode = modes[i];
    std::cout << "Mode #" << i << ": " << mode.width << "x" << mode.height << " - " << mode.bitsPerPixel << " bpp\n";
}

And got:

Mode #0: 1366x768 - 32 bpp
Mode #1: 1024x768 - 32 bpp
Mode #2: 800x600 - 32 bpp
Mode #3: 640x480 - 32 bpp
Mode #4: 1366x768 - 24 bpp
Mode #5: 1024x768 - 24 bpp
Mode #6: 800x600 - 24 bpp
Mode #7: 640x480 - 24 bpp
Mode #8: 1366x768 - 16 bpp
Mode #9: 1024x768 - 16 bpp
Mode #10: 800x600 - 16 bpp
Mode #11: 640x480 - 16 bpp
Mode #12: 1366x768 - 15 bpp
Mode #13: 1024x768 - 15 bpp
Mode #14: 800x600 - 15 bpp
Mode #15: 640x480 - 15 bpp
Mode #16: 1366x768 - 8 bpp
Mode #17: 1024x768 - 8 bpp
Mode #18: 800x600 - 8 bpp
Mode #19: 640x480 - 8 bpp
Mode #20: 1366x768 - 4 bpp
Mode #21: 1024x768 - 4 bpp
Mode #22: 800x600 - 4 bpp
Mode #23: 640x480 - 4 bpp
Mode #24: 1366x768 - 1 bpp
Mode #25: 1024x768 - 1 bpp
Mode #26: 800x600 - 1 bpp
Mode #27: 640x480 - 1 bpp

The resolution of my second monitor (1920x1080), nor the combined resolution, is not found, so that may be part of the issue(?).

'X -version' output:

X.Org X Server 1.14.3
Release Date: 2013-09-12
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.11.1-1-ARCH x86_64 
Current Operating System: Linux alec-archlinux 3.11.6-1-ck #1 SMP PREEMPT Fri Oct 18 16:17:01 EDT 2013 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-linux-ck root=UUID=651199f1-f8a3-43d8-94a4-26c80704514d rw rw ipv6.disable=1 nmi_watchdog=0 elevator=bfq i915.modeset=1 pcie_aspm=force i915.lvds_downclock=1 i915.i915_enable_fbc=1 i915.semaphores=1 i915.i915_enable_rc6=7 intel_pstate=disable quiet splash
Build Date: 08 October 2013  08:48:10PM

Current version of pixman: 0.30.2

Intel HD 3000 with version 9.2.2-1 of Mesa drivers.

@LaurentGomila LaurentGomila removed their assignment May 19, 2014
@TankOs TankOs self-assigned this Jun 9, 2014
@TankOs
Copy link
Member

TankOs commented Jun 9, 2014

Hey, sorry for not replying to you guys. Can you elaborate on your used setup? I.e. how is the multihead setup configured?

@dabbertorres
Copy link
Contributor

About as simple as can be, just two monitors, using a single X server, setup via xrandr. I'll get to you with more info later....

@binary1248
Copy link
Member

Any updates on this?

@dabbertorres
Copy link
Contributor

Sorry, completely forgot about this! So, this is my system:
CPU: Intel i5-4670K
GPU: Nvidia GTX 760 4GB
Driver: 340.32
RAM: 8GB
Triple Head (left, middle, right, all landscape)

Kernel: 3.16.1-1
X version: 1.16.0
One X screen.

Here's my test code:

#include <SFML/Window.hpp>

int main()
{
    sf::Window w(sf::VideoMode(800, 600), "My window", sf::Style::Fullscreen);

    while(w.isOpen())
    {
        sf::Event event;
        while(w.pollEvent(event))
        {
            if(event.type == sf::Event::Closed)
                w.close();

            if(event.type == sf::Event::KeyPressed)
                if(event.key.code == sf::Keyboard::Escape)
                    w.close();
        }
    }

}

Funny thing is though, whereas before my monitors would continue to stay deactivated after exiting the SFML program, my monitor now reactivates after exiting. Which, I think is intended behavior. That's how games on Windows work when you have Nvidia Surround setup (when you're not using the full surround). So unless, you set one X screen per monitor, I think it's actually working fine now. At least for me.

I have a laptop with an Intel HD 3000 that I can test as well, I'll get back to this once I've tested that.

@binary1248
Copy link
Member

It's been a while since this was originally reported, so maybe it was something to do with the underlying window system. I guess we can give this a bit more time, and if nobody else can confirm this is still an issue we can close it as resolved.

@TankOs
Copy link
Member

TankOs commented Oct 2, 2014

Let's close this. If it happens again we can reopen this.

@G-Octav
Copy link

G-Octav commented Aug 3, 2015

I can confirm this bug with the latest version of SFML. I'm running Linux Mint Cinnamon 17.2 and basically if my fullscreen window crashes, the second monitor gets turned off completely and the resolution on my first one is reduced to a minimum. It's a very localized bug but you should still re-open the issue. Also I had sf::Style::Closed set as a window style so that may contribute. I'm not sure how to replicate the bug, but just try creating a fullscreen sf::Style::Closed window and then have it crash, that might be the culprit.

@eXpl0it3r
Copy link
Member

if my fullscreen window crashes

So it only happens when it crashes?

@G-Octav
Copy link

G-Octav commented Aug 3, 2015

In my case yes, only when the window crashes. In my case the crash was the icon if that helps but I'm sure that's unrelated. Also, unlike a previous case the second monitor gets closed even after termination, in order to go back to normal I must enter settings, restore resolution and re-enable the second display.

@eXpl0it3r
Copy link
Member

I'm still a bit confused.

What happens if your fullscreen application closes normally?

What happens if your fullscreen application crashes?

What Window Manager do you use?

Is your SFML version 2.3.1?

@G-Octav
Copy link

G-Octav commented Aug 3, 2015

What happens if your fullscreen application closes normally?

If the game has no crashes, then it simply starts and behaves normally, covering one whole monitor in fullscreen state. If I close it after that, nothing happens to my monitors

What happens if your fullscreen application crashes?

One display gets disabled, the other one has its resolution lowered to around 800x600

What Window Manager do you use?

MATE 1.10

Is your SFML version 2.3.1?

Yes, installed from the official repository

@binary1248
Copy link
Member

So... SFML is supposed to do something after it crashes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants