Comments (12)
note to self: Numpad5 doesn't follow if Desktop 2 has no windows
activate "VD examples", click on it, then activate any other window (I used explorer.exe or chromium edge), then press Numpad2, nothing happens
happens too in win11
from vd.ahk.
现在修好了吗?
谢谢 @huo-feng-ding
from vd.ahk.
现在修好了吗? 谢谢 @huo-feng-ding
刚试了下,在win10下还是不行。 我按的是 小键盘上的2,它还停留在原来的桌面。
from vd.ahk.
cannot reproduce, can you try it on another computer? can you write an autohotkey script to do it? (that I can run on my computer)
What's your A_OSVersion
?
does it work if you replace goToDesktopNum()
with
goToDesktopNum(desktopNum) { ; Lej77 https://github.com/Grabacr07/VirtualDesktop/pull/23#issuecomment-334918711
Gui VD_animation_gui:New, % "-Border -SysMenu +Owner -Caption +HwndVD_animation_gui_hwnd"
IVirtualDesktop := this._GetDesktops_Obj().GetAt(desktopNum)
GetId:=this._vtable(IVirtualDesktop, 4)
VarSetCapacity(GUID_Desktop, 16)
DllCall(GetId, "Ptr", IVirtualDesktop, "Ptr", &GUID_Desktop)
DllCall(this.MoveWindowToDesktop, "Ptr", this.IVirtualDesktopManager, "Ptr", VD_animation_gui_hwnd, "Ptr", &GUID_Desktop)
Gui VD_active_gui:New, % "-Border -SysMenu +Owner -Caption"
Gui VD_active_gui:Show ;you can only Show gui that's in another VD if a gui of same owned/process is already active
Gui VD_animation_gui:Show ;after gui on current desktop owned by current process became active window, Show gui on different desktop owned by current process
; Sleep 100
; Gui VD_animation_gui:Destroy
; Gui VD_active_gui:Destroy
; "ahk_class TPUtilWindow ahk_exe HxD.exe" instead of "ahk_class WorkerW ahk_exe explorer.exe"
; Sleep 50
; if (activeHwnd:=WinExist("A")) {
; if (!this._isValidWindow(activeHwnd)) {
; if (this._activateWindowUnder()==-1) {
; WinActivate % this.explorerDesktopWintitle
; }
; }
; } else {
; if (this._activateWindowUnder()==-1) {
; WinActivate % this.explorerDesktopWintitle
; }
; }
}
? (or simply commenting out WinActivate % this.explorerDesktopWintitle
)
from vd.ahk.
也试一下这个 49766a2 (就更新一下)
win10改成了 "ahk_class Progman ahk_exe explorer.exe"
from vd.ahk.
A_OSVersion 显示的是 10.0.19045
也试一下这个 49766a2 (就更新一下) win10改成了
"ahk_class Progman ahk_exe explorer.exe"
我试了这上,也不行。最后我把代码改成这样就可以了,注释了 Gui VD_animation_gui:Destroy 这一句就可以了
goToDesktopNum(desktopNum) { ; Lej77 https://github.com/Grabacr07/VirtualDesktop/pull/23#issuecomment-334918711
Gui VD_animation_gui:New, % "-Border -SysMenu +Owner -Caption +HwndVD_animation_gui_hwnd"
IVirtualDesktop := this._GetDesktops_Obj().GetAt(desktopNum)
GetId:=this._vtable(IVirtualDesktop, 4)
VarSetCapacity(GUID_Desktop, 16)
DllCall(GetId, "Ptr", IVirtualDesktop, "Ptr", &GUID_Desktop)
DllCall(this.MoveWindowToDesktop, "Ptr", this.IVirtualDesktopManager, "Ptr", VD_animation_gui_hwnd, "Ptr", &GUID_Desktop)
Gui VD_active_gui:New, % "-Border -SysMenu +Owner -Caption"
Gui VD_active_gui:Show ;you can only Show gui that's in another VD if a gui of same owned/process is already active
Gui VD_animation_gui:Show ;after gui on current desktop owned by current process became active window, Show gui on different desktop owned by current process
Sleep 100
; Gui VD_animation_gui:Destroy
Gui VD_active_gui:Destroy
; "ahk_class TPUtilWindow ahk_exe HxD.exe" instead of "ahk_class WorkerW ahk_exe explorer.exe"
Sleep 50
if (activeHwnd:=WinExist("A")) {
if (!this._isValidWindow(activeHwnd)) {
if (this._activateWindowUnder()==-1) {
WinActivate % this.explorerDesktopWintitle
}
}
} else {
if (this._activateWindowUnder()==-1) {
WinActivate % this.explorerDesktopWintitle
}
}
}
from vd.ahk.
把 Sleep 100
加长成 Sleep 500
还发生么?
goToDesktopNum(desktopNum) { ; Lej77 https://github.com/Grabacr07/VirtualDesktop/pull/23#issuecomment-334918711
Gui VD_animation_gui:New, % "-Border -SysMenu +Owner -Caption +HwndVD_animation_gui_hwnd"
IVirtualDesktop := this._GetDesktops_Obj().GetAt(desktopNum)
GetId:=this._vtable(IVirtualDesktop, 4)
VarSetCapacity(GUID_Desktop, 16)
DllCall(GetId, "Ptr", IVirtualDesktop, "Ptr", &GUID_Desktop)
DllCall(this.MoveWindowToDesktop, "Ptr", this.IVirtualDesktopManager, "Ptr", VD_animation_gui_hwnd, "Ptr", &GUID_Desktop)
Gui VD_active_gui:New, % "-Border -SysMenu +Owner -Caption"
Gui VD_active_gui:Show ;you can only Show gui that's in another VD if a gui of same owned/process is already active
Gui VD_animation_gui:Show ;after gui on current desktop owned by current process became active window, Show gui on different desktop owned by current process
Sleep 500
Gui VD_animation_gui:Destroy
Gui VD_active_gui:Destroy
; "ahk_class TPUtilWindow ahk_exe HxD.exe" instead of "ahk_class WorkerW ahk_exe explorer.exe"
Sleep 50
if (activeHwnd:=WinExist("A")) {
if (!this._isValidWindow(activeHwnd)) {
if (this._activateWindowUnder()==-1) {
WinActivate % this.explorerDesktopWintitle
}
}
} else {
if (this._activateWindowUnder()==-1) {
WinActivate % this.explorerDesktopWintitle
}
}
}
if Sleep 500
works, then this should work better:
goToDesktopNum(desktopNum) { ; Lej77 https://github.com/Grabacr07/VirtualDesktop/pull/23#issuecomment-334918711
Gui VD_animation_gui:New, % "-Border -SysMenu +Owner -Caption +HwndVD_animation_gui_hwnd"
IVirtualDesktop := this._GetDesktops_Obj().GetAt(desktopNum)
GetId:=this._vtable(IVirtualDesktop, 4)
VarSetCapacity(GUID_Desktop, 16)
DllCall(GetId, "Ptr", IVirtualDesktop, "Ptr", &GUID_Desktop)
DllCall(this.MoveWindowToDesktop, "Ptr", this.IVirtualDesktopManager, "Ptr", VD_animation_gui_hwnd, "Ptr", &GUID_Desktop)
Gui VD_active_gui:New, % "-Border -SysMenu +Owner -Caption"
Gui VD_active_gui:Show ;you can only Show gui that's in another VD if a gui of same owned/process is already active
Gui VD_animation_gui:Show ;after gui on current desktop owned by current process became active window, Show gui on different desktop owned by current process
Gui VD_active_gui:Destroy
loop 20 {
if (this.getCurrentDesktopNum()==desktopNum) { ; wildest hack ever..
Gui VD_animation_gui:Destroy
; "ahk_class TPUtilWindow ahk_exe HxD.exe" instead of "ahk_class WorkerW ahk_exe explorer.exe"
if (activeHwnd:=WinExist("A")) {
if (!this._isValidWindow(activeHwnd)) {
if (this._activateWindowUnder()==-1) {
WinActivate % "ahk_class Progman ahk_exe explorer.exe"
}
}
} else {
if (this._activateWindowUnder()==-1) {
WinActivate % "ahk_class Progman ahk_exe explorer.exe"
}
}
break
}
Sleep 25
}
}
from vd.ahk.
上边的两个代码试了,都不行。
试了第一个时间加长了, 出现的情况是先切到桌面2,过一小会儿自动回到桌面1了。 还是因为Gui VD_animation_gui:Destroy之后,自动回到了桌面1
from vd.ahk.
出现的情况是先切到桌面2,过一小会儿自动回到桌面1了
wow, this is useful information, I will try to _activateWindowUnder(), then destroy it
___
try the newest update ?
also what's your A_AhkVersion
? (I know this shouldn't matter, but I'm out of ideas)
from vd.ahk.
谢谢,此问题已解决。我用的autohotkey版本 v1版本是 v1.1.36.02 ; v2版本是 2.0.2
from vd.ahk.
终于!
from vd.ahk.
to reproduce the bug,
upon pressing # (Win Key) twice, I go back to the virtual desktop I was on (and I was on vscode)
from vd.ahk.
Related Issues (20)
- After pinning with AH2 version, I get an error when switching desktops by number.
- Script sending "Q" to discord | Desktop switch failure. HOT 2
- getDesktopNumOfWindow sometimes returns -1 rather than the correct num HOT 4
- Error HOT 10
- open Application directly on one virtual desktop in background HOT 2
- "Error: (0x80004002) No such interface supported" after updating Windows 11 (Beta insider channel) HOT 13
- sending keypress to specified virtual desktop only.
- Ah2: Desktop Looping & Switching + Other Feature Regression from Commit ee2f54f626914273f00853306c1daaf803f756cb HOT 2
- It doesn't work on Windows 11 Build 22621.2215 (22H2) HOT 2
- A problem with the new Windows update 11 HOT 18
- Virtual desktop Tasksbar icons HOT 4
- renaming desktops HOT 1
- Switching to Relative Desktop fails initially HOT 2
- Current desktop count is always zero
- New Windows Build 23606: VD.getCurrentDesktopNum() always returns 0 HOT 4
- Windows Server 2022 version HOT 3
- It doesn't work on Windows 11 Build 22631.3085 (23H2) HOT 13
- v2_port分支没有 TogglePinApp,PinApp,UnPinApp HOT 2
- WinExist in another virtual desktop HOT 7
- Previous Desktop HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vd.ahk.