Maybe use None instead of 0 for the XIDs? I'm not too offended by the zeros there, so

Reviewed-by: Aaron Plattner <[email protected]>
Tested-by: Aaron Plattner <[email protected]>

Thanks for sending this out -- sorry I didn't get around to it last week.

On 05/02/2013 05:05 PM, Dave Airlie wrote:
Before the lookup code passing a 0 XID would disconnect,
this fixes it backup.

Signed-off-by: Dave Airlie <[email protected]>
---
  xrandr.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xrandr.c b/xrandr.c
index 305308c..d5727b2 100644
--- a/xrandr.c
+++ b/xrandr.c
@@ -2446,6 +2446,8 @@ find_provider (name_t *name)
  {
      int i;

+    if ((name->kind & name_xid) && name->xid == 0)
+       return NULL;
      for (i = 0; i < num_providers; i++) {
        provider_t *p = &providers[i];
        name_kind_t common = name->kind & p->provider.kind;
@@ -3228,7 +3230,7 @@ main (int argc, char **argv)
        provider = find_provider (&provider_name);
        source = find_provider(&output_source_provider_name);

-       XRRSetProviderOutputSource(dpy, provider->provider.xid, 
source->provider.xid);
+       XRRSetProviderOutputSource(dpy, provider->provider.xid, source ? 
source->provider.xid : 0);
      }
      if (provsetoffsink)
      {
@@ -3243,7 +3245,7 @@ main (int argc, char **argv)
        provider = find_provider (&provider_name);
        sink = find_provider(&offload_sink_provider_name);

-       XRRSetProviderOffloadSink(dpy, provider->provider.xid, 
sink->provider.xid);
+       XRRSetProviderOffloadSink(dpy, provider->provider.xid, sink ? 
sink->provider.xid : 0);
      }
      if (setit_1_2)
      {


--
Aaron
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to