]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
pretty brackets
[chaz/openbox] / openbox / client.c
index efd5dbc91717c745232252603d540b97f9241de8..bb0772d722fd24a22987094448557325ccb77496 100644 (file)
@@ -246,7 +246,8 @@ void client_manage(Window window)
     /* check if it has already been unmapped by the time we started mapping
        the grab does a sync so we don't have to here */
     if (XCheckTypedWindowEvent(ob_display, window, DestroyNotify, &e) ||
-        XCheckTypedWindowEvent(ob_display, window, UnmapNotify, &e)) {
+        XCheckTypedWindowEvent(ob_display, window, UnmapNotify, &e))
+    {
         XPutBackEvent(ob_display, &e);
 
         grab_server(FALSE);
@@ -255,7 +256,8 @@ void client_manage(Window window)
 
     /* make sure it isn't an override-redirect window */
     if (!XGetWindowAttributes(ob_display, window, &attrib) ||
-        attrib.override_redirect) {
+        attrib.override_redirect)
+    {
         grab_server(FALSE);
         return; /* don't manage it */
     }
@@ -263,7 +265,8 @@ void client_manage(Window window)
     /* is the window a docking app */
     if ((wmhint = XGetWMHints(ob_display, window))) {
         if ((wmhint->flags & StateHint) &&
-            wmhint->initial_state == WithdrawnState) {
+            wmhint->initial_state == WithdrawnState)
+        {
             dock_add(window, wmhint);
             grab_server(FALSE);
             XFree(wmhint);
@@ -312,7 +315,7 @@ void client_manage(Window window)
     XChangeSaveSet(ob_display, window, SetModeInsert);
 
     /* create the decoration frame for the client window */
-    self->frame = frame_new();
+    self->frame = frame_new(self);
 
     frame_grab_client(self->frame, self);
 
@@ -330,11 +333,11 @@ void client_manage(Window window)
         /* Don't worry, we won't actually both shade and undecorate the
          * window when push comes to shove. */
         if (settings->shade != -1)
-            client_shade(self, settings->shade);
+            client_shade(self, !!settings->shade);
         if (settings->decor != -1)
             client_set_undecorated(self, !settings->decor);
         if (settings->iconic != -1)
-            client_iconify(self, settings->iconic, FALSE);
+            client_iconify(self, !!settings->iconic, FALSE);
         if (settings->skip_pager != -1) {
             self->skip_pager = !!settings->skip_pager;
             client_change_state(self);
@@ -371,15 +374,17 @@ void client_manage(Window window)
 
     /* focus the new window? */
     if (ob_state() != OB_STATE_STARTING &&
-        ((settings && settings->focus == TRUE) ||
-         (!settings && (config_focus_new ||
-                        client_search_focus_parent(self)))) &&
+        /* this means focus=true for window is same as config_focus_new=true */
+        ((config_focus_new || (settings && settings->focus == 1)) ||
+         client_search_focus_parent(self)) &&
+        /* this checks for focus=false for the window */
+        (!settings || settings->focus != 0) &&
         /* note the check against Type_Normal/Dialog, not client_normal(self),
            which would also include other types. in this case we want more
            strict rules for focus */
         (self->type == OB_CLIENT_TYPE_NORMAL ||
          self->type == OB_CLIENT_TYPE_DIALOG))
-    {        
+    {
         activate = TRUE;
 #if 0
         if (self->desktop != screen_desktop) {
@@ -476,7 +481,8 @@ void client_manage(Window window)
     g_hash_table_insert(window_map, &self->window, self);
 
     /* this has to happen after we're in the client_list */
-    screen_update_areas();
+    if (STRUT_EXISTS(self->strut))
+        screen_update_areas();
 
     /* update the list hints */
     client_set_list();
@@ -523,7 +529,8 @@ void client_unmanage(ObClient *self)
 
     /* once the client is out of the list, update the struts to remove it's
        influence */
-    screen_update_areas();
+    if (STRUT_EXISTS(self->strut))
+        screen_update_areas();
 
     for (it = client_destructors; it; it = g_slist_next(it)) {
         Destructor *d = it->data;
@@ -2354,7 +2361,8 @@ static void client_iconify_recursive(ObClient *self,
     if (changed) {
         client_change_state(self);
         client_showhide(self);
-        screen_update_areas();
+        if (STRUT_EXISTS(self->strut))
+            screen_update_areas();
     }
 
     /* iconify all transients */
@@ -2540,7 +2548,8 @@ void client_set_desktop_recursive(ObClient *self,
         /* raise if it was not already on the desktop */
         if (old != DESKTOP_ALL)
             client_raise(self);
-        screen_update_areas();
+        if (STRUT_EXISTS(self->strut))
+            screen_update_areas();
 
         /* add to the new desktop(s) */
         if (config_focus_new)
This page took 0.026378 seconds and 4 git commands to generate.