xserver: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Dec 17 17:39:12 UTC 2023


 randr/rrmonitor.c |   11 -----------
 1 file changed, 11 deletions(-)

New commits:
commit 146bb9b2c19fb75b7629b65d5871969b7fcef97a
Author: Ilya Pominov <ipominov at astralinux.ru>
Date:   Mon Apr 10 18:52:25 2023 +0300

    RandR: Allow duplicate monitor name when adding it
    
    When calling RRSetMonitor, an existing monitor name is allowed.
    "If 'name' matches an existing Monitor on the screen, the existing one
    will be deleted as if RRDeleteMonitor were called."
    https://cgit.freedesktop.org/xorg/proto/randrproto/tree/randrproto.txt
    
    It looks like the check was added by mistake, because in the next 'for'
    the monitor is deleted if it is in this list.
    
    Steps to reproduce:
    Try RRSetMonitor with existing monitor name and other valid params
    OBSERVED RESULT:
    RRSetMonitors returns BadValue
    EXPECTED RESULT:
    RRSetMonitors returns OK
    
    Amend: 7e1f86d42b54fb7f6492875e47a718eaeca3069b
    Signed-off-by: Ilya Pominov <ipominov at astralinux.ru>

diff --git a/randr/rrmonitor.c b/randr/rrmonitor.c
index 7b0bbfcd5..c905042bb 100644
--- a/randr/rrmonitor.c
+++ b/randr/rrmonitor.c
@@ -489,17 +489,6 @@ RRMonitorAdd(ClientPtr client, ScreenPtr screen, RRMonitorPtr monitor)
         }
     }
 
-    /* 'name' must not match the name of any Monitor on the screen, or
-     * a Value error results.
-     */
-
-    for (m = 0; m < pScrPriv->numMonitors; m++) {
-        if (pScrPriv->monitors[m]->name == monitor->name) {
-            client->errorValue = monitor->name;
-            return BadValue;
-        }
-    }
-
     /* Allocate space for the new pointer. This is done before
      * removing matching monitors as it may fail, and the request
      * needs to not have any side-effects on failure


More information about the xorg-commit mailing list