Bug#248109: gksu's grab failure reporting is broken

Gustavo Noronha Silva Gustavo Noronha Silva <kov@debian.org>, 248109@bugs.debian.org
Tue, 11 May 2004 18:38:29 -0300


severity 248109 grave
thanks

Em Sun, 9 May 2004 04:09:57 -0700, Ryan Murray <rmurray@debian.org> escreveu:

Heya, Ryan!

> If gksu fails to grab the keyboard (which almost always happens on my
> system) it displays the error dialog before it shows the main window,
> and the main window ends up never drawing any of its widgets.  In
> addition, the error message ends up being behind the gksu window.  The
> following patch fixes the problem:
> 
> --- libgksu.c   2004-05-09 03:40:59.000000000 -0700
> +++ libgksu.c.new       2004-05-09 03:33:32.000000000 -0700
> @@ -336,8 +336,8 @@
>           while (gtk_events_pending())
>             gtk_main_iteration ();
>  
> -         report_failed_grab ();
>           gtk_widget_show (dialog);
> +         report_failed_grab ();
>         }
>      }

Right. This should be a workaround, but makes no sense as the
dialog has being hiden just before report_failed_grab exactly
for this purpose, so a better way to do it would be removing
the previous hide and whilhe loop altogether with the widget_show
that appears in your patch.

> This still leaves the problem of why the grabs are failing.  gnome-ssh-askpass
> in the ssh package tries each grab 16 times, with a 250 millisecond delay
> between each attempt, and it has no problems with grabbing on my system.
> Perhaps gksu needs to do something similar?  If I slow gksu down by running
> it under strace or ltrace, it has no problems obtaining the grabs.

Sounds like a good solution to me. Thanks a lot for the pointer! I'll
release a new version with the code I'm doing based on gnome-ssh-askpass'
implementation.

Working on it right now!

Thanks,

-- 
Gustavo Noronha Silva <kov@debian.org>     | http://beterraba.no-ip.org/~kov
  Debian Developer: http://www.debian.org/ | http://www.debian-br.org/
  Brazilian GNOME Translation Effort: http://gnome-br.sourceforge.net/