Applied Ravenlock's screensaver patches.

SVN revision: 28345
This commit is contained in:
Christopher Michael 2007-02-13 16:24:37 +00:00
parent 418bcfd1d6
commit 6b044dfb13
5 changed files with 28 additions and 1 deletions

View File

@ -981,6 +981,7 @@ EAPI void ecore_x_killall(Ecore_X_Window root);
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);

View File

@ -37,6 +37,7 @@ static int _ecore_x_grab_count = 0;
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;
@ -51,7 +52,7 @@ EAPI Ecore_X_Atom ECORE_X_ATOM_TEXT = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_UTF8_STRING = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_COMPOUND_TEXT = 0;
Ecore_X_Atom _ecore_x_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_NUM];
Ecore_X_Atom _ecore_x_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_NUM];
/*
* GNOME hints.
@ -648,6 +649,16 @@ ecore_x_current_time_get(void)
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__)
{

View File

@ -228,6 +228,7 @@ _ecore_x_event_handle_key_press(XEvent *xevent)
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, e, _ecore_x_event_free_key_down, NULL);
}
@ -279,6 +280,7 @@ _ecore_x_event_handle_key_release(XEvent *xevent)
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_UP, e, _ecore_x_event_free_key_up, NULL);
}
@ -332,6 +334,7 @@ _ecore_x_event_handle_button_press(XEvent *xevent)
e->event_win = xevent->xbutton.window;
e->time = xevent->xbutton.time;
_ecore_x_event_last_time = e->time;
_ecore_x_event_last_user_activity_time = e->time;
_ecore_x_event_last_win = e->win;
_ecore_x_event_last_root_x = e->root.x;
_ecore_x_event_last_root_y = e->root.y;
@ -376,6 +379,7 @@ _ecore_x_event_handle_button_press(XEvent *xevent)
e->event_win = xevent->xbutton.window;
e->time = xevent->xbutton.time;
_ecore_x_event_last_time = e->time;
_ecore_x_event_last_user_activity_time = e->time;
_ecore_x_event_last_win = e->win;
_ecore_x_event_last_root_x = e->root.x;
_ecore_x_event_last_root_y = e->root.y;
@ -431,6 +435,7 @@ _ecore_x_event_handle_button_press(XEvent *xevent)
if (!e->double_click && !e->triple_click)
_ecore_x_mouse_up_count = 0;
_ecore_x_event_last_time = e->time;
_ecore_x_event_last_user_activity_time = e->time;
_ecore_x_event_last_win = e->win;
_ecore_x_event_last_root_x = e->root.x;
_ecore_x_event_last_root_y = e->root.y;
@ -497,6 +502,7 @@ _ecore_x_event_handle_button_release(XEvent *xevent)
e->event_win = xevent->xbutton.window;
e->time = xevent->xbutton.time;
_ecore_x_event_last_time = e->time;
_ecore_x_event_last_user_activity_time = e->time;
_ecore_x_event_last_win = e->win;
_ecore_x_event_last_root_x = e->root.x;
_ecore_x_event_last_root_y = e->root.y;
@ -538,6 +544,7 @@ _ecore_x_event_handle_button_release(XEvent *xevent)
e->triple_click = 1;
}
_ecore_x_event_last_time = e->time;
_ecore_x_event_last_user_activity_time = e->time;
_ecore_x_event_last_win = e->win;
_ecore_x_event_last_root_x = e->root.x;
_ecore_x_event_last_root_y = e->root.y;
@ -563,6 +570,7 @@ _ecore_x_event_handle_motion_notify(XEvent *xevent)
e->event_win = xevent->xmotion.window;
e->time = xevent->xmotion.time;
_ecore_x_event_last_time = e->time;
_ecore_x_event_last_user_activity_time = e->time;
_ecore_x_event_last_win = e->win;
_ecore_x_event_last_root_x = e->root.x;
_ecore_x_event_last_root_y = e->root.y;

View File

@ -146,6 +146,7 @@ typedef struct _Ecore_X_DND_Target
extern Display *_ecore_x_disp;
extern double _ecore_x_double_click_time;
extern Time _ecore_x_event_last_time;
extern Time _ecore_x_event_last_user_activity_time;
extern Window _ecore_x_event_last_win;
extern int _ecore_x_event_last_root_x;
extern int _ecore_x_event_last_root_y;

View File

@ -18,6 +18,12 @@ ecore_x_screensaver_event_available_get(void)
return 0;
}
EAPI void
ecore_x_screensaver_set(int timeout, int interval, int blank, int expose)
{
XSetScreenSaver(_ecore_x_disp, timeout, interval, blank, expose);
}
EAPI void
ecore_x_screensaver_timeout_set(double timeout)
{