Gap at the bottom of the screen

Hello, I’m trying to have fullscreen on only my second monitor. I took the advice in this thread and put

ofSetupOpenGL(1920, 1080, OF_WINDOW);
ofSetWindowPosition(1920, 0);

in main.cpp, which kind of works, but it leaves a gap, and, more importantly a border at the bottom of the window:

(not the white line from the search bar- the thin gray line right above it that goes across the whole screen)

I found this old thread, but the link to the project that @theo refers to isn’t working anymore.

Any reason not to do?

ofSetupOpenGL(1920, 1200, OF_FULLSCREEN);

Assuming the monitor/projector is 1920 x 1200 otherwise:

ofSetupOpenGL(1920, 1080, OF_FULLSCREEN);

Oh I see, fullscreen on a second monitor.

You could set it up this way:

int main( ){

	ofGLFWWindowSettings settings;
    settings.monitor = 1;
    settings.windowMode = OF_FULLSCREEN;
	auto mainWindow = ofCreateWindow(settings);

	ofRunApp(mainWindow, make_shared<ofApp>());


Or a slightly less elegant solution, but a little bit more robust.


void ofApp::update(){
if( ofGetFrameNum() == 10 ) ofSetWindowPosition(1920, 0); 
if( ofGetFrameNum() == 40 ) ofSetFullscreen(true); 
1 Like

Hey, neither of these works for me, though the 2nd one seems to work for a moment at first before reverting to the 1st screen.

To clarify, for the 2nd solution I just need the following in main.cpp, right?

ofSetupOpenGL(1920, 1080, OF_WINDOW);

ofRunApp(new ofApp());

and the ofGetFrame-code at the very beginning of Update()?

EDIT: Nevermind, it works when I set it to OF_FULLSCREEN in main.cpp. Thank you!

When I toggle to another window (on the 1st screen), the fullscreen gets nudged up vertically… is there any way to avoid this? (It nudges back down when I toggle back)

That should work for the second solution.
It might be better to init the window smaller too, like 1024x768 instead of 1920x1080 ( in main.cpp ).

Which platform are you on?
That shouldn’t happen.

Windows 10 Home… Your question gave me an idea though. Under my Display settings, there’s an option to scale up the size of text, apps and other items and it’s normally set to 125% (because otherwise, everything looks really tiny due to the 1920x1080 resolution). If I set this to 100%, the nudge problem goes away. Guess I’ll turn it off for performances!

EDIT: Nope, I was wrong about that fix. What removes the nudging problem is changing that magnification while the OF window is already running. So, inversely, if I close it and reset it with interface-scaling set to 100% the nudge problem is there, but if, while it’s running, I set it back to 125%-scaling, the nudge problem is fixed for as long as I have the OF window running.

One thing it could be (now that I think about it) is the taskbar being enabled on multiple windows.
If you rick click on your taskbar and go to taskbar settings, can you try disabling taskbar on multiple displays?

If that doesn’t work can you try having both displays set to 100% scaling? ( this can sometimes require a log out / reboot to take effect ).

There can definitely be issues when scaling is enabled.
We do a lot of projects with fullscreen on a second monitor on Windows and haven’t seen the nudging issue you mention.

Hope that helps!

Hey, I set the taskbar to only be on the 1st screen, set both screens to 100% and restarted the computer… Didn’t fix the problem. For yesterday’s performance I just used the hack of changing the scaling after the exe is already running.