Debugging Xaw Toggle button problems - Xwindows

This is a discussion on Debugging Xaw Toggle button problems - Xwindows ; Hi All, I've been trying to debug a problem in an older X application 'PCB' ( a printed circuit board CAD application) that is giving me some strange problems related to toggle buttons implemented using the Xaw toolkit. I didn't ...

+ Reply to Thread
Results 1 to 10 of 10

Thread: Debugging Xaw Toggle button problems

  1. Debugging Xaw Toggle button problems

    Hi All,

    I've been trying to debug a problem in an older X application 'PCB' ( a
    printed circuit board CAD application) that is giving me some strange
    problems related to toggle buttons implemented using the Xaw toolkit. I
    didn't write this application myself, so I'm not that familiar with the
    code or how to get any further then where I'm at so I'm looking for some
    help.

    The main panel of the application has a number of Toggle buttons to
    select which mode the application is in. When running this application
    with the Gnome sawfish window manager I'm unable to click these buttons
    and have the mode change. I tracked this down to be an issue related to
    a feature in sawfish where the window manager actually first raises the
    window that you clicked on and then passes through the click to the
    application. This sawfish behaviour works well everywere else except for
    these toggle buttons in PCB. I get get the togglebuttons to work by
    holding down the shift key as well, which disables the sawfish
    'click-and-pass-through' feature.

    I'm now running the application through xmon which allows me to see
    exactly what is going on on the Xprotocol level, these are the events I
    see when 'click-and-pass-through' is enabled which makes the buttons not
    work:

    ...............EVENT: LeaveNotify
    ...............EVENT: EnterNotify
    ...............EVENT: LeaveNotify
    ...............EVENT: EnterNotify
    ...............EVENT: ButtonPress
    ...............EVENT: NoExposure
    ...............EVENT: NoExposure
    ...............EVENT: ButtonRelease

    The series of events when I disable the 'click-and-pass-through' feature
    looks like this:

    ...............EVENT: KeyPress
    ...............EVENT: ButtonPress
    ...............EVENT: ButtonRelease
    ...............EVENT: Expose
    ...............EVENT: Expose
    ...............EVENT: NoExposure
    ...............EVENT: NoExposure

    The buttons are added using XtVaCreateManagedWidget and the class is set
    to toggleWidgetClass. I instrumented the two functions registered using
    XtAddEventHandler and XtAddCallback and I can tell that when I click on
    the button with the 'click-and-pass-through' feature enabled only the
    EventHandler function connected to the button is called (not the
    callback). And when I click on the button with 'click-and-pass-through'
    disabled only the callback is called (not the eventhandler).

    The next intesting thing is that there are more Toggle buttons on this
    application and they work fine with or without 'click-and-pass-through'.
    The difference as far as I can tell is that the buttons that work are
    added to the main GUI before XtAppAddActions, XtAugmentTranslations and
    XtRealizeWidget is called and the buttons that only work with
    'click-and-pass-through' disabled are added after the above mentioned
    functions.

    This is about as far as I got, I'm stuck here and could use some hints
    on how to debug further or what to look for. Sorry for the long posting...

    Thanks
    Daniel Nilsson


  2. Re: Debugging Xaw Toggle button problems

    In comp.windows.x, Daniel Nilsson

    wrote
    on Fri, 09 Jan 2004 02:24:22 GMT
    :
    > Hi All,
    >
    > I've been trying to debug a problem in an older X application 'PCB' ( a
    > printed circuit board CAD application) that is giving me some strange
    > problems related to toggle buttons implemented using the Xaw toolkit. I
    > didn't write this application myself, so I'm not that familiar with the
    > code or how to get any further then where I'm at so I'm looking for some
    > help.
    >
    > The main panel of the application has a number of Toggle buttons to
    > select which mode the application is in. When running this application
    > with the Gnome sawfish window manager I'm unable to click these buttons
    > and have the mode change. I tracked this down to be an issue related to
    > a feature in sawfish where the window manager actually first raises the
    > window that you clicked on and then passes through the click to the
    > application. This sawfish behaviour works well everywere else except for
    > these toggle buttons in PCB. I get get the togglebuttons to work by
    > holding down the shift key as well, which disables the sawfish
    > 'click-and-pass-through' feature.
    >
    > I'm now running the application through xmon which allows me to see
    > exactly what is going on on the Xprotocol level, these are the events I
    > see when 'click-and-pass-through' is enabled which makes the buttons not
    > work:
    >
    > ..............EVENT: LeaveNotify
    > ..............EVENT: EnterNotify
    > ..............EVENT: LeaveNotify
    > ..............EVENT: EnterNotify
    > ..............EVENT: ButtonPress
    > ..............EVENT: NoExposure
    > ..............EVENT: NoExposure
    > ..............EVENT: ButtonRelease
    >
    > The series of events when I disable the 'click-and-pass-through' feature
    > looks like this:
    >
    > ..............EVENT: KeyPress
    > ..............EVENT: ButtonPress
    > ..............EVENT: ButtonRelease
    > ..............EVENT: Expose
    > ..............EVENT: Expose
    > ..............EVENT: NoExposure
    > ..............EVENT: NoExposure
    >
    > The buttons are added using XtVaCreateManagedWidget and the class is set
    > to toggleWidgetClass. I instrumented the two functions registered using
    > XtAddEventHandler and XtAddCallback and I can tell that when I click on
    > the button with the 'click-and-pass-through' feature enabled only the
    > EventHandler function connected to the button is called (not the
    > callback). And when I click on the button with 'click-and-pass-through'
    > disabled only the callback is called (not the eventhandler).
    >
    > The next intesting thing is that there are more Toggle buttons on this
    > application and they work fine with or without 'click-and-pass-through'.
    > The difference as far as I can tell is that the buttons that work are
    > added to the main GUI before XtAppAddActions, XtAugmentTranslations and
    > XtRealizeWidget is called and the buttons that only work with
    > 'click-and-pass-through' disabled are added after the above mentioned
    > functions.
    >
    > This is about as far as I got, I'm stuck here and could use some hints
    > on how to debug further or what to look for. Sorry for the long posting...
    >
    > Thanks
    > Daniel Nilsson
    >


    I'd have to experiment but it might be related to a translation table.
    Briefly, the ToggleButton is seeing a , not a

  3. Re: Debugging Xaw Toggle button problems

    The Ghost In The Machine wrote:
    >>The next intesting thing is that there are more Toggle buttons on this
    >>application and they work fine with or without 'click-and-pass-through'.
    >>The difference as far as I can tell is that the buttons that work are
    >>added to the main GUI before XtAppAddActions, XtAugmentTranslations and
    >>XtRealizeWidget is called and the buttons that only work with
    >>'click-and-pass-through' disabled are added after the above mentioned
    >>functions.
    >>

    >
    >
    > I'd have to experiment but it might be related to a translation table.
    > Briefly, the ToggleButton is seeing a , not a
    >

  4. Re: Debugging Xaw Toggle button problems

    In comp.windows.x, Daniel Nilsson

    wrote
    on Sat, 10 Jan 2004 22:16:58 GMT
    :
    > The Ghost In The Machine wrote:
    >>>The next intesting thing is that there are more Toggle buttons on this
    >>>application and they work fine with or without 'click-and-pass-through'.
    >>>The difference as far as I can tell is that the buttons that work are
    >>>added to the main GUI before XtAppAddActions, XtAugmentTranslations and
    >>>XtRealizeWidget is called and the buttons that only work with
    >>>'click-and-pass-through' disabled are added after the above mentioned
    >>>functions.
    >>>

    >>
    >>
    >> I'd have to experiment but it might be related to a translation table.
    >> Briefly, the ToggleButton is seeing a , not a
    >>

  5. Re: Debugging Xaw Toggle button problems

    In comp.windows.x, Daniel Nilsson

    wrote
    on Sat, 10 Jan 2004 22:16:58 GMT
    :
    > The Ghost In The Machine wrote:
    >>>The next intesting thing is that there are more Toggle buttons on this
    >>>application and they work fine with or without 'click-and-pass-through'.
    >>>The difference as far as I can tell is that the buttons that work are
    >>>added to the main GUI before XtAppAddActions, XtAugmentTranslations and
    >>>XtRealizeWidget is called and the buttons that only work with
    >>>'click-and-pass-through' disabled are added after the above mentioned
    >>>functions.
    >>>

    >>
    >>
    >> I'd have to experiment but it might be related to a translation table.
    >> Briefly, the ToggleButton is seeing a , not a
    >>

  6. Re: Debugging Xaw Toggle button problems

    The Ghost In The Machine wrote:
    >In comp.windows.x, Daniel Nilsson
    >
    > wrote
    >on Sat, 10 Jan 2004 22:16:58 GMT
    >:
    >> The Ghost In The Machine wrote:
    >>>>The next intesting thing is that there are more Toggle buttons on this
    >>>>application and they work fine with or without 'click-and-pass-through'.
    >>>>The difference as far as I can tell is that the buttons that work are
    >>>>added to the main GUI before XtAppAddActions, XtAugmentTranslations and
    >>>>XtRealizeWidget is called and the buttons that only work with
    >>>>'click-and-pass-through' disabled are added after the above mentioned
    >>>>functions.
    >>>>
    >>>
    >>>
    >>> I'd have to experiment but it might be related to a translation table.
    >>> Briefly, the ToggleButton is seeing a , not a
    >>>

  7. Re: Debugging Xaw Toggle button problems

    Kip Rugger wrote:
    >>I now have downloaded pcb-20031113 and have noticed the
    >>anomalous behavior in the InitModeButtons. The only
    >>thing I see that's unusual is the XtAddEventHandler,
    >>and since in CB_StopScroll *Flag ("continue_to_dispatch"
    >>in the docs) is already 1 (verified by a simple printf())
    >>I fail to see why it's being fussy.
    >>
    >>There are two translation tables in the defaults but
    >>neither one should affect Toggles as far as I can tell.
    >>
    >>Color me stumped.
    >>

    >
    > 1. The click-and-pass-through mode is likely implemented by a passive
    > grab and replay, which should be totally invisible to the application.
    > I doubt there is any blame to be laid here.


    Any ideas why the Toggles work when I turn the click-and-pass-through
    mode off then ? It is some kind of sideeffect I'm seeing ?

    > 2. 30 seconds on Google gave me a mailing list for pcb and a problem
    > report which sounds applicable.


    Yes, the problem is known and it has been a problem for a while now. It
    has been mentioned several times on several mailing lists.
    >
    > Title gEDA-user: Tool buttons in pcb-20031113
    > Current URL http://www.geda.seul.org/mailinglist.../msg00030.html
    > Document Type text/html
    > Last Modified Sun, 16 Nov 2003 03:55:44 GMT
    > Number of line 65
    > Transferred byte 3394
    >
    > 3. the followup noted compiling with Xaw3d fixed the problem.


    I tried that a while ago, that didn't fix the problem though. Otherwise
    that would have been a nice workaround.

    Daniel


  8. Re: Debugging Xaw Toggle button problems

    The Ghost In The Machine wrote:
    > There's a default Translation table hardwired into the Toggle as well,
    > and the Toggle derives from a Button which derives from a Label.
    >
    > I'm downloading pcb-20031113.tar.gz now and see what if anything
    > I can figure out. I'm not sure how helpful I can be, though,
    > but I can tell you that I'm using Sawfish on a Debian/Gnome desktop.


    Thanks for the effort !

    > Are you using straight libXaw, or one of the variants?


    I've tried Xaw6, Xaw7 and Xaw3d all with the same results...

    What I'm attempting now is to enable the code that had been commented
    out around line 638 of control.c where the togglebuttons are placed
    inside of another "formWidgetClass". The working Toggles are inside of
    one of these masterforms, so I thought I'd see if that makes a
    difference or not.

    Thanks
    Daniel


  9. Re: Debugging Xaw Toggle button problems

    Daniel Nilsson wrote:
    > Kip Rugger wrote:
    >> 1. The click-and-pass-through mode is likely implemented by a passive
    >> grab and replay, which should be totally invisible to the
    >> application.
    >> I doubt there is any blame to be laid here.

    >
    >
    > Any ideas why the Toggles work when I turn the click-and-pass-through
    > mode off then ? It is some kind of sideeffect I'm seeing ?
    >


    Further debug on this issue have shown the the toggle buttons that don't
    work correctly in this application gave pixmap graphics inside the
    button. If I remove the pixmap graphics and only run with a label inside
    the toggle button everything works just fine... Why would the pixmap
    cause a different behaviour of the togglebutton ? Is there a chance that
    the pixmap itself is now listening to the event ? How can I tell ?

    Thanks
    Daniel


  10. Re: Debugging Xaw Toggle button problems

    In comp.windows.x, Daniel Nilsson

    wrote
    on Sun, 18 Jan 2004 20:47:01 GMT
    <9hCOb.80243$sv6.185774@attbi_s52>:
    > Daniel Nilsson wrote:
    >> Kip Rugger wrote:
    >>> 1. The click-and-pass-through mode is likely implemented by a passive
    >>> grab and replay, which should be totally invisible to the
    >>> application.
    >>> I doubt there is any blame to be laid here.

    >>
    >>
    >> Any ideas why the Toggles work when I turn the click-and-pass-through
    >> mode off then ? It is some kind of sideeffect I'm seeing ?
    >>

    >
    > Further debug on this issue have shown the the toggle buttons that don't
    > work correctly in this application gave pixmap graphics inside the
    > button. If I remove the pixmap graphics and only run with a label inside
    > the toggle button everything works just fine... Why would the pixmap
    > cause a different behaviour of the togglebutton ? Is there a chance that
    > the pixmap itself is now listening to the event ? How can I tell ?
    >
    > Thanks
    > Daniel
    >


    A *pixmap* in a Toggle causes a behavioral change?
    My brain's beginning to hurt.

    No, pixmaps do not take events. As to why this change in behavior,
    I can't say.

    --
    #191, ewill3@earthlink.net
    It's still legal to go .sigless.

+ Reply to Thread