Browse Source

Remove hacks for finding real parent, hosts decide what to do

pull/6/head
falkTX 9 years ago
parent
commit
287802cd27
2 changed files with 3 additions and 28 deletions
  1. +0
    -1
      dgl/src/pugl/pugl_internal.h
  2. +3
    -27
      dgl/src/pugl/pugl_x11.c

+ 0
- 1
dgl/src/pugl/pugl_internal.h View File

@@ -59,7 +59,6 @@ struct PuglViewImpl {
PuglInternals* impl;

PuglNativeWindow parent;
PuglNativeWindow topparent;
PuglContextType ctx_type;
uintptr_t transient_parent;



+ 3
- 27
dgl/src/pugl/pugl_x11.c View File

@@ -461,33 +461,9 @@ dispatchKey(PuglView* view, XEvent* event, bool press)

send_event:
if (view->parent != 0) {
if (view->topparent == 0) {
uint nchildren;
Window root, newparent, oldparent, *children;

oldparent = view->topparent = view->parent;
while (XQueryTree(view->impl->display, oldparent, &root, &newparent, &children, &nchildren) != 0) {
if (nchildren == 0 || children == NULL) {
break;
}
XFree(children);
if (newparent == 0 || newparent == root) {
break;
}

// FIXME: this needs a proper check for desktop-style window
if (newparent < 0x6000000 &&
XGetTransientForHint(view->impl->display, oldparent, &newparent) == 0) {
break;
}

view->topparent = oldparent = newparent;
}
}

event->xkey.time = 0; // purposefully set an invalid time, used for feedback detection
event->xany.window = view->topparent;
XSendEvent(view->impl->display, view->topparent, False, NoEventMask, event);
event->xkey.time = 0; // purposefully set an invalid time, used for feedback detection on bad hosts
event->xany.window = view->parent;
XSendEvent(view->impl->display, view->parent, False, NoEventMask, event);
}
}



Loading…
Cancel
Save