Skip to content

Event ListenersCurrentVirtualDesktopChanged Fires Multiple Times #90

@CodeRedPaul

Description

@CodeRedPaul

Hi there

The 'ListenersCurrentVirtualDesktopChanged' listener seems to fire 3 times for any single change of a virtual desktop.

I only discovered this by putting logs into my autohotkey script as simple testing passed, but real world usage became erratic.

I didn't understand the purposes of either your v1 branch - class_VD or your v2 branch v2_port, so I have been using the code downloaded direct from the Alpha branch.

I followed the example and so have been using:

#Include %A_LineFile%\..\VD.ahk
VD.ListenersCurrentVirtualDesktopChanged[(desktopNum_old, currentDesktopNum) {
	...
}

For the moment, I've implemented a workaround by tracking the current desktop in my own script and then only reacting when the currentDesktopNum variable actually changes. This is working for me, however:

  • This put extra workload / maintenance in consuming scripts
  • The listener really ought not to raise multiple events for the same operation

Is this because I'm using the Alpha branch? Is there something else I ought to be doing?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions