]> Dogcows Code - chaz/openbox/commitdiff
make ob_state a function so it cant be changed outside of openbox.c
authorDana Jansens <danakj@orodu.net>
Thu, 10 Jul 2003 19:06:00 +0000 (19:06 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 10 Jul 2003 19:06:00 +0000 (19:06 +0000)
openbox/client.c
openbox/dock.c
openbox/event.c
openbox/focus.c
openbox/frame.c
openbox/openbox.c
openbox/openbox.h
openbox/screen.c
openbox/stacking.c
plugins/placement/history.c
plugins/placement/placement.c

index 644198a77393c785137760a10da6398a777f4937..339c2a18515d9860a197da9d910d279fd5344c56 100644 (file)
@@ -256,7 +256,7 @@ void client_manage(Window window)
     focus_order_add_new(self);
 
     /* focus the new window? */
-    if (ob_state != OB_STATE_STARTING && config_focus_new &&
+    if (ob_state() != OB_STATE_STARTING && config_focus_new &&
         (self->type == OB_CLIENT_TYPE_NORMAL || self->type == OB_CLIENT_TYPE_DIALOG)) {
         gboolean group_foc = FALSE;
         
@@ -405,7 +405,7 @@ void client_unmanage(ObClient *self)
     frame_release_client(self->frame, self);
     self->frame = NULL;
      
-    if (ob_state != OB_STATE_EXITING) {
+    if (ob_state() != OB_STATE_EXITING) {
        /* these values should not be persisted across a window
           unmapping/mapping */
        prop_erase(self->window, prop_atoms.net_wm_desktop);
@@ -1125,7 +1125,7 @@ void client_update_wmhints(ObClient *self)
 
        /* only do this when first managing the window *AND* when we aren't
            starting up! */
-       if (ob_state != OB_STATE_STARTING && self->frame == NULL)
+       if (ob_state() != OB_STATE_STARTING && self->frame == NULL)
             if (hints->flags & StateHint)
                 self->iconic = hints->initial_state == IconicState;
 
index 5d110353fcd84cf3807d09c5fc5faa4937edfad9..5f7585daa1ecc47c7147502774bd22eb1eb671d9 100644 (file)
@@ -93,7 +93,7 @@ void dock_add(Window win, XWMHints *wmhints)
       member set the root window, and one set to the client, but both get
       handled and need to be ignored.
     */
-    if (ob_state == OB_STATE_STARTING)
+    if (ob_state() == OB_STATE_STARTING)
        app->ignore_unmaps += 2;
 
     if (app->win != app->icon_win) {
index d80f755c11212fca6420ecbbcbda987dc204c738..6d74a27d2eb15f4f923667080d0463615cf410a2 100644 (file)
@@ -650,7 +650,7 @@ static void event_handle_client(ObClient *client, XEvent *e)
        break;
     case EnterNotify:
         if (client_normal(client)) {
-            if (ob_state == OB_STATE_STARTING) {
+            if (ob_state() == OB_STATE_STARTING) {
                 /* move it to the top of the focus order */
                 guint desktop = client->desktop;
                 if (desktop == DESKTOP_ALL) desktop = screen_desktop;
index 6177bc9a68455946c1557cd0a9ba42572cc6cd8f..0285f40d0a2cae5439d8f0d3ed09e60877a84f2d 100644 (file)
@@ -94,7 +94,7 @@ void focus_set_client(ObClient *client)
         push_to_top(client);
 
     /* set the NET_ACTIVE_WINDOW hint, but preserve it on shutdown */
-    if (ob_state != OB_STATE_EXITING) {
+    if (ob_state() != OB_STATE_EXITING) {
         active = client ? client->window : None;
         PROP_SET32(RootWindow(ob_display, ob_screen),
                    net_active_window, window, active);
index 82e7f90b12dcb68aa9c6366e5c86ba3b91d05e99..5efc869a5909100101dca56e1374d3ef5bd8737b 100644 (file)
@@ -349,7 +349,7 @@ void frame_grab_client(ObFrame *self, ObClient *client)
       member set the root window, and one set to the client, but both get
       handled and need to be ignored.
     */
-    if (ob_state == OB_STATE_STARTING)
+    if (ob_state() == OB_STATE_STARTING)
        client->ignore_unmaps += 2;
 
     /* select the event mask on the client's parent (to receive config/map
index 65669652f8dc4d3339438d616265c558f4f59b90..747f384063eb7771a06f93f7f2446f8c6e30b255 100644 (file)
@@ -59,10 +59,10 @@ RrInstance *ob_rr_inst;
 RrTheme    *ob_rr_theme;
 Display    *ob_display;
 gint        ob_screen;
-ObState     ob_state;
 Cursor      ob_cursors[OB_NUM_CURSORS];
 KeyCode     ob_keys[OB_NUM_KEYS];
 
+static ObState   state;
 static gboolean  sync;
 static gboolean  shutdown;
 static gboolean  restart;
@@ -91,7 +91,7 @@ int main(int argc, char **argv)
     xmlDocPtr doc;
     xmlNodePtr node;
 
-    ob_state = OB_STATE_STARTING;
+    state = OB_STATE_STARTING;
 
     /* initialize the locale */
     if (!setlocale(LC_ALL, ""))
@@ -256,10 +256,10 @@ int main(int argc, char **argv)
        /* get all the existing windows */
        client_manage_all();
 
-       ob_state = OB_STATE_RUNNING;
+       state = OB_STATE_RUNNING;
        while (!shutdown)
            event_loop();
-       ob_state = OB_STATE_EXITING;
+       state = OB_STATE_EXITING;
 
         dock_remove_all();
        client_unmanage_all();
@@ -612,3 +612,8 @@ KeyCode ob_keycode(ObKey key)
     g_assert(key < OB_NUM_KEYS);
     return ob_keys[key];
 }
+
+ObState ob_state()
+{
+    return state;
+}
index 93ee4813c89ae2744ceab7ffd099026fa127ff7b..73f84364ea6feb7586c06f8742749efa7c6df843 100644 (file)
@@ -28,7 +28,7 @@ SnDisplay *ob_sn_display;
 extern gint     ob_screen;
 
 /* The state of execution of the window manager */
-extern ObState ob_state;
+ObState ob_state();
 
 void ob_restart_other(const gchar *path);
 void ob_restart();
index 67863d17dfded474f33af7c078a0d67f7e68e25f..4b25a03565fd5d35d338cf3e25b3905d473ca3ff 100644 (file)
@@ -257,7 +257,7 @@ void screen_resize()
     PROP_SETA32(RootWindow(ob_display, ob_screen),
                 net_desktop_geometry, cardinal, geometry, 2);
 
-    if (ob_state == OB_STATE_STARTING)
+    if (ob_state() == OB_STATE_STARTING)
        return;
 
     dock_configure();
index 5b9b37b2958134e1a4d7dace6c466cc3206c1346..bab7b765e5a8efffe09af0c642e2bcb319698bd2 100644 (file)
@@ -18,7 +18,7 @@ void stacking_set_list()
     /* on shutdown, don't update the properties, so that we can read it back
        in on startup and re-stack the windows as they were before we shut down
     */
-    if (ob_state == OB_STATE_EXITING) return;
+    if (ob_state() == OB_STATE_EXITING) return;
 
     /* create an array of the window ids (from bottom to top,
        reverse order!) */
index 22dbb6e0e30649d1f32b506fec6e216015baee56..eeff1f63f39a976cf2b143e2a7dfe5fe20647a39 100644 (file)
@@ -58,7 +58,7 @@ gboolean place_history(ObClient *c)
 
     if (hi && !(hi->flags & PLACED)) {
         hi->flags |= PLACED;
-        if (ob_state != OB_STATE_STARTING) {
+        if (ob_state() != OB_STATE_STARTING) {
             if (hi->flags & HAVE_POSITION ||
                 hi->flags & HAVE_SIZE) {
                 if (hi->flags & HAVE_POSITION) {
index a84c41ec4fc0b294874f7fe3b34bb95c673c4937..599d58a99c12a1d4e2296e4dcb8c5ef823d608c5 100644 (file)
@@ -30,7 +30,7 @@ static void place_random(ObClient *c)
     int x, y;
     Rect *area;
 
-    if (ob_state == OB_STATE_STARTING) return;
+    if (ob_state() == OB_STATE_STARTING) return;
 
     area = screen_area_monitor(c->desktop,
                                g_random_int_range(0, screen_num_monitors));
This page took 0.045087 seconds and 4 git commands to generate.