all repos — openbox @ 8349e4ca6ba679a6a43cd56a282502eacafc580d

openbox fork - make it a bit more like ryudo

add osd border stuff
Dana Jansens danakj@orodu.net
commit

8349e4ca6ba679a6a43cd56a282502eacafc580d

parent

aca8327244e0e1ebc4e367a57339ff2dc944782c

M data/themerc.xsddata/themerc.xsd

@@ -137,6 +137,7 @@ </xs:complexType>

<xs:complexType name="allosd"> <xs:all> + <xs:element name="border" type="obt:color" minOccurs="0"/> <xs:element name="label" type="obt:textarea" minOccurs="0"/> <xs:element name="background" type="obt:area" minOccurs="0"/> <xs:element name="hilight" type="obt:area" minOccurs="0"/>

@@ -157,12 +158,19 @@ <xs:element name="borderwidth" type="xs:integer" minOccurs="0"/>

</xs:all> </xs:complexType> + <xs:complexType name="osdDimensions"> + <xs:all> + <xs:element name="borderwidth" type="xs:integer" minOccurs="0"/> + </xs:all> + </xs:complexType> + <xs:complexType name="themeDimensions"> <xs:all> <xs:element name="padding" type="obt:point" minOccurs="0"/> <xs:element name="handle" type="xs:integer" minOccurs="0"/> <xs:element name="window" type="obt:windowDimensions" minOccurs="0"/> <xs:element name="menu" type="obt:menuDimensions" minOccurs="0"/> + <xs:element name="osd" type="obt:osdDimensions" minOccurs="0"/> </xs:all> </xs:complexType>
M openbox/focus_cycle_popup.copenbox/focus_cycle_popup.c

@@ -112,9 +112,9 @@ RrAppearanceAddTextures(popup.a_bg, 1);

popup.a_bg->texture[0].type = RR_TEXTURE_RGBA; attrib.override_redirect = True; - attrib.border_pixel=RrColorPixel(ob_rr_theme->frame_focused_border_color); + attrib.border_pixel=RrColorPixel(ob_rr_theme->osd_border_color); popup.bg = create_window(RootWindow(ob_display, ob_screen), - ob_rr_theme->fbwidth, + ob_rr_theme->obwidth, CWOverrideRedirect | CWBorderPixel, &attrib); popup.text = create_window(popup.bg, 0, 0, NULL);

@@ -298,9 +298,9 @@ texty = h - texth - b;

/* find the position for the popup (include the outer borders) */ x = screen_area->x + (screen_area->width - - (w + ob_rr_theme->fbwidth * 2)) / 2; + (w + ob_rr_theme->obwidth * 2)) / 2; y = screen_area->y + (screen_area->height - - (h + ob_rr_theme->fbwidth * 2)) / 2; + (h + ob_rr_theme->obwidth * 2)) / 2; /* get the dimensions of the target hilite texture */ rgbax = ml;
M openbox/popup.copenbox/popup.c

@@ -51,9 +51,9 @@ self->text = XCreateWindow(ob_display, self->bg,

0, 0, 1, 1, 0, RrDepth(ob_rr_inst), InputOutput, RrVisual(ob_rr_inst), 0, NULL); - XSetWindowBorderWidth(ob_display, self->bg, ob_rr_theme->fbwidth); + XSetWindowBorderWidth(ob_display, self->bg, ob_rr_theme->obwidth); XSetWindowBorder(ob_display, self->bg, - RrColorPixel(ob_rr_theme->frame_focused_border_color)); + RrColorPixel(ob_rr_theme->osd_border_color)); XMapWindow(ob_display, self->text);

@@ -355,7 +355,7 @@ guint r, c;

gint eachw, eachh; const guint cols = screen_desktop_layout.columns; const guint rows = screen_desktop_layout.rows; - const gint linewidth = ob_rr_theme->fbwidth; + const gint linewidth = ob_rr_theme->obwidth; eachw = (w - ((cols + 1) * linewidth)) / cols; eachh = (h - ((rows + 1) * linewidth)) / rows;

@@ -500,9 +500,9 @@ for (i = self->desks; i < screen_num_desktops; ++i) {

XSetWindowAttributes attr; attr.border_pixel = - RrColorPixel(ob_rr_theme->frame_focused_border_color); + RrColorPixel(ob_rr_theme->osd_border_color); self->wins[i] = XCreateWindow(ob_display, self->popup->bg, - 0, 0, 1, 1, ob_rr_theme->fbwidth, + 0, 0, 1, 1, ob_rr_theme->obwidth, RrDepth(ob_rr_inst), InputOutput, RrVisual(ob_rr_inst), CWBorderPixel, &attr);
M render/theme.crender/theme.c

@@ -213,9 +213,12 @@ &theme->fbwidth, 0, 100))

theme->fbwidth = 1; /* menu border width inherits from frame border width */ - if (!FIND(int, L("dimensions","menu","border"), - &theme->mbwidth, 0, 100)) + if (!FIND(int, L("dimensions","menu","border"), &theme->mbwidth, 0, 100)) theme->mbwidth = theme->fbwidth; + + /* osd border width inherits from frame border width */ + if (!FIND(int, L("dimensions","osd","border"), &theme->obwidth, 0, 100)) + theme->obwidth = theme->fbwidth; if (!FIND(point, L("dimensions","window","clientpadding"), &theme->cbwidthx, &theme->cbwidthy, 0, 100, 0, 100))

@@ -251,9 +254,15 @@ theme->frame_unfocused_border_color->g,

theme->frame_unfocused_border_color->b); /* menu border color inherits from frame focused border color */ - if (!FIND(color, L("menu","border"), - &theme->menu_border_color, NULL)) + if (!FIND(color, L("menu","border"), &theme->menu_border_color, NULL)) theme->menu_border_color = + RrColorNew(inst, + theme->frame_focused_border_color->r, + theme->frame_focused_border_color->g, + theme->frame_focused_border_color->b); + /* osd border color inherits from frame focused border color */ + if (!FIND(color, L("osd","border"), &theme->osd_border_color, NULL)) + theme->osd_border_color = RrColorNew(inst, theme->frame_focused_border_color->r, theme->frame_focused_border_color->g,

@@ -1238,6 +1247,7 @@ if (theme) {

g_free(theme->name); RrColorFree(theme->menu_border_color); + RrColorFree(theme->osd_border_color); RrColorFree(theme->frame_focused_border_color); RrColorFree(theme->frame_unfocused_border_color); RrColorFree(theme->title_separator_focused_color);
M render/theme.hrender/theme.h

@@ -42,6 +42,7 @@ gint paddingy;

gint handle_height; gint fbwidth; /*!< frame border width */ gint mbwidth; /*!< menu border width */ + gint obwidth; /*!< osd border width */ gint cbwidthx; gint cbwidthy; gint menu_overlap;

@@ -58,6 +59,7 @@ gint menu_title_height;

/* style settings - colors */ RrColor *menu_border_color; + RrColor *osd_border_color; RrColor *frame_focused_border_color; RrColor *frame_unfocused_border_color; RrColor *title_separator_focused_color;
M tools/themetoxml/themetoxml.ctools/themetoxml/themetoxml.c

@@ -342,12 +342,16 @@

if (read_int(db, "borderWidth", &i)) { CONT3("dimensions", "window", "border", NUM(i)); CONT3("dimensions", "menu", "border", NUM(i)); + CONT3("dimensions", "osd", "border", NUM(i)); } else if (read_int(db, "border.width", &i)) { CONT3("dimensions", "window", "border", NUM(i)); CONT3("dimensions", "menu", "border", NUM(i)); + CONT3("dimensions", "osd", "border", NUM(i)); } if (read_int(db, "menu.border.width", &i)) CONT3("dimensions", "menu", "border", NUM(i)); + if (read_int(db, "osd.border.width", &i)) + CONT3("dimensions", "osd", "border", NUM(i)); if (read_color(db, "border.color", &i, &j, &k)) { COLOR3("window", "active", "border", i, j, k, 255);