Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Specific border width/color for undecorated active/inactive windows (…

…bug #4889)

The attached patch adds three theme options with backward compatible defaults:

undecorated.border.width
  defaults to border.width

window.undecorated.active.border.color
  defaults to window.active.border.color

window.undecorated.inactive.border.color
  defaults to window.inactive.border.color
  • Loading branch information...
commit fadf435ee1a37cf542be037cc2d7e7649a544581 1 parent e4e7c2b
memeplex authored October 14, 2011 danakj committed October 16, 2011
20  obrender/theme.c
@@ -259,9 +259,13 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
259 259
     READ_INT("border.width", theme->fbwidth, 0, 100, 1);
260 260
     READ_INT("menu.border.width", theme->mbwidth, 0, 100, theme->fbwidth);
261 261
     READ_INT("osd.border.width", theme->obwidth, 0, 100, theme->fbwidth);
  262
+    READ_INT("undecorated.border.width", theme->ubwidth, 0, 100,
  263
+             theme->fbwidth);
262 264
     READ_INT("menu.separator.width", theme->menu_sep_width, 1, 100, 1);
263  
-    READ_INT("menu.separator.padding.width", theme->menu_sep_paddingx, 0, 100, 6);
264  
-    READ_INT("menu.separator.padding.height", theme->menu_sep_paddingy, 0, 100, 3);
  265
+    READ_INT("menu.separator.padding.width", theme->menu_sep_paddingx,
  266
+             0, 100, 6);
  267
+    READ_INT("menu.separator.padding.height", theme->menu_sep_paddingy,
  268
+             0, 100, 3);
265 269
     READ_INT("window.client.padding.width", theme->cbwidthx, 0, 100,
266 270
              theme->paddingx);
267 271
     READ_INT("window.client.padding.height", theme->cbwidthy, 0, 100,
@@ -270,7 +274,11 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
270 274
     /* load colors */
271 275
     READ_COLOR_("window.active.border.color", "border.color",
272 276
                 theme->frame_focused_border_color, RrColorNew(inst, 0, 0, 0));
273  
-
  277
+    /* undecorated focused border color inherits from frame focused border
  278
+       color */
  279
+    READ_COLOR("window.undecorated.active.border.color",
  280
+               theme->frame_undecorated_focused_border_color,
  281
+               RrColorCopy(theme->frame_focused_border_color));
274 282
     /* title separator focused color inherits from focused border color */
275 283
     READ_COLOR("window.active.title.separator.color",
276 284
                theme->title_separator_focused_color,
@@ -281,6 +289,12 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
281 289
                theme->frame_unfocused_border_color,
282 290
                RrColorCopy(theme->frame_focused_border_color));
283 291
 
  292
+    /* undecorated unfocused border color inherits from frame unfocused border
  293
+       color */
  294
+    READ_COLOR("window.undecorated.inactive.border.color",
  295
+               theme->frame_undecorated_unfocused_border_color,
  296
+               RrColorCopy(theme->frame_unfocused_border_color));
  297
+
284 298
     /* title separator unfocused color inherits from unfocused border color */
285 299
     READ_COLOR("window.inactive.title.separator.color",
286 300
                theme->title_separator_unfocused_color,
3  obrender/theme.h
@@ -44,6 +44,7 @@ struct _RrTheme {
44 44
     gint fbwidth; /*!< frame border width */
45 45
     gint mbwidth; /*!< menu border width */
46 46
     gint obwidth; /*!< osd border width */
  47
+    gint ubwidth; /*!< undecorated frame border width */
47 48
     gint cbwidthx;
48 49
     gint cbwidthy;
49 50
     gint menu_overlap_x;
@@ -66,7 +67,9 @@ struct _RrTheme {
66 67
     RrColor *menu_border_color;
67 68
     RrColor *osd_border_color;
68 69
     RrColor *frame_focused_border_color;
  70
+    RrColor *frame_undecorated_focused_border_color;
69 71
     RrColor *frame_unfocused_border_color;
  72
+    RrColor *frame_undecorated_unfocused_border_color;
70 73
     RrColor *title_separator_focused_color;
71 74
     RrColor *title_separator_unfocused_color;
72 75
     RrColor *cb_focused_color;
3  openbox/frame.c
@@ -348,7 +348,8 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
348 348
         self->shaded = self->client->shaded;
349 349
 
350 350
         if (self->decorations & OB_FRAME_DECOR_BORDER)
351  
-            self->bwidth = ob_rr_theme->fbwidth;
  351
+            self->bwidth = self->client->undecorated ?
  352
+                ob_rr_theme->ubwidth : ob_rr_theme->fbwidth;
352 353
         else
353 354
             self->bwidth = 0;
354 355
 
10  openbox/framerender.c
@@ -68,9 +68,13 @@ void framerender_frame(ObFrame *self)
68 68
         XSetWindowBackground(obt_display, self->innerbrb, px);
69 69
         XClearWindow(obt_display, self->innerbrb);
70 70
 
71  
-        px = (self->focused ?
72  
-              RrColorPixel(ob_rr_theme->frame_focused_border_color) :
73  
-              RrColorPixel(ob_rr_theme->frame_unfocused_border_color));
  71
+        px = RrColorPixel(self->focused ?
  72
+            (self->client->undecorated ?
  73
+             ob_rr_theme->frame_undecorated_focused_border_color :
  74
+             ob_rr_theme->frame_focused_border_color) :
  75
+            (self->client->undecorated ?
  76
+             ob_rr_theme->frame_undecorated_unfocused_border_color :
  77
+             ob_rr_theme->frame_unfocused_border_color));
74 78
 
75 79
         XSetWindowBackground(obt_display, self->left, px);
76 80
         XClearWindow(obt_display, self->left);

0 notes on commit fadf435

Please sign in to comment.
Something went wrong with that request. Please try again.