# Monitor connection callback doesnt get called on Ubuntu

**URL:** <https://discourse.glfw.org/t/monitor-connection-callback-doesnt-get-called-on-ubuntu/1946>\
**Category:** support\
**Created:** [November 23, 2021, 2:15pm UTC](https://discourse.glfw.org/t/monitor-connection-callback-doesnt-get-called-on-ubuntu/1946 "2021-11-23T14:15:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShacharDev](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/shachardev/32/542_2.png) [@ShacharDev](https://discourse.glfw.org/u/ShacharDev)\
**Post date:** [November 23, 2021, 2:15pm UTC](https://discourse.glfw.org/t/monitor-connection-callback-doesnt-get-called-on-ubuntu/1946/1 "2021-11-23T14:15:23Z")

</div>

I am running application using GLFW on Ubuntu 20.04  
When a new monitor is connected the callback I set never gets called.  
I looked inside the GLFW code and I see that the only call to the callback is from glfwInputMonitor.  
The only place I found which calls this function is from \_glfwPollMonitorsX11 which is called during init.  
Does GLFW not support connection/disconnection on X11?

---

<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, 2:39pm UTC](https://discourse.glfw.org/t/monitor-connection-callback-doesnt-get-called-on-ubuntu/1946/2 "2021-11-23T14:39:59Z")

</div>

Monitor changes on X11 are also polled when events are processed:

> <https://github.com/glfw/glfw/blob/575d2971d414ef9f7a47899f44664168537d26c8/src/x11_window.c#L1165-L1172>

If you are able to build GLFW from the Github source with cmake you can run the events.c test to check if this catches your monitor connection/disconnection. If there is a problem with that then this might be a bug. Note that GLFW only supports a single X11 screen (see [\_glfwPollMonitorsX11 only returns main X screen display(s) · Issue #1927 · glfw/glfw · GitHub](https://github.com/glfw/glfw/issues/1927) and [Only one monitor detected X11 - #11 by elmindreda](https://discourse.glfw.org/t/only-one-monitor-detected-x11/1868/11) ), so if the monitor is registered to another X11 screen in your config it might not get polled.
