update it at the end of running actions instead of multiple times (once for
each action)
#include "event.h"
#include "config.h"
#include "client.h"
#include "event.h"
#include "config.h"
#include "client.h"
#include "openbox.h"
#include "debug.h"
#include "openbox.h"
#include "debug.h"
struct _ObClient *client)
{
GSList *it;
struct _ObClient *client)
{
GSList *it;
+ gboolean update_user_time;
/* Don't allow saving the initial state when running things from the
menu */
/* Don't allow saving the initial state when running things from the
menu */
if (x < 0 && y < 0)
screen_pointer_pos(&x, &y);
if (x < 0 && y < 0)
screen_pointer_pos(&x, &y);
+ update_user_time = FALSE;
for (it = acts; it; it = g_slist_next(it)) {
ObActionsData data;
ObActionsAct *act = it->data;
for (it = acts; it; it = g_slist_next(it)) {
ObActionsData data;
ObActionsAct *act = it->data;
if (!act->def->run(&data, act->options)) {
if (actions_act_is_interactive(act))
actions_interactive_end_act();
if (!act->def->run(&data, act->options)) {
if (actions_act_is_interactive(act))
actions_interactive_end_act();
+ if (client && client == focus_client)
+ update_user_time = TRUE;
} else {
/* make sure its interactive if it returned TRUE */
g_assert(act->i_input);
} else {
/* make sure its interactive if it returned TRUE */
g_assert(act->i_input);
+ if (update_user_time)
+ event_update_user_time();
}
gboolean actions_interactive_act_running(void)
}
gboolean actions_interactive_act_running(void)
+
+void event_update_user_time(void)
+{
+ event_last_user_time = event_time();
+}
/*! A time at which an event happened that caused this current event to be
generated. This is a user-provided time and not to be trusted.
Returns CurrentTime if there was no source time provided.
/*! A time at which an event happened that caused this current event to be
generated. This is a user-provided time and not to be trusted.
Returns CurrentTime if there was no source time provided.
Time event_source_time(void);
Time event_source_time(void);
+/*! Update the timestamp for when the user has last used the focused window.
+ This updates the timestamp to the time of the last event, given by
+ event_time().
+*/
+void event_update_user_time(void);
+