The focus_cycle is now in obclient
authorBenoit Gschwind <doth.gschwind@gmail.com>
Fri, 22 Feb 2008 21:36:52 +0000 (22:36 +0100)
committerBenoit Gschwind <doth.gschwind@gmail.com>
Fri, 22 Feb 2008 21:36:52 +0000 (22:36 +0100)
engines/default/plugin.c
openbox/client.c
openbox/event.c
openbox/focus_cycle.c
openbox/focus_cycle.h
openbox/openbox.c
openbox/screen.c

index faf308207158c9518f961b8480ea9d092b42c8bf..26d00ef4eccf5d2c77927c7bd7806d26c8f8af12 100644 (file)
@@ -1082,11 +1082,6 @@ void frame_update_layout(gpointer _self, Rect area, gboolean is_resize, gboolean
             OBT_PROP_SETA32(self->client->w_client, KDE_NET_WM_FRAME_STRUT,
                     CARDINAL, vals, 4);
         }
-
-        /* if this occurs while we are focus cycling, the indicator needs to
-         match the changes */
-        if (plugin.focus_cycle_target == self->client)
-            focus_cycle_draw_indicator(self->client);
     }
     if (is_resize && (self->decorations & OB_FRAME_DECOR_TITLEBAR))
         XResizeWindow(obp_display, self->label, self->label_width,
index 03ce9cc681a5a17ec4a1452bd0a4438e7f1de986..10f33615f9ed6f8e35500ca3b3ae5e0334fbba9f 100644 (file)
@@ -31,6 +31,7 @@
 #include "grab.h"
 #include "prompt.h"
 #include "focus.h"
+#include "focus_cycle.h"
 #include "stacking.h"
 #include "openbox.h"
 #include "group.h"
@@ -663,6 +664,10 @@ ObClient *client_fake_manage(Window window)
     frame_engine->frame_set_decorations (self->frame, self->decorations);
     frame_engine->frame_update_title (self->frame, self->title);
     frame_engine->frame_update_layout (self->frame, self->area, FALSE, FALSE);
+    /* if this occurs while we are focus cycling, the indicator needs to
+     match the changes */
+    if (focus_cycle_target == self)
+        focus_cycle_draw_indicator(self);
     frame_engine->frame_update_skin (self->frame);
 
     Strut size;
@@ -2482,7 +2487,13 @@ static void client_change_state(ObClient *self)
     OBT_PROP_SETA32(self->w_client, NET_WM_STATE, ATOM, netstate, num);
 
     if (self->frame)
+    {
         frame_engine->frame_update_layout (self->frame, self->area, FALSE, FALSE);
+        /* if this occurs while we are focus cycling, the indicator needs to
+         match the changes */
+        if (focus_cycle_target == self)
+            focus_cycle_draw_indicator(self);
+    }
 }
 
 ObClient *client_search_focus_tree(ObClient *self)
@@ -2825,6 +2836,10 @@ static void client_apply_startup_state(ObClient *self,
     self->area = oldarea;
     frame_engine->frame_set_decorations (self->frame, self->decorations);
     frame_engine->frame_update_layout (self->frame, self->area, FALSE, FALSE);
+    /* if this occurs while we are focus cycling, the indicator needs to
+     match the changes */
+    if (focus_cycle_target == self)
+        focus_cycle_draw_indicator(self);
     client_configure(self, x, y, w, h, FALSE, TRUE, FALSE);
 
     /* set the desktop hint, to make sure that it always exists */
@@ -3116,6 +3131,10 @@ void client_configure(ObClient *self, gint x, gint y, gint w, gint h,
     if (send_resize_client && (w > oldw || h > oldh)) {
         frame_engine->frame_set_decorations (self->frame, self->decorations);
         frame_engine->frame_update_layout (self->frame, self->area, FALSE, FALSE);
+        /* if this occurs while we are focus cycling, the indicator needs to
+         match the changes */
+        if (focus_cycle_target == self)
+            focus_cycle_draw_indicator(self);
     }
 
     /* find the frame's dimensions and move/resize it */
@@ -3141,6 +3160,10 @@ void client_configure(ObClient *self, gint x, gint y, gint w, gint h,
 
         frame_engine->frame_set_decorations (self->frame, self->decorations);
         frame_engine->frame_update_layout (self->frame, self->area, TRUE, FALSE);
+        /* if this occurs while we are focus cycling, the indicator needs to
+         match the changes */
+        if (focus_cycle_target == self)
+            focus_cycle_draw_indicator(self);
 
         if (!user)
             event_end_ignore_all_enters(ignore_start);
@@ -3206,6 +3229,10 @@ void client_configure(ObClient *self, gint x, gint y, gint w, gint h,
     if (send_resize_client && (w <= oldw || h <= oldh)) {
       frame_engine->frame_set_decorations (self->frame, self->decorations);
       frame_engine->frame_update_layout (self->frame, self->area, FALSE, FALSE);
+      /* if this occurs while we are focus cycling, the indicator needs to
+       match the changes */
+      if (focus_cycle_target == self)
+          focus_cycle_draw_indicator(self);
     }
 
     XFlush(obt_display);
@@ -3427,6 +3454,10 @@ void client_shade(ObClient *self, gboolean shade)
     /* resize the frame to just the titlebar */
     frame_engine->frame_set_is_shaded (self->frame, self->shaded);
     frame_engine->frame_update_layout(self->frame, self->area, FALSE, FALSE);
+    /* if this occurs while we are focus cycling, the indicator needs to
+     match the changes */
+    if (focus_cycle_target == self)
+        focus_cycle_draw_indicator(self);
 }
 
 static void client_ping_event(ObClient *self, gboolean dead)
@@ -3580,6 +3611,10 @@ static void client_set_desktop_recursive(ObClient *self,
         /* the frame can display the current desktop state */
         frame_engine->frame_set_decorations (self->frame, self->decorations);
         frame_engine->frame_update_layout(self->frame, self->area, FALSE, FALSE);
+        /* if this occurs while we are focus cycling, the indicator needs to
+         match the changes */
+        if (focus_cycle_target == self)
+            focus_cycle_draw_indicator(self);
         /* 'move' the window to the new desktop */
         if (!donthide)
             client_hide(self);
@@ -4536,6 +4571,10 @@ void client_show_frame(ObClient * self)
 {
     frame_engine->frame_set_is_visible(self->frame, TRUE);
     frame_engine->frame_update_layout(self->frame, self->area, FALSE, FALSE);
+    /* if this occurs while we are focus cycling, the indicator needs to
+     match the changes */
+    if (focus_cycle_target == self)
+        focus_cycle_draw_indicator(self);
     frame_engine->frame_update_skin(self->frame);
     /* Grab the server to make sure that the frame window is mapped before
      the client gets its MapNotify, i.e. to make sure the client is
index a9f526b2ef75f28d3c134316f47825aed963b537..980141dee5c9f49f72db5433d41aa1e81f8d46f1 100644 (file)
@@ -529,6 +529,10 @@ static void event_process(const XEvent *ec, gpointer data)
                window with RevertToParent focus */
             frame_engine->frame_set_is_focus(client->frame, FALSE);
             frame_engine->frame_update_layout (client->frame, client->area, FALSE, FALSE);
+            /* if this occurs while we are focus cycling, the indicator needs to
+             match the changes */
+            if (focus_cycle_target == client)
+                focus_cycle_draw_indicator(client);
             frame_engine->frame_update_skin(client->frame);
             /* focus_set_client(NULL) has already been called */
         }
@@ -594,6 +598,10 @@ static void event_process(const XEvent *ec, gpointer data)
             focus_left_screen = FALSE;
             frame_engine->frame_set_is_focus(client->frame, TRUE);
             frame_engine->frame_update_layout (client->frame, client->area, FALSE, FALSE);
+            /* if this occurs while we are focus cycling, the indicator needs to
+             match the changes */
+            if (focus_cycle_target == client)
+                focus_cycle_draw_indicator(client);
             frame_engine->frame_update_skin (client->frame);
             focus_set_client(client);
             client_calc_layer(client);
@@ -641,6 +649,10 @@ static void event_process(const XEvent *ec, gpointer data)
         if (client && client != focus_client) {
           frame_engine->frame_set_is_focus(client->frame, FALSE);
           frame_engine->frame_update_layout (client->frame, client->area, FALSE, FALSE);
+          /* if this occurs while we are focus cycling, the indicator needs to
+           match the changes */
+          if (focus_cycle_target == client)
+              focus_cycle_draw_indicator(client);
           frame_engine->frame_update_skin(client->frame);
             /* focus_set_client(NULL) has already been called in this
                section or by focus_fallback */
index f2146e7b07204e9f1ca1ade283b5107caf34cdfe..35f46f2592030c73cd543ed036362b3391442a5b 100644 (file)
@@ -29,7 +29,7 @@
 #include <X11/Xlib.h>
 #include <glib.h>
 
-//ObClient       *focus_cycle_target = NULL;
+ObClient       *focus_cycle_target = NULL;
 static gboolean focus_cycle_iconic_windows;
 static gboolean focus_cycle_all_desktops;
 static gboolean focus_cycle_dock_windows;
index 97ac8467f83943decaf5b697c880392538a63812..c31abc81f47abe8165030342703c28e95604e2d2 100644 (file)
@@ -29,7 +29,7 @@
 struct _ObClient;
 
 /*! The client which appears focused during a focus cycle operation */
-//extern struct _ObClient *focus_cycle_target;
+extern struct _ObClient *focus_cycle_target;
 
 void focus_cycle_startup(gboolean reconfig);
 void focus_cycle_shutdown(gboolean reconfig);
index d1bb0f478ba200a56abc58b6191862dd368da70d..3bbb96874814ed7bedb86919550fe60381c63dad 100644 (file)
@@ -338,6 +338,10 @@ gint main(gint argc, gchar **argv)
                     client_setup_decor_and_functions(c, FALSE);
                     /* redraw the frames */
                     frame_engine->frame_update_layout (c->frame, c->area, FALSE, FALSE);
+                    /* if this occurs while we are focus cycling, the indicator needs to
+                     match the changes */
+                    if (focus_cycle_target == c)
+                        focus_cycle_draw_indicator(c);
                     /* the decor sizes may have changed, so the windows may
                        end up in new positions */
                     client_reconfigure(c, FALSE);
index 617923b038a94e15b606ae0cb0cc5be0ff87322e..64421e17be1aae1bf0fc4ee93ae5cbc2748656ce 100644 (file)
@@ -30,6 +30,7 @@
 #include "engine_interface.h"
 #include "event.h"
 #include "focus.h"
+#include "focus_cycle.h"
 #include "popup.h"
 #include "render/render.h"
 #include "gettext.h"
@@ -573,6 +574,10 @@ static void screen_fallback_focus(void)
                server FocusIn event */
         frame_engine->frame_set_is_focus (c->frame, TRUE);
         frame_engine->frame_update_layout (c->frame, c->area, FALSE, FALSE);
+        /* if this occurs while we are focus cycling, the indicator needs to
+         match the changes */
+        if (focus_cycle_target == c)
+            focus_cycle_draw_indicator(c);
         frame_engine->frame_update_skin (c->frame);
             /* do this here so that if you switch desktops to a window with
                helper windows then the helper windows won't flash */
@@ -1230,6 +1235,10 @@ void screen_show_desktop(gboolean show, ObClient *show_only)
                    server FocusIn event */
         frame_engine->frame_set_is_focus(c->frame, TRUE);
         frame_engine->frame_update_layout (c->frame, c->area, FALSE, FALSE);
+        /* if this occurs while we are focus cycling, the indicator needs to
+         match the changes */
+        if (focus_cycle_target == c)
+            focus_cycle_draw_indicator(c);
         frame_engine->frame_update_skin (c->frame);
             }
         }