]> Dogcows Code - chaz/openbox/blobdiff - openbox/event.c
add support for _NET_WM_USER_TIME_WINDOW. round 1 ! ding.
[chaz/openbox] / openbox / event.c
index a4090b0c4d5a210d5cd0dd9b1b194e8803de2511..3b318b01fc7b622987515c44fa50758912253fa0 100644 (file)
@@ -81,7 +81,7 @@ static gboolean event_handle_menu(XEvent *e);
 static void event_handle_dock(ObDock *s, XEvent *e);
 static void event_handle_dockapp(ObDockApp *app, XEvent *e);
 static void event_handle_client(ObClient *c, XEvent *e);
-static void event_handle_group(ObGroup *g, XEvent *e);
+static void event_handle_user_time_window_client(ObClient *c, XEvent *e);
 static void event_handle_user_input(ObClient *client, XEvent *e);
 
 static void focus_delay_dest(gpointer data);
@@ -406,11 +406,11 @@ static gboolean event_ignore(XEvent *e, ObClient *client)
 static void event_process(const XEvent *ec, gpointer data)
 {
     Window window;
-    ObGroup *group = NULL;
     ObClient *client = NULL;
     ObDock *dock = NULL;
     ObDockApp *dockapp = NULL;
     ObWindow *obwin = NULL;
+    ObClient *timewinclient = NULL;
     XEvent ee, *e;
     ObEventData *ed = data;
 
@@ -419,8 +419,9 @@ static void event_process(const XEvent *ec, gpointer data)
     e = ⅇ
 
     window = event_get_window(e);
-    if (!(e->type == PropertyNotify &&
-          (group = g_hash_table_lookup(group_map, &window))))
+    if (e->type != PropertyNotify ||
+        !(timewinclient =
+          g_hash_table_lookup(client_user_time_window_map, &window)))
         if ((obwin = g_hash_table_lookup(window_map, &window))) {
             switch (obwin->type) {
             case Window_Dock:
@@ -554,8 +555,8 @@ static void event_process(const XEvent *ec, gpointer data)
             /* focus_set_client has already been called for sure */
             client_calc_layer(client);
         }
-    } else if (group)
-        event_handle_group(group, e);
+    } else if (timewinclient)
+        event_handle_user_time_window_client(timewinclient, e);
     else if (client)
         event_handle_client(client, e);
     else if (dockapp)
@@ -662,16 +663,6 @@ static void event_handle_root(XEvent *e)
     }
 }
 
-static void event_handle_group(ObGroup *group, XEvent *e)
-{
-    GSList *it;
-
-    g_assert(e->type == PropertyNotify);
-
-    for (it = group->members; it; it = g_slist_next(it))
-        event_handle_client(it->data, e);
-}
-
 void event_enter_client(ObClient *client)
 {
     g_assert(config_focus_follow);
@@ -699,6 +690,13 @@ void event_enter_client(ObClient *client)
     }
 }
 
+static void event_handle_user_time_window_client(ObClient *client, XEvent *e)
+{
+    g_assert(e->type == PropertyNotify);
+    if (e->xproperty.atom == prop_atoms.net_wm_user_time)
+        client_update_user_time(client);
+}
+
 static void event_handle_client(ObClient *client, XEvent *e)
 {
     XEvent ce;
@@ -1191,6 +1189,9 @@ static void event_handle_client(ObClient *client, XEvent *e)
         else if (msgtype == prop_atoms.net_wm_user_time) {
             client_update_user_time(client);
         }
+        else if (msgtype == prop_atoms.net_wm_user_time_window) {
+            client_update_user_time_window(client);
+        }
 #ifdef SYNC
         else if (msgtype == prop_atoms.net_wm_sync_request_counter) {
             client_update_sync_request_counter(client);
This page took 0.026822 seconds and 4 git commands to generate.