Problem with Minimize and Restore - Motif

This is a discussion on Problem with Minimize and Restore - Motif ; My app has always had menu options to hide windows, even though the Window Manager typically provides a minimize command too. We have popup() and popdown() functions that do the work. We have different versions of these functions for Main ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Problem with Minimize and Restore

  1. Problem with Minimize and Restore


    My app has always had menu options to hide windows, even though the Window
    Manager typically provides a minimize command too. We have popup() and
    popdown() functions that do the work. We have different versions of these
    functions for Main Windows and Dialogue windows. All this code predates me
    so I don't know the reasons behind the different implementation or even why
    they are differrent.

    The problem: Dialogues that are minimized via the Window Manager will not
    come back with popup() function. Only if they hidden with my popdown() can I
    get them back. The Window Manager does iconify them and I can use the Window
    Manager to get them back. But I need the app to be able to raise them too.

    I am including the logic for both windows and dialogues. Can someone tell me
    how to tweak this so that it works correctly for dialogues too? Does the
    logic have to be different?

    The popdown logic for windows is the following:

    Window win = XtWindow( getShell() );
    Display* dpy = XtDisplay( getShell() );
    XIconifyWindow( dpy, win, XScreenNumberOfScreen(DefaultScreenOfDisplay(dpy)) );

    The popup logic for windows is the following:

    if( !XtIsManaged( getWidget() ) )
    XtManageChild( getWidget() );

    if( !XtIsRealized( getShell() ) )
    XtRealizeWidget( getShell() );

    Widget theShell = getShell();
    Window theWindow = XtWindow( theShell );
    XtCallCallbacks( theShell, XtNpopupCallback, NULL );
    XMapRaised( gDisplay, theWindow );

    The popdown logic for dialogues is the following:

    XtUnmanageChild( getWidget() );
    XtPopdown( getShell() );

    The popup logic for dialogues is the following:

    XtManageChild( getWidget() );
    XtPopup( getShell(), XtGrabNone );

    --
    Jake Colman

    Principia Partners LLC Phone: (201) 209-2467
    Harborside Financial Center Fax: (201) 946-0320
    902 Plaza Two E-mail: colman@ppllc.com
    Jersey City, NJ 07311 www.principiapartners.com

  2. Re: Problem with Minimize and Restore


    I could really use some help here. Does anyone have any idea whether
    dialogues and windows have to be dealt with differently in the first case? I
    did not write this code but maybe it's overly complex for no good reason?

    >>>>> "Jake" == Jake Colman writes:


    Jake> My app has always had menu options to hide windows, even though the
    Jake> Window Manager typically provides a minimize command too. We have
    Jake> popup() and popdown() functions that do the work. We have different
    Jake> versions of these functions for Main Windows and Dialogue windows.
    Jake> All this code predates me so I don't know the reasons behind the
    Jake> different implementation or even why they are differrent.

    Jake> The problem: Dialogues that are minimized via the Window Manager
    Jake> will not come back with popup() function. Only if they hidden with
    Jake> my popdown() can I get them back. The Window Manager does iconify
    Jake> them and I can use the Window Manager to get them back. But I need
    Jake> the app to be able to raise them too.

    Jake> I am including the logic for both windows and dialogues. Can
    Jake> someone tell me how to tweak this so that it works correctly for
    Jake> dialogues too? Does the logic have to be different?

    Jake> The popdown logic for windows is the following:

    Jake> Window win = XtWindow( getShell() );
    Jake> Display* dpy = XtDisplay( getShell() );
    Jake> XIconifyWindow( dpy, win, XScreenNumberOfScreen(DefaultScreenOfDisplay(dpy)) );

    Jake> The popup logic for windows is the following:

    Jake> if( !XtIsManaged( getWidget() ) )
    Jake> XtManageChild( getWidget() );

    Jake> if( !XtIsRealized( getShell() ) )
    Jake> XtRealizeWidget( getShell() );

    Jake> Widget theShell = getShell();
    Jake> Window theWindow = XtWindow( theShell );
    Jake> XtCallCallbacks( theShell, XtNpopupCallback, NULL );
    Jake> XMapRaised( gDisplay, theWindow );

    Jake> The popdown logic for dialogues is the following:

    Jake> XtUnmanageChild( getWidget() );
    Jake> XtPopdown( getShell() );

    Jake> The popup logic for dialogues is the following:

    Jake> XtManageChild( getWidget() );
    Jake> XtPopup( getShell(), XtGrabNone );


    --
    Jake Colman

    Principia Partners LLC Phone: (201) 209-2467
    Harborside Financial Center Fax: (201) 946-0320
    902 Plaza Two E-mail: colman@ppllc.com
    Jersey City, NJ 07311 www.principiapartners.com

+ Reply to Thread