testinput - how to get events when coreptr not in window



Hello,

I'd like to adjust gtk/testinput, so that it will receive and respond to 
XINPUT events, while the core pointer is outside the main drawing area.

[Setting mode='Screen' is not adquate. I wish to have mode='Window' work]
  
I've experiented with some direct X11(non-gtk) XINPUT programs, and in
principle, it works fine, as long as XSelectExtensionEvent() is called with
the root window as the target.

However.... there does not seem to be a way to DO that, with gtk currently.
(gtk1.2.10)

gtk_widget_set_extension_events()

only takes GtkWidget type as an argument.  I dont know of a gtkwidget
wrapper around the root window.

So far, I have tried,

-  gtk_widget_set_extension_events(GDK_ROOT_PARENT(), ...)
-  gtk_widget_set_extension_events(gdk_root_parent, ...)

-  gtkrootwin=gdk_window_foreign_new(GDK_ROOT_WINDOW ());
   gtk_widget_set_extension_events(gtkrootwin,...)

but none of these seem to work out. Even the last one gives an error,

  Gtk-CRITICAL **: file gtkwidget.c: line 3906
  (gtk_widget_set_extension_events): assertion `GTK_IS_WIDGET (widget)'
  failed.


Could someone give me a pointer as to how I should proceed, please?

I'm new to gtk programming, so please excuse me if I've missed the "obvious"
gtk solution.



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