Browse Source

Reorder XWindow creation, callback, and reparent

pull/1639/head
Cameron Leger 6 years ago
parent
commit
3cfd3a498b
1 changed files with 13 additions and 13 deletions
  1. +13
    -13
      dep/lglw/lglw_linux.c

+ 13
- 13
dep/lglw/lglw_linux.c View File

@@ -658,6 +658,18 @@ lglw_bool_t lglw_window_open (lglw_t _lglw, void *_parentHWNDOrNull, int32_t _x,
NULL/*XSizeHints*/
);

// Setup the event proc now, on the parent window as well just for the debug host
// It was simpler to do this than check in the debug host for the reparent event
lglw_log("lglw:lglw_window_open: 7\n");
loc_setEventProc(lglw->xdsp, lglw->win.xwnd);
loc_setProperty(lglw->xdsp, lglw->win.xwnd, "_lglw", (void*)lglw); // set instance pointer

if(0 != _parentHWNDOrNull)
{
loc_setEventProc(lglw->xdsp, lglw->parent_xwnd);
loc_setProperty(lglw->xdsp, lglw->parent_xwnd, "_lglw", (void*)lglw); // set instance pointer
}

// Some hosts only check and store the callback when the Window is reparented
// Since creating the Window with a Parent may or may not do that, but the callback is not set,
// ... it's created as a root window, the callback is set, and then it's reparented
@@ -665,7 +677,7 @@ lglw_bool_t lglw_window_open (lglw_t _lglw, void *_parentHWNDOrNull, int32_t _x,
// (note) [cameronleger] In Ardour's code-base, the only time it looks for the _XEventProc is during a ReparentNotify event
if (0 != _parentHWNDOrNull)
{
lglw_log("lglw:lglw_window_open: 7\n");
lglw_log("lglw:lglw_window_open: 8\n");
XReparentWindow(lglw->xdsp, lglw->win.xwnd, lglw->parent_xwnd, 0, 0);
}
#endif
@@ -675,18 +687,6 @@ lglw_bool_t lglw_window_open (lglw_t _lglw, void *_parentHWNDOrNull, int32_t _x,
lglw->win.b_owner = LGLW_FALSE;
#endif

// Setup the event proc now, on the parent window as well just for the debug host
// It was simpler to do this than check in the debug host for the reparent event
lglw_log("lglw:lglw_window_open: 8\n");
loc_setEventProc(lglw->xdsp, lglw->win.xwnd);

if(NULL != _parentHWNDOrNull)
{
loc_setEventProc(lglw->xdsp, lglw->parent_xwnd);
loc_setProperty(lglw->xdsp, lglw->parent_xwnd, "_lglw", (void*)lglw); // set instance pointer
}
loc_setProperty(lglw->xdsp, lglw->win.xwnd, "_lglw", (void*)lglw); // set instance pointer

lglw_log("lglw:lglw_window_open: 9\n");
if(lglw->win.b_owner)
{


Loading…
Cancel
Save