Hello xorg developers,

I have attached my patch to xserver that removes the "one-monitor-per-output" restriction. My attempt and the result is described in https://gitlab.gnome.org/GNOME/gtk/-/issues/2013#note_1564376 . The result is amazing, split-screen works flawlessly with all of my desktop applications, similar as if I had 2 monitors.

I'd be happy if that could make it into xserver. Should I create a PR from the patch in the gitlab?

Kind regards,

Michael.


Am 29.09.22 um 22:41 schrieb Keith Packard:
Michael Wyraz <mich...@wyraz.de> writes:

For the second monitor, the output must be set to "none" which is
obviously wrong since it is connected to a device. The reason why it is
set to "none" is some code in xserver that removes an monitor if another
one is added to the same output:
That's actually required in the RandR spec:

        For each output in 'info.outputs, each one is removed from all
        pre-existing Monitors. If removing the output causes the list of
        outputs for that Monitor to become empty, then that Monitor will
        be deleted as if RRDeleteMonitor were called.

The notion of splitting one physical output into multiple virtual
monitors was not considered when this extension was defined, which is
why it doesn't work. I don't see any particular reason for *not*
supporting your use case.

However, there are subtleties here. We want to remove any automatically
created 'Monitor' objects when mapping user-specified monitors to
them, and we want to re-generate automatically generated 'Monitors' when
all virtual monitors associated with an output are removed.

I think what we want is:

  * If no user-specified Monitors map to a particular Output, then automatically
    create a Monitor for that Output

  * If any user-specified Monitors map to a particular Output, then
    remove the automatically generated Monitor for that Output.
In the current spec, there's no real separation between user-specified
and automatically-generated Monitors, I think that would be necessary to
make this work?
--- xorg-server-21.1.4/randr/rrmonitor.c.orig	2022-09-30 00:09:40.458561832 +0200
+++ xorg-server-21.1.4/randr/rrmonitor.c	2022-09-30 00:09:46.298529786 +0200
@@ -528,27 +528,6 @@
             continue;
         }
 
-        /* For each output in 'info.outputs', each one is removed from all
-         * pre-existing Monitors. If removing the output causes the list
-         * of outputs for that Monitor to become empty, then that
-         * Monitor will be deleted as if RRDeleteMonitor were called.
-         */
-
-        for (eo = 0; eo < existing->numOutputs; eo++) {
-            for (o = 0; o < monitor->numOutputs; o++) {
-                if (monitor->outputs[o] == existing->outputs[eo]) {
-                    memmove(existing->outputs + eo, existing->outputs + eo + 1,
-                            (existing->numOutputs - (eo + 1)) * sizeof (RROutput));
-                    --existing->numOutputs;
-                    --eo;
-                    break;
-                }
-            }
-            if (existing->numOutputs == 0) {
-                (void) RRMonitorDelete(client, screen, existing->name);
-                break;
-            }
-        }
         if (monitor->primary)
             existing->primary = FALSE;
     }

Reply via email to