]> Dogcows Code - chaz/openbox/blobdiff - engines/openbox/openbox.c
rm the themerc stuff
[chaz/openbox] / engines / openbox / openbox.c
index 06b366168161fc079580d6710aae632d1ecd7506..f9ac31d4c3f2c5a5f5770c8e19d2e0df08884f9d 100644 (file)
@@ -3,7 +3,7 @@
 #include "../../kernel/screen.h"
 #include "../../kernel/extensions.h"
 #include "../../kernel/dispatch.h"
-#include "../../kernel/themerc.h"
+#include "../../kernel/config.h"
 #include "../../kernel/frame.h"
 #include "../../render/render.h"
 #include "../../render/color.h"
@@ -177,7 +177,7 @@ gboolean startup()
     a_unfocused_title = appearance_new(Surface_Planar, 0);
     a_focused_label = appearance_new(Surface_Planar, 1);
     a_unfocused_label = appearance_new(Surface_Planar, 1);
-    a_icon = appearance_new(Surface_Planar, 0);//1);
+    a_icon = appearance_new(Surface_Planar, 0);/*1);*/
     a_focused_handle = appearance_new(Surface_Planar, 0);
     a_unfocused_handle = appearance_new(Surface_Planar, 0);
 
@@ -475,14 +475,14 @@ void frame_adjust_area(ObFrame *self)
                        self->innersize.top + self->innersize.bottom +
                        self->frame.client->area.height));
 
-    /* do this in two steps because clients whose gravity is set to
-       'Static' don't end up getting moved at all with an XMoveResizeWindow */
-    XMoveWindow(ob_display, self->frame.plate,
-               self->innersize.left - self->cbwidth,
-               self->innersize.top - self->cbwidth);
-    XResizeWindow(ob_display, self->frame.plate,
-                 self->frame.client->area.width,
-                 self->frame.client->area.height);
+    /* move and resize the plate */
+    XMoveResizeWindow(ob_display, self->frame.plate,
+                      self->innersize.left - self->cbwidth,
+                      self->innersize.top - self->cbwidth,
+                      self->frame.client->area.width,
+                      self->frame.client->area.height);
+    /* when the client has StaticGravity, it likes to move around. */
+    XMoveWindow(ob_display, self->frame.client->window, 0, 0);
 
     STRUT_SET(self->frame.size,
              self->innersize.left + self->bwidth,
@@ -497,7 +497,7 @@ void frame_adjust_area(ObFrame *self)
                  self->frame.size.top + self->frame.size.bottom);
 
     render(self);
-     
+
     frame_adjust_shape(self);
 }
 
@@ -605,12 +605,18 @@ static void layout_title(ObFrame *self)
     const char *lc;
     int x;
     gboolean n, d, i, l, m ,c;
+    ConfigValue layout;
 
     n = d = i = l = m = c = FALSE;
 
+    if (!config_get("titlebar.layout", Config_String, &layout)) {
+        layout.string = "NDLIMC";
+        config_set("titlebar.layout", Config_String, layout);
+    }
+
     /* figure out whats being shown, and the width of the label */
     self->label_width = self->width - (s_bevel + 1) * 2;
-    for (lc = themerc_titlebar_layout; *lc != '\0'; ++lc) {
+    for (lc = layout.string; *lc != '\0'; ++lc) {
        switch (*lc) {
        case 'N':
            if (!(self->frame.client->decorations & Decor_Icon)) break;
@@ -678,7 +684,7 @@ static void layout_title(ObFrame *self)
     }
 
     x = s_bevel + 1;
-    for (lc = themerc_titlebar_layout; *lc != '\0'; ++lc) {
+    for (lc = layout.string; *lc != '\0'; ++lc) {
        switch (*lc) {
        case 'N':
            if (!n) break;
This page took 0.031323 seconds and 4 git commands to generate.