<p>I'm not entirely sure about this case, but at least with some APIs I've worked with, there's a &quot;maximize window&quot; option.</p>
<p>The bands that you're having is most likely because the window isn't maximized (isn't fullscreen) and so the computer makes no effort to align it with the edges of your screen.</p>
<p>The reason why the window dimensions are funky are probably because, since the window isn't aligned to the edges of your screen, it has to get slimmed down a bit to still fit on your screen.</p>
<p>Edit: Ah, found something: <a href="https://www.glfw.org/docs/3.3/window_guide.html" rel="nofollow noreferrer">https://www.glfw.org/docs/3.3/window_guide.html</a></p>
<p>GLFW_MAXIMIZED, set it to GLFW_TRUE and you'll be set :)</p>

CC BY-SA 4.0
2021-07-25T16:47:05.830Z
But passing the monitor to the 4th parameter of `glfwCreateWindow` is supposed to create a fullscreen window - it shouldn't be necessary to maximize it. (And maximize doesn't mean fullscreen anyway - maximized windows still allow room for the taskbar or menu bar, etc.)
Nathan Reed
CC BY-SA 4.0
2021-07-24T23:27:00.093Z
2021-07-24T23:27:00.093Z
EthanKim8683
<p>I'm using GLFW to create a full screen GL application. I'm running it on my Ubuntu 20.04 laptop that has a typical 1920:1080 display, at least that's the screen resolution reported under Settings-&gt;Displays. When I run the following code:</p>
<pre><code>int monitor_x = 0;
int monitor_y = 0;
int monitor_width = 0;
int monitor_height = 0;

GLFWmonitor *monitor = glfwGetPrimaryMonitor();
glfwGetMonitorWorkarea(monitor, &amp;monitor_x, &amp;monitor_y, &amp;monitor_width, &amp;monitor_height);
printf(&quot;before monitor %d, %d, %d, %d\n&quot;, monitor_x, monitor_y, monitor_width, monitor_height);
window = glfwCreateWindow(1920, 1080, &quot;OpenGL&quot;, glfwGetPrimaryMonitor(), nullptr); // Fullscreen
glfwGetMonitorWorkarea(monitor, &amp;monitor_x, &amp;monitor_y, &amp;monitor_width, &amp;monitor_height);
printf(&quot;after monitor %d, %d, %d, %d\n&quot;, monitor_x, monitor_y, monitor_width, monitor_height);
</code></pre>
<p>When I run the code, I get the following output on stdout:</p>
<pre><code>before monitor 72, 27, 1848, 1053
after monitor 72, 27, 1848, 1053
</code></pre>
<p>Also, it seems as if there's a horizontal band at the top and a vertical band at the right of the full screen that remains the background color, no matter what my application attempts to write to those areas.</p>
<p>So 72 + 1848 = 1920 and 27 + 1053 = 1080, but it seems that the system is reserving these horizontal and vertical bands for something else that I assume has something to do with that 72 and 27.</p>
<p>Is there some hint or some such thing that i need to specify in order to make the entire 1920 by 1080 of the screen available for rendering?</p>
<p>Thanks</p>
<p>=======================================================</p>
<p>update:</p>
<p>So far I've tried this (including your suggestion, EthanKim8683, and some from others).</p>
<pre><code>GLFWmonitor *monitor = glfwGetPrimaryMonitor();
vid_mode = glfwGetVideoMode(monitor);
printf(&quot;mode.width %d, mode.height %d\n&quot;, vid_mode-&gt;width, vid_mode-&gt;height);
screen_x = vid_mode-&gt;width;
screen_y = vid_mode-&gt;height;
// screen_x = 640; screen_y = 480;
// screen_x = 1600; screen_y = 900;
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
glfwWindowHint(GLFW_GREEN_BITS, vid_mode-&gt;greenBits);
glfwWindowHint(GLFW_BLUE_BITS, vid_mode-&gt;blueBits);
glfwWindowHint(GLFW_REFRESH_RATE, vid_mode-&gt;refreshRate);
glfwWindowHint(GLFW_MAXIMIZED, GLFW_TRUE);
window = glfwCreateWindow(screen_x, screen_y, window_title, monitor, nullptr); // Fullscreen
glfwSetWindowAttrib(window, GLFW_DECORATED, GLFW_FALSE);
glfwSetWindowSize(window, screen_x, screen_y);
glfwSetWindowPos(window, 0, 0);
glfwShowWindow(window);
</code></pre>
<p>The behavior is the same as reported before. There's these apparently inaccessible bands of screen real estate at the top and on the right side of the screen. But if I uncomment the line where I assign 1600 and 900 to screen_x and screen_y, the unaccessible bands disappear. The whole full screen shows the output of my application.</p>

<opengl>
why is reported screen size smaller than display size with GLFW full screen window
user256552
# why is reported screen size smaller than display size with GLFW full screen window

(Asked by: username_0 on 2021-07-23)

I'm using GLFW to create a full screen GL application. I'm running it on my Ubuntu 20.04 laptop that has a typical 1920:1080 display, at least that's the screen resolution reported under Settings->Displays. When I run the following code:

```
int monitor_x = 0;
int monitor_y = 0;
int monitor_width = 0;
int monitor_height = 0;

GLFWmonitor *monitor = glfwGetPrimaryMonitor();
glfwGetMonitorWorkarea(monitor, &monitor_x, &monitor_y, &monitor_width, &monitor_height);
printf("before monitor %d, %d, %d, %d\n", monitor_x, monitor_y, monitor_width, monitor_height);
window = glfwCreateWindow(1920, 1080, "OpenGL", glfwGetPrimaryMonitor(), nullptr); // Fullscreen
glfwGetMonitorWorkarea(monitor, &monitor_x, &monitor_y, &monitor_width, &monitor_height);
printf("after monitor %d, %d, %d, %d\n", monitor_x, monitor_y, monitor_width, monitor_height);

```

When I run the code, I get the following output on stdout:

```
before monitor 72, 27, 1848, 1053
after monitor 72, 27, 1848, 1053

```

Also, it seems as if there's a horizontal band at the top and a vertical band at the right of the full screen that remains the background color, no matter what my application attempts to write to those areas.

So 72 + 1848 = 1920 and 27 + 1053 = 1080, but it seems that the system is reserving these horizontal and vertical bands for something else that I assume has something to do with that 72 and 27.

Is there some hint or some such thing that i need to specify in order to make the entire 1920 by 1080 of the screen available for rendering?

Thanks

=======================================================

update:

So far I've tried this (including your suggestion, username_1, and some from others).

```
GLFWmonitor *monitor = glfwGetPrimaryMonitor();
vid_mode = glfwGetVideoMode(monitor);
printf("mode.width %d, mode.height %d\n", vid_mode->width, vid_mode->height);
screen_x = vid_mode->width;
screen_y = vid_mode->height;
// screen_x = 640; screen_y = 480;
// screen_x = 1600; screen_y = 900;
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
glfwWindowHint(GLFW_GREEN_BITS, vid_mode->greenBits);
glfwWindowHint(GLFW_BLUE_BITS, vid_mode->blueBits);
glfwWindowHint(GLFW_REFRESH_RATE, vid_mode->refreshRate);
glfwWindowHint(GLFW_MAXIMIZED, GLFW_TRUE);
window = glfwCreateWindow(screen_x, screen_y, window_title, monitor, nullptr); // Fullscreen
glfwSetWindowAttrib(window, GLFW_DECORATED, GLFW_FALSE);
glfwSetWindowSize(window, screen_x, screen_y);
glfwSetWindowPos(window, 0, 0);
glfwShowWindow(window);

```

The behavior is the same as reported before. There's these apparently inaccessible bands of screen real estate at the top and on the right side of the screen. But if I uncomment the line where I assign 1600 and 900 to screen\_x and screen\_y, the unaccessible bands disappear. The whole full screen shows the output of my application.

**Tags:** opengl


---

## 1 answers

### Answer by username_1 on 2021-07-24. Score: 1

I'm not entirely sure about this case, but at least with some APIs I've worked with, there's a "maximize window" option.

The bands that you're having is most likely because the window isn't maximized (isn't fullscreen) and so the computer makes no effort to align it with the edges of your screen.

The reason why the window dimensions are funky are probably because, since the window isn't aligned to the edges of your screen, it has to get slimmed down a bit to still fit on your screen.

Edit: Ah, found something: <https://www.glfw.org/docs/3.3/window_guide.html>

GLFW\_MAXIMIZED, set it to GLFW\_TRUE and you'll be set :)

> **Comments:**
> **username_2**: But passing the monitor to the 4th parameter of `glfwCreateWindow` is supposed to create a fullscreen window - it shouldn't be necessary to maximize it. (And maximize doesn't mean fullscreen anyway - maximized windows still allow room for the taskbar or menu bar, etc.)  

---

