when a window cant be resized, its handle is not removed but its grips are.
change allowing the user to disable individual decorations as that is overkill,
instead allow a toggle through the client.decorate boolean.
if (!c) return;
- c->disabled_decorations = c->disabled_decorations ? 0 : ~0;
+ c->decorate = !c->decorate;
client_setup_decor_and_functions(c);
}
self->layer = -1;
self->urgent = FALSE;
self->positioned = FALSE;
- self->disabled_decorations = 0;
+ self->decorate = TRUE;
self->group = NULL;
self->nicons = 0;
void client_setup_decor_and_functions(ObClient *self)
{
/* start with everything (cept fullscreen) */
- self->decorations = Decor_Titlebar | Decor_Handle | Decor_Border |
- Decor_Icon | Decor_AllDesktops | Decor_Iconify | Decor_Maximize |
- Decor_Shade;
- self->functions = OB_CLIENT_FUNC_RESIZE | OB_CLIENT_FUNC_MOVE |
- OB_CLIENT_FUNC_ICONIFY | OB_CLIENT_FUNC_MAXIMIZE |
- OB_CLIENT_FUNC_SHADE;
+ self->decorations = (OB_FRAME_DECOR_TITLEBAR |
+ OB_FRAME_DECOR_HANDLE |
+ OB_FRAME_DECOR_GRIPS |
+ OB_FRAME_DECOR_BORDER |
+ OB_FRAME_DECOR_ICON |
+ OB_FRAME_DECOR_ALLDESKTOPS |
+ OB_FRAME_DECOR_ICONIFY |
+ OB_FRAME_DECOR_MAXIMIZE |
+ OB_FRAME_DECOR_SHADE);
+ self->functions = (OB_CLIENT_FUNC_RESIZE |
+ OB_CLIENT_FUNC_MOVE |
+ OB_CLIENT_FUNC_ICONIFY |
+ OB_CLIENT_FUNC_MAXIMIZE |
+ OB_CLIENT_FUNC_SHADE);
if (self->delete_window) {
- self->decorations |= Decor_Close;
self->functions |= OB_CLIENT_FUNC_CLOSE;
+ self->decorations |= OB_FRAME_DECOR_CLOSE;
}
if (!(self->min_size.width < self->max_size.width ||
- self->min_size.height < self->max_size.height)) {
- self->decorations &= ~(Decor_Maximize | Decor_Handle);
+ self->min_size.height < self->max_size.height))
self->functions &= ~OB_CLIENT_FUNC_RESIZE;
- }
switch (self->type) {
case OB_CLIENT_TYPE_NORMAL:
case OB_CLIENT_TYPE_DIALOG:
case OB_CLIENT_TYPE_UTILITY:
/* these windows cannot be maximized */
- self->decorations &= ~Decor_Maximize;
self->functions &= ~OB_CLIENT_FUNC_MAXIMIZE;
break;
case OB_CLIENT_TYPE_MENU:
case OB_CLIENT_TYPE_TOOLBAR:
/* these windows get less functionality */
- self->decorations &= ~(Decor_Iconify | Decor_Handle);
self->functions &= ~(OB_CLIENT_FUNC_ICONIFY | OB_CLIENT_FUNC_RESIZE);
break;
decor and functionality */
if (self->mwmhints.flags & OB_MWM_FLAG_DECORATIONS) {
if (! (self->mwmhints.decorations & OB_MWM_DECOR_ALL)) {
- if (! (self->mwmhints.decorations & OB_MWM_DECOR_BORDER))
- self->decorations &= ~Decor_Border;
- if (! (self->mwmhints.decorations & OB_MWM_DECOR_HANDLE))
- self->decorations &= ~Decor_Handle;
- if (! (self->mwmhints.decorations & OB_MWM_DECOR_TITLE))
- self->decorations &= ~Decor_Titlebar;
- if (! (self->mwmhints.decorations & OB_MWM_DECOR_ICONIFY))
- self->decorations &= ~Decor_Iconify;
- if (! (self->mwmhints.decorations & OB_MWM_DECOR_MAXIMIZE))
- self->decorations &= ~Decor_Maximize;
+ if (! ((self->mwmhints.decorations & OB_MWM_DECOR_HANDLE) ||
+ (self->mwmhints.decorations & OB_MWM_DECOR_TITLE)))
+ /* if the mwm hints request no handle or title, then all
+ decorations are disabled */
+ self->decorations = 0;
}
}
self->functions &= ~OB_CLIENT_FUNC_RESIZE;
if (! (self->mwmhints.functions & OB_MWM_FUNC_MOVE))
self->functions &= ~OB_CLIENT_FUNC_MOVE;
+ /* dont let mwm hints kill any buttons
if (! (self->mwmhints.functions & OB_MWM_FUNC_ICONIFY))
self->functions &= ~OB_CLIENT_FUNC_ICONIFY;
if (! (self->mwmhints.functions & OB_MWM_FUNC_MAXIMIZE))
self->functions &= ~OB_CLIENT_FUNC_MAXIMIZE;
+ */
/* dont let mwm hints kill the close button
if (! (self->mwmhints.functions & MwmFunc_Close))
- self->functions &= ~Func_Close; */
+ self->functions &= ~OB_CLIENT_FUNC_CLOSE; */
}
}
+ if (!(self->functions & OB_CLIENT_FUNC_SHADE))
+ self->decorations &= ~OB_FRAME_DECOR_SHADE;
+ if (!(self->functions & OB_CLIENT_FUNC_ICONIFY))
+ self->decorations &= ~OB_FRAME_DECOR_ICONIFY;
+ if (!(self->functions & OB_CLIENT_FUNC_RESIZE))
+ self->decorations &= ~OB_FRAME_DECOR_GRIPS;
+
/* can't maximize without moving/resizing */
- if (!((self->functions & OB_CLIENT_FUNC_MOVE) &&
- (self->functions & OB_CLIENT_FUNC_RESIZE)))
- self->functions &= ~(OB_CLIENT_FUNC_MAXIMIZE |
- OB_CLIENT_FUNC_FULLSCREEN);
-
- /* finally, user specified disabled decorations are applied to subtract
- decorations */
- if (self->disabled_decorations & Decor_Titlebar)
- self->decorations &= ~Decor_Titlebar;
- if (self->disabled_decorations & Decor_Handle)
- self->decorations &= ~Decor_Handle;
- if (self->disabled_decorations & Decor_Border)
- self->decorations &= ~Decor_Border;
- if (self->disabled_decorations & Decor_Iconify)
- self->decorations &= ~Decor_Iconify;
- if (self->disabled_decorations & Decor_Maximize)
- self->decorations &= ~Decor_Maximize;
- if (self->disabled_decorations & Decor_AllDesktops)
- self->decorations &= ~Decor_AllDesktops;
- if (self->disabled_decorations & Decor_Shade)
- self->decorations &= ~Decor_Shade;
- if (self->disabled_decorations & Decor_Close)
- self->decorations &= ~Decor_Close;
+ if (!((self->functions & OB_CLIENT_FUNC_MAXIMIZE) &&
+ (self->functions & OB_CLIENT_FUNC_MOVE) &&
+ (self->functions & OB_CLIENT_FUNC_RESIZE))) {
+ self->functions &= ~OB_CLIENT_FUNC_MAXIMIZE;
+ self->decorations &= ~OB_FRAME_DECOR_MAXIMIZE;
+ }
+
+ /* finally, the user can have requested no decorations, which overrides
+ everything */
+ if (!self->decorate)
+ self->decorations = 0;
/* if we don't have a titlebar, then we cannot shade! */
- if (!(self->decorations & Decor_Titlebar))
+ if (!(self->decorations & OB_FRAME_DECOR_TITLEBAR))
self->functions &= ~OB_CLIENT_FUNC_SHADE;
/* now we need to check against rules for the client's current state */
OB_CLIENT_FUNC_CLOSE = 1 << 6 /*!< Allow to be closed */
} ObFunctions;
-/*! The decorations the client window wants to be displayed on it */
-typedef enum {
- Decor_Titlebar = 1 << 0, /*!< Display a titlebar */
- Decor_Handle = 1 << 1, /*!< Display a handle (bottom) */
- Decor_Border = 1 << 2, /*!< Display a border */
- Decor_Icon = 1 << 3, /*!< Display the window's icon */
- Decor_Iconify = 1 << 4, /*!< Display an iconify button */
- Decor_Maximize = 1 << 5, /*!< Display a maximize button */
- /*! Display a button to toggle the window's placement on
- all desktops */
- Decor_AllDesktops = 1 << 6,
- Decor_Shade = 1 << 7, /*!< Displays a shade button */
- Decor_Close = 1 << 8 /*!< Display a close button */
-} Decoration;
-
struct _ObClient
{
ObWindow obwin;
are always below windows in higher layers. */
ObStackingLayer layer;
- /*! A bitmask of values in the Decoration enum
+ /*! A bitmask of values in the ObFrameDecorations enum
The values in the variable are the decorations that the client wants to
be displayed around it.
*/
guint decorations;
- /*! A bitmask of values in the Decoration enum.
- Specifies the decorations that should NOT be displayed on the client.
+ /*! A user option. When this is set to FALSE the client will not ever
+ be decorated.
*/
- guint disabled_decorations;
+ gboolean decorate;
/*! A bitmask of values in the ObFunctions enum
The values in the variable specify the ways in which the user is allowed
static void layout_title(ObFrame *self);
-void frame_startup()
-{
-}
-
-void frame_shutdown()
-{
-}
-
static Window createWindow(Window parent, unsigned long mask,
XSetWindowAttributes *attrib)
{
ShapeBounding, ShapeSet);
num = 0;
- if (self->decorations & Decor_Titlebar) {
+ if (self->decorations & OB_FRAME_DECOR_TITLEBAR) {
xrect[0].x = -ob_rr_theme->bevel;
xrect[0].y = -ob_rr_theme->bevel;
xrect[0].width = self->width + self->bwidth * 2;
++num;
}
- if (self->decorations & Decor_Handle) {
+ if (self->decorations & OB_FRAME_DECOR_HANDLE) {
xrect[1].x = -ob_rr_theme->bevel;
xrect[1].y = FRAME_HANDLE_Y(self);
xrect[1].width = self->width + self->bwidth * 2;
{
if (resized) {
self->decorations = self->client->decorations;
- if (self->decorations & Decor_Border) {
+ if (self->decorations & OB_FRAME_DECOR_BORDER) {
self->bwidth = ob_rr_theme->bwidth;
self->cbwidth = ob_rr_theme->cbwidth;
} else {
self->max_x = -1;
self->close_x = -1;
- if (self->decorations & Decor_Titlebar) {
+ if (self->decorations & OB_FRAME_DECOR_TITLEBAR) {
XMoveResizeWindow(ob_display, self->title,
-self->bwidth, -self->bwidth,
self->width, ob_rr_theme->title_height);
} else
XUnmapWindow(ob_display, self->title);
- if (self->decorations & Decor_Handle) {
+ if (self->decorations & OB_FRAME_DECOR_HANDLE) {
XMoveResizeWindow(ob_display, self->handle,
-self->bwidth, FRAME_HANDLE_Y(self),
self->width, ob_rr_theme->handle_height);
- XMoveWindow(ob_display, self->lgrip,
- -self->bwidth, -self->bwidth);
- XMoveWindow(ob_display, self->rgrip,
- -self->bwidth + self->width -
- ob_rr_theme->grip_width, -self->bwidth);
self->innersize.bottom += ob_rr_theme->handle_height +
self->bwidth;
XMapWindow(ob_display, self->handle);
+ if (self->decorations & OB_FRAME_DECOR_GRIPS) {
+ XMoveWindow(ob_display, self->lgrip,
+ -self->bwidth, -self->bwidth);
+ XMoveWindow(ob_display, self->rgrip,
+ -self->bwidth + self->width -
+ ob_rr_theme->grip_width, -self->bwidth);
+ XMapWindow(ob_display, self->lgrip);
+ XMapWindow(ob_display, self->rgrip);
+ } else {
+ XUnmapWindow(ob_display, self->lgrip);
+ XUnmapWindow(ob_display, self->rgrip);
+ }
+
/* XXX make a subwindow with these dimentions?
ob_rr_theme->grip_width + self->bwidth, 0,
self->width - (ob_rr_theme->grip_width + self->bwidth) * 2,
for (lc = ob_rr_theme->title_layout; *lc != '\0'; ++lc) {
switch (*lc) {
case 'N':
- if (!(self->decorations & Decor_Icon)) break;
if (n) { *lc = ' '; break; } /* rm duplicates */
n = TRUE;
self->label_width -= (ob_rr_theme->button_size + 2 +
ob_rr_theme->bevel + 1);
break;
case 'D':
- if (!(self->decorations & Decor_AllDesktops)) break;
if (d) { *lc = ' '; break; } /* rm duplicates */
d = TRUE;
self->label_width -= (ob_rr_theme->button_size +
ob_rr_theme->bevel + 1);
break;
case 'S':
- if (!(self->decorations & Decor_Shade)) break;
if (s) { *lc = ' '; break; } /* rm duplicates */
s = TRUE;
self->label_width -= (ob_rr_theme->button_size +
ob_rr_theme->bevel + 1);
break;
case 'I':
- if (!(self->decorations & Decor_Iconify)) break;
if (i) { *lc = ' '; break; } /* rm duplicates */
i = TRUE;
self->label_width -= (ob_rr_theme->button_size +
l = TRUE;
break;
case 'M':
- if (!(self->decorations & Decor_Maximize)) break;
if (m) { *lc = ' '; break; } /* rm duplicates */
m = TRUE;
self->label_width -= (ob_rr_theme->button_size +
ob_rr_theme->bevel + 1);
break;
case 'C':
- if (!(self->decorations & Decor_Close)) break;
if (c) { *lc = ' '; break; } /* rm duplicates */
c = TRUE;
self->label_width -= (ob_rr_theme->button_size +
OB_FRAME_NUM_CONTEXTS
} ObFrameContext;
+/*! The decorations the client window wants to be displayed on it */
+typedef enum {
+ OB_FRAME_DECOR_TITLEBAR = 1 << 0, /*!< Display a titlebar */
+ OB_FRAME_DECOR_HANDLE = 1 << 1, /*!< Display a handle (bottom) */
+ OB_FRAME_DECOR_GRIPS = 1 << 2, /*!< Display grips in the handle */
+ OB_FRAME_DECOR_BORDER = 1 << 3, /*!< Display a border */
+ OB_FRAME_DECOR_ICON = 1 << 4, /*!< Display the window's icon */
+ OB_FRAME_DECOR_ICONIFY = 1 << 5, /*!< Display an iconify button */
+ OB_FRAME_DECOR_MAXIMIZE = 1 << 6, /*!< Display a maximize button */
+ /*! Display a button to toggle the window's placement on
+ all desktops */
+ OB_FRAME_DECOR_ALLDESKTOPS = 1 << 7,
+ OB_FRAME_DECOR_SHADE = 1 << 8, /*!< Displays a shade button */
+ OB_FRAME_DECOR_CLOSE = 1 << 9 /*!< Display a close button */
+} ObFrameDecorations;
+
struct _ObFrame
{
struct _ObClient *client;
gboolean focused;
};
-void frame_startup();
-void frame_shutdown();
-
ObFrame *frame_new();
void frame_show(ObFrame *self);
void frame_hide(ObFrame *self);
XSetWindowBorder(ob_display, self->plate,
RrColorPixel(ob_rr_theme->cb_unfocused_color));
- if (self->client->decorations & Decor_Titlebar) {
+ if (self->decorations & OB_FRAME_DECOR_TITLEBAR) {
RrAppearance *t, *l, *m, *n, *i, *d, *s, *c;
t = (self->focused ?
self->a_focused_title : self->a_unfocused_title);
l = (self->focused ?
self->a_focused_label : self->a_unfocused_label);
- m = (self->focused ?
- (self->client->max_vert || self->client->max_horz ?
- ob_rr_theme->a_focused_pressed_set_max :
- (self->max_press ?
- ob_rr_theme->a_focused_pressed_max :
- ob_rr_theme->a_focused_unpressed_max)) :
- (self->client->max_vert || self->client->max_horz ?
- ob_rr_theme->a_unfocused_pressed_set_max :
- (self->max_press ?
- ob_rr_theme->a_unfocused_pressed_max :
- ob_rr_theme->a_unfocused_unpressed_max)));
+ m = (!(self->decorations & OB_FRAME_DECOR_MAXIMIZE) ?
+ (self->focused ?
+ ob_rr_theme->a_disabled_focused_max :
+ ob_rr_theme->a_disabled_unfocused_max) :
+ (self->focused ?
+ (self->client->max_vert || self->client->max_horz ?
+ ob_rr_theme->a_focused_pressed_set_max :
+ (self->max_press ?
+ ob_rr_theme->a_focused_pressed_max :
+ ob_rr_theme->a_focused_unpressed_max)) :
+ (self->client->max_vert || self->client->max_horz ?
+ ob_rr_theme->a_unfocused_pressed_set_max :
+ (self->max_press ?
+ ob_rr_theme->a_unfocused_pressed_max :
+ ob_rr_theme->a_unfocused_unpressed_max))));
n = self->a_icon;
- i = (self->focused ?
- (self->iconify_press ?
- ob_rr_theme->a_focused_pressed_iconify :
- ob_rr_theme->a_focused_unpressed_iconify) :
- (self->iconify_press ?
- ob_rr_theme->a_unfocused_pressed_iconify :
- ob_rr_theme->a_unfocused_unpressed_iconify));
- d = (self->focused ?
- (self->client->desktop == DESKTOP_ALL ?
- ob_rr_theme->a_focused_pressed_set_desk :
- (self->desk_press ?
- ob_rr_theme->a_focused_pressed_desk :
- ob_rr_theme->a_focused_unpressed_desk)) :
- (self->client->desktop == DESKTOP_ALL ?
- ob_rr_theme->a_unfocused_pressed_set_desk :
- (self->desk_press ?
- ob_rr_theme->a_unfocused_pressed_desk :
- ob_rr_theme->a_unfocused_unpressed_desk)));
- s = (self->focused ?
- (self->client->shaded ?
- ob_rr_theme->a_focused_pressed_set_shade :
- (self->shade_press ?
- ob_rr_theme->a_focused_pressed_shade :
- ob_rr_theme->a_focused_unpressed_shade)) :
- (self->client->shaded ?
- ob_rr_theme->a_unfocused_pressed_set_shade :
- (self->shade_press ?
- ob_rr_theme->a_unfocused_pressed_shade :
- ob_rr_theme->a_unfocused_unpressed_shade)));
- c = (self->focused ?
- (self->close_press ?
- ob_rr_theme->a_focused_pressed_close :
- ob_rr_theme->a_focused_unpressed_close) :
- (self->close_press ?
- ob_rr_theme->a_unfocused_pressed_close :
- ob_rr_theme->a_unfocused_unpressed_close));
+ i = (!(self->decorations & OB_FRAME_DECOR_ICONIFY) ?
+ (self->focused ?
+ ob_rr_theme->a_disabled_focused_iconify :
+ ob_rr_theme->a_disabled_unfocused_iconify) :
+ (self->focused ?
+ (self->iconify_press ?
+ ob_rr_theme->a_focused_pressed_iconify :
+ ob_rr_theme->a_focused_unpressed_iconify) :
+ (self->iconify_press ?
+ ob_rr_theme->a_unfocused_pressed_iconify :
+ ob_rr_theme->a_unfocused_unpressed_iconify)));
+ d = (!(self->decorations & OB_FRAME_DECOR_ALLDESKTOPS) ?
+ (self->focused ?
+ ob_rr_theme->a_disabled_focused_desk :
+ ob_rr_theme->a_disabled_unfocused_desk) :
+ (self->focused ?
+ (self->client->desktop == DESKTOP_ALL ?
+ ob_rr_theme->a_focused_pressed_set_desk :
+ (self->desk_press ?
+ ob_rr_theme->a_focused_pressed_desk :
+ ob_rr_theme->a_focused_unpressed_desk)) :
+ (self->client->desktop == DESKTOP_ALL ?
+ ob_rr_theme->a_unfocused_pressed_set_desk :
+ (self->desk_press ?
+ ob_rr_theme->a_unfocused_pressed_desk :
+ ob_rr_theme->a_unfocused_unpressed_desk))));
+ s = (!(self->decorations & OB_FRAME_DECOR_SHADE) ?
+ (self->focused ?
+ ob_rr_theme->a_disabled_focused_shade :
+ ob_rr_theme->a_disabled_unfocused_shade) :
+ (self->focused ?
+ (self->client->shaded ?
+ ob_rr_theme->a_focused_pressed_set_shade :
+ (self->shade_press ?
+ ob_rr_theme->a_focused_pressed_shade :
+ ob_rr_theme->a_focused_unpressed_shade)) :
+ (self->client->shaded ?
+ ob_rr_theme->a_unfocused_pressed_set_shade :
+ (self->shade_press ?
+ ob_rr_theme->a_unfocused_pressed_shade :
+ ob_rr_theme->a_unfocused_unpressed_shade))));
+ c = (!(self->decorations & OB_FRAME_DECOR_CLOSE) ?
+ (self->focused ?
+ ob_rr_theme->a_disabled_focused_close :
+ ob_rr_theme->a_disabled_unfocused_close) :
+ (self->focused ?
+ (self->close_press ?
+ ob_rr_theme->a_focused_pressed_close :
+ ob_rr_theme->a_focused_unpressed_close) :
+ (self->close_press ?
+ ob_rr_theme->a_unfocused_pressed_close :
+ ob_rr_theme->a_unfocused_unpressed_close)));
RrPaint(t, self->title, self->width, ob_rr_theme->title_height);
framerender_close(self, c);
}
- if (self->client->decorations & Decor_Handle) {
+ if (self->decorations & OB_FRAME_DECOR_HANDLE) {
RrAppearance *h, *g;
h = (self->focused ?
RrPaint(h, self->handle, self->width, ob_rr_theme->handle_height);
- g = (self->focused ?
- ob_rr_theme->a_focused_grip : ob_rr_theme->a_unfocused_grip);
+ if (self->decorations & OB_FRAME_DECOR_GRIPS) {
+ g = (self->focused ?
+ ob_rr_theme->a_focused_grip : ob_rr_theme->a_unfocused_grip);
- if (g->surface.grad == RR_SURFACE_PARENTREL)
- g->surface.parent = h;
+ if (g->surface.grad == RR_SURFACE_PARENTREL)
+ g->surface.parent = h;
- g->surface.parentx = 0;
- g->surface.parenty = 0;
+ g->surface.parentx = 0;
+ g->surface.parenty = 0;
- RrPaint(g, self->lgrip,
- ob_rr_theme->grip_width, ob_rr_theme->handle_height);
+ RrPaint(g, self->lgrip,
+ ob_rr_theme->grip_width, ob_rr_theme->handle_height);
- g->surface.parentx = self->width - ob_rr_theme->grip_width;
- g->surface.parenty = 0;
+ g->surface.parentx = self->width - ob_rr_theme->grip_width;
+ g->surface.parenty = 0;
- RrPaint(g, self->rgrip,
- ob_rr_theme->grip_width, ob_rr_theme->handle_height);
+ RrPaint(g, self->rgrip,
+ ob_rr_theme->grip_width, ob_rr_theme->handle_height);
+ }
}
}
if (ob_rr_theme == NULL)
exit_with_error("Unable to load a theme.");
- frame_startup();
moveresize_startup();
screen_startup();
group_startup();
screen_shutdown();
focus_shutdown();
moveresize_shutdown();
- frame_shutdown();
menu_shutdown();
window_shutdown();
grab_shutdown();
theme->inst = inst;
- theme->b_color = theme->cb_unfocused_color = theme->cb_focused_color =
- theme->title_unfocused_color = theme->title_focused_color =
- theme->titlebut_unfocused_color = theme->titlebut_focused_color =
- theme->menu_color = theme->menu_title_color =
- theme->menu_disabled_color = theme->menu_hilite_color = NULL;
- theme->winfont = theme->mtitlefont = theme->mfont = NULL;
- theme->title_layout = NULL;
- theme->max_set_mask = theme->max_unset_mask = NULL;
- theme->desk_set_mask = theme->desk_unset_mask = NULL;
- theme->shade_set_mask = theme->shade_unset_mask = NULL;
- theme->iconify_mask = theme->close_mask = NULL;
-
+ theme->a_disabled_focused_max = RrAppearanceNew(inst, 1);
+ theme->a_disabled_unfocused_max = RrAppearanceNew(inst, 1);
theme->a_focused_unpressed_max = RrAppearanceNew(inst, 1);
theme->a_focused_pressed_max = RrAppearanceNew(inst, 1);
theme->a_focused_pressed_set_max = RrAppearanceNew(inst, 1);
theme->a_unfocused_unpressed_max = RrAppearanceNew(inst, 1);
theme->a_unfocused_pressed_max = RrAppearanceNew(inst, 1);
theme->a_unfocused_pressed_set_max = RrAppearanceNew(inst, 1);
- theme->a_focused_unpressed_close = NULL;
- theme->a_focused_pressed_close = NULL;
- theme->a_unfocused_unpressed_close = NULL;
- theme->a_unfocused_pressed_close = NULL;
- theme->a_focused_unpressed_desk = NULL;
- theme->a_focused_pressed_desk = NULL;
- theme->a_focused_pressed_set_desk = NULL;
- theme->a_unfocused_unpressed_desk = NULL;
- theme->a_unfocused_pressed_desk = NULL;
- theme->a_unfocused_pressed_set_desk = NULL;
- theme->a_focused_unpressed_shade = NULL;
- theme->a_focused_pressed_shade = NULL;
- theme->a_focused_pressed_set_shade = NULL;
- theme->a_unfocused_unpressed_shade = NULL;
- theme->a_unfocused_pressed_shade = NULL;
- theme->a_unfocused_pressed_set_shade = NULL;
- theme->a_focused_unpressed_iconify = NULL;
- theme->a_focused_pressed_iconify = NULL;
- theme->a_unfocused_unpressed_iconify = NULL;
- theme->a_unfocused_pressed_iconify = NULL;
theme->a_focused_grip = RrAppearanceNew(inst, 0);
theme->a_unfocused_grip = RrAppearanceNew(inst, 0);
theme->a_focused_title = RrAppearanceNew(inst, 0);
"window.label.unfocus.textColor",
&theme->title_unfocused_color))
theme->title_unfocused_color = RrColorNew(inst, 0xff, 0xff, 0xff);
+ if (!read_color(db, inst,
+ "window.button.disabled.focus.picColor",
+ &theme->titlebut_disabled_focused_color))
+ theme->titlebut_disabled_focused_color =
+ RrColorNew(inst, 0xff, 0xff, 0xff);
+ if (!read_color(db, inst,
+ "window.button.disabled.unfocus.picColor",
+ &theme->titlebut_disabled_unfocused_color))
+ theme->titlebut_disabled_unfocused_color = RrColorNew(inst, 0, 0, 0);
if (!read_color(db, inst,
"window.button.focus.picColor",
&theme->titlebut_focused_color))
set_default_appearance(theme->app_unhilite_label);
/* read buttons textures */
+ if (!read_appearance(db, inst,
+ "window.button.disabled.focus",
+ theme->a_disabled_focused_max))
+ set_default_appearance(theme->a_disabled_focused_max);
+ if (!read_appearance(db, inst,
+ "window.button.disabled.unfocus",
+ theme->a_disabled_unfocused_max))
+ set_default_appearance(theme->a_disabled_unfocused_max);
if (!read_appearance(db, inst,
"window.button.pressed.focus",
theme->a_focused_pressed_max))
theme->a_unfocused_unpressed_max))
set_default_appearance(theme->a_unfocused_unpressed_max);
+ theme->a_disabled_focused_close =
+ RrAppearanceCopy(theme->a_disabled_focused_max);
+ theme->a_disabled_unfocused_close =
+ RrAppearanceCopy(theme->a_disabled_unfocused_max);
theme->a_unfocused_unpressed_close =
RrAppearanceCopy(theme->a_unfocused_unpressed_max);
theme->a_unfocused_pressed_close =
RrAppearanceCopy(theme->a_focused_unpressed_max);
theme->a_focused_pressed_close =
RrAppearanceCopy(theme->a_focused_pressed_max);
+ theme->a_disabled_focused_desk =
+ RrAppearanceCopy(theme->a_disabled_focused_max);
+ theme->a_disabled_unfocused_desk =
+ RrAppearanceCopy(theme->a_disabled_unfocused_max);
theme->a_unfocused_unpressed_desk =
RrAppearanceCopy(theme->a_unfocused_unpressed_max);
theme->a_unfocused_pressed_desk =
RrAppearanceCopy(theme->a_focused_pressed_max);
theme->a_focused_pressed_set_desk =
RrAppearanceCopy(theme->a_focused_pressed_max);
+ theme->a_disabled_focused_shade =
+ RrAppearanceCopy(theme->a_disabled_focused_max);
+ theme->a_disabled_unfocused_shade =
+ RrAppearanceCopy(theme->a_disabled_unfocused_max);
theme->a_unfocused_unpressed_shade =
RrAppearanceCopy(theme->a_unfocused_unpressed_max);
theme->a_unfocused_pressed_shade =
RrAppearanceCopy(theme->a_focused_pressed_max);
theme->a_focused_pressed_set_shade =
RrAppearanceCopy(theme->a_focused_pressed_max);
+ theme->a_disabled_focused_iconify =
+ RrAppearanceCopy(theme->a_disabled_focused_max);
+ theme->a_disabled_unfocused_iconify =
+ RrAppearanceCopy(theme->a_disabled_focused_max);
theme->a_unfocused_unpressed_iconify =
RrAppearanceCopy(theme->a_unfocused_unpressed_max);
theme->a_unfocused_pressed_iconify =
theme->a_menu_hilite->texture[0].data.text.color =
theme->menu_hilite_color;
- theme->a_focused_unpressed_max->texture[0].type =
+ theme->a_disabled_focused_max->texture[0].type =
+ theme->a_disabled_unfocused_max->texture[0].type =
+ theme->a_focused_unpressed_max->texture[0].type =
theme->a_focused_pressed_max->texture[0].type =
theme->a_focused_pressed_set_max->texture[0].type =
theme->a_unfocused_unpressed_max->texture[0].type =
theme->a_unfocused_pressed_max->texture[0].type =
theme->a_unfocused_pressed_set_max->texture[0].type =
+ theme->a_disabled_focused_close->texture[0].type =
+ theme->a_disabled_unfocused_close->texture[0].type =
theme->a_focused_unpressed_close->texture[0].type =
theme->a_focused_pressed_close->texture[0].type =
theme->a_unfocused_unpressed_close->texture[0].type =
theme->a_unfocused_pressed_close->texture[0].type =
+ theme->a_disabled_focused_desk->texture[0].type =
+ theme->a_disabled_unfocused_desk->texture[0].type =
theme->a_focused_unpressed_desk->texture[0].type =
theme->a_focused_pressed_desk->texture[0].type =
theme->a_focused_pressed_set_desk->texture[0].type =
theme->a_unfocused_unpressed_desk->texture[0].type =
theme->a_unfocused_pressed_desk->texture[0].type =
theme->a_unfocused_pressed_set_desk->texture[0].type =
+ theme->a_disabled_focused_shade->texture[0].type =
+ theme->a_disabled_unfocused_shade->texture[0].type =
theme->a_focused_unpressed_shade->texture[0].type =
theme->a_focused_pressed_shade->texture[0].type =
theme->a_focused_pressed_set_shade->texture[0].type =
theme->a_unfocused_unpressed_shade->texture[0].type =
theme->a_unfocused_pressed_shade->texture[0].type =
theme->a_unfocused_pressed_set_shade->texture[0].type =
+ theme->a_disabled_focused_iconify->texture[0].type =
+ theme->a_disabled_unfocused_iconify->texture[0].type =
theme->a_focused_unpressed_iconify->texture[0].type =
theme->a_focused_pressed_iconify->texture[0].type =
theme->a_unfocused_unpressed_iconify->texture[0].type =
theme->a_unfocused_pressed_iconify->texture[0].type = RR_TEXTURE_MASK;
- theme->a_focused_unpressed_max->texture[0].data.mask.mask =
+ theme->a_disabled_focused_max->texture[0].data.mask.mask =
+ theme->a_disabled_unfocused_max->texture[0].data.mask.mask =
+ theme->a_focused_unpressed_max->texture[0].data.mask.mask =
theme->a_unfocused_unpressed_max->texture[0].data.mask.mask =
theme->a_focused_pressed_max->texture[0].data.mask.mask =
theme->a_unfocused_pressed_max->texture[0].data.mask.mask =
theme->a_focused_pressed_set_max->texture[0].data.mask.mask =
theme->a_unfocused_pressed_set_max->texture[0].data.mask.mask =
theme->max_set_mask;
- theme->a_focused_pressed_close->texture[0].data.mask.mask =
+ theme->a_disabled_focused_close->texture[0].data.mask.mask =
+ theme->a_disabled_unfocused_close->texture[0].data.mask.mask =
+ theme->a_focused_pressed_close->texture[0].data.mask.mask =
theme->a_unfocused_pressed_close->texture[0].data.mask.mask =
theme->a_focused_unpressed_close->texture[0].data.mask.mask =
theme->a_unfocused_unpressed_close->texture[0].data.mask.mask =
theme->close_mask;
- theme->a_focused_unpressed_desk->texture[0].data.mask.mask =
+ theme->a_disabled_focused_desk->texture[0].data.mask.mask =
+ theme->a_disabled_unfocused_desk->texture[0].data.mask.mask =
+ theme->a_focused_unpressed_desk->texture[0].data.mask.mask =
theme->a_unfocused_unpressed_desk->texture[0].data.mask.mask =
theme->a_focused_pressed_desk->texture[0].data.mask.mask =
theme->a_unfocused_pressed_desk->texture[0].data.mask.mask =
theme->a_focused_pressed_set_desk->texture[0].data.mask.mask =
theme->a_unfocused_pressed_set_desk->texture[0].data.mask.mask =
theme->desk_set_mask;
- theme->a_focused_unpressed_shade->texture[0].data.mask.mask =
+ theme->a_disabled_focused_shade->texture[0].data.mask.mask =
+ theme->a_disabled_unfocused_shade->texture[0].data.mask.mask =
+ theme->a_focused_unpressed_shade->texture[0].data.mask.mask =
theme->a_unfocused_unpressed_shade->texture[0].data.mask.mask =
theme->a_focused_pressed_shade->texture[0].data.mask.mask =
theme->a_unfocused_pressed_shade->texture[0].data.mask.mask =
theme->a_focused_pressed_set_shade->texture[0].data.mask.mask =
theme->a_unfocused_pressed_set_shade->texture[0].data.mask.mask =
theme->shade_set_mask;
- theme->a_focused_unpressed_iconify->texture[0].data.mask.mask =
+ theme->a_disabled_focused_iconify->texture[0].data.mask.mask =
+ theme->a_disabled_unfocused_iconify->texture[0].data.mask.mask =
+ theme->a_focused_unpressed_iconify->texture[0].data.mask.mask =
theme->a_unfocused_unpressed_iconify->texture[0].data.mask.mask =
theme->a_focused_pressed_iconify->texture[0].data.mask.mask =
theme->a_unfocused_pressed_iconify->texture[0].data.mask.mask =
theme->iconify_mask;
+ theme->a_disabled_focused_max->texture[0].data.mask.color =
+ theme->a_disabled_focused_close->texture[0].data.mask.color =
+ theme->a_disabled_focused_desk->texture[0].data.mask.color =
+ theme->a_disabled_focused_shade->texture[0].data.mask.color =
+ theme->a_disabled_focused_iconify->texture[0].data.mask.color =
+ theme->titlebut_disabled_focused_color;
+ theme->a_disabled_unfocused_max->texture[0].data.mask.color =
+ theme->a_disabled_unfocused_close->texture[0].data.mask.color =
+ theme->a_disabled_unfocused_desk->texture[0].data.mask.color =
+ theme->a_disabled_unfocused_shade->texture[0].data.mask.color =
+ theme->a_disabled_unfocused_iconify->texture[0].data.mask.color =
+ theme->titlebut_disabled_unfocused_color;
theme->a_focused_unpressed_max->texture[0].data.mask.color =
theme->a_focused_pressed_max->texture[0].data.mask.color =
theme->a_focused_pressed_set_max->texture[0].data.mask.color =
RrColor *cb_unfocused_color;
RrColor *title_focused_color;
RrColor *title_unfocused_color;
+ RrColor *titlebut_disabled_focused_color;
+ RrColor *titlebut_disabled_unfocused_color;
RrColor *titlebut_focused_color;
RrColor *titlebut_unfocused_color;
RrColor *menu_title_color;
RrPixmapMask *close_mask;
/* global appearances */
+ RrAppearance *a_disabled_focused_max;
+ RrAppearance *a_disabled_unfocused_max;
RrAppearance *a_focused_unpressed_max;
RrAppearance *a_focused_pressed_max;
RrAppearance *a_focused_pressed_set_max;
RrAppearance *a_unfocused_unpressed_max;
RrAppearance *a_unfocused_pressed_max;
RrAppearance *a_unfocused_pressed_set_max;
+ RrAppearance *a_disabled_focused_close;
+ RrAppearance *a_disabled_unfocused_close;
RrAppearance *a_focused_unpressed_close;
RrAppearance *a_focused_pressed_close;
RrAppearance *a_unfocused_unpressed_close;
RrAppearance *a_unfocused_pressed_close;
+ RrAppearance *a_disabled_focused_desk;
+ RrAppearance *a_disabled_unfocused_desk;
RrAppearance *a_focused_unpressed_desk;
RrAppearance *a_focused_pressed_desk;
RrAppearance *a_focused_pressed_set_desk;
RrAppearance *a_unfocused_unpressed_desk;
RrAppearance *a_unfocused_pressed_desk;
RrAppearance *a_unfocused_pressed_set_desk;
+ RrAppearance *a_disabled_focused_shade;
+ RrAppearance *a_disabled_unfocused_shade;
RrAppearance *a_focused_unpressed_shade;
RrAppearance *a_focused_pressed_shade;
RrAppearance *a_focused_pressed_set_shade;
RrAppearance *a_unfocused_unpressed_shade;
RrAppearance *a_unfocused_pressed_shade;
RrAppearance *a_unfocused_pressed_set_shade;
+ RrAppearance *a_disabled_focused_iconify;
+ RrAppearance *a_disabled_unfocused_iconify;
RrAppearance *a_focused_unpressed_iconify;
RrAppearance *a_focused_pressed_iconify;
RrAppearance *a_unfocused_unpressed_iconify;
urgent
icons
override
+noresize
--- /dev/null
+#include <stdio.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
+int main () {
+ XSetWindowAttributes xswa;
+ unsigned long xswamask;
+ Display *display;
+ Window win;
+ XEvent report;
+ int x=10,y=10,h=100,w=400;
+ XSizeHints size;
+
+ display = XOpenDisplay(NULL);
+
+ if (display == NULL) {
+ fprintf(stderr, "couldn't connect to X server :0\n");
+ return 0;
+ }
+
+ xswa.win_gravity = StaticGravity;
+ xswamask = CWWinGravity;
+
+ win = XCreateWindow(display, RootWindow(display, 0),
+ x, y, w, h, 10, CopyFromParent, CopyFromParent,
+ CopyFromParent, xswamask, &xswa);
+
+ XSetWindowBackground(display,win,WhitePixel(display,0));
+
+ size.flags = PMinSize | PMaxSize;
+ size.max_width = 0;
+ size.min_width = w;
+ size.max_height = 0;
+ size.min_height = h;
+ XSetWMNormalHints(display, win, &size);
+
+ XMapWindow(display, win);
+ XFlush(display);
+
+ XSelectInput(display, win, ExposureMask | StructureNotifyMask);
+
+ while (1) {
+ XNextEvent(display, &report);
+
+ switch (report.type) {
+ case Expose:
+ printf("exposed\n");
+ break;
+ case ConfigureNotify:
+ x = report.xconfigure.x;
+ y = report.xconfigure.y;
+ w = report.xconfigure.width;
+ h = report.xconfigure.height;
+ printf("confignotify %i,%i-%ix%i\n",x,y,w,h);
+ break;
+ }
+
+ }
+
+ return 1;
+}