COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 09-01-2019, 09:22 AM   #1
Burtan
Human being with feelings
 
Join Date: Jan 2013
Location: Bochum, Germany
Posts: 103
Default TreeView notification bug on linux

Hi,
the notification TVN_SELCHANGED for a treeview on linux with its NMTREEVIEW does not contain a valid hItem (HTREEITEM) on linux so it's impossible to query all data (like iImage and text).
Burtan is offline   Reply With Quote
Old 09-07-2019, 05:50 AM   #2
Burtan
Human being with feelings
 
Join Date: Jan 2013
Location: Bochum, Germany
Posts: 103
Default

I think the bug is in swell-wnd-generic.cpp, it's the same for the mac version.

Code:
void TreeView_SelectItem(HWND hwnd, HTREEITEM item)
{
  treeViewState *tvs = hwnd ? (treeViewState *)hwnd->m_private_data : NULL;
  if (!tvs) return;

  if (tvs->m_sel == item || (item && !tvs->findItem(item,NULL,NULL))) return;

  tvs->m_sel = item;

  static int __rent;
  if (!__rent)
  {
    __rent++;
    NMTREEVIEW nm={{(HWND)hwnd,(UINT_PTR)hwnd->m_id,TVN_SELCHANGED},};
    SendMessage(GetParent(hwnd),WM_NOTIFY,nm.hdr.idFrom,(LPARAM)&nm);
    __rent--;
  }
  tvs->ensureItemVisible(hwnd,tvs->m_sel);
  InvalidateRect(hwnd,NULL,FALSE);
}
The NMTREEVIEW does not contain any information, you could easily add the HTREEITEM though by adding:

Code:
nm.itemNew.hItem = item;
Should I push a pull request? Or what is the best to get this into reaper
Burtan is offline   Reply With Quote
Old 11-24-2019, 01:50 PM   #3
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,721
Default

Make a patch and post it or email it, thanks!
Justin is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:39 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.