[Patch] Add gdk_window_set_pointer function
- From: Peter Seiderer <Peter Seiderer ciselant de>
- To: gtk-devel-list gnome org
- Subject: [Patch] Add gdk_window_set_pointer function
- Date: Mon, 15 Apr 2002 15:10:56 +0200
Hello,
I missed a gdk_window_set_pointer function (analog to gdk_window_get_pointer)
to implement some functionality for xsane
(see: http://www.mostang.com/pipermail/sane-devel/2002-April/003304.html).
The attached patch implements this one.
Peter
Please CC, I am not subscribed.
--
------------------------------------------------------------------------
Peter Seiderer E-Mail: Peter Seiderer ciselant de
diff -ru gtk+-1.2.10_orig/gdk/gdk.h gtk+-1.2.10/gdk/gdk.h
--- gtk+-1.2.10_orig/gdk/gdk.h Mon Apr 15 12:55:51 2002
+++ gtk+-1.2.10/gdk/gdk.h Mon Apr 15 13:37:03 2002
@@ -360,6 +360,9 @@
gint *x,
gint *y,
GdkModifierType *mask);
+GdkWindow* gdk_window_set_pointer (GdkWindow *window,
+ gint x,
+ gint y);
GdkWindow* gdk_window_get_parent (GdkWindow *window);
GdkWindow* gdk_window_get_toplevel (GdkWindow *window);
GList* gdk_window_get_children (GdkWindow *window);
diff -ru gtk+-1.2.10_orig/gdk/gdkwindow.c gtk+-1.2.10/gdk/gdkwindow.c
--- gtk+-1.2.10_orig/gdk/gdkwindow.c Mon Apr 15 12:55:51 2002
+++ gtk+-1.2.10/gdk/gdkwindow.c Mon Apr 15 13:47:42 2002
@@ -1662,6 +1662,27 @@
}
GdkWindow*
+gdk_window_set_pointer (GdkWindow *window,
+ gint x,
+ gint y)
+{
+ GdkWindowPrivate *private;
+ GdkWindow *return_val;
+
+ if (!window)
+ window = (GdkWindow*) &gdk_root_parent;
+
+ private = (GdkWindowPrivate*) window;
+
+ return_val = NULL;
+ if (!private->destroyed) {
+ XWarpPointer (private->xdisplay, None, private->xwindow, 0, 0, 0, 0, x, y);
+ }
+
+ return return_val;
+}
+
+GdkWindow*
gdk_window_at_pointer (gint *win_x,
gint *win_y)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]