not passing timestamps sometimes and not others. set event_curtime when client messages provide a timestamp.

This commit is contained in:
Dana Jansens 2007-03-19 17:59:16 +00:00
parent 7db7d62ceb
commit fb3d2033ba
6 changed files with 22 additions and 25 deletions

View file

@ -1149,8 +1149,7 @@ void action_activate(union ActionData *data)
moving on us */
event_halt_focus_delay();
client_activate(data->activate.any.c, data->activate.here, TRUE,
data->activate.any.time);
client_activate(data->activate.any.c, data->activate.here, TRUE);
}
}
@ -1632,8 +1631,7 @@ void action_cycle_windows(union ActionData *data)
focus_cycle(data->cycle.forward, data->cycle.linear, data->any.interactive,
data->cycle.dialog,
data->cycle.inter.final, data->cycle.inter.cancel,
data->cycle.inter.any.time);
data->cycle.inter.final, data->cycle.inter.cancel);
}
void action_directional_focus(union ActionData *data)
@ -1646,8 +1644,7 @@ void action_directional_focus(union ActionData *data)
data->any.interactive,
data->interdiraction.dialog,
data->interdiraction.inter.final,
data->interdiraction.inter.cancel,
data->interdiraction.inter.any.time);
data->interdiraction.inter.cancel);
}
void action_movetoedge(union ActionData *data)

View file

@ -3080,7 +3080,7 @@ static void client_unfocus(ObClient *self)
}
}
void client_activate(ObClient *self, gboolean here, gboolean user, Time time)
void client_activate(ObClient *self, gboolean here, gboolean user)
{
/* XXX do some stuff here if user is false to determine if we really want
to activate it or not (a parent or group member is currently
@ -3088,9 +3088,9 @@ void client_activate(ObClient *self, gboolean here, gboolean user, Time time)
*/
ob_debug("Want to activate window 0x%x with time %u (last time %u), "
"source=%s\n",
self->window, time, client_last_user_time,
self->window, event_curtime, client_last_user_time,
(user ? "user" : "application"));
if (!user && time && time < client_last_user_time)
if (!user && event_curtime && event_curtime < client_last_user_time)
client_hilite(self, TRUE);
else {
if (client_normal(self) && screen_showing_desktop)

View file

@ -504,9 +504,8 @@ gboolean client_focus(ObClient *self);
otherwise, the desktop is changed to where the client lives.
@param user If true, then a user action is what requested the activation;
otherwise, it means an application requested it on its own
@param timestamp The time at which the activate was requested.
*/
void client_activate(ObClient *self, gboolean here, gboolean user, Time time);
void client_activate(ObClient *self, gboolean here, gboolean user);
/*! Calculates the stacking layer for the client window */
void client_calc_layer(ObClient *self);

View file

@ -542,6 +542,7 @@ static void event_handle_root(XEvent *e)
msgtype = e->xclient.message_type;
if (msgtype == prop_atoms.net_current_desktop) {
guint d = e->xclient.data.l[0];
event_curtime = e->xclient.data.l[1];
if (d < screen_num_desktops)
screen_set_desktop(d);
} else if (msgtype == prop_atoms.net_number_of_desktops) {
@ -880,6 +881,7 @@ static void event_handle_client(ObClient *client, XEvent *e)
}
break;
case UnmapNotify:
ob_debug("UnmapNotify for window 0x%x\n", client->window);
if (client->ignore_unmaps) {
client->ignore_unmaps--;
break;
@ -887,6 +889,7 @@ static void event_handle_client(ObClient *client, XEvent *e)
client_unmanage(client);
break;
case DestroyNotify:
ob_debug("DestroyNotify for window 0x%x\n", client->window);
client_unmanage(client);
break;
case ReparentNotify:
@ -913,7 +916,7 @@ static void event_handle_client(ObClient *client, XEvent *e)
it can happen now when the window is on
another desktop, but we still don't
want it! */
client_activate(client, FALSE, TRUE, CurrentTime);
client_activate(client, FALSE, TRUE);
break;
case ClientMessage:
/* validate cuz we query stuff off the client here */
@ -972,11 +975,11 @@ static void event_handle_client(ObClient *client, XEvent *e)
(e->xclient.data.l[0] == 0 ? "unknown" :
(e->xclient.data.l[0] == 1 ? "application" :
(e->xclient.data.l[0] == 2 ? "user" : "INVALID"))));
/* XXX make use of data.l[1] and [2] ! */
/* XXX make use of data.l[2] ! */
event_curtime = e->xclient.data.l[1];
client_activate(client, FALSE,
(e->xclient.data.l[0] == 0 ||
e->xclient.data.l[0] == 2),
e->xclient.data.l[1]);
e->xclient.data.l[0] == 2));
} else if (msgtype == prop_atoms.net_wm_moveresize) {
ob_debug("net_wm_moveresize for 0x%lx direction %d\n",
client->window, e->xclient.data.l[2]);

View file

@ -59,7 +59,7 @@ static void focus_cycle_destructor(ObClient *client, gpointer data)
be used
*/
if (focus_cycle_target == client)
focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, CurrentTime);
focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE);
}
static Window createWindow(Window parent, gulong mask,
@ -180,7 +180,7 @@ void focus_set_client(ObClient *client)
be used.
*/
if (focus_cycle_target)
focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, CurrentTime);
focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE);
old = focus_client;
focus_client = client;
@ -497,7 +497,7 @@ static gboolean valid_focus_target(ObClient *ft)
}
void focus_cycle(gboolean forward, gboolean linear, gboolean interactive,
gboolean dialog, gboolean done, gboolean cancel, Time time)
gboolean dialog, gboolean done, gboolean cancel)
{
static ObClient *first = NULL;
static ObClient *t = NULL;
@ -558,7 +558,7 @@ void focus_cycle(gboolean forward, gboolean linear, gboolean interactive,
done_cycle:
if (done && focus_cycle_target)
client_activate(focus_cycle_target, FALSE, TRUE, time);
client_activate(focus_cycle_target, FALSE, TRUE);
t = NULL;
first = NULL;
@ -575,8 +575,7 @@ done_cycle:
}
void focus_directional_cycle(ObDirection dir, gboolean interactive,
gboolean dialog, gboolean done, gboolean cancel,
Time time)
gboolean dialog, gboolean done, gboolean cancel)
{
static ObClient *first = NULL;
ObClient *ft = NULL;
@ -621,7 +620,7 @@ void focus_directional_cycle(ObDirection dir, gboolean interactive,
done_cycle:
if (done && focus_cycle_target)
client_activate(focus_cycle_target, FALSE, TRUE, time);
client_activate(focus_cycle_target, FALSE, TRUE);
first = NULL;
focus_cycle_target = NULL;

View file

@ -58,10 +58,9 @@ void focus_fallback(gboolean allow_refocus);
/*! Cycle focus amongst windows. */
void focus_cycle(gboolean forward, gboolean linear, gboolean interactive,
gboolean dialog, gboolean done, gboolean cancel, Time time);
gboolean dialog, gboolean done, gboolean cancel);
void focus_directional_cycle(ObDirection dir, gboolean interactive,
gboolean dialog, gboolean done, gboolean cancel,
Time time);
gboolean dialog, gboolean done, gboolean cancel);
void focus_cycle_draw_indicator();
/*! Add a new client into the focus order */