GdkEventMask?



Hi,

I use this in my gdk-app to show if a event is available for root
window:

GdkEventMask unavailable_events;
GdkWindow *rootwindow;

rootwindow = gdk_window_foreign_new (gdk_x11_get_default_root_xwindow());

unavailable_events = gdk_window_get_events(rootwindow);

if ((unavailable_events & GDK_BUTTON_PRESS_MASK) == GDK_BUTTON_PRESS_MASK)
    {
      printf ("GDK_BUTTON_PRESS_MASK not available for root window\n");
      exit (1);
    }
  else
    {
      printf ("GDK_BUTTON_PRESS_MASK available for root window\n");
      gdk_window_set_events (rootwindow, GDK_BUTTON_PRESS_MASK);
    }

I want to check it, because if not my app crashes with:
The program 'grootevent' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAccess (attempt to access private resource denied)'.
  (Details: serial 44 error_code 10 request_code 2 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

But it doesn't work. I go everytime into the else-part. What did I wrong?

Thanks
Andreas



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]