<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
|
#if 1
|
||||||
curwin = gdk_window_xid_at_coords(xevent->xmotion.x_root,
|
curwin = gdk_window_xid_at_coords(xevent->xmotion.x_root,
|
||||||
xevent->xmotion.y_root,
|
xevent->xmotion.y_root,
|
||||||
gdk_dnd.c->xids);
|
gdk_dnd.c->xids,TRUE);
|
||||||
XTranslateCoordinates(gdk_display, gdk_root_window, curwin,
|
XTranslateCoordinates(gdk_display, gdk_root_window, curwin,
|
||||||
x, y, &x, &y, &childwin);
|
x, y, &x, &y, &childwin);
|
||||||
#else
|
#else
|
||||||
|
|||||||
@ -239,8 +239,8 @@ void gdk_dnd_display_drag_cursor(gint x,
|
|||||||
gboolean change_made);
|
gboolean change_made);
|
||||||
|
|
||||||
/* Please see gdkwindow.c for comments on how to use */
|
/* 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(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);
|
Window gdk_window_xid_at_coords(gint x, gint y, GList *excludes, gboolean excl_child);
|
||||||
|
|
||||||
extern gint gdk_debug_level;
|
extern gint gdk_debug_level;
|
||||||
extern gint gdk_show_events;
|
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 */
|
/* internal function created for and used by gdk_window_xid_at_coords */
|
||||||
Window
|
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;
|
GdkWindow *window;
|
||||||
GdkWindowPrivate *private;
|
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--)
|
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);
|
XFree(list);
|
||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!i) break;
|
if (!i) break;
|
||||||
}
|
}
|
||||||
XFree(list);
|
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.
|
* those X,Y co-ordinates.
|
||||||
*/
|
*/
|
||||||
Window
|
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;
|
GdkWindow *window;
|
||||||
GdkWindowPrivate *private;
|
GdkWindowPrivate *private;
|
||||||
@ -122,31 +125,22 @@ gdk_window_xid_at_coords(gint x, gint y, GList *excludes)
|
|||||||
root=private->xwindow;
|
root=private->xwindow;
|
||||||
XGrabServer(disp);
|
XGrabServer(disp);
|
||||||
num=g_list_length(excludes);
|
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))
|
if (!XQueryTree(disp,root,&root_win,&parent_win,&list,&num))
|
||||||
{
|
|
||||||
printf("Mouse in %x\n",root);
|
|
||||||
return root;
|
return root;
|
||||||
}
|
|
||||||
if (list)
|
if (list)
|
||||||
{
|
{
|
||||||
for (i=num-1;;i--)
|
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 (excludes)
|
||||||
{
|
{
|
||||||
if (!g_list_find(excludes,(gpointer)child))
|
if (!g_list_find(excludes,(gpointer *)child))
|
||||||
{
|
{
|
||||||
XFree(list);
|
XFree(list);
|
||||||
XUngrabServer(disp);
|
XUngrabServer(disp);
|
||||||
printf("Mouse in %x\n",child);
|
|
||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -154,16 +148,15 @@ gdk_window_xid_at_coords(gint x, gint y, GList *excludes)
|
|||||||
{
|
{
|
||||||
XFree(list);
|
XFree(list);
|
||||||
XUngrabServer(disp);
|
XUngrabServer(disp);
|
||||||
printf("Mouse in %x\n",child);
|
|
||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!i) break;
|
if (!i) break;
|
||||||
}
|
}
|
||||||
XFree(list);
|
XFree(list);
|
||||||
}
|
}
|
||||||
XUngrabServer(disp);
|
XUngrabServer(disp);
|
||||||
printf("Mouse in %x\n",root);
|
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2089,7 +2089,7 @@ gdk_event_translate (GdkEvent *event,
|
|||||||
#if 1
|
#if 1
|
||||||
curwin = gdk_window_xid_at_coords(xevent->xmotion.x_root,
|
curwin = gdk_window_xid_at_coords(xevent->xmotion.x_root,
|
||||||
xevent->xmotion.y_root,
|
xevent->xmotion.y_root,
|
||||||
gdk_dnd.c->xids);
|
gdk_dnd.c->xids,TRUE);
|
||||||
XTranslateCoordinates(gdk_display, gdk_root_window, curwin,
|
XTranslateCoordinates(gdk_display, gdk_root_window, curwin,
|
||||||
x, y, &x, &y, &childwin);
|
x, y, &x, &y, &childwin);
|
||||||
#else
|
#else
|
||||||
|
|||||||
@ -55,7 +55,8 @@ int event_mask_table[19] =
|
|||||||
|
|
||||||
/* internal function created for and used by gdk_window_xid_at_coords */
|
/* internal function created for and used by gdk_window_xid_at_coords */
|
||||||
Window
|
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;
|
GdkWindow *window;
|
||||||
GdkWindowPrivate *private;
|
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--)
|
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);
|
XFree(list);
|
||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!i) break;
|
if (!i) break;
|
||||||
}
|
}
|
||||||
XFree(list);
|
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.
|
* those X,Y co-ordinates.
|
||||||
*/
|
*/
|
||||||
Window
|
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;
|
GdkWindow *window;
|
||||||
GdkWindowPrivate *private;
|
GdkWindowPrivate *private;
|
||||||
@ -122,31 +125,22 @@ gdk_window_xid_at_coords(gint x, gint y, GList *excludes)
|
|||||||
root=private->xwindow;
|
root=private->xwindow;
|
||||||
XGrabServer(disp);
|
XGrabServer(disp);
|
||||||
num=g_list_length(excludes);
|
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))
|
if (!XQueryTree(disp,root,&root_win,&parent_win,&list,&num))
|
||||||
{
|
|
||||||
printf("Mouse in %x\n",root);
|
|
||||||
return root;
|
return root;
|
||||||
}
|
|
||||||
if (list)
|
if (list)
|
||||||
{
|
{
|
||||||
for (i=num-1;;i--)
|
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 (excludes)
|
||||||
{
|
{
|
||||||
if (!g_list_find(excludes,(gpointer)child))
|
if (!g_list_find(excludes,(gpointer *)child))
|
||||||
{
|
{
|
||||||
XFree(list);
|
XFree(list);
|
||||||
XUngrabServer(disp);
|
XUngrabServer(disp);
|
||||||
printf("Mouse in %x\n",child);
|
|
||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -154,16 +148,15 @@ gdk_window_xid_at_coords(gint x, gint y, GList *excludes)
|
|||||||
{
|
{
|
||||||
XFree(list);
|
XFree(list);
|
||||||
XUngrabServer(disp);
|
XUngrabServer(disp);
|
||||||
printf("Mouse in %x\n",child);
|
|
||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!i) break;
|
if (!i) break;
|
||||||
}
|
}
|
||||||
XFree(list);
|
XFree(list);
|
||||||
}
|
}
|
||||||
XUngrabServer(disp);
|
XUngrabServer(disp);
|
||||||
printf("Mouse in %x\n",root);
|
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user