Re: [E-devel] Desklock's idle timer....

2007-04-04 Thread The Rasterman
On Wed, 21 Mar 2007 06:00:46 -0500 Ravenlock [EMAIL PROTECTED] babbled:

 On 03/21/2007 04:47, Carsten Haitzler (The Rasterman) wrote:
  On Mon, 19 Mar 2007 00:50:26 -0500 Ravenlock [EMAIL PROTECTED]
  babbled:
  
  Hello,
 
  The desklock's idle timer was apparently broken from the start. 
  Keyboard activity was not considered when determining if the user was 
  active or not.
 
  Here are some patches which fix this.  With these patches a persons 
  keyboard and mouse activity are both taken into consideration when 
  determining if the user is active.
 
  This implementation requires that the XScreensaver extension be present. 
This is the easy fix.  If the powers that be prefer that this 
  functionality *not* depend on the XScreensaver extension, well... then 
  its a bigger problem.
 
  Questions/comments/complaints welcome. :)
  
  actually desklocks idle thing has always been broken. the e_manage though
  uses the xscreensaver events in _e_manager_cb_screensaver_notify() to turn
  on desklock if the screensaver kicks in :)
 
 
 *That* timer still exists.  However, I created a new timer that was 
 separate from that which will allow a user to lock the screen either 
 before or after the X screesaver, or at the same time as some other 
 third party saver.  That timer was not functioning properly.  I am 
 hoping this patch fixes the problem I introduced.

a patch read seems to show that desklock still runs a timer and polls idle time
- e_manager already uses the screensaver event (blank timeout kicked in) to
signal desklock to go. i should remove the idle timer stuff from desklock
anyway as not depending on screensaver really isn't sane as you can't really
necessarily intercept key stroked everywhere on the screen and same for mouse.

 
  -- 
  Regards,
  Ravenlock
 
  
  
 
 
 -- 
 Regards,
 Ravenlock
 
 -
 Take Surveys. Earn Cash. Influence the Future of IT
 Join SourceForge.net's Techsay panel and you'll get the chance to share your
 opinions on IT  business topics through brief surveys-and earn cash
 http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
 ___
 enlightenment-devel mailing list
 enlightenment-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
 


-- 
- Codito, ergo sum - I code, therefore I am --
The Rasterman (Carsten Haitzler)[EMAIL PROTECTED]
裸好多
Tokyo, Japan (東京 日本)

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Desklock's idle timer....

2007-03-21 Thread The Rasterman
On Mon, 19 Mar 2007 00:50:26 -0500 Ravenlock [EMAIL PROTECTED] babbled:

 Hello,
 
 The desklock's idle timer was apparently broken from the start. 
 Keyboard activity was not considered when determining if the user was 
 active or not.
 
 Here are some patches which fix this.  With these patches a persons 
 keyboard and mouse activity are both taken into consideration when 
 determining if the user is active.
 
 This implementation requires that the XScreensaver extension be present. 
   This is the easy fix.  If the powers that be prefer that this 
 functionality *not* depend on the XScreensaver extension, well... then 
 its a bigger problem.
 
 Questions/comments/complaints welcome. :)

actually desklocks idle thing has always been broken. the e_manage though uses
the xscreensaver events in _e_manager_cb_screensaver_notify() to turn on
desklock if the screensaver kicks in :)

 -- 
 Regards,
 Ravenlock
 


-- 
- Codito, ergo sum - I code, therefore I am --
The Rasterman (Carsten Haitzler)[EMAIL PROTECTED]
裸好多
Tokyo, Japan (東京 日本)

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Desklock's idle timer....

2007-03-21 Thread Ravenlock
On 03/21/2007 04:47, Carsten Haitzler (The Rasterman) wrote:
 On Mon, 19 Mar 2007 00:50:26 -0500 Ravenlock [EMAIL PROTECTED] babbled:
 
 Hello,

 The desklock's idle timer was apparently broken from the start. 
 Keyboard activity was not considered when determining if the user was 
 active or not.

 Here are some patches which fix this.  With these patches a persons 
 keyboard and mouse activity are both taken into consideration when 
 determining if the user is active.

 This implementation requires that the XScreensaver extension be present. 
   This is the easy fix.  If the powers that be prefer that this 
 functionality *not* depend on the XScreensaver extension, well... then 
 its a bigger problem.

 Questions/comments/complaints welcome. :)
 
 actually desklocks idle thing has always been broken. the e_manage though uses
 the xscreensaver events in _e_manager_cb_screensaver_notify() to turn on
 desklock if the screensaver kicks in :)


*That* timer still exists.  However, I created a new timer that was 
separate from that which will allow a user to lock the screen either 
before or after the X screesaver, or at the same time as some other 
third party saver.  That timer was not functioning properly.  I am 
hoping this patch fixes the problem I introduced.


 -- 
 Regards,
 Ravenlock

 
 


-- 
Regards,
Ravenlock

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[E-devel] Desklock's idle timer....

2007-03-18 Thread Ravenlock

Hello,

The desklock's idle timer was apparently broken from the start. 
Keyboard activity was not considered when determining if the user was 
active or not.


Here are some patches which fix this.  With these patches a persons 
keyboard and mouse activity are both taken into consideration when 
determining if the user is active.


This implementation requires that the XScreensaver extension be present. 
 This is the easy fix.  If the powers that be prefer that this 
functionality *not* depend on the XScreensaver extension, well... then 
its a bigger problem.


Questions/comments/complaints welcome. :)

--
Regards,
Ravenlock
Index: e17/apps/e/src/bin/e_desklock.c
===
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_desklock.c,v
retrieving revision 1.34
diff -u -r1.34 e_desklock.c
--- e17/apps/e/src/bin/e_desklock.c 11 Mar 2007 05:01:49 -  1.34
+++ e17/apps/e/src/bin/e_desklock.c 19 Mar 2007 05:00:36 -
@@ -794,23 +794,13 @@
 static int 
 _e_desklock_cb_idle_timer(void *data)
 {
-   static double time_of_last_event = 0;
-   static unsigned int xtime_of_last_user_activity = 0;
-
-   if ( ecore_x_current_user_activity_time_get()  xtime_of_last_user_activity 
)
- {
-xtime_of_last_user_activity = ecore_x_current_user_activity_time_get();
-time_of_last_event = ecore_time_get();
- }
-
if (e_config-desklock_autolock_idle)
  {
/* If a desklock is already up, bail */
 if ((_e_custom_desklock_exe) || (edd)) return 1;
 
/* If we have exceeded our idle time... */
-double t = ecore_time_get();
-if (t - time_of_last_event = e_config-desklock_autolock_idle_timeout)
+if (ecore_x_screensaver_idle_time_get() = 
e_config-desklock_autolock_idle_timeout)
  {
 /*
  * Unfortunately, not all desklocks stay up for as long as
Index: e17/libs/ecore/src/lib/ecore_x/Ecore_X.h
===
RCS file: /var/cvs/e/e17/libs/ecore/src/lib/ecore_x/Ecore_X.h,v
retrieving revision 1.184
diff -u -r1.184 Ecore_X.h
--- e17/libs/ecore/src/lib/ecore_x/Ecore_X.h13 Mar 2007 16:29:02 -  
1.184
+++ e17/libs/ecore/src/lib/ecore_x/Ecore_X.h19 Mar 2007 04:57:24 -
@@ -981,7 +981,6 @@
 EAPI void ecore_x_kill(Ecore_X_Window win);
 
 EAPI Ecore_X_Time ecore_x_current_time_get(void);
-EAPI Ecore_X_Time ecore_x_current_user_activity_time_get(void);
 
 EAPI void ecore_x_error_handler_set(void (*func) (void *data), 
const void *data);
 EAPI void ecore_x_io_error_handler_set(void (*func) (void *data), 
const void *data);
@@ -1374,6 +1373,7 @@
 EAPI int ecore_x_xinerama_screen_geometry_get(int screen, int 
*x, int *y, int *w, int *h);
 
 EAPI int ecore_x_screensaver_event_available_get(void);
+EAPI intecore_x_screensaver_idle_time_get(void);
 EAPI voidecore_x_screensaver_set(int timeout, int interval, 
int blank, int expose);
 EAPI voidecore_x_screensaver_timeout_set(double timeout);
 EAPI double  ecore_x_screensaver_timeout_get(void);
Index: e17/libs/ecore/src/lib/ecore_x/ecore_x.c
===
RCS file: /var/cvs/e/e17/libs/ecore/src/lib/ecore_x/ecore_x.c,v
retrieving revision 1.125
diff -u -r1.125 ecore_x.c
--- e17/libs/ecore/src/lib/ecore_x/ecore_x.c9 Mar 2007 01:11:09 -   
1.125
+++ e17/libs/ecore/src/lib/ecore_x/ecore_x.c19 Mar 2007 04:57:25 -
@@ -37,7 +37,6 @@
 Display *_ecore_x_disp = NULL;
 double   _ecore_x_double_click_time = 0.25;
 Time _ecore_x_event_last_time = 0;
-Time _ecore_x_event_last_user_activity_time = 0;
 Window   _ecore_x_event_last_win = 0;
 int  _ecore_x_event_last_root_x = 0;
 int  _ecore_x_event_last_root_y = 0;
@@ -650,16 +649,6 @@
return _ecore_x_event_last_time;
 }
 
-/*
- * Return the last time a *USER* generated an event
- *   Should corespond to key-down, key-up, mouse-down, mouse-up, mouse move
- */
-EAPI Ecore_X_Time
-ecore_x_current_user_activity_time_get()
-{
-   return _ecore_x_event_last_user_activity_time;
-}
-
 static int
 _ecore_x_fd_handler(void *data, Ecore_Fd_Handler *fd_handler __UNUSED__)
 {
Index: e17/libs/ecore/src/lib/ecore_x/ecore_x_events.c
===
RCS file: /var/cvs/e/e17/libs/ecore/src/lib/ecore_x/ecore_x_events.c,v
retrieving revision 1.94
diff -u -r1.94 ecore_x_events.c
--- e17/libs/ecore/src/lib/ecore_x/ecore_x_events.c 13 Feb 2007 16:24:37 
-  1.94
+++ e17/libs/ecore/src/lib/ecore_x/ecore_x_events.c 19 Mar 2007 04:57:26 
-
@@ -228,7 +228,6 @@
e-time = xevent-xkey.time;
e-modifiers = xevent-xkey.state;
_ecore_x_event_last_time = e-time;
-   _ecore_x_event_last_user_activity_time = e-time;
ecore_event_add(ECORE_X_EVENT_KEY_DOWN,