mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
relax LinuxVST GUI event loop.
it was spinning at 100Hz.
This commit is contained in:
parent
d98af1785a
commit
2d311979e3
1 changed files with 11 additions and 0 deletions
|
|
@ -348,12 +348,19 @@ void* gui_event_loop (void* ptr)
|
||||||
/*Look at the XEvent queue - if there are any XEvents we need to handle them,
|
/*Look at the XEvent queue - if there are any XEvents we need to handle them,
|
||||||
including passing them to all the plugin (eventProcs) we are currently managing*/
|
including passing them to all the plugin (eventProcs) we are currently managing*/
|
||||||
|
|
||||||
|
bool may_sleep = true;
|
||||||
|
|
||||||
if(LXVST_XDisplay)
|
if(LXVST_XDisplay)
|
||||||
{
|
{
|
||||||
/*See if there are any events in the queue*/
|
/*See if there are any events in the queue*/
|
||||||
|
|
||||||
int num_events = XPending(LXVST_XDisplay);
|
int num_events = XPending(LXVST_XDisplay);
|
||||||
|
|
||||||
|
if (num_events > 0) {
|
||||||
|
// keep dispatching events as fast as possible
|
||||||
|
may_sleep = false;
|
||||||
|
}
|
||||||
|
|
||||||
/*process them if there are any*/
|
/*process them if there are any*/
|
||||||
|
|
||||||
while(num_events)
|
while(num_events)
|
||||||
|
|
@ -464,6 +471,10 @@ again:
|
||||||
|
|
||||||
clock1 = g_get_monotonic_time();
|
clock1 = g_get_monotonic_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (may_sleep && elapsed_time_ms + 1 < LXVST_sched_timer_interval) {
|
||||||
|
Glib::usleep(1000 * (LXVST_sched_timer_interval - elapsed_time_ms - 1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Drop out to here if we set gui_quit to 1 */
|
/*Drop out to here if we set gui_quit to 1 */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue