[PATCH] xfree86: after VT switching back, only enable previously enabled devices

Chase Douglas chase.douglas at canonical.com
Thu Apr 12 07:15:47 PDT 2012


On 04/11/2012 11:08 PM, Peter Hutterer wrote:
> If a device was enabled before the VT switch, re-enabled it. Otherwise leave
> it as is, there was probably a reason why it was disabled.
> 
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
> bit of a hack, we could store this in the device struct but this approach is
> sufficient.
> 
> Note that this only affects xfree86 devices, virtual devices (master
> devices) are enabled anyway.
> 
>  hw/xfree86/common/xf86Events.c |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
> index 058057e..c56243e 100644
> --- a/hw/xfree86/common/xf86Events.c
> +++ b/hw/xfree86/common/xf86Events.c
> @@ -415,6 +415,7 @@ xf86VTSwitch(void)
>      static int prevSIGIO;
>      InputInfoPtr pInfo;
>      IHPtr ih;
> +    static char device_was_enabled[MAXDEVICES];

Why static? I'm sure this code likely will never be reenterant, but
usually static is only used when there is a good reason for it, and I
fail to see one here.

-- Chase


More information about the xorg-devel mailing list