mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 19:00:08 +00:00
<raster@redhat.com>
<raster@redhat.com> added bolleean to gdk_window_xid_at_coords for excluding children fo excluded windows
This commit is contained in:
parent
617a879dfe
commit
c5327ecc31
@ -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,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;
|
||||
}
|
||||
|
||||
|
@ -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,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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user