1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-16 00:03:45 +00:00

1. Fixed stability issue with message pump

2. Added Hand mouse icon for some UX components of user-consent and privacy bar
This commit is contained in:
Bryan Roe
2022-04-20 10:28:01 -07:00
parent edff560369
commit 9f4fc50b3c
4 changed files with 28 additions and 71 deletions

View File

@@ -2145,7 +2145,10 @@ void* ILibDuktape_GlobalGenericCallback_Process(int numParms, ...)
#ifdef WIN32
if (windispatch)
{
while (windispatch->finished == 0) { SleepEx(INFINITE, TRUE); }
while (windispatch->finished == 0)
{
if (SleepEx(5000, TRUE) == 0) { break; }
}
retVal = windispatch->retValue;
ILibMemory_Free(windispatch);
ILibMemory_Free(user);

File diff suppressed because one or more lines are too long

View File

@@ -308,7 +308,7 @@ function windows_notifybar_local(title, bar_options)
this._HAND = this._user32.LoadCursorA(0, IDC_HAND);
this._ARROW = this._user32.LoadCursorA(0, IDC_ARROW);
this._addAsyncMethodCall(this._user32.SetClassLongPtrA.async, [h, GCLP_HCURSOR, this._ARROW]).then(function (z) { console.log('SetClassLong: ' + z.Val, z._LastError); });
this._addAsyncMethodCall(this._user32.SetClassLongPtrA.async, [h, GCLP_HCURSOR, this._ARROW]);
this._icon = getScaledImage(x_icon, this.height * 0.75, this.height * 0.75, bar_options);
this._addCreateWindowEx(0, GM.CreateVariable('STATIC', { wide: true }), GM.CreateVariable('X', { wide: true }), WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_BITMAP | SS_CENTERIMAGE | SS_NOTIFY,
@@ -339,17 +339,7 @@ function windows_notifybar_local(title, bar_options)
this.pump._pushpin = c;
this.pump._pinned = true;
this.pump._addAsyncMethodCall(this.pump._user32.SendMessageW.async, [c, STM_SETIMAGE, IMAGE_BITMAP, this.pump._pin1.Deref()]);
c.x = this.pump.height * 0.125;
c.y = this.pump.height * 0.0625;
c.w = this.pump.height * 0.75;
c.h = this.pump.height * 0.75;
var r = GM.CreateVariable(4);
r.increment(4294967284, true);
this.pump._addAsyncMethodCall(this.pump._user32.SetClassLongPtrA.async, [c, GCLP_HCURSOR, this.pump._HAND]).then(function (z) { console.log('SetClassLong: ' + z.Val, z._LastError); });
//this.pump.hookChild(c);
this.pump._addAsyncMethodCall(this.pump._user32.SetClassLongPtrA.async, [c, GCLP_HCURSOR, this.pump._HAND]);
}).parentPromise.pump = this;
this._addCreateWindowEx(0, GM.CreateVariable('STATIC', { wide: true }), GM.CreateVariable(this._title, { wide: true }), WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT | SS_CENTERIMAGE | SS_WORDELLIPSIS,
this.height, // x position
@@ -446,26 +436,6 @@ function windows_notifybar_local(title, bar_options)
}
break;
case WM_MOUSEMOVE:
if (msg.hwnd.Val == this._pushpin.Val)
{
if (this.pushpincursor == null || this.pushpincursor === false)
{
this.pushpincursor = true;
console.log('PUSHPIN!');
var v = GM.CreateVariable(24);
v.toBuffer().writeUInt32LE(24);
v.toBuffer().writeUInt32LE(TME_LEAVE, 4);
this._pushpin.pointerBuffer().copy(v.Deref(8, 8).toBuffer());
this._user32.TrackMouseEvent(v);
//this._addAsyncMethodCall(this._user32.LoadCursorA.async, [0, IDC_HAND]).then(function (cs)
//{
// this.pump._addAsyncMethodCall(this.pump._user32.SetCursor.async, [cs]);
//}).parentPromise.pump = this;
//break;
}
}
if (!this._pinned)
{
if (this._minimized)
@@ -478,29 +448,6 @@ function windows_notifybar_local(title, bar_options)
this._idle = setTimeout(this._idleTimeout.bind(this), 3000);
}
break;
case WM_MOUSELEAVE:
case WM_NCMOUSELEAVE:
console.log('LEAVE!');
this.pushpincursor = false;
this._addAsyncMethodCall(this._user32.LoadCursorA.async, [0, IDC_ARROW]).then(function (cs)
{
this.pump._addAsyncMethodCall(this.pump._user32.SetCursor.async, [cs]);
}).parentPromise.pump = this;
break;
case WM_SETCURSOR:
console.log('SETCURSOR', this._HANDLE.Val == msg.hwnd.Val);
if (this._HANDLE.Val == msg.hwnd.Val)
{
//if(this.pushpincursor === true)
//{
// return (this._HAND);
//}
//else
//{
// return (this._ARROW);
//}
}
break;
}
});
}

File diff suppressed because one or more lines are too long