Diff

Differences From Artifact [89abcac8c7]:

To Artifact [c44e109a25]:


1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407





1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
    struct gui_data *inst = (struct gui_data *)frontend;

    inst->term_exit_idle_id = gtk_idle_add(idle_exit_func, inst);
}

static gint timer_trigger(gpointer data)
{
    long now = GPOINTER_TO_LONG(data);
    long next;
    long ticks;

    if (run_timers(now, &next)) {





	ticks = next - GETTICKCOUNT();
	timer_id = gtk_timeout_add(ticks > 0 ? ticks : 1, timer_trigger,
				   LONG_TO_GPOINTER(next));
    }

    /*
     * Never let a timer resume. If we need another one, we've
     * asked for it explicitly above.
     */
    return FALSE;
}

void timer_change_notify(long next)
{
    long ticks;

    if (timer_id)
	gtk_timeout_remove(timer_id);

    ticks = next - GETTICKCOUNT();







|
|



>
>
>
>
>
|
|










|







1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
    struct gui_data *inst = (struct gui_data *)frontend;

    inst->term_exit_idle_id = gtk_idle_add(idle_exit_func, inst);
}

static gint timer_trigger(gpointer data)
{
    unsigned long now = GPOINTER_TO_LONG(data);
    unsigned long next, then;
    long ticks;

    if (run_timers(now, &next)) {
	then = now;
	now = GETTICKCOUNT();
	if (now - then > next - then)
	    ticks = 0;
	else
	    ticks = next - now;
	timer_id = gtk_timeout_add(ticks, timer_trigger,
				   LONG_TO_GPOINTER(next));
    }

    /*
     * Never let a timer resume. If we need another one, we've
     * asked for it explicitly above.
     */
    return FALSE;
}

void timer_change_notify(unsigned long next)
{
    long ticks;

    if (timer_id)
	gtk_timeout_remove(timer_id);

    ticks = next - GETTICKCOUNT();