gnustep-dev
[Top][All Lists]
Advanced

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

Re: GUI updates do not show even from separate thread


From: Fred Kiefer
Subject: Re: GUI updates do not show even from separate thread
Date: Tue, 12 Jul 2016 11:43:01 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1

I made some progress here although I am still not satisfied with the
result. It turns out that

[[NSRunLoop currentRunLoop] runUntilDate:[NSDate distantPast]];

is a NOP with current GNUstep base. It may have been different some time
ago, but now when the limit is in the past this method returns immediately.
Richard could you please confirm that this is the intended behaviour?

If we replace that line with

[[NSRunLoop currentRunLoop] runMode: NSDefaultRunLoopMode
beforeDate:[NSDate distantPast]];

we get the expected behaviour. You could use this code for now to get
your application working correctly under GNUstep. But on MacOSX none of
this hacks should be needed. Riccardo, could you please try to run FTP
with that runloop line removed on a Mac and report back whether the
progress bar gets filled smoothly?

To me this looks like we are having an issue with background threads
that run their own runloop. As this is an area where I am not very
familiar it would be great if Richard could take over.

Fred



Am 07.07.2016 um 12:15 schrieb Riccardo Mottola:
> Fred Kiefer wrote:
>> Thank you to both you and Sebastian, switching to passive mode made
>> the application work. This really should be the default mode.
> 
> I just did it. it is the default now, apparently some firewalls are
> prickier than others.
> 
>> Now I see that the transfer happens in a background thread while the
>> UI changes are made in the main thread, just like it should be. Very
>> impressive, I will need some more time to admire this code.
> 
> Don't exaggerate!
>>
>> Now I see the wrong behaviour just like you described it. The progress
>> bar gets updated but only one or two times whereas the download
>> constantly provides the progress information. I am going to add some
>> debug output to the NSWindow autoupdate code to see, whether this gets
>> called. Most likely this isn't the case, meaning we have a problem
>> with the runtime loop. Maybe we need to add the autoupdate to more
>> event modes or there is an issue with having two run loops. Some more
>> investigation is needed.
>>
> 
> I too verified that the DO code works and that the updates are flowing
> into the main thread.
> Thank you - let us know.
> 
> Riccardo
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]