* Tools/xpbs.m (-xProvideSelection:): Leave enough space for all

possible types.
* Source/x11/XGDragView.m: Simplify D&D window detection code.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37457 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2013-12-13 12:58:09 +00:00
parent e1817e8283
commit 40fc6bfe72
3 changed files with 18 additions and 5 deletions

View file

@ -1,3 +1,9 @@
2013-12-13 Fred Kiefer <FredKiefer@gmx.de>
* Tools/xpbs.m (-xProvideSelection:): Leave enough space for all
possible types.
* Source/x11/XGDragView.m: Simplify D&D window detection code.
2013-09-29 Fred Kiefer <FredKiefer@gmx.de>
* Headers/opal/OpalSurface.h

View file

@ -52,9 +52,9 @@
#define SLIDE_TIME_STEP .02 /* in seconds */
#define SLIDE_NR_OF_STEPS 20
#define dragWindev [XGServer _windowWithTag: [_window windowNumber]]
#define DRAGWINDEV [XGServer _windowWithTag: [_window windowNumber]]
#define XX(P) (P.x)
#define XY(P) (DisplayHeight(XDPY, dragWindev->screen) - P.y)
#define XY(P) (DisplayHeight(XDPY, DRAGWINDEV->screen) - P.y)
@interface XGRawWindow : NSWindow
@end
@ -268,6 +268,8 @@ static XGDragView *sharedDragView = nil;
timestamp: (NSTimeInterval)time
toWindow: (int)dWindowNumber
{
gswindow_device_t *dragWindev = DRAGWINDEV;
switch (subtype)
{
case GSAppKitDraggingDrop:
@ -332,7 +334,8 @@ static XGDragView *sharedDragView = nil;
-1 if we can only find the X window that we are dragging
None if there is no X window that accepts drag and drop.
*/
- (Window) _xWindowAcceptingDnDDescendentOf: (Window) parent
- (Window) _xWindowAcceptingDnDDescendentOf: (Window) parent
ignoring: (Window) ident
underX: (int) x
Y: (int) y
{
@ -344,7 +347,7 @@ static XGDragView *sharedDragView = nil;
XWindowAttributes attr;
int ret_x, ret_y;
if (parent == dragWindev->ident)
if (parent == ident)
return -1;
XQueryTree(display, parent, &root, &ignore, &children, &nchildren);
@ -361,6 +364,7 @@ static XGDragView *sharedDragView = nil;
&& ret_y >= 0 && ret_y < attr.height)
{
result = [self _xWindowAcceptingDnDDescendentOf: child
ignoring: ident
underX: x
Y: y];
if (result != (Window)-1)
@ -389,8 +393,10 @@ static XGDragView *sharedDragView = nil;
- (Window) _xWindowAcceptingDnDunderX: (int) x Y: (int) y
{
Window result;
gswindow_device_t *dragWindev = DRAGWINDEV;
result = [self _xWindowAcceptingDnDDescendentOf: dragWindev->root
ignoring: dragWindev->ident
underX: x
Y: y];
if (result == (Window)-1)

View file

@ -1156,7 +1156,8 @@ xErrorHandler(Display *d, XErrorEvent *e)
if (xEvent->target == XG_TARGETS)
{
unsigned numTypes = 0;
Atom xTypes[10];
// ATTENTION: Increase this array when adding more types
Atom xTypes[16];
/*
* The requestor wants a list of the types we can supply it with.