My application attaches a XFixes created reactangle to a window.
Therefore it does a XOpenDisplay() + XFixesCreateRegion() + XCloseDisplay() inside one short function and done.
After the above outlined function resturns a call to XFixesFetchRegion()
from a outside observer forces the application to quit:

PropertyNotify : _NET_COLOR_REGIONS    vvvvv      679x580+642+245  2
X Error of failed request:  179
  Major opcode of failed request:  155 (XFIXES)
  Minor opcode of failed request:  19 (XFixesFetchRegion)
  Serial number of failed request:  7927
  Current serial number in output stream:  7927

Any idea how to avoid a quit from XFixesFetchRegion()? A error message would be enough. A exit in not acceptable to the application.

A minimal example application source code is attached.


kind regards
Kai-Uwe Behrmann
--
developing for colour management www.behrmann.name + www.oyranos.org
/* !cc -Wall -g -o test_XFixes test_XFixes.c -lXfixes -lX11 */
#include <X11/Xlib.h>
#include <X11/extensions/Xfixes.h>
#include <stdio.h>

int main(int argc, char * argv[])
{
  Display * display = XOpenDisplay(0);
  XRectangle rec[2] = { { 0,0,0,0 }, { 0,0,0,0 } },
           * rect = 0;
  int nRect = 0;
  XserverRegion reg = 0;

  rec[0].x = 10;
  rec[0].y = 20;
  rec[0].width = 30;
  rec[0].height = 40;

  reg = XFixesCreateRegion( display, rec, 1);
  rect = XFixesFetchRegion( display, reg, &nRect );
  if(!nRect)
    printf( "no region to be found %d\n", (int)reg );
  else
    printf( "rect found[%d]: %dx%d+%d+%d\n", (int)reg,
            rect->width, rect->height, rect->x, rect->y );

  XCloseDisplay( display ); display = 0;
  printf( "close display\n\n" );

  /* reopen */
  printf( "reopening display and fetching the same region[%d]\n\n", (int)reg );
  display = XOpenDisplay(0);
  nRect = 0;
  rect = XFixesFetchRegion( display, reg, &nRect );
  if(!nRect)
    printf( "no region to be found %d\n", (int)reg );
  else
    printf( "rect found: %dx%d+%d+%d\n",
            rect->width, rect->height, rect->x, rect->y );

  XCloseDisplay( display ); display = 0;

  return 0;
}
_______________________________________________
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Reply via email to