Git Product home page Git Product logo

Comments (19)

mmaukii avatar mmaukii commented on July 27, 2024 1

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.

mmaukii avatar mmaukii commented on July 27, 2024

My system:
Edition Windows 10 Pro
Version 21H2
Leistung Windows Feature Experience Pack 120.2212.4190.0

from vd.ahk.

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024

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.

mmaukii avatar mmaukii commented on July 27, 2024

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.

mmaukii avatar mmaukii commented on July 27, 2024

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.

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024

@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.

mmaukii avatar mmaukii commented on July 27, 2024

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.

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024

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.

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024

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.

mmaukii avatar mmaukii commented on July 27, 2024

i also had at that time MSTeams active. My Browser is firefox, so it could be connected to MSteams.

from vd.ahk.

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024

@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.

mmaukii avatar mmaukii commented on July 27, 2024

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.

mmaukii avatar mmaukii commented on July 27, 2024

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.

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024

@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.

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024
    _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.

mmaukii avatar mmaukii commented on July 27, 2024

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.

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024

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.

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024

@mmaukii does this work now ?
download the latest version, not the commit 7c0a466

from vd.ahk.

mmaukii avatar mmaukii commented on July 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.