# Window changes size randomly when dragged abruptly between 2 monitors

**URL:** <https://discourse.glfw.org/t/window-changes-size-randomly-when-dragged-abruptly-between-2-monitors/1945>\
**Category:** support\
**Created:** [November 22, 2021, 8:19pm UTC](https://discourse.glfw.org/t/window-changes-size-randomly-when-dragged-abruptly-between-2-monitors/1945 "2021-11-22T20:19:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![deadlocklogic](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/deadlocklogic/32/574_2.png) [@deadlocklogic](https://discourse.glfw.org/u/deadlocklogic)\
**Post date:** [November 22, 2021, 8:19pm UTC](https://discourse.glfw.org/t/window-changes-size-randomly-when-dragged-abruptly-between-2-monitors/1945/1 "2021-11-22T20:19:27Z")

</div>

Hi I am using the most basic `HelloWorld` example:

```auto
#include <stdio.h>
#include <stdlib.h>

#include "GLFW/glfw3.h"

const int width = 960;
const int height = 640;

void error_callback(int error, const char* description) {
    fputs(description, stderr);
}

int main() {
    GLFWwindow* window;
    glfwSetErrorCallback(error_callback);
    if (!glfwInit()) {
        exit(EXIT_FAILURE);
    }

    window = glfwCreateWindow(width, height, "Simple example", NULL, NULL);
    if (!window) {
        glfwTerminate();
        exit(EXIT_FAILURE);
    }
    
    glfwMakeContextCurrent(window);

    while (!glfwWindowShouldClose(window)) {
        glfwWaitEvents();

        glfwSwapBuffers(window);
    }

    glfwDestroyWindow(window);
    glfwTerminate();
    exit(EXIT_SUCCESS);
}

```

When the window is abruptly shaken between 2 monitors it sometimes changes size randomly (sometimes it grows, sometimes it shrinks). Is it kind of bug?  
By the way softly moving between the 2 monitors has normal effect, and I saw this topic: [link](https://discourse.glfw.org/t/moving-window-to-second-monitor-causes-window-to-change-size/1786), my problem isn’t related to `GLFW_SCALE_TO_MONITOR `.

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [November 23, 2021, 11:51am UTC](https://discourse.glfw.org/t/window-changes-size-randomly-when-dragged-abruptly-between-2-monitors/1945/2 "2021-11-23T11:51:21Z")

</div>

Hi and welcome to the GLFW forum!

I’ve not heard of this before, and can’t replicate on the multi monitor system I have available at the moment (Windows 10, latest GLFW, 2 same monitors AMD GPU with latest WHQL drivers).

Can you replicate with a GLFW sample built from source with cmake?

If so some more details about your system would be useful such as what OS (& window manager if Linux) are you running on & what GPU and drivers you are using along with some info on the 2 monitors and their sizes and any scaling settings if present.

Cheers,

Doug.
