SetScroll(x, false) hammers OnPluginWorldOutputResized

Posted by Fiendish on Fri 03 Jan 2020 09:22 PM — 8 posts, 27,704 views.

USA Global Moderator #0
Load this plugin into a blank world and scroll up/down and watch the status bar. [EDIT] On affected systems it counts up very rapidly and shows the window width bouncing back and forth.

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<muclient>
<plugin
   name="Resize_Test"
   author="Fiendish"
   id="aaaaaaaaaaaaaaaaaaaaaaaa"
   language="Lua"
   requires="4.00"
   version="1.0"
   >
</plugin>

<script>
<![CDATA[
for i=1,1000 do
    Note('foo', i)
end

SetScroll(-2, false)

i = 0
function OnPluginWorldOutputResized()
    i = i + 1
    SetStatus(i, "   ", GetInfo(281))
end
]]>
</script>
</muclient>
Amended on Tue 07 Jan 2020 05:30 AM by Fiendish
USA Global Moderator #1
Replacing SetScrollInfo with SetScrollInfo in this one spot appears to fix it (no more transient scrollbar pop-in), though I don't really understand why SetScrollInfo doesn't work right there.

https://github.com/fiendish/mushclient/commit/ef5b905e17a8be598981cbd3e34634e119266d80
Amended on Sat 04 Jan 2020 09:38 AM by Fiendish
USA Global Moderator #2
Quote:
Replacing SetScrollInfo with SetScrollInfo

I mean replacing SetScrollInfo with SetScrollPos, of course
Amended on Sun 05 Jan 2020 03:21 AM by Fiendish
Australia Forum Administrator #3
I wondered about that.
USA Global Moderator #4
After some testing on real Windows, I think it's possible that this only affects Wine, or at least that it doesn't affect the latest version of Windows 10, or at least it definitely affects the latest version of Wine on a macbook running macOS Mojave. But I think it should be patched in MUSHclient anyway to protect Wine users and possibly others. The unpatched behavior makes it functionally impossible to play with a hidden scrollbar on affected systems, because scrolling at all hits the system so hard because the scrollbar appears and disappears hundreds of times per second.

My reason for looking into this is that I implemented the idea in https://www.gammon.com.au/forum/?id=10550&reply=3 with my miniwindow scrollbar module, and it's really nice when it works, but it requires this patch to work with the original bar hidden.
Amended on Tue 07 Jan 2020 06:22 AM by Fiendish
Australia Forum Administrator #5
Didn't I implement your last Git push? Or is this a separate one?
USA Global Moderator #6
Separate. https://github.com/nickgammon/mushclient/pull/52
Australia Forum Administrator #7
Merged now.