[comp.windows.x] xdbx, problems

converse@EXPO.LCS.MIT.EDU (Donna Converse) (11/19/89)

> xdbx: (the problem only occurs on SPARC, since the Sun3 version is fixed.)
> I have the three patch files now for xdbx (therefore I am at PATCHLEVEL 1?)
> Over the last few days, a patch was sugguested to fix xdbx for a system 
> running 4.0.3: 
> 
>>    /* ask window manager for input focus: */

Nit: this isn't asking for input focus, it is communicating to the
window manager the input focus model used by the client application.
Input focus models are described in section 4.1.7 of the ICCCM.

>>    {
>>      XWMHints wmhints;
>>      wmhints = XGetWMHints(XtDisplay(vpane), XtWindow(vpane));
>>      wmhints.input = True;
>>      wmhints.flags = InputHint;
>>      XSetWMHints(XtDisplay(vpane), XtWindow(vpane), &wmhints);
>>    }
>
>It looks like it might work, but I receive a bad window error on the line
>wmhints = XGetWMHints(Xt....
>
>I believe that I put the patch in the right place (ie. After the line
>vpane = XtCreateManagedWidget("vpane", vPanedWidgetClass, parent, args, n);)

Read section 2.4 of the X Toolkit Intrinsics manual.  The 
creation of a widget is a three phase process; the third phase
of the process occurs when XtRealizeWidget executes, and that 
is when the window of the widget is created.  You get a 
BadWindow error because the vpane widget doen't have a window yet.

>Does this mean that a managed child cannot have its WMHints adjusted?

No, that's not the case.

> What am I doing wrong?

Since xdbx is a toolkit client, I would try setting the XtNinput
resource of the top-level shell to True.  (The default is False.)
That's the toolkit level solution; the code above is the Xlib
level solution, and is not incorrect; what is wrong is when and
perhaps upon what window you are setting WM_HINT's input to True.
If you want to use the code above, try it out on the toplevel
shell widget, after it has been realized.

If problems continue then it would be useful to know what 
window manger you are running.


Donna Converse
converse@expo.lcs.mit.edu