Closed arzoo1 closed 4 years ago
The order in which the plugin receives the first two transition callbacks is random.
I noticed that to get around it, set return false if transitions ttime = 0
Can you elaborate? It seems like ttime is always = 0 and per the documentation, I always return false.
as long you use same layout for display menu and system
start_time <- 0;
fe.add_transition_callback( "hs_transition" );
function hs_transition( ttype, var, ttime )
{
switch ( ttype )
{
case Transition.ToNewList:
if( start_time ){ // newlist transition
}else{ // discard newlist transition when fired at startlayout
return false;
}
break;
}
}
fe.add_ticks_callback( "hs_tick" );
function hs_tick( ttime )
{
start_time=ttime;
}
Hey there, this should be fixed now in the master dev branch. thanks for the report and the description
When AM is configured with
startup_mode = displays_menu
, any plugin using a transition callback will receive two sets of transitions back-to-back; The first will be StartLayout and ToNewList for the last selected item in the displays menu, and the second will be StartLayout and ToNewList for the Displays menu itself. The first set of transition callbacks (for the last selected item) are not needed and should not be triggered.