Tk Source Code

View Ticket
Login
Ticket UUID: 220613
Title: resizing toplevel with menu generates fatal X Error
Type: Bug Version: obsolete: 8.2.1
Submitter: welch Created on: 2000-10-31 23:46:23
Subsystem: 67. Unix Window Operations Assigned To: nobody
Priority: 2 Severity:
Status: Closed Last Modified: 2001-03-24 07:11:02
Resolution: Fixed Closed By: dgp
    Closed on: 2001-03-24 00:11:02
Description:
OriginalBugID: 3377 Bug
Version: 8.2.1
SubmitDate: '1999-11-05'
LastModified: '2000-01-07'
Severity: SER
Status: Released
Submitter: techsupp
ChangedBy: hobbs
OS: Linux
OSVersion: RedHat Linux 6.0
FixedDate: '2000-01-07'
FixedInVersion: 8.3b2


Name:

Jonas Beskow


ReproducibleScript:

menu .m

    .m add cascade -label [info patchlevel]

    . config -menu .m


    # resize the toplevel window vertically until only the menubar is

    visible (i.e. window area below the 

    # menubar is exactly of zero height - the error is especially easy to

    produce on window managers with 

    # dynamic content window resizing, e.g. KDE)


ObservedBehavior:

wish exits with the following error:

    X Error of failed request:  BadValue (integer parameter out of range for

    operation)

      Major opcode of failed request:  12 (X_ConfigureWindow)

      Value in failed request:  0x0

      Serial number of failed request:  180

      Current serial number in output stream:  181


DesiredBehavior:

wish continues to run with no error


Patch:

*** tkUnixWm.c  Thu Oct 14 15:31:06 1999

--- tkUnixWm.c.fix      Thu Oct 14 15:30:52 1999

***************

*** 2074,2079 ****

--- 2074,2080 ----

      TkWindow *wrapperPtr = wmPtr->wrapperPtr;

      TkWindow *winPtr = wmPtr->winPtr;

      TkDisplay *dispPtr = wmPtr->winPtr->dispPtr;

+     Tk_ErrorHandler handler;


      /* 

       * Update size information from the event.  There are a couple of

***************

*** 2203,2212 ****

       * Make sure that the toplevel and menubar are properly positioned within

       * the wrapper.

       */

! 

      XMoveResizeWindow(winPtr->display, winPtr->window, 0,

            wmPtr->menuHeight, (unsigned) wrapperPtr->changes.width,

            (unsigned) (wrapperPtr->changes.height - wmPtr->menuHeight));

      if ((wmPtr->menubar != NULL)

            && ((Tk_Width(wmPtr->menubar) != wrapperPtr->changes.width)

            || (Tk_Height(wmPtr->menubar) != wmPtr->menuHeight))) {

--- 2204,2215 ----

       * Make sure that the toplevel and menubar are properly positioned within

       * the wrapper.

       */

!     handler = Tk_CreateErrorHandler(winPtr->display, -1, -1, -1,

!                                   (Tk_ErrorProc *) NULL, (ClientData) NULL);

      XMoveResizeWindow(winPtr->display, winPtr->window, 0,

            wmPtr->menuHeight, (unsigned) wrapperPtr->changes.width,

            (unsigned) (wrapperPtr->changes.height - wmPtr->menuHeight));

+     Tk_DeleteErrorHandler(handler);

      if ((wmPtr->menubar != NULL)

            && ((Tk_Width(wmPtr->menubar) != wrapperPtr->changes.width)

            || (Tk_Height(wmPtr->menubar) != wmPtr->menuHeight))) {


PatchFiles:

tkUnixWm.c




fixed in 8.3b2. 
-- 01/07/2000 hobbs