<br><br><div class="gmail_quote">2011/5/3 Geoffroy Couprie <span dir="ltr"><<a href="mailto:geo.couprie@gmail.com">geo.couprie@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello,<br>
<div class="im"><br>
On Tue, May 3, 2011 at 4:04 PM, Juha Jeronen <<a href="mailto:juha.jeronen@jyu.fi">juha.jeronen@jyu.fi</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> On 05/03/11 15:43, Rémi Denis-Courmont wrote:<br>
>><br>
>>    Hello,<br>
>><br>
>> On Tuesday 03 May 2011, Juha Jeronen wrote:<br>
>>><br>
>>> - Have an instance data struct for the thread, containing only an exit<br>
>>> flag (initialized to false in the main thread, just before it starts the<br>
>>> new thread). Malloc it, and pass a pointer as the thread argument. The<br>
>>> flag will be used for signaling.<br>
>><br>
>> Oh no, never suggest that. This does not fit our (POSIX) threaded memory<br>
>> synchronization model.<br>
><br>
> Ok.<br>
><br>
>>> - When the main thread wants to shut down the screensaver prevention<br>
>>> thread, it sets the exit flag to true.<br>
>>> - When the thread notices that its exit flag has been set to true, it<br>
>>> joins.<br>
>>> - Finally, we need to take care of the 50-second sleep. How about,<br>
>>> instead of<br>
>><br>
>> No. Polling timers are for incompetent programmers.<br>
><br>
> I did say it was no good :P<br>
><br>
><br>
>> In this case, the thread can sleep for 50 seconds, and be terminated by thread<br>
>> cancellation. Alternetiavely, it can use a condition variable and a 50-seconds<br>
>> time-out.<br>
><br>
> This sounds good.<br>
><br>
<br>
</div>Thinking a bit out of the box here: did you try applying the method<br>
shown in <a href="http://msdn.microsoft.com/en-us/library/cc144066(VS.85).aspx" target="_blank">http://msdn.microsoft.com/en-us/library/cc144066(VS.85).aspx</a><br>
?<br>
<br>
"Windows does not start the screen saver if [...] the active<br>
application receives the WM_SYSCOMMAND message with the wParam<br>
parameter set to the SC_SCREENSAVE value, but it does not pass the<br>
message to the DefWindowProc function."<br>
<br>
Basically, you set up a GetMessage loop (in Qt or in the vout), and<br>
when you receive a WM_SYSCOMMAND with SC_SCREENSAVE or<br>
SC_MONITORPOWER, you don't pass it to DefWindowProc. It will block the<br>
screensaver or the monitor power off, unless the user has set a<br>
password policy on the screensaver.<br></blockquote><div><br></div><div>Those won't work in certain situations (like screensaver with password you mentioned + some message loop design issues cause problems).</div><div>
<a href="http://stackoverflow.com/questions/463813/programmatically-prevent-windows-screensaver-from-starting">http://stackoverflow.com/questions/463813/programmatically-prevent-windows-screensaver-from-starting</a></div>
<div><a href="http://www.codeguru.com/forum/archive/index.php/t-304863.html">http://www.codeguru.com/forum/archive/index.php/t-304863.html</a></div><div><br></div><div>AFAIK there isn't any sane way to prevent screensavers under Windows if the software itself doesn't provide inputs. </div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">_______________________________________________<br>
vlc-devel mailing list<br>
To unsubscribe or modify your subscription options:<br>
<a href="http://mailman.videolan.org/listinfo/vlc-devel" target="_blank">http://mailman.videolan.org/listinfo/vlc-devel</a><br>
</div></div></blockquote></div><br>