git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/4] Fix drop-down menus in the git-gui dialogs.

From
Shawn O. Pearce <spearce@spearce.org>
Date
Apr 4, 2007, 16:37 UTC
Message-ID
<20070404163709.GA5167@spearce.org>
In-Reply-To
<20070327103005.GP14837@codelabs.ru>
git-gui patches should be addressed to me, not Paul.
Eygene Ryabinkin <rea-git@codelabs.ru> wrote:
Show 12 quoted lines
> If the drop-down menu (for example "Local Branch" from the dialog
> activated by the "Branch/Create..." menu item) is chosen with the
> left mouse button, then the pointer is moved off the drop-down menu
> while the mouse button is still pressed and then the 'Escape' key
> is pressed, the main menu will be broken. Next time when you will
> try to select any main menu item, the Tcl/Tk interpreter will spawn
> an internal error.
> 
> Error was fixed by "grab"bing the drop-down menu windows on their
> activation. Now all drop-down menus are disappearing once the mouse
> button is depressed, no matter what is the current position of the
> mouse pointer.

This fix actually horribly breaks on Mac OS X. The problem appears to be that the <Visibility> event on that system doesn't get delivered until after the menu is destroyed, yet I'm getting a %s of VisibilityUnobscured in the event handler. Go figure.

So anyway, I cannot apply this patch as-is, because it breaks my main development system. I understand and feel your pain, but you either need to make this binding apply only on your OS, or find another way to workaround that Tk bug...

Show 12 quoted lines
> diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
> index 8157184..1f3ee05 100755
> --- a/git-gui/git-gui.sh
> +++ b/git-gui/git-gui.sh
> @@ -2126,6 +2126,7 @@ proc do_create_branch {} {
>  		-font font_ui
>  	set lbranchm [eval tk_optionMenu $w.from.head_m create_branch_head \
>  		$all_heads]
> +	bind $lbranchm <Visibility> "grab $lbranchm"
>  	$lbranchm configure -font font_ui
>  	$w.from.head_m configure -font font_ui
>  	grid $w.from.head_r $w.from.head_m -sticky w
-- 
Shawn.
Previous: Eygene RyabinkinNext: Eygene Ryabinkin
Message 2 of 5 in “Fix drop-down menus in the git-gui dialogs.”
  1. 2/4 Fix drop-down menus in the git-gui dialogs.Eygene Ryabinkin, Mar 27, 2007
  2. Shawn O. PearceApr 4, 2007
  3. Eygene RyabinkinApr 5, 2007
  4. Shawn O. PearceApr 5, 2007
  5. Eygene RyabinkinApr 6, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.