View Single Post
Old 10-14-2018, 10:46 AM   #28
Human being with feelings
Join Date: Jul 2009
Posts: 2,355

Originally Posted by _Stevie_ View Post

The problem seems, that Reaper does not differentiate between lower, upper, left or right docker.

But I will give it a shot, when I got a bit more time!
As Breeder noted, "under the hood", REAPER does distinguish between the dockers and they have different window HWNDs, so it should be possible to selectively access them.

Two other useful remarks that I noticed in the other thread:
Originally Posted by Garrick View Post
So as it stands, the only way a dock position is hidden is if it contains no tabs.
Originally Posted by Breeder View Post
and exists even if you don't use it, it's just are called "REAPER_dock", have a look yourself if you don't believe me
So I guess you can find specific dockers in at least two ways:
1) Find all the windows named "REAPER_dock", get their coordinates, and check which are positioned at the edges of the main window.
2) If specific windows (such as Actions) are always docked in specific dockers (such as the left docker), you can instead find the window, then find the REAPER_dock that is its parent.

To hide the docker, you can't destroy the docker itself (or its necessary child windows), but must instead destroy the tabs.

I checked the docker's child windows, and it seems that its frame is named "Custom" something.

The following code seems to work to close the docker under the mouse:

w = reaper.JS_Window_FromPoint(reaper.GetMousePosition())
    if not w then return end
    t = reaper.JS_Window_GetTitle(w, "")
    if t == "REAPER_dock" then goto gotDock end
    w = reaper.JS_Window_GetParent(w)
    goto getParentDock

a = reaper.new_array({}, 100)
reaper.JS_Window_ArrayAllChild(w, a)
tHandles = a.table()
tTitles = {}
for i = 1, #tHandles do
    tHandles[i] = reaper.JS_Window_HandleFromAddress(tHandles[i])
    tTitles[i]  = reaper.JS_Window_GetTitle(tHandles[i], "")
for i = 1, #tHandles do
    if not tTitles[i]:match("Custom") then reaper.JS_Window_Destroy(tHandles[i]) end
* Alternatively, you can probably JS_WindowMessage_Send some WM_COMMAND message to simulate the menu item "Close all windows in dock".

* JS_Window_Show(dockerHWND, "HIDE") can hide the docker and JS_Window_Show(dockerHWND, "SHOW") can show it again, but the track view doesn't expand after hiding the docker, so these functions alone aren't enough.

We will have to experiment some more...

Last edited by juliansader; 10-14-2018 at 12:29 PM.
juliansader is offline   Reply With Quote