<raster@redhat.com> added bolleean to gdk_window_xid_at_coords for excluding children fo excluded windows
This commit is contained in:
		@ -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
 | 
			
		||||
 | 
			
		||||
@ -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;
 | 
			
		||||
 | 
			
		||||
@ -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,12 +80,14 @@ 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])))
 | 
			
		||||
	       {
 | 
			
		||||
		  if ((child=gdk_window_xid_at(list[i],wx,wy,x,y,excludes,excl_child))!=0)
 | 
			
		||||
		    {
 | 
			
		||||
		  printf("-> %x\n",child);
 | 
			
		||||
		       XFree(list);
 | 
			
		||||
		       return child;
 | 
			
		||||
		    }
 | 
			
		||||
	       }
 | 
			
		||||
	     if (!i) break;
 | 
			
		||||
	  }
 | 
			
		||||
	XFree(list);
 | 
			
		||||
@ -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,31 +125,22 @@ 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])))
 | 
			
		||||
	       {
 | 
			
		||||
		  if ((child=gdk_window_xid_at(list[i],0,0,x,y,excludes,excl_child))!=0)
 | 
			
		||||
		    {
 | 
			
		||||
		  printf("%x\n",child);
 | 
			
		||||
		       if (excludes)
 | 
			
		||||
			 {
 | 
			
		||||
		       if (!g_list_find(excludes,(gpointer)child))
 | 
			
		||||
			    if (!g_list_find(excludes,(gpointer *)child))
 | 
			
		||||
			      {
 | 
			
		||||
				 XFree(list);
 | 
			
		||||
				 XUngrabServer(disp);
 | 
			
		||||
			    printf("Mouse in %x\n",child);
 | 
			
		||||
				 return child;
 | 
			
		||||
			      }
 | 
			
		||||
			 }
 | 
			
		||||
@ -154,16 +148,15 @@ gdk_window_xid_at_coords(gint x, gint y, GList *excludes)
 | 
			
		||||
			 {
 | 
			
		||||
			    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;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
 | 
			
		||||
@ -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,12 +80,14 @@ 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])))
 | 
			
		||||
	       {
 | 
			
		||||
		  if ((child=gdk_window_xid_at(list[i],wx,wy,x,y,excludes,excl_child))!=0)
 | 
			
		||||
		    {
 | 
			
		||||
		  printf("-> %x\n",child);
 | 
			
		||||
		       XFree(list);
 | 
			
		||||
		       return child;
 | 
			
		||||
		    }
 | 
			
		||||
	       }
 | 
			
		||||
	     if (!i) break;
 | 
			
		||||
	  }
 | 
			
		||||
	XFree(list);
 | 
			
		||||
@ -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,31 +125,22 @@ 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])))
 | 
			
		||||
	       {
 | 
			
		||||
		  if ((child=gdk_window_xid_at(list[i],0,0,x,y,excludes,excl_child))!=0)
 | 
			
		||||
		    {
 | 
			
		||||
		  printf("%x\n",child);
 | 
			
		||||
		       if (excludes)
 | 
			
		||||
			 {
 | 
			
		||||
		       if (!g_list_find(excludes,(gpointer)child))
 | 
			
		||||
			    if (!g_list_find(excludes,(gpointer *)child))
 | 
			
		||||
			      {
 | 
			
		||||
				 XFree(list);
 | 
			
		||||
				 XUngrabServer(disp);
 | 
			
		||||
			    printf("Mouse in %x\n",child);
 | 
			
		||||
				 return child;
 | 
			
		||||
			      }
 | 
			
		||||
			 }
 | 
			
		||||
@ -154,16 +148,15 @@ gdk_window_xid_at_coords(gint x, gint y, GList *excludes)
 | 
			
		||||
			 {
 | 
			
		||||
			    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;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user