]> Dogcows Code - chaz/openbox/commitdiff
not passing timestamps sometimes and not others. set event_curtime when client messag...
authorDana Jansens <danakj@orodu.net>
Mon, 19 Mar 2007 17:59:16 +0000 (17:59 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 19 Mar 2007 17:59:16 +0000 (17:59 +0000)
openbox/action.c
openbox/client.c
openbox/client.h
openbox/event.c
openbox/focus.c
openbox/focus.h

index 73524ae4e0019af4cecabf7a0a5e73d3cb42fdf1..e89502f09b568573b4395e053e6bad415ac7148b 100644 (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)
index 7c29f9f2fbb352494fa3bc7722e37c5f8e1fed92..e09aff53430915b6a4c1a443fd8723b3bbf4619d 100644 (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)
index c3c4c8f2fb8b8305af3f2b003d3950f89f9b1f1d..5a1e165283cd0e5369ca4ad25cded1597b6bf229 100644 (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);
index d4d921efd229cb34d94af6b23cfcaaf9db8a4513..effa166a0d5198fab6217bf117e4ae8459e20ee2 100644 (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]);
index f06a077e27eea72e55e58df7fe1c149a99f0803b..6652c5deb069b750cb819a96eb0d0eac298f5d70 100644 (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;
index e1d6a6c4e1f4e6c9fca970635cd90f4c6465aadf..1366cd08869e0971ae1c22c4abbcdc7d7b15dd29 100644 (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 */
This page took 0.043118 seconds and 4 git commands to generate.