Default widget bug?



I think there is a bug in the GtkWindow code. If you hit <Enter> then
the default_widget is activated even if it is insensitive i.e. an
insensitive button has it's clicked signal emitted. The same is true for
gtk_window_activate_default().

Attached is a patch for gtkwindow.c which, I think, fixes it. Oh yeah,
the patch is against v 1.2.3.

Cheers, Matt.

--
* Matt Goodall, mgg@isotek.co.uk
* Isotek Electronics Ltd
* Claro House, Servia Road, Leeds, LS7 1NL. England


*** orig/gtk+-1.2.3/gtk/gtkwindow.c	Tue Apr 13 20:20:09 1999
--- gtk+-1.2.3/gtk/gtkwindow.c	Thu Oct  7 15:13:57 1999
***************
*** 478,484 ****
  
    if (window->default_widget)
      {
!       gtk_widget_activate (window->default_widget);
        return TRUE;
      }
  
--- 478,485 ----
  
    if (window->default_widget)
      {
!       if(GTK_WIDGET_IS_SENSITIVE (window->default_widget))
!         gtk_widget_activate (window->default_widget);
        return TRUE;
      }
  
***************
*** 1049,1056 ****
  	      (!window->focus_widget || 
  	       !GTK_WIDGET_RECEIVES_DEFAULT (window->focus_widget)))
  	    {
! 	      gtk_widget_activate (window->default_widget);
! 	      handled = TRUE;
  	    }
            else if (window->focus_widget)
  	    {
--- 1050,1060 ----
  	      (!window->focus_widget || 
  	       !GTK_WIDGET_RECEIVES_DEFAULT (window->focus_widget)))
  	    {
!           if( GTK_WIDGET_IS_SENSITIVE(window->default_widget) )
!           {
!             gtk_widget_activate (window->default_widget);
!             handled = TRUE;
!           }
  	    }
            else if (window->focus_widget)
  	    {
begin:vcard 
n:Goodall;Matt
tel;fax:+44 113 234 2918
tel;work:+44 113 234 3202/3
x-mozilla-html:TRUE
org:Isotek Electronics Ltd
adr;quoted-printable:;;Claro House=0D=0AServia Road;Leeds;W.Yorks;LS7 1NL;England
adr:;;;;;;
version:2.1
email;internet:mgg@isotek.co.uk
x-mozilla-cpt:;-21184
fn:Matt Goodall
end:vcard


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