Comments (19)
msgbox 1234567 is not reached when i put it in the code. not with pinned window and also not without it.
I am not sure where inside of _activateWindowUnder(excludeHwnd:=-1) to put the code. Could you post the full _activateWindowUnder(excludeHwnd:=-1) function?
from vd.ahk.
My system:
Edition Windows 10 Pro
Version 21H2
Leistung Windows Feature Experience Pack 120.2212.4190.0
from vd.ahk.
just to make sure: "shared on all desktops means" is a synonym for "Show this window on all desktops" or VD.PinWindow()
___
what's the active window you tried it with (notepad.exe?) ? what's the hotkey you tried it with (Numpad2?) ?
___
Is this intended to be like that?
no
press Numpad2 to jump to desktop 2, regardless of which window is active
but if the active window is admin, you need to run ahk as admin, but I don't think admin is the problem since it flashes but doesn't switch
I tried on a clean install of Win10 with the same
Experience: Windows Feature Experience Pack 120.2212.4190.0
and Numpad1,Numpad2,Numpad3 worked
do you have any apps installed ?
from vd.ahk.
thank you for your answer. Maybe I have than something else running which causes this strange behaviour in combination with your script. I have tried it on my working PC. I will go back to work on monday and will try to find out what goes on!
from vd.ahk.
to confirm: "shared on all desktops means" is a synonym for "Show this window on all desktops" or VD.PinWindow()
what i do:
closed all other ahk scripts
downloaded the files from your git
start VD examples
Press Numpad0, Numpad2, Numpad3, Numpad1-> VD.ahk window gets pinned, i can move to desktop 2, 3 and back to 1
Press Numpad0 and Numpad 3 -> VD.ahk window gets unpinned, I cant move to desktop 3. Screen seems to jump shortly there but at the end im am back on desktop 1
same behaviour with edtior window
Info: on startup of script only one desktop opened (the script produces the other ones)
Also tried to changes setting of virtuell desktops in win without any effect.
if i start the CurrentVirtualDesktopChanged RegisterDesktopNotifications.ahk in other examples i get also normal results with pinned windows but stragen one if i do not pinn (example for moving from desktop 1 to 3):
pinned: Tooltipp: "1,3" Deskotps get changed to desktop 3
upinnde: "3,1" I am back to desktop 1
from vd.ahk.
@mmaukii try the update ?
after reading MScholtes/VirtualDesktop#57 (comment)
the desktopBackground is "shared on all desktops", so I'm trying WinActivate desktopBackground before switching
from vd.ahk.
Thanks for your efforts. I downloaded the new version. Unfortunatly did not work. I also found the strange behaviour
start VD examples on Desktop 1
Press Numpad9, Numpad2-> VD.ahk window gets moved to desktop 3 but after pressing Numpad2 I end up on Desktop 3 (where VD.ahk is) and not on desktop 2
from vd.ahk.
I'm out of ideas, try running as admin ?
also try out this branch https://github.com/FuPeiJiang/VD.ahk/tree/debug39
I assume you're using AHK v1
the ToolTips are explained here: #40 (comment)
but that's not what's important, what's important in the branch https://github.com/FuPeiJiang/VD.ahk/tree/debug39 is : Pin and Activate before switching
from vd.ahk.
I'm not able to switch VD when
Microsoft Teams
Chrome_WidgetWin_1
Teams.exe
0x14C20000
0x00000100
is active
I feel a fix is incoming to this issue
because I'm able to reproduce something similar to the issue now
from vd.ahk.
i also had at that time MSTeams active. My Browser is firefox, so it could be connected to MSteams.
from vd.ahk.
@mmaukii download the newest version again ? and run as admin ?
the branch is : class_VD
the commit is : {LShift Down} doesn't work, needs keybd_event
from vd.ahk.
sorry i did not work out. But i found something strange. If i add a msgbox at the end of goToDesktopNum(desktopNum) {
Sleep 25
}
msgbox %desktopNum%
}
And i run this without the focus on the ahk example window i can switch to the desktops. It seems to me, that the desktopswitching is woking (fast jump to the right desktop) but then something automatically moves the focus back to the starting desktop. That does not apply with this "experiment"
from vd.ahk.
No idea what this "if" is doing. I think it get not even called by the code but if I comment it out everything seems to work in the first place:
goToDesktopNum(desktopNum) {
...
; "ahk_class TPUtilWindow ahk_exe HxD.exe" instead of "ahk_class WorkerW ahk_exe explorer.exe"
;if (this._activateWindowUnder(VD_animation_gui_hwnd)==-1) {
; this._activateDesktopBackground()
;}
...
}
from vd.ahk.
@mmaukii
so the fix would be to remove
if (this._activateWindowUnder(VD_animation_gui_hwnd)==-1) {
this._activateDesktopBackground()
}
inside goToDesktopNum ?
but before I do that, can you tell me if the code reaches the line this._activateDesktopBackground()
?
place a msgbox 1234567
inside, and if it appears it reaches there
if (this._activateWindowUnder(VD_animation_gui_hwnd)==-1) {
msgbox 1234567
this._activateDesktopBackground()
}
___
so the function _activateWindowUnder
is bringing you back to the desktop you were at, I need to know which window it is activating
, can you place this inside the function
_activateWindowUnder(excludeHwnd:=-1) {
if (!(OutputVar_MinMax==-1)) { ;not Minimized
; WinActivate % "ahk_id " theHwnd
WinGetTitle winTitle, % "ahk_id " theHwnd
WinGetClass className, % "ahk_id " theHwnd
WinGet processName, ProcessName, % "ahk_id " theHwnd
WinGet winStyle, Style, % "ahk_id " theHwnd
WinGet winExStyle, ExStyle, % "ahk_id " theHwnd
clipText:=winTitle "`n" className "`n" processName "`n" winStyle "`n" winExStyle
Clipboard:=clipText
ToolTip % clipText
Sleep 500
ToolTip
DllCall("SetForegroundWindow","Ptr",theHwnd)
returnValue:=theHwnd
break
}
from vd.ahk.
_activateWindowUnder(excludeHwnd:=-1) {
bak_DetectHiddenWindows:=A_DetectHiddenWindows
DetectHiddenWindows, off
returnValue:=-1
WinGet, outHwndList, List
loop % outHwndList {
theHwnd:=outHwndList%A_Index%
if (theHwnd == excludeHwnd) {
continue
}
if (pView:=this._isValidWindow(theHwnd)) {
WinGet, OutputVar_MinMax, MinMax, % "ahk_id " theHwnd
if (!(OutputVar_MinMax==-1)) { ;not Minimized
; WinActivate % "ahk_id " theHwnd
WinGetTitle winTitle, % "ahk_id " theHwnd
WinGetClass className, % "ahk_id " theHwnd
WinGet processName, ProcessName, % "ahk_id " theHwnd
WinGet winStyle, Style, % "ahk_id " theHwnd
WinGet winExStyle, ExStyle, % "ahk_id " theHwnd
clipText:=winTitle "`n" className "`n" processName "`n" winStyle "`n" winExStyle
Clipboard:=clipText
ToolTip % clipText
Sleep 500
ToolTip
DllCall("SetForegroundWindow","Ptr",theHwnd)
returnValue:=theHwnd
break
}
}
}
DetectHiddenWindows % bak_DetectHiddenWindows
return returnValue
}
from vd.ahk.
with firefox open i get the following tooltip
can not change desktop . Issue '39 . FuPeiJian/VD.ahk-Mozilla Firefox
MozillaWindowClass
0x17CF0000
0x000000100
from vd.ahk.
so firefox was the active window before switching ? or it is the active window in the desktop you're trying to switch to ?
this is weird, because it isn't supposed to be detecting windows inside other virtual desktops
one fix is to filter the windows inside _activateWindowUnder
using _desktopNum_from_Hwnd
what's your AHK version ?
MsgBox % Clipboard:=A_AhkVersion
from vd.ahk.
@mmaukii does this work now ?
download the latest version, not the commit 7c0a466
from vd.ahk.
it seems to work!!!!! thank you a lot. Now i can work happily.
If it is of any concern: ahkversion 1.1.31.00
Thank again for your effort and the great tool!!
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.