open-src/xserver/xorg/apm-handlers.patch
changeset 705 24ca414edbff
equal deleted inserted replaced
704:f9b973ecc909 705:24ca414edbff
       
     1 From c74220b853cd99d03e33cc62d32431ca3a879483 Mon Sep 17 00:00:00 2001
       
     2 From: Adam Jackson <[email protected]>
       
     3 Date: Mon, 30 Mar 2009 14:56:15 -0400
       
     4 Subject: [PATCH] APM: Use general handlers, not input handlers.
       
     5 
       
     6 Otherwise APM events get treated as input events, which messes up idle
       
     7 time accounting and screensavers and such.  Not, we hope, that anyone
       
     8 is using APM anymore.
       
     9 ---
       
    10  hw/xfree86/os-support/bsd/bsd_apm.c        |    4 ++--
       
    11  hw/xfree86/os-support/bsd/bsd_kqueue_apm.c |    4 ++--
       
    12  hw/xfree86/os-support/linux/lnx_apm.c      |    4 ++--
       
    13  hw/xfree86/os-support/solaris/sun_apm.c    |    4 ++--
       
    14  4 files changed, 8 insertions(+), 8 deletions(-)
       
    15 
       
    16 diff --git a/hw/xfree86/os-support/bsd/bsd_apm.c b/hw/xfree86/os-support/bsd/bsd_apm.c
       
    17 index 43eda74..73c88dc 100644
       
    18 --- a/hw/xfree86/os-support/bsd/bsd_apm.c
       
    19 +++ b/hw/xfree86/os-support/bsd/bsd_apm.c
       
    20 @@ -122,7 +122,7 @@ xf86OSPMOpen(void)
       
    21      }
       
    22      xf86PMGetEventFromOs = bsdPMGetEventFromOS;
       
    23      xf86PMConfirmEventToOs = bsdPMConfirmEventToOs;
       
    24 -    APMihPtr = xf86AddInputHandler(fd, xf86HandlePMEvents, NULL);
       
    25 +    APMihPtr = xf86AddGeneralHandler(fd, xf86HandlePMEvents, NULL);
       
    26      return bsdCloseAPM;
       
    27  }
       
    28  
       
    29 @@ -132,7 +132,7 @@ bsdCloseAPM(void)
       
    30      int fd;
       
    31  
       
    32      if (APMihPtr) {
       
    33 -	fd = xf86RemoveInputHandler(APMihPtr);
       
    34 +	fd = xf86RemoveGeneralHandler(APMihPtr);
       
    35  	close(fd);
       
    36  	APMihPtr = NULL;
       
    37      }
       
    38 diff --git a/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c b/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c
       
    39 index b37070c..053619e 100644
       
    40 --- a/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c
       
    41 +++ b/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c
       
    42 @@ -178,7 +178,7 @@ xf86OSPMOpen(void)
       
    43  
       
    44      xf86PMGetEventFromOs = bsdPMGetEventFromOS;
       
    45      xf86PMConfirmEventToOs = bsdPMConfirmEventToOs;
       
    46 -    APMihPtr = xf86AddInputHandler(kq, xf86HandlePMEvents, NULL);
       
    47 +    APMihPtr = xf86AddGeneralHandler(kq, xf86HandlePMEvents, NULL);
       
    48      return bsdCloseAPM;
       
    49  }
       
    50  
       
    51 @@ -188,7 +188,7 @@ bsdCloseAPM(void)
       
    52      int kq;
       
    53  
       
    54      if (APMihPtr) {
       
    55 -	kq = xf86RemoveInputHandler(APMihPtr);
       
    56 +	kq = xf86RemoveGeneralHandler(APMihPtr);
       
    57  	close(devFd);
       
    58  	devFd = -1;
       
    59  	close(kq);
       
    60 diff --git a/hw/xfree86/os-support/linux/lnx_apm.c b/hw/xfree86/os-support/linux/lnx_apm.c
       
    61 index 16ac80d..8cf318f 100644
       
    62 --- a/hw/xfree86/os-support/linux/lnx_apm.c
       
    63 +++ b/hw/xfree86/os-support/linux/lnx_apm.c
       
    64 @@ -180,7 +180,7 @@ lnxAPMOpen(void)
       
    65  	    close(pfd);
       
    66  	xf86PMGetEventFromOs = lnxPMGetEventFromOs;
       
    67  	xf86PMConfirmEventToOs = lnxPMConfirmEventToOs;
       
    68 -	APMihPtr = xf86AddInputHandler(fd,xf86HandlePMEvents,NULL);
       
    69 +	APMihPtr = xf86AddGeneralHandler(fd, xf86HandlePMEvents, NULL);
       
    70  	xf86MsgVerb(X_INFO,3,"Open APM successful\n");
       
    71  	return lnxCloseAPM;
       
    72      }
       
    73 @@ -197,7 +197,7 @@ lnxCloseAPM(void)
       
    74     ErrorF("APM: Closing device\n");
       
    75  #endif
       
    76      if (APMihPtr) {
       
    77 -	fd = xf86RemoveInputHandler(APMihPtr);
       
    78 +	fd = xf86RemoveGeneralHandler(APMihPtr);
       
    79  	close(fd);
       
    80  	APMihPtr = NULL;
       
    81      }
       
    82 diff --git a/hw/xfree86/os-support/solaris/sun_apm.c b/hw/xfree86/os-support/solaris/sun_apm.c
       
    83 index 7decc90..e128c13 100644
       
    84 --- a/hw/xfree86/os-support/solaris/sun_apm.c
       
    85 +++ b/hw/xfree86/os-support/solaris/sun_apm.c
       
    86 @@ -215,7 +215,7 @@ xf86OSPMOpen(void)
       
    87      }
       
    88      xf86PMGetEventFromOs = sunPMGetEventFromOS;
       
    89      xf86PMConfirmEventToOs = sunPMConfirmEventToOs;
       
    90 -    APMihPtr = xf86AddInputHandler(fd, xf86HandlePMEvents, NULL);
       
    91 +    APMihPtr = xf86AddGeneralHandler(fd, xf86HandlePMEvents, NULL);
       
    92      return sunCloseAPM;
       
    93  }
       
    94  
       
    95 @@ -225,7 +225,7 @@ sunCloseAPM(void)
       
    96      int fd;
       
    97  
       
    98      if (APMihPtr) {
       
    99 -	fd = xf86RemoveInputHandler(APMihPtr);
       
   100 +	fd = xf86RemoveGeneralHandler(APMihPtr);
       
   101  	close(fd);
       
   102  	APMihPtr = NULL;
       
   103      }
       
   104 -- 
       
   105 1.5.6.5
       
   106