Re: patch #59456, #59456-2, #64977 -- menu stuff



Kristian Rietveld <kristian planet nl> writes:

> On Thu, 2001-11-29 at 01:00, Owen Taylor wrote:
> > 
> > [...]
> > 
> > Looks to me like this will mean that MENU_SHELL_TIMEOUT will no
> > longer work since we'll always deactivate on the release after the
> > initial click. It seems to me:
> > 
> >  - the check/clear of just-activate should occur outside the
> >    > MENU_SHELL_TIMEOUT block
> >  - but the actual use of it for deactivation should be inside
> >    the > MENU_SHELL_TIMEOUT block.
> > 
> 
> Fixed this in the new diff.

Hmmm, I still think things aren't going to work quite right; for
instance, it looks like if you:

 Click on the header and release to pop up the menu
 Click again on the header, drag down to an insensitive 
   and release.

I think it will deactivate the menu, and it shouldn't.

But why don't you go ahead and commit and we'll tweak it from
there.

Thanks,
                                        Owen

> @@ -446,22 +450,39 @@
>    menu_shell = GTK_MENU_SHELL (widget);
>    if (menu_shell->active)
>      {
> +      gboolean deactivate_immediately = FALSE;
> +
>        if (menu_shell->button && (event->button != menu_shell->button))
>  	{
>  	  menu_shell->button = 0;
>  	  if (menu_shell->parent_menu_shell)
>  	    return gtk_widget_event (menu_shell->parent_menu_shell, (GdkEvent*) event);
>  	}
> -      
> +
>        menu_shell->button = 0;
>        menu_item = gtk_menu_shell_get_item (menu_shell, (GdkEvent*) event);
>  
>        deactivate = TRUE;
>  
> +      if (menu_item
> +	  && GTK_MENU_SHELL_GET_CLASS (menu_shell)->submenu_placement == GTK_TOP_BOTTOM)
> +	{
> +	  if (g_object_get_data (G_OBJECT (menu_shell), "gtk-menushell-just-activated"))
> +	    g_object_set_data (G_OBJECT (menu_shell), "gtk-menushell-just-activated", NULL);
> +	  else
> +	    deactivate_immediately = TRUE;
> +	}
> +
>        if ((event->time - menu_shell->activate_time) > MENU_SHELL_TIMEOUT)
>  	{
> +	  if (deactivate_immediately)
> +	    {
> +	      gtk_menu_shell_deactivate (menu_shell);
> +	      return TRUE;
> +	    }
> +	    
>  	  if (menu_item && (menu_shell->active_menu_item == menu_item) &&
> -	      GTK_WIDGET_IS_SENSITIVE (menu_item))
> +	      _gtk_menu_item_is_selectable (menu_item))
>  	    {
>  	      if (GTK_MENU_ITEM (menu_item)->submenu == NULL)
>  		{



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