templeos-info/public/Wb/Home/Src/Adam/WinMgr.HC.HTML

895 lines
112 KiB
HTML
Executable File

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="generator" content="TempleOS V5.03">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="/style/templeos.css">
<script src="/script/templeos.js"></script>
<style type="text/css">
.cF0{color:#000000;background-color:#ffffff;}
.cF1{color:#0000aa;background-color:#ffffff;}
.cF2{color:#00aa00;background-color:#ffffff;}
.cF3{color:#00aaaa;background-color:#ffffff;}
.cF4{color:#aa0000;background-color:#ffffff;}
.cF5{color:#aa00aa;background-color:#ffffff;}
.cF6{color:#aa5500;background-color:#ffffff;}
.cF7{color:#aaaaaa;background-color:#ffffff;}
.cF8{color:#555555;background-color:#ffffff;}
.cF9{color:#5555ff;background-color:#ffffff;}
.cFA{color:#55ff55;background-color:#ffffff;}
.cFB{color:#55ffff;background-color:#ffffff;}
.cFC{color:#ff5555;background-color:#ffffff;}
.cFD{color:#ff55ff;background-color:#ffffff;}
.cFE{color:#ffff55;background-color:#ffffff;}
.cFF{color:#ffffff;background-color:#ffffff;}
</style>
</head>
<body>
<pre id="content">
<a name="l1"></a><span class=cF0>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>&quot;Windows;Task/Delay&quot;</span><span class=cF0>
<a name="l2"></a>
<a name="l3"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>Refresh</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> cnt=1,</span><span class=cF1>Bool</span><span class=cF0> force=</span><span class=cF3>FALSE</span><span class=cF0>)
<a name="l4"></a>{</span><span class=cF2>//Wait for 30fps WinMgr to start &amp; finish scrn refresh.</span><span class=cF0>
<a name="l5"></a> </span><span class=cF2>//0,FALSE Cnt Sync to WinMgr.</span><span class=cF0>
<a name="l6"></a> </span><span class=cF2>//0,TRUE Pump Msgs.</span><span class=cF0>
<a name="l7"></a> </span><span class=cF2>//1 Cnt Wait and Pump Msgs.</span><span class=cF0>
<a name="l8"></a> </span><span class=cF2>//2 Cnt Make Sure to do a Full Refresh</span><span class=cF0>
<a name="l9"></a> </span><span class=cF2>//and Set Cur Pos.</span><span class=cF0>
<a name="l10"></a> </span><span class=cF1>Bool</span><span class=cF0> old_full_refresh,
<a name="l11"></a> old_idle=</span><span class=cF5>LBts</span><span class=cF0>(&amp;</span><span class=cF5>Fs</span><span class=cF0>-&gt;task_flags,</span><span class=cF3>TASKf_IDLE</span><span class=cF0>);
<a name="l12"></a> </span><span class=cF9>CDoc</span><span class=cF0> *old_doc=</span><span class=cF5>DocPut</span><span class=cF0>;
<a name="l13"></a> </span><span class=cF9>I64</span><span class=cF0> update_cnt;
<a name="l14"></a> </span><span class=cF1>if</span><span class=cF0> (!cnt&amp;&amp;force)
<a name="l15"></a> </span><span class=cF5>LBts</span><span class=cF0>(&amp;</span><span class=cFB>sys_semas</span><span class=cF0>[</span><span class=cF3>SEMA_JUST_PUMP_MSGS</span><span class=cF0>],0);
<a name="l16"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;</span><span class=cFB>sys_semas</span><span class=cF0>[</span><span class=cF3>SEMA_REFRESH_IN_PROGRESS</span><span class=cF0>],0</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l17"></a> </span><span class=cF1>if</span><span class=cF0> (force &amp;&amp; </span><span class=cFB>sys_winmgr_task</span><span class=cF0>)
<a name="l18"></a> </span><span class=cFB>sys_winmgr_task</span><span class=cF0>-&gt;wake_jiffy=</span><span class=cFB>cnts</span><span class=cF0>.jiffies;
<a name="l19"></a> </span><span class=cF5>Yield</span><span class=cF0>;
<a name="l20"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l21"></a> </span><span class=cF1>if</span><span class=cF0> (cnt&gt;1 &amp;&amp; old_doc)
<a name="l22"></a> old_full_refresh=</span><span class=cF5>LBts</span><span class=cF0>(&amp;old_doc-&gt;flags,</span><span class=cF3>DOCf_DO_FULL_REFRESH</span><span class=cF0>);
<a name="l23"></a> update_cnt=</span><span class=cFB>winmgr</span><span class=cF0>.updates+cnt;
<a name="l24"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>winmgr</span><span class=cF0>.updates&lt;update_cnt) </span><span class=cF7>{</span><span class=cF0>
<a name="l25"></a> </span><span class=cF1>if</span><span class=cF0> (force &amp;&amp; </span><span class=cFB>sys_winmgr_task</span><span class=cF0>)
<a name="l26"></a> </span><span class=cFB>sys_winmgr_task</span><span class=cF0>-&gt;wake_jiffy=</span><span class=cFB>cnts</span><span class=cF0>.jiffies;
<a name="l27"></a> </span><span class=cF5>Sleep</span><span class=cF0>(1);
<a name="l28"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l29"></a> </span><span class=cF1>if</span><span class=cF0> (old_doc)
<a name="l30"></a> </span><span class=cF5>LBEqu</span><span class=cF0>(&amp;old_doc-&gt;flags,</span><span class=cF3>DOCf_DO_FULL_REFRESH</span><span class=cF0>,old_full_refresh);
<a name="l31"></a> </span><span class=cF5>LBEqu</span><span class=cF0>(&amp;</span><span class=cF5>Fs</span><span class=cF0>-&gt;task_flags,</span><span class=cF3>TASKf_IDLE</span><span class=cF0>,old_idle);
<a name="l32"></a>}
<a name="l33"></a>
<a name="l34"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>&quot;Windows&quot;</span><span class=cF0>
<a name="l35"></a>
<a name="l36"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>WinQueIPMsgs</span><span class=cF0>(</span><span class=cF1>Bool</span><span class=cF0> que)
<a name="l37"></a>{
<a name="l38"></a> </span><span class=cF1>static</span><span class=cF0> </span><span class=cF9>CD3I64</span><span class=cF0> single_ms=</span><span class=cF7>{</span><span class=cF0>0,0,0</span><span class=cF7>}</span><span class=cF0>;
<a name="l39"></a> </span><span class=cF1>F64</span><span class=cF0> time=</span><span class=cF5>tS</span><span class=cF0>;
<a name="l40"></a> </span><span class=cF9>I64</span><span class=cF0> msg_code=0,arg1,arg2,single_arg1,single_arg2;
<a name="l41"></a> </span><span class=cF9>CTask</span><span class=cF0> *task_focus=</span><span class=cFB>sys_focus_task</span><span class=cF0>;
<a name="l42"></a>
<a name="l43"></a> </span><span class=cF1>if</span><span class=cF0> (task_focus &amp;&amp; !</span><span class=cFB>winmgr</span><span class=cF0>.grab_scroll) </span><span class=cF7>{</span><span class=cF0>
<a name="l44"></a> arg1=</span><span class=cFB>ms</span><span class=cF0>.pos.x-task_focus-&gt;pix_left-task_focus-&gt;scroll_x;
<a name="l45"></a> arg2=</span><span class=cFB>ms</span><span class=cF0>.pos.y-task_focus-&gt;pix_top-task_focus-&gt;scroll_y;
<a name="l46"></a> single_arg1=single_ms.x-task_focus-&gt;pix_left-task_focus-&gt;scroll_x;
<a name="l47"></a> single_arg2=single_ms.y-task_focus-&gt;pix_top-task_focus-&gt;scroll_y;
<a name="l48"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>old_ms</span><span class=cF0>.presnap.x!=</span><span class=cFB>ms</span><span class=cF0>.presnap.x || </span><span class=cFB>old_ms</span><span class=cF0>.presnap.y!=</span><span class=cFB>ms</span><span class=cF0>.presnap.y) {
<a name="l49"></a> </span><span class=cF1>if</span><span class=cF0> (que)
<a name="l50"></a> </span><span class=cF5>TaskMsg</span><span class=cF0>(task_focus,0,
<a name="l51"></a> </span><span class=cF3>MSG_MS_MOVE</span><span class=cF0>,arg1,arg2,0);
<a name="l52"></a> msg_code=</span><span class=cF3>MSG_MS_MOVE</span><span class=cF0>;
<a name="l53"></a> }
<a name="l54"></a></span><span class=cF2>//TODO que msg for ms.pos.z?</span><span class=cF0>
<a name="l55"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.left_dbl_time) {
<a name="l56"></a> </span><span class=cF1>if</span><span class=cF0> (time&gt;</span><span class=cFB>ms</span><span class=cF0>.left_dbl_time) </span><span class=cF7>{</span><span class=cF0>
<a name="l57"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.left_dbl) {
<a name="l58"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>ms</span><span class=cF0>.left_down_sent) </span><span class=cF7>{</span><span class=cF0>
<a name="l59"></a> </span><span class=cF1>if</span><span class=cF0> (que)
<a name="l60"></a> </span><span class=cF5>TaskMsg</span><span class=cF0>(task_focus,0,
<a name="l61"></a> </span><span class=cF3>MSG_MS_L_D_DOWN</span><span class=cF0>,arg1,arg2,0);
<a name="l62"></a> </span><span class=cFB>ms</span><span class=cF0>.left_down_sent=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l63"></a> msg_code=</span><span class=cF3>MSG_MS_L_D_DOWN</span><span class=cF0>;
<a name="l64"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l65"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>ms</span><span class=cF0>.lb) </span><span class=cF7>{</span><span class=cF0>
<a name="l66"></a> </span><span class=cF1>if</span><span class=cF0> (que)
<a name="l67"></a> </span><span class=cF5>TaskMsg</span><span class=cF0>(task_focus,0,
<a name="l68"></a> </span><span class=cF3>MSG_MS_L_D_UP</span><span class=cF0>,arg1,arg2,0);
<a name="l69"></a> </span><span class=cFB>ms</span><span class=cF0>.left_dbl_time=0;
<a name="l70"></a> msg_code=</span><span class=cF3>MSG_MS_L_D_UP</span><span class=cF0>;
<a name="l71"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l72"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l73"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>ms</span><span class=cF0>.left_down_sent) </span><span class=cF7>{</span><span class=cF0>
<a name="l74"></a> </span><span class=cF1>if</span><span class=cF0> (que)
<a name="l75"></a> </span><span class=cF5>TaskMsg</span><span class=cF0>(task_focus,0,
<a name="l76"></a> </span><span class=cF3>MSG_MS_L_DOWN</span><span class=cF0>,single_arg1,single_arg2,0);
<a name="l77"></a> </span><span class=cFB>ms</span><span class=cF0>.left_down_sent=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l78"></a> msg_code=</span><span class=cF3>MSG_MS_L_DOWN</span><span class=cF0>;
<a name="l79"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l80"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>ms</span><span class=cF0>.lb) </span><span class=cF7>{</span><span class=cF0>
<a name="l81"></a> </span><span class=cF1>if</span><span class=cF0> (que)
<a name="l82"></a> </span><span class=cF5>TaskMsg</span><span class=cF0>(task_focus,0,
<a name="l83"></a> </span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>,arg1,arg2,0);
<a name="l84"></a> </span><span class=cFB>ms</span><span class=cF0>.left_dbl_time=0;
<a name="l85"></a> msg_code=</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>;
<a name="l86"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l87"></a> }
<a name="l88"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l89"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.lb &amp;&amp; !</span><span class=cFB>ms_last</span><span class=cF0>.lb) {
<a name="l90"></a> </span><span class=cFB>ms</span><span class=cF0>.left_dbl_time=time;
<a name="l91"></a> </span><span class=cFB>ms</span><span class=cF0>.left_dbl=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l92"></a> }
<a name="l93"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l94"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l95"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task_focus</span><span class=cF7>)</span><span class=cF0> &amp;&amp;
<a name="l96"></a> </span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;task_focus-&gt;win_inhibit,</span><span class=cF3>WIf_FOCUS_TASK_MS_L_D</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l97"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.lb &amp;&amp; !</span><span class=cFB>ms_last</span><span class=cF0>.lb) {
<a name="l98"></a> </span><span class=cF1>if</span><span class=cF0> (que)
<a name="l99"></a> </span><span class=cF5>TaskMsg</span><span class=cF0>(task_focus,0,
<a name="l100"></a> </span><span class=cF3>MSG_MS_L_DOWN</span><span class=cF0>,arg1,arg2,0);
<a name="l101"></a> msg_code=</span><span class=cF3>MSG_MS_L_DOWN</span><span class=cF0>;
<a name="l102"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>ms</span><span class=cF0>.lb &amp;&amp; </span><span class=cFB>ms_last</span><span class=cF0>.lb) {
<a name="l103"></a> </span><span class=cF1>if</span><span class=cF0> (que)
<a name="l104"></a> </span><span class=cF5>TaskMsg</span><span class=cF0>(task_focus,0,
<a name="l105"></a> </span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>,arg1,arg2,0);
<a name="l106"></a> msg_code=</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>;
<a name="l107"></a> }
<a name="l108"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l109"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.lb &amp;&amp; !</span><span class=cFB>ms_last</span><span class=cF0>.lb) {
<a name="l110"></a> </span><span class=cFB>ms</span><span class=cF0>.left_dbl=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l111"></a> </span><span class=cFB>ms</span><span class=cF0>.left_down_sent=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l112"></a> </span><span class=cFB>ms</span><span class=cF0>.left_dbl_time=time+</span><span class=cFB>ms</span><span class=cF0>.dbl_time;
<a name="l113"></a> single_ms.x=</span><span class=cFB>ms</span><span class=cF0>.pos.x;
<a name="l114"></a> single_ms.y=</span><span class=cFB>ms</span><span class=cF0>.pos.y;
<a name="l115"></a> }
<a name="l116"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l117"></a> }
<a name="l118"></a>
<a name="l119"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.right_dbl_time) {
<a name="l120"></a> </span><span class=cF1>if</span><span class=cF0> (time&gt;</span><span class=cFB>ms</span><span class=cF0>.right_dbl_time) </span><span class=cF7>{</span><span class=cF0>
<a name="l121"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.right_dbl) {
<a name="l122"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>ms</span><span class=cF0>.right_down_sent) </span><span class=cF7>{</span><span class=cF0>
<a name="l123"></a> </span><span class=cF1>if</span><span class=cF0> (que)
<a name="l124"></a> </span><span class=cF5>TaskMsg</span><span class=cF0>(task_focus,0,
<a name="l125"></a> </span><span class=cF3>MSG_MS_R_D_DOWN</span><span class=cF0>,arg1,arg2,0);
<a name="l126"></a> </span><span class=cFB>ms</span><span class=cF0>.right_down_sent=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l127"></a> msg_code=</span><span class=cF3>MSG_MS_R_D_DOWN</span><span class=cF0>;
<a name="l128"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l129"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>ms</span><span class=cF0>.rb) </span><span class=cF7>{</span><span class=cF0>
<a name="l130"></a> </span><span class=cF1>if</span><span class=cF0> (que)
<a name="l131"></a> </span><span class=cF5>TaskMsg</span><span class=cF0>(task_focus,0,
<a name="l132"></a> </span><span class=cF3>MSG_MS_R_D_UP</span><span class=cF0>,arg1,arg2,0);
<a name="l133"></a> </span><span class=cFB>ms</span><span class=cF0>.right_dbl_time=0;
<a name="l134"></a> msg_code=</span><span class=cF3>MSG_MS_R_D_UP</span><span class=cF0>;
<a name="l135"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l136"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l137"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>ms</span><span class=cF0>.right_down_sent) </span><span class=cF7>{</span><span class=cF0>
<a name="l138"></a> </span><span class=cF1>if</span><span class=cF0> (que)
<a name="l139"></a> </span><span class=cF5>TaskMsg</span><span class=cF0>(task_focus,0,
<a name="l140"></a> </span><span class=cF3>MSG_MS_R_DOWN</span><span class=cF0>,single_arg1,single_arg2,0);
<a name="l141"></a> </span><span class=cFB>ms</span><span class=cF0>.right_down_sent=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l142"></a> msg_code=</span><span class=cF3>MSG_MS_R_DOWN</span><span class=cF0>;
<a name="l143"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l144"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>ms</span><span class=cF0>.rb) </span><span class=cF7>{</span><span class=cF0>
<a name="l145"></a> </span><span class=cF1>if</span><span class=cF0> (que)
<a name="l146"></a> </span><span class=cF5>TaskMsg</span><span class=cF0>(task_focus,0,
<a name="l147"></a> </span><span class=cF3>MSG_MS_R_UP</span><span class=cF0>,arg1,arg2,0);
<a name="l148"></a> </span><span class=cFB>ms</span><span class=cF0>.right_dbl_time=0;
<a name="l149"></a> msg_code=</span><span class=cF3>MSG_MS_R_UP</span><span class=cF0>;
<a name="l150"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l151"></a> }
<a name="l152"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l153"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.rb &amp;&amp; !</span><span class=cFB>ms_last</span><span class=cF0>.rb) {
<a name="l154"></a> </span><span class=cFB>ms</span><span class=cF0>.right_dbl_time=time;
<a name="l155"></a> </span><span class=cFB>ms</span><span class=cF0>.right_dbl=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l156"></a> }
<a name="l157"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l158"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l159"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task_focus</span><span class=cF7>)</span><span class=cF0> &amp;&amp;
<a name="l160"></a> </span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;task_focus-&gt;win_inhibit,</span><span class=cF3>WIf_FOCUS_TASK_MS_R_D</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l161"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.rb &amp;&amp; !</span><span class=cFB>ms_last</span><span class=cF0>.rb) {
<a name="l162"></a> </span><span class=cF1>if</span><span class=cF0> (que)
<a name="l163"></a> </span><span class=cF5>TaskMsg</span><span class=cF0>(task_focus,0,
<a name="l164"></a> </span><span class=cF3>MSG_MS_R_DOWN</span><span class=cF0>,arg1,arg2,0);
<a name="l165"></a> msg_code=</span><span class=cF3>MSG_MS_R_DOWN</span><span class=cF0>;
<a name="l166"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>ms</span><span class=cF0>.rb &amp;&amp; </span><span class=cFB>ms_last</span><span class=cF0>.rb) {
<a name="l167"></a> </span><span class=cF1>if</span><span class=cF0> (que)
<a name="l168"></a> </span><span class=cF5>TaskMsg</span><span class=cF0>(task_focus,0,
<a name="l169"></a> </span><span class=cF3>MSG_MS_R_UP</span><span class=cF0>,arg1,arg2,0);
<a name="l170"></a> msg_code=</span><span class=cF3>MSG_MS_R_UP</span><span class=cF0>;
<a name="l171"></a> }
<a name="l172"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l173"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.rb &amp;&amp; !</span><span class=cFB>ms_last</span><span class=cF0>.rb) {
<a name="l174"></a> </span><span class=cFB>ms</span><span class=cF0>.right_dbl=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l175"></a> </span><span class=cFB>ms</span><span class=cF0>.right_down_sent=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l176"></a> </span><span class=cFB>ms</span><span class=cF0>.right_dbl_time=time+</span><span class=cFB>ms</span><span class=cF0>.dbl_time;
<a name="l177"></a> single_ms.x=</span><span class=cFB>ms</span><span class=cF0>.pos.x;
<a name="l178"></a> single_ms.y=</span><span class=cFB>ms</span><span class=cF0>.pos.y;
<a name="l179"></a> }
<a name="l180"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l181"></a> }
<a name="l182"></a>
<a name="l183"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(&amp;</span><span class=cFB>ms_last</span><span class=cF0>,&amp;</span><span class=cFB>ms</span><span class=cF0>,</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CMsStateGlbls</span><span class=cF7>)</span><span class=cF0>);
<a name="l184"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(&amp;</span><span class=cFB>old_ms</span><span class=cF0>,&amp;</span><span class=cFB>ms</span><span class=cF0>,</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CMsStateGlbls</span><span class=cF7>)</span><span class=cF0>);
<a name="l185"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l186"></a> </span><span class=cF1>return</span><span class=cF0> msg_code;
<a name="l187"></a>}
<a name="l188"></a>
<a name="l189"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>WinCalcIdles</span><span class=cF0>()
<a name="l190"></a>{
<a name="l191"></a> </span><span class=cF1>F64</span><span class=cF0> calc_idle_time;
<a name="l192"></a> </span><span class=cF9>I64</span><span class=cF0> i,k,total_jiffies,total_jiffies_delta,idle_pt_hits[</span><span class=cF3>MP_PROCESSORS_NUM</span><span class=cF0>];
<a name="l193"></a> </span><span class=cF9>CCPU</span><span class=cF0> *c;
<a name="l194"></a> </span><span class=cF9>CWinMgrTimingGlbls</span><span class=cF0> *t=</span><span class=cFB>winmgr</span><span class=cF0>.t;
<a name="l195"></a>
<a name="l196"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>t-&gt;calc_idle_delta_time=
<a name="l197"></a> (calc_idle_time=</span><span class=cF5>tS</span><span class=cF0>)-t-&gt;last_calc_idle_time</span><span class=cF7>)</span><span class=cF0>&gt;.25) </span><span class=cF7>{</span><span class=cF0>
<a name="l198"></a> </span><span class=cF1>PUSHFD</span><span class=cF0>
<a name="l199"></a> </span><span class=cF1>CLI</span><span class=cF0>
<a name="l200"></a> total_jiffies=</span><span class=cFB>cpu_structs</span><span class=cF0>[0].total_jiffies;
<a name="l201"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;</span><span class=cFB>mp_cnt</span><span class=cF0>;i++)
<a name="l202"></a> idle_pt_hits[i]=</span><span class=cFB>cpu_structs</span><span class=cF0>[i].idle_pt_hits;
<a name="l203"></a> </span><span class=cF1>POPFD</span><span class=cF0>
<a name="l204"></a>
<a name="l205"></a> total_jiffies_delta=total_jiffies-t-&gt;last_total_jiffies;
<a name="l206"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;</span><span class=cFB>mp_cnt</span><span class=cF0>;i++) {
<a name="l207"></a> c=&amp;</span><span class=cFB>cpu_structs</span><span class=cF0>[i];
<a name="l208"></a> </span><span class=cF1>if</span><span class=cF0> (total_jiffies_delta &amp;&amp; </span><span class=cF7>(</span><span class=cF0>k=idle_pt_hits[i]-t-&gt;last_idle_pt_hits[i]</span><span class=cF7>)</span><span class=cF0>&gt;=0)
<a name="l209"></a> c-&gt;idle_factor=</span><span class=cF5>Clamp</span><span class=cF0>(</span><span class=cF5>ToF64</span><span class=cF7>(</span><span class=cF0>k</span><span class=cF7>)</span><span class=cF0>/total_jiffies_delta,0.01,0.99);
<a name="l210"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l211"></a> c-&gt;idle_factor=0.01;
<a name="l212"></a> t-&gt;last_idle_pt_hits[i]=idle_pt_hits[i];
<a name="l213"></a> }
<a name="l214"></a> t-&gt;last_total_jiffies=total_jiffies;
<a name="l215"></a> t-&gt;last_calc_idle_time=calc_idle_time;
<a name="l216"></a> t-&gt;calc_idle_cnt++;
<a name="l217"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l218"></a>}
<a name="l219"></a>
<a name="l220"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>WinMgrSleep</span><span class=cF0>(</span><span class=cF1>Bool</span><span class=cF0> flush_msgs=</span><span class=cF3>FALSE</span><span class=cF0>)
<a name="l221"></a>{
<a name="l222"></a> </span><span class=cF9>I64</span><span class=cF0> timeout_val,msg_code=0;
<a name="l223"></a> </span><span class=cF9>CCtrl</span><span class=cF0> *c;
<a name="l224"></a> </span><span class=cF1>Bool</span><span class=cF0> que;
<a name="l225"></a> </span><span class=cF1>F64</span><span class=cF0> t,t_delta;
<a name="l226"></a> </span><span class=cF1>U8</span><span class=cF0> *st;
<a name="l227"></a> </span><span class=cF9>CDC</span><span class=cF0> *diff;
<a name="l228"></a> </span><span class=cF9>CDate</span><span class=cF0> cdt;
<a name="l229"></a>
<a name="l230"></a> </span><span class=cF5>TimeCal</span><span class=cF0>;
<a name="l231"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>t_delta=(t=</span><span class=cF5>tS</span><span class=cF0>)-</span><span class=cFB>winmgr</span><span class=cF0>.last_refresh_tS</span><span class=cF7>)</span><span class=cF0>&gt;0.01)
<a name="l232"></a> </span><span class=cFB>winmgr</span><span class=cF0>.fps=</span><span class=cF5>Max</span><span class=cF0>(1.0/t_delta,1);
<a name="l233"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l234"></a> </span><span class=cFB>winmgr</span><span class=cF0>.fps=99;
<a name="l235"></a> </span><span class=cFB>winmgr</span><span class=cF0>.last_refresh_tS=t;
<a name="l236"></a> </span><span class=cF5>WinCalcIdles</span><span class=cF0>;
<a name="l237"></a>
<a name="l238"></a> </span><span class=cF1>if</span><span class=cF0> (flush_msgs)
<a name="l239"></a> </span><span class=cF5>FifoI64Flush</span><span class=cF0>(</span><span class=cFB>kbd</span><span class=cF0>.scan_code_fifo);
<a name="l240"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cFB>sys_focus_task</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l241"></a> </span><span class=cF5>KbdMsgsQue</span><span class=cF0>;
<a name="l242"></a>
<a name="l243"></a> que=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l244"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cFB>sys_focus_task</span><span class=cF7>)</span><span class=cF0> &amp;&amp;
<a name="l245"></a> !</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;</span><span class=cFB>sys_focus_task</span><span class=cF0>-&gt;win_inhibit,</span><span class=cF3>WIf_FOCUS_TASK_CTRLS</span><span class=cF7>)</span><span class=cF0>) {
<a name="l246"></a> c=</span><span class=cFB>sys_focus_task</span><span class=cF0>-&gt;next_ctrl;
<a name="l247"></a> </span><span class=cF1>while</span><span class=cF0> (c!=&amp;</span><span class=cFB>sys_focus_task</span><span class=cF0>-&gt;next_ctrl) </span><span class=cF7>{</span><span class=cF0>
<a name="l248"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>CtrlInside</span><span class=cF7>(</span><span class=cF0>c,</span><span class=cFB>ms</span><span class=cF0>.pos.x,</span><span class=cFB>ms</span><span class=cF0>.pos.y</span><span class=cF7>)</span><span class=cF0>) {
<a name="l249"></a> que=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l250"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l251"></a> }
<a name="l252"></a> c=c-&gt;next;
<a name="l253"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l254"></a> }
<a name="l255"></a> msg_code=</span><span class=cF5>WinQueIPMsgs</span><span class=cF0>(que);
<a name="l256"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l257"></a> </span><span class=cF5>WinRefocus</span><span class=cF0>(</span><span class=cFB>sys_focus_task</span><span class=cF0>);
<a name="l258"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cFB>sys_focus_task</span><span class=cF7>)</span><span class=cF0>)
<a name="l259"></a> </span><span class=cF5>FifoI64Flush</span><span class=cF0>(</span><span class=cFB>kbd</span><span class=cF0>.scan_code_fifo);
<a name="l260"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l261"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>sys_focus_task</span><span class=cF0>)
<a name="l262"></a> </span><span class=cF5>LBtr</span><span class=cF0>(&amp;</span><span class=cFB>sys_focus_task</span><span class=cF0>-&gt;task_flags,</span><span class=cF3>TASKf_HAS_SONG</span><span class=cF0>);
<a name="l263"></a> </span><span class=cF5>WinMsUpdate</span><span class=cF0>;
<a name="l264"></a>
<a name="l265"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>LBtr</span><span class=cF7>(</span><span class=cF0>&amp;</span><span class=cFB>sys_semas</span><span class=cF0>[</span><span class=cF3>SEMA_JUST_PUMP_MSGS</span><span class=cF0>],0</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l266"></a> t=</span><span class=cF5>tS</span><span class=cF0>+</span><span class=cF3>WINMGR_PERIOD</span><span class=cF0>/8;
<a name="l267"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>winmgr</span><span class=cF0>.ideal_refresh_tS&lt;t)
<a name="l268"></a> </span><span class=cFB>winmgr</span><span class=cF0>.ideal_refresh_tS+=</span><span class=cF3>WINMGR_PERIOD</span><span class=cF0>;
<a name="l269"></a> timeout_val=</span><span class=cFB>cnts</span><span class=cF0>.jiffies+(</span><span class=cFB>winmgr</span><span class=cF0>.ideal_refresh_tS-</span><span class=cF5>tS</span><span class=cF0>)*</span><span class=cF3>JIFFY_FREQ</span><span class=cF0>;
<a name="l270"></a> </span><span class=cF5>LBts</span><span class=cF0>(&amp;</span><span class=cFB>sys_semas</span><span class=cF0>[</span><span class=cF3>SEMA_REFRESH_IN_PROGRESS</span><span class=cF0>],0);
<a name="l271"></a> </span><span class=cF5>GrUpdateScrn</span><span class=cF0>;
<a name="l272"></a> </span><span class=cF5>LBtr</span><span class=cF0>(&amp;</span><span class=cFB>sys_semas</span><span class=cF0>[</span><span class=cF3>SEMA_REFRESH_IN_PROGRESS</span><span class=cF0>],0);
<a name="l273"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>scrncast</span><span class=cF0>.record &amp;&amp; !</span><span class=cFB>scrncast</span><span class=cF0>.just_audio) {
<a name="l274"></a> cdt=</span><span class=cFB>scrncast</span><span class=cF0>.t0_now(</span><span class=cF9>I64</span><span class=cF0>)+</span><span class=cF5>ToI64</span><span class=cF0>(</span><span class=cF3>CDATE_FREQ</span><span class=cF0>*</span><span class=cF7>(</span><span class=cF5>tS</span><span class=cF0>-</span><span class=cFB>scrncast</span><span class=cF0>.t0_tS</span><span class=cF7>)</span><span class=cF0>);
<a name="l275"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>scrncast</span><span class=cF0>.dc) </span><span class=cF7>{</span><span class=cF0>
<a name="l276"></a> </span><span class=cFB>scrncast</span><span class=cF0>.dc=</span><span class=cF5>DCCopy</span><span class=cF0>(</span><span class=cFB>scrncast</span><span class=cF0>.dc2_alias);
<a name="l277"></a> </span><span class=cFB>scrncast</span><span class=cF0>.dc-&gt;cdt=cdt;
<a name="l278"></a> st=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cFB>scrncast</span><span class=cF0>.print_fmt,cdt);
<a name="l279"></a> </span><span class=cF5>GRWrite</span><span class=cF0>(st,</span><span class=cFB>scrncast</span><span class=cF0>.dc);
<a name="l280"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l281"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>MemCmp</span><span class=cF7>(</span><span class=cFB>scrncast</span><span class=cF0>.dc-&gt;body,
<a name="l282"></a> </span><span class=cFB>scrncast</span><span class=cF0>.dc2_alias-&gt;body,</span><span class=cF5>MSize</span><span class=cF0>(</span><span class=cFB>scrncast</span><span class=cF0>.dc2_alias-&gt;body)</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l283"></a> diff=</span><span class=cF5>DCDiff</span><span class=cF0>(</span><span class=cFB>scrncast</span><span class=cF0>.dc,</span><span class=cFB>scrncast</span><span class=cF0>.dc2_alias);
<a name="l284"></a> diff-&gt;cdt=cdt;
<a name="l285"></a> st=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cFB>scrncast</span><span class=cF0>.print_fmt,cdt);
<a name="l286"></a> </span><span class=cF5>GRWrite</span><span class=cF0>(st,diff);
<a name="l287"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l288"></a> </span><span class=cF5>DCDel</span><span class=cF0>(diff);
<a name="l289"></a> </span><span class=cF5>Free</span><span class=cF0>(</span><span class=cFB>scrncast</span><span class=cF0>.dc-&gt;body);
<a name="l290"></a> </span><span class=cFB>scrncast</span><span class=cF0>.dc-&gt;body=</span><span class=cF5>MAllocIdent</span><span class=cF0>(</span><span class=cFB>scrncast</span><span class=cF0>.dc2_alias-&gt;body);
<a name="l291"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l292"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>scrncast</span><span class=cF0>.dc) {
<a name="l293"></a> </span><span class=cF5>DCDel</span><span class=cF0>(</span><span class=cFB>scrncast</span><span class=cF0>.dc); </span><span class=cF2>//TODO: </span><a href="/Wb/Adam/Opt/Utils/MemRep.HC.HTML#l193"><span class=cF4>MemRep</span></a><span class=cF2> can crash.</span><span class=cF0>
<a name="l294"></a> </span><span class=cFB>scrncast</span><span class=cF0>.dc=</span><span class=cF3>NULL</span><span class=cF0>;
<a name="l295"></a> }
<a name="l296"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>sys_focus_task</span><span class=cF0> &amp;&amp; !</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;</span><span class=cFB>sys_focus_task</span><span class=cF0>-&gt;task_flags,</span><span class=cF3>TASKf_HAS_SONG</span><span class=cF7>)</span><span class=cF0>) {
<a name="l297"></a> </span><span class=cF5>Free</span><span class=cF0>(</span><span class=cFB>music</span><span class=cF0>.cur_song);
<a name="l298"></a> </span><span class=cFB>music</span><span class=cF0>.cur_song=</span><span class=cF3>NULL</span><span class=cF0>;
<a name="l299"></a> }
<a name="l300"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>music</span><span class=cF0>.cur_song) {
<a name="l301"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>music</span><span class=cF0>.cur_song_task)
<a name="l302"></a> </span><span class=cFB>music</span><span class=cF0>.cur_song_task=</span><span class=cF5>Spawn</span><span class=cF0>(&amp;</span><span class=cF5>CurSongTask</span><span class=cF0>,</span><span class=cF3>NULL</span><span class=cF0>,</span><span class=cF6>&quot;Song&quot;</span><span class=cF0>);
<a name="l303"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>music</span><span class=cF0>.cur_song_task) {
<a name="l304"></a> </span><span class=cF5>Kill</span><span class=cF0>(</span><span class=cFB>music</span><span class=cF0>.cur_song_task);
<a name="l305"></a> </span><span class=cFB>music</span><span class=cF0>.cur_song_task=</span><span class=cF3>NULL</span><span class=cF0>;
<a name="l306"></a> }
<a name="l307"></a> </span><span class=cFB>winmgr</span><span class=cF0>.updates++;
<a name="l308"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>ms_hard</span><span class=cF0>.install_attempts) </span><span class=cF2>//Don't call before boot mouse install attempt</span><span class=cF0>
<a name="l309"></a> </span><span class=cF5>KbdMsHndlr</span><span class=cF0>(</span><span class=cF3>FALSE</span><span class=cF0>,</span><span class=cF3>TRUE</span><span class=cF0>);
<a name="l310"></a> </span><span class=cF5>SleepUntil</span><span class=cF0>(timeout_val);
<a name="l311"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l312"></a> </span><span class=cF1>return</span><span class=cF0> msg_code;
<a name="l313"></a>}
<a name="l314"></a>
<a name="l315"></a></span><span class=cF9>CDoc</span><span class=cF0> *</span><span class=cF5>WinCursorPosSet</span><span class=cF0>(</span><span class=cF9>CTask</span><span class=cF0> *task,</span><span class=cF9>I64</span><span class=cF0> msx,</span><span class=cF9>I64</span><span class=cF0> msy,</span><span class=cF1>Bool</span><span class=cF0> set_cursor=</span><span class=cF3>TRUE</span><span class=cF0>)
<a name="l316"></a>{
<a name="l317"></a> </span><span class=cF9>CDoc</span><span class=cF0> *res=</span><span class=cF3>NULL</span><span class=cF0>;
<a name="l318"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock;
<a name="l319"></a> </span><span class=cF9>I64</span><span class=cF0> x0,y0;
<a name="l320"></a> </span><span class=cF1>if</span><span class=cF0> (!task) task=</span><span class=cF5>Fs</span><span class=cF0>;
<a name="l321"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>WinInside</span><span class=cF7>(</span><span class=cF0>msx,msy,task</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l322"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>res=</span><span class=cF5>DocDisplay</span><span class=cF0>(task)</span><span class=cF7>)</span><span class=cF0> &amp;&amp; res-&gt;flags&amp;</span><span class=cF3>DOCF_DONT_SHOW</span><span class=cF0>)
<a name="l323"></a> res=</span><span class=cF3>NULL</span><span class=cF0>;
<a name="l324"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (set_cursor) {
<a name="l325"></a> unlock=</span><span class=cF5>DocLock</span><span class=cF0>(res);
<a name="l326"></a> </span><span class=cF1>if</span><span class=cF0> (res-&gt;doc_signature!=</span><span class=cF3>DOC_SIGNATURE_VAL</span><span class=cF0>)
<a name="l327"></a> res=</span><span class=cF3>NULL</span><span class=cF0>;
<a name="l328"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l329"></a> x0=res-&gt;line_start_col;
<a name="l330"></a> y0=res-&gt;top_line_num;
<a name="l331"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(res,</span><span class=cF3>RECALCF_HAS_CURSOR</span><span class=cF0>);
<a name="l332"></a> res-&gt;x=(msx-task-&gt;pix_left-task-&gt;scroll_x)/</span><span class=cF3>FONT_WIDTH</span><span class=cF0> +x0;
<a name="l333"></a> res-&gt;y=(msy-task-&gt;pix_top -task-&gt;scroll_y)/</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>+y0;
<a name="l334"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(res,</span><span class=cF3>RECALCt_FIND_CURSOR</span><span class=cF0>);
<a name="l335"></a> task-&gt;scroll_x=0;
<a name="l336"></a> task-&gt;scroll_y=0;
<a name="l337"></a> task-&gt;scroll_z=0;
<a name="l338"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
<a name="l339"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(res);
<a name="l340"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l341"></a> }
<a name="l342"></a> </span><span class=cF5>WinToTop</span><span class=cF0>(task);
<a name="l343"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l344"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l345"></a>}
<a name="l346"></a>
<a name="l347"></a></span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>WinKeyNavMenu</span><span class=cF0>()
<a name="l348"></a>{
<a name="l349"></a> </span><span class=cF9>I64</span><span class=cF0> i,old_key_cnt;
<a name="l350"></a> </span><span class=cF9>CD3I64</span><span class=cF0> old_pos,new_pos;
<a name="l351"></a> </span><span class=cF9>CMenu</span><span class=cF0> *m;
<a name="l352"></a> </span><span class=cF9>CMenuEntry</span><span class=cF0> *tmpme;
<a name="l353"></a> </span><span class=cF9>CTask</span><span class=cF0> *focus=</span><span class=cF5>MenuTask</span><span class=cF0>;
<a name="l354"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>kbd</span><span class=cF0>.down_bitmap,</span><span class=cF3>SC_GUI</span><span class=cF7>)</span><span class=cF0> &amp;&amp; focus &amp;&amp; </span><span class=cF7>(</span><span class=cF0>m=focus-&gt;cur_menu</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l355"></a> </span><span class=cFB>winmgr</span><span class=cF0>.show_menu=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l356"></a> </span><span class=cFB>sys_cur_submenu_entry</span><span class=cF0>=</span><span class=cF3>NULL</span><span class=cF0>;
<a name="l357"></a> old_pos.x=</span><span class=cFB>ms</span><span class=cF0>.pos.x; old_pos.y=</span><span class=cFB>ms</span><span class=cF0>.pos.y;
<a name="l358"></a> </span><span class=cFB>ms</span><span class=cF0>.pos.x=new_pos.x=</span><span class=cFB>ms</span><span class=cF0>.pos.y=new_pos.y=0;
<a name="l359"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>kbd</span><span class=cF0>.down_bitmap,</span><span class=cF3>SC_GUI</span><span class=cF7>)</span><span class=cF0>) {
<a name="l360"></a> old_key_cnt=</span><span class=cFB>kbd</span><span class=cF0>.cnt;
<a name="l361"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>kbd</span><span class=cF0>.down_bitmap,</span><span class=cF3>SC_CURSOR_LEFT</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l362"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>kbd</span><span class=cF0>.down_bitmap,</span><span class=cF3>SC_CURSOR_LEFT</span><span class=cF7>)</span><span class=cF0> &amp;&amp; </span><span class=cFB>kbd</span><span class=cF0>.cnt==old_key_cnt)
<a name="l363"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>(</span><span class=cF3>TRUE</span><span class=cF0>);
<a name="l364"></a> </span><span class=cF1>if</span><span class=cF0> (new_pos.x) {
<a name="l365"></a> i=0;
<a name="l366"></a> tmpme=m-&gt;sub;
<a name="l367"></a> </span><span class=cF1>while</span><span class=cF0> (tmpme) </span><span class=cF7>{</span><span class=cF0>
<a name="l368"></a> </span><span class=cF1>if</span><span class=cF0> (i+</span><span class=cF5>MenuEntryWidth</span><span class=cF7>(</span><span class=cF0>tmpme</span><span class=cF7>)</span><span class=cF0>*</span><span class=cF3>FONT_WIDTH</span><span class=cF0>==new_pos.x) {
<a name="l369"></a> new_pos.x=i;
<a name="l370"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l371"></a> }
<a name="l372"></a> i+=</span><span class=cF5>MenuEntryWidth</span><span class=cF0>(tmpme)*</span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
<a name="l373"></a> tmpme=tmpme-&gt;next;
<a name="l374"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l375"></a> }
<a name="l376"></a> new_pos.y=0;
<a name="l377"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>kbd</span><span class=cF0>.down_bitmap,</span><span class=cF3>SC_CURSOR_RIGHT</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l378"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>kbd</span><span class=cF0>.down_bitmap,</span><span class=cF3>SC_CURSOR_RIGHT</span><span class=cF7>)</span><span class=cF0> &amp;&amp; </span><span class=cFB>kbd</span><span class=cF0>.cnt==old_key_cnt)
<a name="l379"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>(</span><span class=cF3>TRUE</span><span class=cF0>);
<a name="l380"></a> i=0;
<a name="l381"></a> tmpme=m-&gt;sub;
<a name="l382"></a> </span><span class=cF1>while</span><span class=cF0> (tmpme) {
<a name="l383"></a> </span><span class=cF1>if</span><span class=cF0> (i==new_pos.x) </span><span class=cF7>{</span><span class=cF0>
<a name="l384"></a> </span><span class=cF1>if</span><span class=cF0> (tmpme-&gt;next)
<a name="l385"></a> new_pos.x=i+</span><span class=cF5>MenuEntryWidth</span><span class=cF0>(tmpme)*</span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
<a name="l386"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l387"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l388"></a> i+=</span><span class=cF5>MenuEntryWidth</span><span class=cF0>(tmpme)*</span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
<a name="l389"></a> tmpme=tmpme-&gt;next;
<a name="l390"></a> }
<a name="l391"></a> new_pos.y=0;
<a name="l392"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>kbd</span><span class=cF0>.down_bitmap,</span><span class=cF3>SC_CURSOR_UP</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l393"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>kbd</span><span class=cF0>.down_bitmap,</span><span class=cF3>SC_CURSOR_UP</span><span class=cF7>)</span><span class=cF0> &amp;&amp; </span><span class=cFB>kbd</span><span class=cF0>.cnt==old_key_cnt)
<a name="l394"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>(</span><span class=cF3>TRUE</span><span class=cF0>);
<a name="l395"></a> new_pos.y-=</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
<a name="l396"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>kbd</span><span class=cF0>.down_bitmap,</span><span class=cF3>SC_CURSOR_DOWN</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l397"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>kbd</span><span class=cF0>.down_bitmap,</span><span class=cF3>SC_CURSOR_DOWN</span><span class=cF7>)</span><span class=cF0> &amp;&amp; </span><span class=cFB>kbd</span><span class=cF0>.cnt==old_key_cnt)
<a name="l398"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>(</span><span class=cF3>TRUE</span><span class=cF0>);
<a name="l399"></a> new_pos.y+=</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
<a name="l400"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l401"></a> new_pos.x=</span><span class=cF5>ClampI64</span><span class=cF0>(new_pos.x,0,</span><span class=cF3>GR_WIDTH</span><span class=cF0>-1);
<a name="l402"></a> new_pos.y=</span><span class=cF5>ClampI64</span><span class=cF0>(new_pos.y,0,</span><span class=cF3>GR_HEIGHT</span><span class=cF0>-1);
<a name="l403"></a> </span><span class=cFB>ms</span><span class=cF0>.pos.x=new_pos.x; </span><span class=cFB>ms</span><span class=cF0>.pos.y=new_pos.y;
<a name="l404"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>(</span><span class=cF3>TRUE</span><span class=cF0>);
<a name="l405"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>sys_cur_submenu_entry</span><span class=cF0>)
<a name="l406"></a> </span><span class=cFB>ms</span><span class=cF0>.pos.y=new_pos.y=0;
<a name="l407"></a> }
<a name="l408"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>sys_cur_submenu_entry</span><span class=cF0>)
<a name="l409"></a> </span><span class=cF5>TaskMsg</span><span class=cF0>(</span><span class=cFB>sys_focus_task</span><span class=cF0>,0,</span><span class=cFB>sys_cur_submenu_entry</span><span class=cF0>-&gt;msg_code,
<a name="l410"></a> </span><span class=cFB>sys_cur_submenu_entry</span><span class=cF0>-&gt;arg1,</span><span class=cFB>sys_cur_submenu_entry</span><span class=cF0>-&gt;arg2,0);
<a name="l411"></a> </span><span class=cFB>winmgr</span><span class=cF0>.show_menu=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l412"></a> </span><span class=cFB>ms</span><span class=cF0>.pos.x=old_pos.x; </span><span class=cFB>ms</span><span class=cF0>.pos.y=old_pos.y;
<a name="l413"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l414"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l415"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l416"></a>}
<a name="l417"></a>
<a name="l418"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>WinMgrTask</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0>)
<a name="l419"></a>{
<a name="l420"></a> </span><span class=cF9>CTask</span><span class=cF0> *task=</span><span class=cF5>Fs</span><span class=cF0>;
<a name="l421"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc;
<a name="l422"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e;
<a name="l423"></a> </span><span class=cF9>I64</span><span class=cF0> x,y,z,msg_code,
<a name="l424"></a> my_ms_z=0,left,top,
<a name="l425"></a> old_flags=</span><span class=cF5>GetRFlags</span><span class=cF0>;
<a name="l426"></a> </span><span class=cF1>Bool</span><span class=cF0> has_border;
<a name="l427"></a> </span><span class=cF9>CCtrl</span><span class=cF0> *c;
<a name="l428"></a> </span><span class=cF5>WinHorz</span><span class=cF0>(0,</span><span class=cF3>TEXT_COLS</span><span class=cF0>-1);
<a name="l429"></a> </span><span class=cF5>WinVert</span><span class=cF0>(0,</span><span class=cF3>TEXT_ROWS</span><span class=cF0>-1);
<a name="l430"></a> </span><span class=cF5>LBts</span><span class=cF0>(&amp;</span><span class=cF5>Fs</span><span class=cF0>-&gt;display_flags,</span><span class=cF3>DISPLAYf_NO_BORDER</span><span class=cF0>);
<a name="l431"></a> </span><span class=cF5>LBts</span><span class=cF0>(&amp;</span><span class=cF5>Fs</span><span class=cF0>-&gt;display_flags,</span><span class=cF3>DISPLAYf_SHOW</span><span class=cF0>);
<a name="l432"></a> </span><span class=cFB>gr</span><span class=cF0>.dc-&gt;win_task=</span><span class=cF5>Fs</span><span class=cF0>;
<a name="l433"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;win_inhibit&amp;=~</span><span class=cF3>WIF_SELF_CTRLS</span><span class=cF0>;
<a name="l434"></a> </span><span class=cF5>GrSetUpTables</span><span class=cF0>;
<a name="l435"></a> </span><span class=cFB>scrncast</span><span class=cF0>.dc2_alias=</span><span class=cF5>DCAlias</span><span class=cF0>(</span><span class=cFB>gr</span><span class=cF0>.dc2);
<a name="l436"></a> </span><span class=cF5>WinZBufUpdate</span><span class=cF0>;
<a name="l437"></a> </span><span class=cF5>LBts</span><span class=cF0>(&amp;</span><span class=cFB>sys_run_level</span><span class=cF0>,</span><span class=cF3>RLf_WINMGR</span><span class=cF0>);
<a name="l438"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l439"></a> </span><span class=cF1>try</span><span class=cF0> {
<a name="l440"></a>wmt_start:
<a name="l441"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;</span><span class=cFB>sys_run_level</span><span class=cF0>,</span><span class=cF3>RLf_ADAM_SERVER</span><span class=cF7>)</span><span class=cF0>)
<a name="l442"></a> </span><span class=cF5>TaskKillDying</span><span class=cF0>;
<a name="l443"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>;
<a name="l444"></a>
<a name="l445"></a> task=</span><span class=cF5>Fs</span><span class=cF0>-&gt;last_task;
<a name="l446"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l447"></a> </span><span class=cF1>CLI</span><span class=cF0>
<a name="l448"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>) {
<a name="l449"></a> </span><span class=cF5>SetRFlags</span><span class=cF0>(old_flags);
<a name="l450"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l451"></a> }
<a name="l452"></a> </span><span class=cF5>TaskDerivedValsUpdate</span><span class=cF0>(task,</span><span class=cF3>FALSE</span><span class=cF0>);
<a name="l453"></a> task=task-&gt;last_task;
<a name="l454"></a> </span><span class=cF5>SetRFlags</span><span class=cF0>(old_flags);
<a name="l455"></a> </span><span class=cF1>if</span><span class=cF0> (task==</span><span class=cF5>Fs</span><span class=cF0>)
<a name="l456"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l457"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l458"></a> </span><span class=cF5>TaskDerivedValsUpdate</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>,</span><span class=cF3>FALSE</span><span class=cF0>);
<a name="l459"></a>
<a name="l460"></a> task=</span><span class=cF5>Fs</span><span class=cF0>-&gt;last_task;
<a name="l461"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l462"></a> </span><span class=cF1>CLI</span><span class=cF0>
<a name="l463"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>) {
<a name="l464"></a> </span><span class=cF5>SetRFlags</span><span class=cF0>(old_flags);
<a name="l465"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l466"></a> }
<a name="l467"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>WinInside</span><span class=cF7>(</span><span class=cFB>ms</span><span class=cF0>.pos.x,</span><span class=cFB>ms</span><span class=cF0>.pos.y,task,</span><span class=cF3>FONT_WIDTH</span><span class=cF7>)</span><span class=cF0>) {
<a name="l468"></a> </span><span class=cF5>SetRFlags</span><span class=cF0>(old_flags);
<a name="l469"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l470"></a> }
<a name="l471"></a> </span><span class=cF1>if</span><span class=cF0> (task==</span><span class=cF5>Fs</span><span class=cF0>) { </span><span class=cF2>//Shouldn't happen</span><span class=cF0>
<a name="l472"></a> </span><span class=cF5>SetRFlags</span><span class=cF0>(old_flags);
<a name="l473"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l474"></a> }
<a name="l475"></a> task=task-&gt;last_task;
<a name="l476"></a> </span><span class=cF5>SetRFlags</span><span class=cF0>(old_flags);
<a name="l477"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l478"></a>
<a name="l479"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;task-&gt;display_flags,</span><span class=cF3>DISPLAYf_NO_BORDER</span><span class=cF7>)</span><span class=cF0>)
<a name="l480"></a> has_border=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l481"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l482"></a> has_border=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l483"></a>
<a name="l484"></a> </span><span class=cFB>winmgr</span><span class=cF0>.show_menu=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l485"></a> </span><span class=cFB>sys_cur_submenu_entry</span><span class=cF0>=</span><span class=cF3>NULL</span><span class=cF0>;
<a name="l486"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cFB>sys_focus_task</span><span class=cF7>)</span><span class=cF0> &amp;&amp;
<a name="l487"></a> !</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;</span><span class=cFB>sys_focus_task</span><span class=cF0>-&gt;win_inhibit,</span><span class=cF3>WIf_FOCUS_TASK_MENU</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l488"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>WinKeyNavMenu</span><span class=cF0>)
<a name="l489"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l490"></a> </span><span class=cF1>if</span><span class=cF0> (task==</span><span class=cF5>Fs</span><span class=cF0> &amp;&amp; 0&lt;=</span><span class=cFB>ms</span><span class=cF0>.pos.y&lt;</span><span class=cF3>FONT_HEIGHT</span><span class=cF0> &amp;&amp; </span><span class=cFB>ms_hard</span><span class=cF0>.installed) {
<a name="l491"></a> </span><span class=cFB>winmgr</span><span class=cF0>.show_menu=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l492"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.lb &amp;&amp; !</span><span class=cFB>old_ms</span><span class=cF0>.lb) </span><span class=cF7>{</span><span class=cF0>
<a name="l493"></a> </span><span class=cFB>winmgr</span><span class=cF0>.show_menu=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l494"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.lb)
<a name="l495"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>(</span><span class=cF3>TRUE</span><span class=cF0>);
<a name="l496"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>sys_cur_submenu_entry</span><span class=cF0>)
<a name="l497"></a> </span><span class=cF5>TaskMsg</span><span class=cF0>(</span><span class=cFB>sys_focus_task</span><span class=cF0>,0,
<a name="l498"></a> </span><span class=cFB>sys_cur_submenu_entry</span><span class=cF0>-&gt;msg_code,
<a name="l499"></a> </span><span class=cFB>sys_cur_submenu_entry</span><span class=cF0>-&gt;arg1,
<a name="l500"></a> </span><span class=cFB>sys_cur_submenu_entry</span><span class=cF0>-&gt;arg2,0);
<a name="l501"></a> </span><span class=cFB>winmgr</span><span class=cF0>.show_menu=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l502"></a> </span><span class=cFB>old_ms</span><span class=cF0>.lb=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l503"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l504"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l505"></a> }
<a name="l506"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l507"></a>
<a name="l508"></a> </span><span class=cF2>//grab scroll</span><span class=cF0>
<a name="l509"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;task-&gt;win_inhibit,</span><span class=cF3>WIf_SELF_GRAB_SCROLL</span><span class=cF7>)</span><span class=cF0> &amp;&amp;
<a name="l510"></a> </span><span class=cF7>(</span><span class=cF0>!</span><span class=cF5>TaskValidate</span><span class=cF0>(</span><span class=cFB>sys_focus_task</span><span class=cF0>)||
<a name="l511"></a> !</span><span class=cF5>Bt</span><span class=cF0>(&amp;</span><span class=cFB>sys_focus_task</span><span class=cF0>-&gt;win_inhibit,</span><span class=cF3>WIf_FOCUS_TASK_GRAB_SCROLL</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0> &amp;&amp;
<a name="l512"></a> </span><span class=cFB>kbd</span><span class=cF0>.scan_code&amp;</span><span class=cF3>SCF_CTRL</span><span class=cF0> &amp;&amp; </span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l513"></a> </span><span class=cFB>winmgr</span><span class=cF0>.grab_scroll_closed=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l514"></a> </span><span class=cFB>winmgr</span><span class=cF0>.grab_scroll=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l515"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>kbd</span><span class=cF0>.scan_code&amp;</span><span class=cF3>SCF_CTRL</span><span class=cF0> &amp;&amp; </span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0> &amp;&amp; </span><span class=cF7>(</span><span class=cF0>!</span><span class=cFB>ac</span><span class=cF0>.task ||
<a name="l516"></a> !</span><span class=cF5>WinInside</span><span class=cF0>(</span><span class=cFB>ms</span><span class=cF0>.pos.x,</span><span class=cFB>ms</span><span class=cF0>.pos.y,</span><span class=cFB>ac</span><span class=cF0>.task,</span><span class=cF3>FONT_WIDTH</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>) {
<a name="l517"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.lb) </span><span class=cF7>{</span><span class=cF0>
<a name="l518"></a> </span><span class=cFB>winmgr</span><span class=cF0>.grab_scroll_closed=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l519"></a> x=</span><span class=cFB>ms</span><span class=cF0>.pos.x-task-&gt;scroll_x;
<a name="l520"></a> y=</span><span class=cFB>ms</span><span class=cF0>.pos.y-task-&gt;scroll_y;
<a name="l521"></a> z=</span><span class=cFB>ms</span><span class=cF0>.pos.z-task-&gt;scroll_z;
<a name="l522"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.lb &amp;&amp; </span><span class=cFB>kbd</span><span class=cF0>.scan_code&amp;</span><span class=cF3>SCF_CTRL</span><span class=cF0> &amp;&amp; </span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>) {
<a name="l523"></a> task-&gt;scroll_x=(</span><span class=cFB>ms</span><span class=cF0>.pos.x-x)&amp;~7;
<a name="l524"></a> task-&gt;scroll_y=(</span><span class=cFB>ms</span><span class=cF0>.pos.y-y)&amp;~7;
<a name="l525"></a> task-&gt;scroll_z=</span><span class=cFB>ms</span><span class=cF0>.pos.z-z;
<a name="l526"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>(</span><span class=cF3>TRUE</span><span class=cF0>);
<a name="l527"></a> }
<a name="l528"></a> </span><span class=cFB>winmgr</span><span class=cF0>.grab_scroll_closed=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l529"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.rb) </span><span class=cF7>{</span><span class=cF0>
<a name="l530"></a> task-&gt;scroll_x=0;
<a name="l531"></a> task-&gt;scroll_y=0;
<a name="l532"></a> task-&gt;scroll_z=0;
<a name="l533"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>(</span><span class=cF3>TRUE</span><span class=cF0>);
<a name="l534"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l535"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>;
<a name="l536"></a> }
<a name="l537"></a> </span><span class=cFB>winmgr</span><span class=cF0>.grab_scroll=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l538"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l539"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l540"></a> </span><span class=cFB>winmgr</span><span class=cF0>.grab_scroll=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l541"></a>
<a name="l542"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;task-&gt;win_inhibit,</span><span class=cF3>WIf_SELF_CTRLS</span><span class=cF7>)</span><span class=cF0> &amp;&amp;
<a name="l543"></a> </span><span class=cF7>(</span><span class=cF0>!</span><span class=cF5>TaskValidate</span><span class=cF0>(</span><span class=cFB>sys_focus_task</span><span class=cF0>)||
<a name="l544"></a> !</span><span class=cF5>Bt</span><span class=cF0>(&amp;</span><span class=cFB>sys_focus_task</span><span class=cF0>-&gt;win_inhibit,</span><span class=cF3>WIf_FOCUS_TASK_CTRLS</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l545"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.lb &amp;&amp; !</span><span class=cFB>old_ms</span><span class=cF0>.lb) {
<a name="l546"></a> c=task-&gt;next_ctrl;
<a name="l547"></a> </span><span class=cF1>while</span><span class=cF0> (c!=&amp;task-&gt;next_ctrl) </span><span class=cF7>{</span><span class=cF0>
<a name="l548"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>CtrlInside</span><span class=cF7>(</span><span class=cF0>c,</span><span class=cFB>ms</span><span class=cF0>.pos.x,</span><span class=cFB>ms</span><span class=cF0>.pos.y</span><span class=cF7>)</span><span class=cF0>) {
<a name="l549"></a> left=task-&gt;pix_left;
<a name="l550"></a> top =task-&gt;pix_top;
<a name="l551"></a> </span><span class=cF1>if</span><span class=cF0> (c-&gt;flags&amp;</span><span class=cF3>CTRLF_BORDER</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l552"></a> left-=</span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
<a name="l553"></a> top -=</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
<a name="l554"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l555"></a> </span><span class=cF1>if</span><span class=cF0> (c-&gt;flags&amp;</span><span class=cF3>CTRLF_CAPTURE_LEFT_MS</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l556"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.lb &amp;&amp; </span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>) {
<a name="l557"></a> </span><span class=cF1>if</span><span class=cF0> (c-&gt;left_click)
<a name="l558"></a> (*c-&gt;left_click)(c,</span><span class=cFB>ms</span><span class=cF0>.pos.x-left,</span><span class=cFB>ms</span><span class=cF0>.pos.y-top,</span><span class=cF3>TRUE</span><span class=cF0>);
<a name="l559"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>;
<a name="l560"></a> }
<a name="l561"></a> </span><span class=cF1>if</span><span class=cF0> (c-&gt;left_click)
<a name="l562"></a> (*c-&gt;left_click)(c,</span><span class=cFB>ms</span><span class=cF0>.pos.x-left,</span><span class=cFB>ms</span><span class=cF0>.pos.y-top,</span><span class=cF3>FALSE</span><span class=cF0>);
<a name="l563"></a> </span><span class=cFB>old_ms</span><span class=cF0>.lb=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l564"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l565"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l566"></a> </span><span class=cF1>if</span><span class=cF0> (c-&gt;left_click)
<a name="l567"></a> (*c-&gt;left_click)(c,</span><span class=cFB>ms</span><span class=cF0>.pos.x-left,</span><span class=cFB>ms</span><span class=cF0>.pos.y-top,</span><span class=cF3>TRUE</span><span class=cF0>);
<a name="l568"></a> </span><span class=cFB>old_ms</span><span class=cF0>.lb=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l569"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l570"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l571"></a> }
<a name="l572"></a> c=c-&gt;next;
<a name="l573"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l574"></a> }
<a name="l575"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>old_ms</span><span class=cF0>.lb &amp;&amp; !</span><span class=cFB>ms</span><span class=cF0>.lb) {
<a name="l576"></a> c=task-&gt;next_ctrl;
<a name="l577"></a> </span><span class=cF1>while</span><span class=cF0> (c!=&amp;task-&gt;next_ctrl) </span><span class=cF7>{</span><span class=cF0>
<a name="l578"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>CtrlInside</span><span class=cF7>(</span><span class=cF0>c,</span><span class=cFB>ms</span><span class=cF0>.pos.x,</span><span class=cFB>ms</span><span class=cF0>.pos.y</span><span class=cF7>)</span><span class=cF0>) {
<a name="l579"></a> left=task-&gt;pix_left;
<a name="l580"></a> top =task-&gt;pix_top;
<a name="l581"></a> </span><span class=cF1>if</span><span class=cF0> (c-&gt;flags&amp;</span><span class=cF3>CTRLF_BORDER</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l582"></a> left-=</span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
<a name="l583"></a> top -=</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
<a name="l584"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l585"></a> </span><span class=cF1>if</span><span class=cF0> (c-&gt;left_click)
<a name="l586"></a> (*c-&gt;left_click)(c,</span><span class=cFB>ms</span><span class=cF0>.pos.x-left,</span><span class=cFB>ms</span><span class=cF0>.pos.y-top,</span><span class=cF3>FALSE</span><span class=cF0>);
<a name="l587"></a> </span><span class=cFB>old_ms</span><span class=cF0>.lb=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l588"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l589"></a> }
<a name="l590"></a> c=c-&gt;next;
<a name="l591"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l592"></a> }
<a name="l593"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.rb &amp;&amp; !</span><span class=cFB>old_ms</span><span class=cF0>.rb) {
<a name="l594"></a> c=task-&gt;next_ctrl;
<a name="l595"></a> </span><span class=cF1>while</span><span class=cF0> (c!=&amp;task-&gt;next_ctrl) </span><span class=cF7>{</span><span class=cF0>
<a name="l596"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>CtrlInside</span><span class=cF7>(</span><span class=cF0>c,</span><span class=cFB>ms</span><span class=cF0>.pos.x,</span><span class=cFB>ms</span><span class=cF0>.pos.y</span><span class=cF7>)</span><span class=cF0>) {
<a name="l597"></a> left=task-&gt;pix_left;
<a name="l598"></a> top =task-&gt;pix_top;
<a name="l599"></a> </span><span class=cF1>if</span><span class=cF0> (c-&gt;flags&amp;</span><span class=cF3>CTRLF_BORDER</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l600"></a> left-=</span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
<a name="l601"></a> top -=</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
<a name="l602"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l603"></a> </span><span class=cF1>if</span><span class=cF0> (c-&gt;flags&amp;</span><span class=cF3>CTRLF_CAPTURE_RIGHT_MS</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l604"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.rb &amp;&amp; </span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>) {
<a name="l605"></a> </span><span class=cF1>if</span><span class=cF0> (c-&gt;right_click)
<a name="l606"></a> (*c-&gt;right_click)(c,</span><span class=cFB>ms</span><span class=cF0>.pos.x-left,</span><span class=cFB>ms</span><span class=cF0>.pos.y-top,</span><span class=cF3>TRUE</span><span class=cF0>);
<a name="l607"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>;
<a name="l608"></a> }
<a name="l609"></a> </span><span class=cF1>if</span><span class=cF0> (c-&gt;right_click)
<a name="l610"></a> (*c-&gt;right_click)(c,</span><span class=cFB>ms</span><span class=cF0>.pos.x-left,</span><span class=cFB>ms</span><span class=cF0>.pos.y-top,</span><span class=cF3>FALSE</span><span class=cF0>);
<a name="l611"></a> </span><span class=cFB>old_ms</span><span class=cF0>.rb=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l612"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l613"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l614"></a> </span><span class=cF1>if</span><span class=cF0> (c-&gt;right_click)
<a name="l615"></a> (*c-&gt;right_click)(c,</span><span class=cFB>ms</span><span class=cF0>.pos.x-left,</span><span class=cFB>ms</span><span class=cF0>.pos.y-top,</span><span class=cF3>TRUE</span><span class=cF0>);
<a name="l616"></a> </span><span class=cFB>old_ms</span><span class=cF0>.rb=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l617"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l618"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l619"></a> }
<a name="l620"></a> c=c-&gt;next;
<a name="l621"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l622"></a> }
<a name="l623"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>old_ms</span><span class=cF0>.rb &amp;&amp; !</span><span class=cFB>ms</span><span class=cF0>.rb) {
<a name="l624"></a> c=task-&gt;next_ctrl;
<a name="l625"></a> </span><span class=cF1>while</span><span class=cF0> (c!=&amp;task-&gt;next_ctrl) </span><span class=cF7>{</span><span class=cF0>
<a name="l626"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>CtrlInside</span><span class=cF7>(</span><span class=cF0>c,</span><span class=cFB>ms</span><span class=cF0>.pos.x,</span><span class=cFB>ms</span><span class=cF0>.pos.y</span><span class=cF7>)</span><span class=cF0>) {
<a name="l627"></a> left=task-&gt;pix_left;
<a name="l628"></a> top =task-&gt;pix_top;
<a name="l629"></a> </span><span class=cF1>if</span><span class=cF0> (c-&gt;flags&amp;</span><span class=cF3>CTRLF_BORDER</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l630"></a> left-=</span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
<a name="l631"></a> top -=</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
<a name="l632"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l633"></a> </span><span class=cF1>if</span><span class=cF0> (c-&gt;right_click)
<a name="l634"></a> (*c-&gt;right_click)(c,</span><span class=cFB>ms</span><span class=cF0>.pos.x-left,</span><span class=cFB>ms</span><span class=cF0>.pos.y-top,</span><span class=cF3>FALSE</span><span class=cF0>);
<a name="l635"></a> </span><span class=cFB>old_ms</span><span class=cF0>.rb=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l636"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l637"></a> }
<a name="l638"></a> c=c-&gt;next;
<a name="l639"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l640"></a> }
<a name="l641"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.has_wheel &amp;&amp; my_ms_z!=</span><span class=cFB>ms</span><span class=cF0>.pos.z) {
<a name="l642"></a> </span><span class=cF1>if</span><span class=cF0> (task==</span><span class=cFB>sys_focus_task</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l643"></a> c=task-&gt;next_ctrl;
<a name="l644"></a> </span><span class=cF1>while</span><span class=cF0> (c!=&amp;task-&gt;next_ctrl) {
<a name="l645"></a> </span><span class=cF1>if</span><span class=cF0> (c-&gt;wheel_chg) </span><span class=cF7>{</span><span class=cF0>
<a name="l646"></a> (*c-&gt;wheel_chg)(c,</span><span class=cFB>ms</span><span class=cF0>.pos.z-my_ms_z);
<a name="l647"></a> my_ms_z=</span><span class=cFB>ms</span><span class=cF0>.pos.z;
<a name="l648"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l649"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l650"></a> c=c-&gt;next;
<a name="l651"></a> }
<a name="l652"></a> my_ms_z=</span><span class=cFB>ms</span><span class=cF0>.pos.z;
<a name="l653"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>sys_focus_task</span><span class=cF0>)
<a name="l654"></a> my_ms_z=</span><span class=cFB>ms</span><span class=cF0>.pos.z;
<a name="l655"></a> }
<a name="l656"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l657"></a>
<a name="l658"></a> </span><span class=cF1>if</span><span class=cF0> (task==</span><span class=cF5>Fs</span><span class=cF0>)
<a name="l659"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l660"></a>
<a name="l661"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;task-&gt;win_inhibit,</span><span class=cF3>WIf_SELF_MS_L</span><span class=cF7>)</span><span class=cF0>&amp;&amp;
<a name="l662"></a> </span><span class=cF7>(</span><span class=cF0>!</span><span class=cF5>TaskValidate</span><span class=cF0>(</span><span class=cFB>sys_focus_task</span><span class=cF0>)||
<a name="l663"></a> !</span><span class=cF5>Bt</span><span class=cF0>(&amp;</span><span class=cFB>sys_focus_task</span><span class=cF0>-&gt;win_inhibit,</span><span class=cF3>WIf_FOCUS_TASK_MS_L</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l664"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>old_ms</span><span class=cF0>.lb &amp;&amp; </span><span class=cFB>ms</span><span class=cF0>.lb) {
<a name="l665"></a> </span><span class=cF1>if</span><span class=cF0> (doc=</span><span class=cF5>WinCursorPosSet</span><span class=cF7>(</span><span class=cF0>task,</span><span class=cFB>ms</span><span class=cF0>.pos.x,</span><span class=cFB>ms</span><span class=cF0>.pos.y</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l666"></a> </span><span class=cF5>DocLock</span><span class=cF0>(doc);
<a name="l667"></a> </span><span class=cF1>if</span><span class=cF0> (doc-&gt;doc_signature==</span><span class=cF3>DOC_SIGNATURE_VAL</span><span class=cF0>) {
<a name="l668"></a> doc_e=doc-&gt;cur_entry;
<a name="l669"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e!=doc) </span><span class=cF7>{</span><span class=cF0>
<a name="l670"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_HAS_BORDER</span><span class=cF0>)
<a name="l671"></a> doc_e-&gt;de_flags|=</span><span class=cF3>DOCEF_SOLID_BORDER</span><span class=cF0>;
<a name="l672"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l673"></a> }
<a name="l674"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
<a name="l675"></a> </span><span class=cFB>old_ms</span><span class=cF0>.lb=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l676"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l677"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l678"></a> }
<a name="l679"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l680"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;task-&gt;win_inhibit,</span><span class=cF3>WIf_SELF_MS_R</span><span class=cF7>)</span><span class=cF0>&amp;&amp;
<a name="l681"></a> </span><span class=cF7>(</span><span class=cF0>!</span><span class=cF5>TaskValidate</span><span class=cF0>(</span><span class=cFB>sys_focus_task</span><span class=cF0>)||
<a name="l682"></a> !</span><span class=cF5>Bt</span><span class=cF0>(&amp;</span><span class=cFB>sys_focus_task</span><span class=cF0>-&gt;win_inhibit,</span><span class=cF3>WIf_FOCUS_TASK_MS_R</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l683"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>old_ms</span><span class=cF0>.rb &amp;&amp; </span><span class=cFB>ms</span><span class=cF0>.rb) {
<a name="l684"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>WinCursorPosSet</span><span class=cF7>(</span><span class=cF0>task,</span><span class=cFB>ms</span><span class=cF0>.pos.x,</span><span class=cFB>ms</span><span class=cF0>.pos.y</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l685"></a> </span><span class=cFB>old_ms</span><span class=cF0>.rb=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l686"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l687"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l688"></a> }
<a name="l689"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l690"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;task-&gt;win_inhibit,</span><span class=cF3>WIf_SELF_BORDER</span><span class=cF7>)</span><span class=cF0> &amp;&amp; has_border &amp;&amp;
<a name="l691"></a> </span><span class=cF7>(</span><span class=cF0>!</span><span class=cF5>TaskValidate</span><span class=cF0>(</span><span class=cFB>sys_focus_task</span><span class=cF0>)||
<a name="l692"></a> !</span><span class=cF5>Bt</span><span class=cF0>(&amp;</span><span class=cFB>sys_focus_task</span><span class=cF0>-&gt;win_inhibit,</span><span class=cF3>WIf_FOCUS_TASK_BORDER</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l693"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>old_ms</span><span class=cF0>.lb &amp;&amp; !</span><span class=cFB>ms</span><span class=cF0>.lb) {
<a name="l694"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.pos_text.y==task-&gt;win_top-1) </span><span class=cF7>{</span><span class=cF0>
<a name="l695"></a> </span><span class=cF1>if</span><span class=cF0> (task-&gt;win_left&lt;=</span><span class=cFB>ms</span><span class=cF0>.pos_text.x&lt;task-&gt;win_left+4) {
<a name="l696"></a> </span><span class=cF5>TaskMsg</span><span class=cF0>(task,0,</span><span class=cF3>MSG_KEY_DOWN</span><span class=cF0>,</span><span class=cF3>CH_CTRLM</span><span class=cF0>,0x43200000432,0);
<a name="l697"></a> </span><span class=cFB>old_ms</span><span class=cF0>.lb=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l698"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l699"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (task-&gt;win_right-2&lt;=</span><span class=cFB>ms</span><span class=cF0>.pos_text.x&lt;=task-&gt;win_right) {
<a name="l700"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>DocPut</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>)
<a name="l701"></a> </span><span class=cF5>TaskMsg</span><span class=cF0>(task,0,</span><span class=cF3>MSG_KEY_DOWN</span><span class=cF0>,</span><span class=cF3>CH_SHIFT_ESC</span><span class=cF0>,0,0);
<a name="l702"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l703"></a> </span><span class=cF5>Kill</span><span class=cF0>(task,</span><span class=cF3>FALSE</span><span class=cF0>);
<a name="l704"></a> </span><span class=cFB>old_ms</span><span class=cF0>.lb=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l705"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l706"></a> }
<a name="l707"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l708"></a> }
<a name="l709"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l710"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;task-&gt;win_inhibit,</span><span class=cF3>WIf_SELF_MS_L</span><span class=cF7>)</span><span class=cF0>&amp;&amp;
<a name="l711"></a> </span><span class=cF7>(</span><span class=cF0>!</span><span class=cF5>TaskValidate</span><span class=cF0>(</span><span class=cFB>sys_focus_task</span><span class=cF0>)||
<a name="l712"></a> !</span><span class=cF5>Bt</span><span class=cF0>(&amp;</span><span class=cFB>sys_focus_task</span><span class=cF0>-&gt;win_inhibit,</span><span class=cF3>WIf_FOCUS_TASK_MS_L</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l713"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>old_ms</span><span class=cF0>.lb &amp;&amp; !</span><span class=cFB>ms</span><span class=cF0>.lb) {
<a name="l714"></a> </span><span class=cF1>if</span><span class=cF0> (doc=</span><span class=cF5>WinCursorPosSet</span><span class=cF7>(</span><span class=cF0>task,</span><span class=cFB>ms</span><span class=cF0>.pos.x,</span><span class=cFB>ms</span><span class=cF0>.pos.y,</span><span class=cF3>FALSE</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l715"></a> </span><span class=cF1>do</span><span class=cF0> msg_code=</span><span class=cF5>WinMgrSleep</span><span class=cF0>;
<a name="l716"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0> &amp;&amp; </span><span class=cF7>(</span><span class=cFB>ms</span><span class=cF0>.lb || </span><span class=cFB>ms</span><span class=cF0>.left_dbl_time</span><span class=cF7>)</span><span class=cF0>);
<a name="l717"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>) {
<a name="l718"></a> </span><span class=cF1>if</span><span class=cF0> (msg_code==</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l719"></a> </span><span class=cF1>if</span><span class=cF0> (doc-&gt;doc_signature==</span><span class=cF3>DOC_SIGNATURE_VAL</span><span class=cF0>) {
<a name="l720"></a> </span><span class=cF5>DocLock</span><span class=cF0>(doc);
<a name="l721"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l722"></a> </span><span class=cF1>if</span><span class=cF0> (doc-&gt;doc_signature==</span><span class=cF3>DOC_SIGNATURE_VAL</span><span class=cF0>) {
<a name="l723"></a> doc_e=doc-&gt;cur_entry;
<a name="l724"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e!=doc) </span><span class=cF7>{</span><span class=cF0>
<a name="l725"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags &amp; </span><span class=cF3>DOCEF_HAS_BORDER</span><span class=cF0>)
<a name="l726"></a> doc_e-&gt;de_flags&amp;=~</span><span class=cF3>DOCEF_SOLID_BORDER</span><span class=cF0>;
<a name="l727"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags &amp; </span><span class=cF7>(</span><span class=cF3>DOCEF_TREE</span><span class=cF0>|</span><span class=cF3>DOCEF_LST</span><span class=cF0>|
<a name="l728"></a> </span><span class=cF3>DOCEF_LINK</span><span class=cF0>|</span><span class=cF3>DOCEF_CHECK_COLLAPSABLE</span><span class=cF0>|
<a name="l729"></a> </span><span class=cF3>DOCEF_LEFT_CB</span><span class=cF0>|</span><span class=cF3>DOCEF_LEFT_MACRO</span><span class=cF0>|</span><span class=cF3>DOCEF_LEFT_EXP</span><span class=cF7>)</span><span class=cF0>)
<a name="l730"></a> </span><span class=cF5>TaskMsg</span><span class=cF0>(task,0,</span><span class=cF3>MSG_KEY_DOWN</span><span class=cF0>,</span><span class=cF3>CH_SPACE</span><span class=cF0>,0,0);
<a name="l731"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l732"></a> }
<a name="l733"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
<a name="l734"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l735"></a> }
<a name="l736"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (msg_code==</span><span class=cF3>MSG_MS_L_D_UP</span><span class=cF0>)
<a name="l737"></a> </span><span class=cF5>TaskMsg</span><span class=cF0>(task,0,</span><span class=cF3>MSG_KEY_DOWN</span><span class=cF0>,</span><span class=cF3>CH_ESC</span><span class=cF0>,0,0);
<a name="l738"></a> }
<a name="l739"></a> </span><span class=cFB>old_ms</span><span class=cF0>.lb=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l740"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l741"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l742"></a> }
<a name="l743"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l744"></a>
<a name="l745"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;task-&gt;win_inhibit,</span><span class=cF3>WIf_SELF_MS_R</span><span class=cF7>)</span><span class=cF0>&amp;&amp;
<a name="l746"></a> </span><span class=cF7>(</span><span class=cF0>!</span><span class=cF5>TaskValidate</span><span class=cF0>(</span><span class=cFB>sys_focus_task</span><span class=cF0>)||
<a name="l747"></a> !</span><span class=cF5>Bt</span><span class=cF0>(&amp;</span><span class=cFB>sys_focus_task</span><span class=cF0>-&gt;win_inhibit,</span><span class=cF3>WIf_FOCUS_TASK_MS_R</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l748"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>old_ms</span><span class=cF0>.rb &amp;&amp; !</span><span class=cFB>ms</span><span class=cF0>.rb) {
<a name="l749"></a> </span><span class=cF1>if</span><span class=cF0> (doc=</span><span class=cF5>WinCursorPosSet</span><span class=cF7>(</span><span class=cF0>task,</span><span class=cFB>ms</span><span class=cF0>.pos.x,</span><span class=cFB>ms</span><span class=cF0>.pos.y,</span><span class=cF3>FALSE</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l750"></a> </span><span class=cF1>do</span><span class=cF0> msg_code=</span><span class=cF5>WinMgrSleep</span><span class=cF0>;
<a name="l751"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0> &amp;&amp; </span><span class=cF7>(</span><span class=cFB>ms</span><span class=cF0>.rb || </span><span class=cFB>ms</span><span class=cF0>.right_dbl_time</span><span class=cF7>)</span><span class=cF0>);
<a name="l752"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>) {
<a name="l753"></a> </span><span class=cF1>if</span><span class=cF0> (msg_code==</span><span class=cF3>MSG_MS_R_UP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l754"></a> </span><span class=cF1>if</span><span class=cF0> (doc-&gt;doc_signature==</span><span class=cF3>DOC_SIGNATURE_VAL</span><span class=cF0>) {
<a name="l755"></a> </span><span class=cF5>DocLock</span><span class=cF0>(doc);
<a name="l756"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l757"></a> </span><span class=cF1>if</span><span class=cF0> (doc-&gt;doc_signature==</span><span class=cF3>DOC_SIGNATURE_VAL</span><span class=cF0>) {
<a name="l758"></a> doc_e=doc-&gt;cur_entry;
<a name="l759"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e!=doc) </span><span class=cF7>{</span><span class=cF0>
<a name="l760"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags&amp;</span><span class=cF7>(</span><span class=cF3>DOCEF_LINK</span><span class=cF0>|
<a name="l761"></a> </span><span class=cF3>DOCEF_RIGHT_CB</span><span class=cF0>|</span><span class=cF3>DOCEF_RIGHT_MACRO</span><span class=cF0>|</span><span class=cF3>DOCEF_RIGHT_EXP</span><span class=cF7>)</span><span class=cF0>)
<a name="l762"></a> </span><span class=cF5>TaskMsg</span><span class=cF0>(task,0,</span><span class=cF3>MSG_KEY_DOWN</span><span class=cF0>,</span><span class=cF6>'\n'</span><span class=cF0>,0,0);
<a name="l763"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l764"></a> }
<a name="l765"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
<a name="l766"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l767"></a> }
<a name="l768"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (msg_code==</span><span class=cF3>MSG_MS_R_D_UP</span><span class=cF0>)
<a name="l769"></a> </span><span class=cF5>TaskMsg</span><span class=cF0>(task,0,</span><span class=cF3>MSG_KEY_DOWN</span><span class=cF0>,</span><span class=cF3>CH_SHIFT_ESC</span><span class=cF0>,0,0);
<a name="l770"></a> }
<a name="l771"></a> </span><span class=cFB>old_ms</span><span class=cF0>.rb=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l772"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l773"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l774"></a> }
<a name="l775"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l776"></a>
<a name="l777"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;task-&gt;win_inhibit,</span><span class=cF3>WIf_SELF_BORDER</span><span class=cF7>)</span><span class=cF0> &amp;&amp; has_border &amp;&amp;
<a name="l778"></a> </span><span class=cF7>(</span><span class=cF0>!</span><span class=cF5>TaskValidate</span><span class=cF0>(</span><span class=cFB>sys_focus_task</span><span class=cF0>)||
<a name="l779"></a> !</span><span class=cF5>Bt</span><span class=cF0>(&amp;</span><span class=cFB>sys_focus_task</span><span class=cF0>-&gt;win_inhibit,</span><span class=cF3>WIf_FOCUS_TASK_BORDER</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l780"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.lb &amp;&amp; !</span><span class=cFB>old_ms</span><span class=cF0>.lb) {
<a name="l781"></a> </span><span class=cF1>if</span><span class=cF0> (task-&gt;win_top==</span><span class=cFB>ms</span><span class=cF0>.pos_text.y+1 &amp;&amp;
<a name="l782"></a> task-&gt;win_left-1&lt;=</span><span class=cFB>ms</span><span class=cF0>.pos_text.x&lt;=task-&gt;win_right+1) </span><span class=cF7>{</span><span class=cF0>
<a name="l783"></a> </span><span class=cF1>if</span><span class=cF0> (task-&gt;win_left&lt;=</span><span class=cFB>ms</span><span class=cF0>.pos_text.x&lt;task-&gt;win_left+4) {
<a name="l784"></a> </span><span class=cFB>old_ms</span><span class=cF0>.lb=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l785"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l786"></a> }
<a name="l787"></a> </span><span class=cF1>if</span><span class=cF0> (task-&gt;win_right-2&lt;=</span><span class=cFB>ms</span><span class=cF0>.pos_text.x&lt;=task-&gt;win_right) {
<a name="l788"></a> </span><span class=cFB>old_ms</span><span class=cF0>.lb=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l789"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l790"></a> }
<a name="l791"></a> x=</span><span class=cFB>ms</span><span class=cF0>.pos_text.x-task-&gt;win_left;
<a name="l792"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.lb) {
<a name="l793"></a> </span><span class=cF5>WinToTop</span><span class=cF0>(task);
<a name="l794"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.lb &amp;&amp; </span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l795"></a> </span><span class=cF5>WinHorz</span><span class=cF0>(</span><span class=cFB>ms</span><span class=cF0>.pos_text.x-x,task-&gt;win_width-1+</span><span class=cFB>ms</span><span class=cF0>.pos_text.x-x,task);
<a name="l796"></a> </span><span class=cF5>WinVert</span><span class=cF0>(</span><span class=cFB>ms</span><span class=cF0>.pos_text.y+1,task-&gt;win_height+</span><span class=cFB>ms</span><span class=cF0>.pos_text.y,task);
<a name="l797"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>;
<a name="l798"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l799"></a> }
<a name="l800"></a> </span><span class=cFB>old_ms</span><span class=cF0>.lb=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l801"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l802"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l803"></a> </span><span class=cF1>if</span><span class=cF0> (task-&gt;win_left==</span><span class=cFB>ms</span><span class=cF0>.pos_text.x+1 &amp;&amp;
<a name="l804"></a> task-&gt;win_top-1&lt;=</span><span class=cFB>ms</span><span class=cF0>.pos_text.y&lt;=task-&gt;win_bottom+1) </span><span class=cF7>{</span><span class=cF0>
<a name="l805"></a> y=</span><span class=cFB>ms</span><span class=cF0>.pos_text.y-task-&gt;win_top;
<a name="l806"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.lb) {
<a name="l807"></a> </span><span class=cF5>WinToTop</span><span class=cF0>(task);
<a name="l808"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.lb &amp;&amp; </span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l809"></a> </span><span class=cF5>WinHorz</span><span class=cF0>(</span><span class=cFB>ms</span><span class=cF0>.pos_text.x+1,task-&gt;win_width+</span><span class=cFB>ms</span><span class=cF0>.pos_text.x,task);
<a name="l810"></a> </span><span class=cF5>WinVert</span><span class=cF0>(</span><span class=cFB>ms</span><span class=cF0>.pos_text.y-y,
<a name="l811"></a> task-&gt;win_height-1+</span><span class=cFB>ms</span><span class=cF0>.pos_text.y-y,task);
<a name="l812"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>;
<a name="l813"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l814"></a> }
<a name="l815"></a> </span><span class=cFB>old_ms</span><span class=cF0>.lb=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l816"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l817"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l818"></a> </span><span class=cF1>if</span><span class=cF0> (task-&gt;win_right+1==</span><span class=cFB>ms</span><span class=cF0>.pos_text.x &amp;&amp;
<a name="l819"></a> task-&gt;win_bottom+1==</span><span class=cFB>ms</span><span class=cF0>.pos_text.y) </span><span class=cF7>{</span><span class=cF0>
<a name="l820"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.lb) {
<a name="l821"></a> </span><span class=cF5>WinToTop</span><span class=cF0>(task);
<a name="l822"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.lb &amp;&amp; </span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l823"></a> </span><span class=cF5>WinHorz</span><span class=cF0>(task-&gt;win_left,</span><span class=cFB>ms</span><span class=cF0>.pos_text.x-1,task);
<a name="l824"></a> </span><span class=cF5>WinVert</span><span class=cF0>(task-&gt;win_top,</span><span class=cFB>ms</span><span class=cF0>.pos_text.y-1,task);
<a name="l825"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>;
<a name="l826"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l827"></a> }
<a name="l828"></a> </span><span class=cFB>old_ms</span><span class=cF0>.lb=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l829"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l830"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l831"></a> </span><span class=cF1>if</span><span class=cF0> (task-&gt;win_bottom==</span><span class=cFB>ms</span><span class=cF0>.pos_text.y-1 &amp;&amp;
<a name="l832"></a> task-&gt;win_left&lt;=</span><span class=cFB>ms</span><span class=cF0>.pos_text.x&lt;=task-&gt;win_right) </span><span class=cF7>{</span><span class=cF0>
<a name="l833"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.lb) {
<a name="l834"></a> </span><span class=cF5>WinToTop</span><span class=cF0>(task);
<a name="l835"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.lb &amp;&amp; </span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l836"></a> </span><span class=cF5>WinVert</span><span class=cF0>(task-&gt;win_top,</span><span class=cFB>ms</span><span class=cF0>.pos_text.y-1,task);
<a name="l837"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>;
<a name="l838"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l839"></a> }
<a name="l840"></a> </span><span class=cFB>old_ms</span><span class=cF0>.lb=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l841"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l842"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l843"></a> </span><span class=cF1>if</span><span class=cF0> (task-&gt;win_right==</span><span class=cFB>ms</span><span class=cF0>.pos_text.x-1 &amp;&amp;
<a name="l844"></a> task-&gt;win_top&lt;=</span><span class=cFB>ms</span><span class=cF0>.pos_text.y&lt;=task-&gt;win_bottom) </span><span class=cF7>{</span><span class=cF0>
<a name="l845"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.lb) {
<a name="l846"></a> </span><span class=cF5>WinToTop</span><span class=cF0>(task);
<a name="l847"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>ms</span><span class=cF0>.lb &amp;&amp; </span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l848"></a> </span><span class=cF5>WinHorz</span><span class=cF0>(task-&gt;win_left,</span><span class=cFB>ms</span><span class=cF0>.pos_text.x-1,task);
<a name="l849"></a> </span><span class=cF5>WinMgrSleep</span><span class=cF0>;
<a name="l850"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l851"></a> }
<a name="l852"></a> </span><span class=cFB>old_ms</span><span class=cF0>.lb=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l853"></a> </span><span class=cF1>goto</span><span class=cF0> wmt_start;
<a name="l854"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l855"></a> }
<a name="l856"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l857"></a> } </span><span class=cF1>catch</span><span class=cF0> {
<a name="l858"></a> </span><span class=cF5>Beep</span><span class=cF0>;
<a name="l859"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;catch_except=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l860"></a> task=</span><span class=cF5>Fs</span><span class=cF0>;
<a name="l861"></a> }
<a name="l862"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l863"></a>}
</span></pre></body>
</html>