imawizard / MiguruWM

A tiling window manager for Windows
BSD 2-Clause "Simplified" License
39 stars 3 forks source link

Minor issue with unpin functionality #8

Closed micoro closed 1 year ago

micoro commented 1 year ago

Minor issue with the unpin code.

I have written the following function to toggle the pinned status

#t::{
        if mwm.VD.IsWindowPinned(WinExist("A")) = true {
    TrayTip("Miguru","UnPinned",16)
    SetTimer HideTrayTip, -1000
    view := mwm.VD.viewCollection.GetViewForHwnd(WinExist("A"))
    mwm.VD.pinnedApps.UnpinView(view)
    } else {
    view := mwm.VD.viewCollection.GetViewForHwnd(WinExist("A"))
    mwm.VD.pinnedApps.PinView(view)
    TrayTip("Miguru","Pinned",16)
    SetTimer HideTrayTip, -1000
    }
}

but when unpinning there was an error: image

It was easily solved by deleting one line inside:

MiguruWM/lib/vd/interfaces/IVirtualDesktopPinnedApps.ahk

The Unpin function is now:

UnpinView(view) {
        this._funcs["UnpinView"](
            "Ptr", view,
            "HRESULT",
        )
    }