[PATCH] Solaris: Avoid switching to inactive VT's

Alan Coopersmith Alan.Coopersmith at Sun.COM
Tue Dec 15 10:21:28 PST 2009


Tiago Vignatti wrote:
>> diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
>> index 8cd765a..8e6a15b 100644
>> --- a/hw/xfree86/common/xf86Events.c
>> +++ b/hw/xfree86/common/xf86Events.c
>> @@ -202,8 +202,16 @@ xf86ProcessActionEvent(ActionEvent action, void *arg)
>>  	    vtno--;
>>  #endif
>>  #if defined(sun)
>> -	    if (vtno == xf86Info.vtno)
>> +	    if (vtno == xf86Info.vtno) {
>>  		break;
>> +	    } else {
>> +		struct vt_stat state;
>> +		if (ioctl(xf86Info.consoleFd, VT_GETSTATE, &state) < 0)
>> +			break;
>> +
>> +		if ((state.v_state & (1 << vtno)) == 0)
>> +			break;
>> +	    }
> 
> bonus points if we could hide this OS code on os-support directories instead.

That section of xf86Events.c is already full of OS-specific code - replacing
that all with calls to a new function in the os-support dirs may be worthwhile,
but is separate from this bug fix.

-- 
	-Alan Coopersmith-           alan.coopersmith at sun.com
	 Sun Microsystems, Inc. - X Window System Engineering



More information about the xorg-devel mailing list