diff options
author | Alexander Neumann <alexander.neumann@picos-software.com> | 2020-09-02 17:10:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-02 17:10:18 +0200 |
commit | 5e32bf2a2a52a6f0dd87e76cec3a4dc590c8a01d (patch) | |
tree | 5305d48f79d712588c506ee5a92f9932f24f19e6 | |
parent | Bitmap: Use StretchBlt instead of AlphaBlend when it makes sense (diff) | |
parent | add name to authors (diff) | |
download | wireguard-windows-5e32bf2a2a52a6f0dd87e76cec3a4dc590c8a01d.tar.xz wireguard-windows-5e32bf2a2a52a6f0dd87e76cec3a4dc590c8a01d.zip |
Merge pull request #711 from xoviat/bugfix/issue_710
remove treeview condition check
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | treeview.go | 8 |
2 files changed, 2 insertions, 7 deletions
@@ -33,3 +33,4 @@ Shawn Sun <datago@yeah.net> Simon Rozman <simon@rozman.si> Tim Dufrane <tim.dufrane@gmail.com> Vincent Vanackere <vincent.vanackere@gmail.com> +xoviat <xoviat@gmail.com> diff --git a/treeview.go b/treeview.go index 7458e647..1fb412a7 100644 --- a/treeview.go +++ b/treeview.go @@ -572,13 +572,7 @@ func (tv *TreeView) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) u item := tv.handle2Item[nmtvdi.Item.HItem] if nmtvdi.Item.Mask&win.TVIF_TEXT != 0 { - var text string - rc := win.RECT{Left: int32(nmtvdi.Item.HItem)} - if 0 != tv.SendMessage(win.TVM_GETITEMRECT, 0, uintptr(unsafe.Pointer(&rc))) { - // Only retrieve text if the item is visible. Why isn't Windows doing this for us? - text = item.Text() - } - + text := item.Text() utf16 := syscall.StringToUTF16(text) buf := (*[264]uint16)(unsafe.Pointer(nmtvdi.Item.PszText)) max := mini(len(utf16), int(nmtvdi.Item.CchTextMax)) |