diff options
author | rhlabs <rhlabs> | 1998-03-11 22:24:54 +0000 |
---|---|---|
committer | rhlabs <rhlabs> | 1998-03-11 22:24:54 +0000 |
commit | c5327ecc316d03499699b9f1958debdb6a307d27 (patch) | |
tree | 0b2e2a6cf54f684860f88d9e697918158eb691b3 /gdk | |
parent | 617a879dfe8811bb184627cc015378fefcd5292e (diff) | |
download | gdk-pixbuf-c5327ecc316d03499699b9f1958debdb6a307d27.tar.gz |
<raster@redhat.com>
<raster@redhat.com>
added bolleean to gdk_window_xid_at_coords for excluding children fo
excluded windows
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/gdk.c | 2 | ||||
-rw-r--r-- | gdk/gdkprivate.h | 4 | ||||
-rw-r--r-- | gdk/gdkwindow.c | 49 | ||||
-rw-r--r-- | gdk/x11/gdkmain-x11.c | 2 | ||||
-rw-r--r-- | gdk/x11/gdkwindow-x11.c | 49 |
5 files changed, 46 insertions, 60 deletions
@@ -2089,7 +2089,7 @@ gdk_event_translate (GdkEvent *event, #if 1 curwin = gdk_window_xid_at_coords(xevent->xmotion.x_root, xevent->xmotion.y_root, - gdk_dnd.c->xids); + gdk_dnd.c->xids,TRUE); XTranslateCoordinates(gdk_display, gdk_root_window, curwin, x, y, &x, &y, &childwin); #else diff --git a/gdk/gdkprivate.h b/gdk/gdkprivate.h index 65e9e7200..d45bcc67e 100644 --- a/gdk/gdkprivate.h +++ b/gdk/gdkprivate.h @@ -239,8 +239,8 @@ void gdk_dnd_display_drag_cursor(gint x, gboolean change_made); /* Please see gdkwindow.c for comments on how to use */ -Window gdk_window_xid_at(Window base, gint bx, gint by, gint x, gint y); -Window gdk_window_xid_at_coords(gint x, gint y, GList *excludes); +Window gdk_window_xid_at(Window base, gint bx, gint by, gint x, gint y, GList *excludes, gboolean excl_child); +Window gdk_window_xid_at_coords(gint x, gint y, GList *excludes, gboolean excl_child); extern gint gdk_debug_level; extern gint gdk_show_events; diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index d3ec24e3c..b95135cf3 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -55,7 +55,8 @@ int event_mask_table[19] = /* internal function created for and used by gdk_window_xid_at_coords */ Window -gdk_window_xid_at(Window base, gint bx, gint by, gint x, gint y) +gdk_window_xid_at(Window base, gint bx, gint by, gint x, gint y, + GList *excludes, gboolean excl_child) { GdkWindow *window; GdkWindowPrivate *private; @@ -79,11 +80,13 @@ gdk_window_xid_at(Window base, gint bx, gint by, gint x, gint y) { for (i=num-1;;i--) { - if ((child=gdk_window_xid_at(list[i],wx,wy,x,y))!=0) + if ((!excl_child)||(!g_list_find(excludes,(gpointer *)list[i]))) { - printf("-> %x\n",child); - XFree(list); - return child; + if ((child=gdk_window_xid_at(list[i],wx,wy,x,y,excludes,excl_child))!=0) + { + XFree(list); + return child; + } } if (!i) break; } @@ -106,7 +109,7 @@ gdk_window_xid_at(Window base, gint bx, gint by, gint x, gint y) * those X,Y co-ordinates. */ Window -gdk_window_xid_at_coords(gint x, gint y, GList *excludes) +gdk_window_xid_at_coords(gint x, gint y, GList *excludes, gboolean excl_child) { GdkWindow *window; GdkWindowPrivate *private; @@ -122,48 +125,38 @@ gdk_window_xid_at_coords(gint x, gint y, GList *excludes) root=private->xwindow; XGrabServer(disp); num=g_list_length(excludes); - printf("coords %i %i\n",x,y); - for(i=0;i<num;i++) - { - gl=g_list_nth(excludes,i); - printf("excludes %x\n",gl->data); - } if (!XQueryTree(disp,root,&root_win,&parent_win,&list,&num)) - { - printf("Mouse in %x\n",root); return root; - } if (list) { for (i=num-1;;i--) { - if ((child=gdk_window_xid_at(list[i],0,0,x,y))!=0) + if ((!excl_child)||(!g_list_find(excludes,(gpointer *)list[i]))) { - printf("%x\n",child); - if (excludes) + if ((child=gdk_window_xid_at(list[i],0,0,x,y,excludes,excl_child))!=0) { - if (!g_list_find(excludes,(gpointer)child)) + if (excludes) + { + if (!g_list_find(excludes,(gpointer *)child)) + { + XFree(list); + XUngrabServer(disp); + return child; + } + } + else { XFree(list); XUngrabServer(disp); - printf("Mouse in %x\n",child); return child; } } - else - { - XFree(list); - XUngrabServer(disp); - printf("Mouse in %x\n",child); - return child; - } } if (!i) break; } XFree(list); } XUngrabServer(disp); - printf("Mouse in %x\n",root); return root; } diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c index 1bffc2a28..857d39a19 100644 --- a/gdk/x11/gdkmain-x11.c +++ b/gdk/x11/gdkmain-x11.c @@ -2089,7 +2089,7 @@ gdk_event_translate (GdkEvent *event, #if 1 curwin = gdk_window_xid_at_coords(xevent->xmotion.x_root, xevent->xmotion.y_root, - gdk_dnd.c->xids); + gdk_dnd.c->xids,TRUE); XTranslateCoordinates(gdk_display, gdk_root_window, curwin, x, y, &x, &y, &childwin); #else diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index d3ec24e3c..b95135cf3 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -55,7 +55,8 @@ int event_mask_table[19] = /* internal function created for and used by gdk_window_xid_at_coords */ Window -gdk_window_xid_at(Window base, gint bx, gint by, gint x, gint y) +gdk_window_xid_at(Window base, gint bx, gint by, gint x, gint y, + GList *excludes, gboolean excl_child) { GdkWindow *window; GdkWindowPrivate *private; @@ -79,11 +80,13 @@ gdk_window_xid_at(Window base, gint bx, gint by, gint x, gint y) { for (i=num-1;;i--) { - if ((child=gdk_window_xid_at(list[i],wx,wy,x,y))!=0) + if ((!excl_child)||(!g_list_find(excludes,(gpointer *)list[i]))) { - printf("-> %x\n",child); - XFree(list); - return child; + if ((child=gdk_window_xid_at(list[i],wx,wy,x,y,excludes,excl_child))!=0) + { + XFree(list); + return child; + } } if (!i) break; } @@ -106,7 +109,7 @@ gdk_window_xid_at(Window base, gint bx, gint by, gint x, gint y) * those X,Y co-ordinates. */ Window -gdk_window_xid_at_coords(gint x, gint y, GList *excludes) +gdk_window_xid_at_coords(gint x, gint y, GList *excludes, gboolean excl_child) { GdkWindow *window; GdkWindowPrivate *private; @@ -122,48 +125,38 @@ gdk_window_xid_at_coords(gint x, gint y, GList *excludes) root=private->xwindow; XGrabServer(disp); num=g_list_length(excludes); - printf("coords %i %i\n",x,y); - for(i=0;i<num;i++) - { - gl=g_list_nth(excludes,i); - printf("excludes %x\n",gl->data); - } if (!XQueryTree(disp,root,&root_win,&parent_win,&list,&num)) - { - printf("Mouse in %x\n",root); return root; - } if (list) { for (i=num-1;;i--) { - if ((child=gdk_window_xid_at(list[i],0,0,x,y))!=0) + if ((!excl_child)||(!g_list_find(excludes,(gpointer *)list[i]))) { - printf("%x\n",child); - if (excludes) + if ((child=gdk_window_xid_at(list[i],0,0,x,y,excludes,excl_child))!=0) { - if (!g_list_find(excludes,(gpointer)child)) + if (excludes) + { + if (!g_list_find(excludes,(gpointer *)child)) + { + XFree(list); + XUngrabServer(disp); + return child; + } + } + else { XFree(list); XUngrabServer(disp); - printf("Mouse in %x\n",child); return child; } } - else - { - XFree(list); - XUngrabServer(disp); - printf("Mouse in %x\n",child); - return child; - } } if (!i) break; } XFree(list); } XUngrabServer(disp); - printf("Mouse in %x\n",root); return root; } |