[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: No refresh of buffer before popup-menu

From: Jason Rumney
Subject: Re: No refresh of buffer before popup-menu
Date: Thu, 22 Feb 2007 19:40:07 +0000
User-agent: Thunderbird (Windows/20061207)

Lennart Borgman (gmail) wrote:
But unfortunately the other bug (menu title corruption in the second popup-menu) is still there.

This bug indeed looks a bit serious IMO. I have not been able to reproduce it clearly before, but with the test code I sent I see it every time.

What especially bothers me is that this happens during the time the popup-menu is displayed. At first the menu title is shown, but using the up/down arrows erases or even corrupts the text shown. It seems to me that something is wrong with the data structures sent to w32 menu handler - and that could lead to trouble.

I think what happens is this:

 First menu structure created, and Windows asked to create the menu.

 User selects option from first menu.

 Second menu structure created, and Windows asked to create the menu.

 First menu structure destroyed after Windows destroys the actual menu.

User uses arrows to move in second menu - when the cursor is moved the menu items moved from and to are redrawn.

The problem is that there is only one copy of the menu structure kept. So when the second menu is created, it overwrites the first one. This causes two bugs:

1) A memory leak, since the first menu structure is never freed.
2) The menu structure for the second menu is destroyed while the menu is still active.

There are two possible solutions to this:

1) Make the popup menu signal an error if it is used reentrantly.
2) Wait for Windows to destroy the menu before running any lisp code associated with the chosen action.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]