On Tue, Jun 29, 2010 at 12:43 PM, James Vega <james...@jamessan.com> wrote:
> On Tue, Jun 29, 2010 at 1:36 AM, SungHyun Nam <gow...@gmail.com> wrote:
>> James Vega wrote:
>>>
>>> On Fri, Nov 13, 2009 at 5:39 PM, Bram Moolenaar<b...@moolenaar.net>
>>>  wrote:
>>>>
>>>> Tim Starling wrote:
>>>>>
>>>>> GtkFileChooser is disabled in gvim, because gvim exits gtk_main() level
>>>>> 1 every time an event is received, causing GTK to write to the disk
>>>>> excessively.
>>>>>
>>>>> [snip]
>>>>>
>>>>> That turns out to be unnecessary, since all GMainLoop does is calls
>>>>> g_main_context_iteration() repeatedly, until it's time to exit. The
>>>>> actual task of registering event sources and calling select() is done by
>>>>> GMainContext, which exists whether or not a GMainLoop has been created.
>>>>> Thus by calling g_main_context_iteration() at the relevant places, vim
>>>>> can leave main_loop() unmodified.
>>>>>
>>>>> My patch does this, and removes all calls to gtk_main_quit() except the
>>>>> ones in modal dialogs. Modal dialogs are now implemented by calling
>>>>> gtk_main() once only, and allowing the button handlers to call
>>>>> gtk_main_quit(), just like in a regular GTK application.
>>>>> [snip]
>>>>
>>>> I'm very glad to see someone is picking up a GTK problem.  Hardly any
>>>> work was done on GTK for a long time.
>>>>
>>>> I would appreciate it if a few people try this out and report any
>>>> problems they notice.
>>>
>>> Given the recent removal of GTK 1 support, attached is an updated patch.
>>
>> Though I never use the file open dialog, I just tried the patch.
>> On the Ubuntu 9.04, file chooser worked fine.
>>
>> But, on the cygwin, a problem occurs.
>> Without the patch, there's no problem to open file open dialog.
>>
>>    $ uname -a
>>    CYGWIN_NT-5.1 namsh 1.7.5(0.225/5/3) 2010-04-12 19:07 i686 Cygwin
>>
>> If I run 'vim -f -g' (foreground), file chooser worked fine.
>> If I run 'vim -g'  (background), VIM died with SIGSEGV.
>
> Thanks for trying the patch out!  I'd like to see this get included, so
> it's good to see people giving it a shot.
>
> As for the crash, this happens without the patch as well, if the Gtk2
> file chooser is enabled.  This even happens in Vim 7.2 if the Gtk2 file
> chooser is enabled, so I'm wondering if there isn't something else going
> on here.

Even the original changeset that introduced the use of the file chooser
(a20218704019) crashes in cygwin.  I've been able to get other
applications (eog) to build and run in cygwin and use the file chooser
there.  So, it doesn't look like this is a problem specific to the
cygwin port of the Gtk libraries.

If need be, cygwin builds could use the old file chooser but that
doesn't help with the goal of removing old Gtk code.  Remember, the old
file chooser is likely being removed for Gtk3 along with all the other
deprecated widgets.

In the 2+ years the file chooser was active, before being disabled in
7.2b.026, there weren't any reported bugs that I can recall about gvim
crashing when using the file chooser.  I'm only subscribed to vim-dev,
though.  At any rate, it seems that either the bug didn't exist back
then and Gtk/Glib has changed in such a way that Vim's use of it is now
wrong or no one encountered (due to not using the file chooser) or was
bothered enough to report the bug.

-- 
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega <james...@jamessan.com>

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui