]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
really fix focus_last?
[chaz/openbox] / openbox / client.c
index ccd30787ed6a7c6b50b0112e9f9b3f8f4186d299..d4759bb9495d5118def64d29d899b50cfcc300f8 100644 (file)
@@ -204,8 +204,6 @@ void client_manage_all()
     XFree(children);
 }
 
-/* This should possibly do something more interesting than just match
- * against WM_CLASS literally. */
 static ObAppSettings *get_settings(ObClient *client)
 {
     GSList *a = config_per_app_settings;
@@ -214,7 +212,7 @@ static ObAppSettings *get_settings(ObClient *client)
         ObAppSettings *app = (ObAppSettings *) a->data;
         
         if (
-            (app->name && && !app->class && !strcmp(app->name, client->name))
+            (app->name && !app->class && !strcmp(app->name, client->name))
             || (app->class && !app->name && !strcmp(app->class, client->class))
             || (app->class && app->name && !strcmp(app->class, client->class)
                 && !strcmp(app->name, client->name))
@@ -343,14 +341,14 @@ void client_manage(Window window)
         }
 
         /* 1 && -1 shouldn't be possible by the code in config.c */
-        if (settings->max_vert == 1 && self->max_horz == 1)
+        if (settings->max_vert == 1 && settings->max_horz == 1)
             client_maximize(self, TRUE, 0, TRUE);
-        else if (settings->max_vert == 0 && self->max_horz == 0)
+        else if (settings->max_vert == 0 && settings->max_horz == 0)
             client_maximize(self, FALSE, 0, TRUE);
-        else if (settings->max_vert == 1 && self->max_horz == 0) {
+        else if (settings->max_vert == 1 && settings->max_horz == 0) {
             client_maximize(self, TRUE, 2, TRUE);
             client_maximize(self, FALSE, 1, TRUE);
-        } else if (settings->max_vert == 0 && self->max_horz == 1) {
+        } else if (settings->max_vert == 0 && settings->max_horz == 1) {
             client_maximize(self, TRUE, 1, TRUE);
             client_maximize(self, FALSE, 2, TRUE);
         }
@@ -1236,7 +1234,7 @@ void client_update_normal_hints(ObClient *self)
         if (size.flags & PBaseSize)
             SIZE_SET(self->base_size, size.base_width, size.base_height);
     
-        if (size.flags & PResizeInc)
+        if (size.flags & PResizeInc && size.width_inc && size.height_inc)
             SIZE_SET(self->size_inc, size.width_inc, size.height_inc);
     }
 }
@@ -1246,7 +1244,7 @@ void client_setup_decor_and_functions(ObClient *self)
     /* start with everything (cept fullscreen) */
     self->decorations =
         (OB_FRAME_DECOR_TITLEBAR |
-         (ob_rr_theme->show_handle ? OB_FRAME_DECOR_HANDLE : 0) |
+         OB_FRAME_DECOR_HANDLE |
          OB_FRAME_DECOR_GRIPS |
          OB_FRAME_DECOR_BORDER |
          OB_FRAME_DECOR_ICON |
@@ -2035,35 +2033,16 @@ void client_configure_full(ObClient *self, ObCorner anchor,
 
     /* set the size and position if fullscreen */
     if (self->fullscreen) {
-#ifdef VIDMODE
-        gint dot;
-        XF86VidModeModeLine mode;
-#endif
         Rect *a;
         guint i;
 
         i = client_monitor(self);
         a = screen_physical_area_monitor(i);
 
-#ifdef VIDMODE
-        if (i == 0 && /* primary head */
-            extensions_vidmode &&
-            XF86VidModeGetViewPort(ob_display, ob_screen, &x, &y) &&
-            /* get the mode last so the mode.privsize isnt freed incorrectly */
-            XF86VidModeGetModeLine(ob_display, ob_screen, &dot, &mode)) {
-            x += a->x;
-            y += a->y;
-            w = mode.hdisplay;
-            h = mode.vdisplay;
-            if (mode.privsize) XFree(mode.private);
-        } else
-#endif
-        {
-            x = a->x;
-            y = a->y;
-            w = a->width;
-            h = a->height;
-        }
+        x = a->x;
+        y = a->y;
+        w = a->width;
+        h = a->height;
 
         user = FALSE; /* ignore that increment etc shit when in fullscreen */
     } else {
@@ -2347,12 +2326,6 @@ static void client_iconify_recursive(ObClient *self,
             focus_order_remove(self);
             focus_order_add_new(self);
 
-            /* this is here cuz with the VIDMODE extension, the viewport can
-               change while a fullscreen window is iconic, and when it
-               uniconifies, it would be nice if it did so to the new position
-               of the viewport */
-            client_reconfigure(self);
-
             changed = TRUE;
         }
     }
@@ -2860,13 +2833,15 @@ gboolean client_focus(ObClient *self)
     return TRUE;
 }
 
+/* Used when the current client is closed, focus_last will then prevent
+ * focus from going to the mouse pointer */
 void client_unfocus(ObClient *self)
 {
     if (focus_client == self) {
 #ifdef DEBUG_FOCUS
         ob_debug("client_unfocus for %lx\n", self->window);
 #endif
-        focus_fallback(OB_FOCUS_FALLBACK_UNFOCUSING);
+        focus_fallback(OB_FOCUS_FALLBACK_CLOSED);
     }
 }
 
This page took 0.023565 seconds and 4 git commands to generate.