#1108228 xserver-xorg: Non existing VGA monitor connected

Package:
xserver-xorg
Source:
xserver-xorg
Description:
X.Org X server
Submitter:
Adam Chyła
Date:
2025-06-23 16:49:02 UTC
Severity:
normal
#1108228#5
Date:
2025-06-23 16:45:47 UTC
From:
To:
Dear Maintainer,

the xrandr tool shows VGA-1-1 as connected, even though I don't have any VGA
monitor connected.

     $ xrandr | grep connected
     LVDS-1 connected 1366x768+1920+312 (normal left inverted right x axis y axis) 345mm x 194mm
     VGA-2 disconnected (normal left inverted right x axis y axis)
     HDMI-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 476mm x 268mm
     DP-1 disconnected (normal left inverted right x axis y axis)
     VGA-1-1 connected 103x77+3286+312 (normal left inverted right x axis y axis) 0mm x 0mm


GDK reports this additional monitor (below is example) causing issues with some
software, see Bug#1107954:

File gdk_example.cpp:
     #include <gtk/gtk.h>
     #include <iostream>

     int
     main(int argc, char *argv[]) {
         gtk_init(&argc, &argv);

         GdkDisplay *display = gdk_display_get_default();
         if (!display) {
             std::cerr << "Failed to get default display." << std::endl;
             return 1;
         }

         int monitor_count = gdk_display_get_n_monitors(display);
         std::cout << "Number of monitors: " << monitor_count << std::endl;

         for (int i = 0; i < monitor_count; ++i) {
             GdkMonitor *monitor = gdk_display_get_monitor(display, i);
             if (monitor) {
                 GdkRectangle geometry;
                 gdk_monitor_get_geometry(monitor, &geometry);
                 std::cout << "Monitor " << i << ": "
                           << "x=" << geometry.x << ", "
                           << "y=" << geometry.y << ", "
                           << "width=" << geometry.width << ", "
                           << "height=" << geometry.height << std::endl;
             }
         }

         return 0;
     }

Compilation command:
     g++ -o gdk_example.out gdk_example.cpp `pkg-config --cflags --libs gtk+-3.0`

Console output:
     Number of monitors: 3
     Monitor 0: x=0, y=0, width=1920, height=1080
     Monitor 1: x=1920, y=312, width=1366, height=768
     Monitor 2: x=3286, y=312, width=103, height=77


XCB reports width_in_millimeters, height_in_millimeters as 0 for the screen,
causing issues with Qt-based software, see Bug#1107294.

File xcb_example.c:
     #include <stdio.h>
     #include <xcb/xcb.h>

     int
     main()
     {
       xcb_connection_t     *c;
       xcb_screen_t         *screen;
       int                   screen_nbr;
       xcb_screen_iterator_t iter;

       /* Open the connection to the X server. Use the DISPLAY environment variable */
       c = xcb_connect (NULL, &screen_nbr);

       /* Get the screen #screen_nbr */
       iter = xcb_setup_roots_iterator (xcb_get_setup (c));
       for (; iter.rem; --screen_nbr, xcb_screen_next (&iter))
         if (screen_nbr == 0) {
           screen = iter.data;
           break;
         }

       printf ("\n");
       printf ("Informations of screen %ld:\n", screen->root);
       printf ("  width..................: %d\n", screen->width_in_pixels);
       printf ("  height.................: %d\n", screen->height_in_pixels);
       printf ("  width_in_millimeters...: %d\n", screen->width_in_millimeters);
       printf ("  height_in_millimeters..: %d\n", screen->height_in_millimeters);
       printf ("\n");

       return 0;
     }

Compilation command:
     gcc -o xcb_example.out xcb_example.c -lxcb

Console output:
     Informations of screen 1077:
       width..................: 4310
       height.................: 1080
       width_in_millimeters...: 0
       height_in_millimeters..: 0


Could you please help to check why VGA-1-1 is detected and visible as connected?

Regards,
Adam.


Attaching logs: