add disabled buttons, instead of now showing buttons at all when they wont do anything, now show a disabled button instead. this severely breaks compatibility with blackbox themes since there is no good way to automiatically create a disabled button that i can think of, so if they dont exist in the theme you get black and white for the button.
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.
This commit is contained in:
parent
b0e8e276e4
commit
81af5a8b0c
11 changed files with 313 additions and 196 deletions
|
@ -1105,7 +1105,7 @@ void action_toggle_decorations(union ActionData *data)
|
||||||
|
|
||||||
if (!c) return;
|
if (!c) return;
|
||||||
|
|
||||||
c->disabled_decorations = c->disabled_decorations ? 0 : ~0;
|
c->decorate = !c->decorate;
|
||||||
client_setup_decor_and_functions(c);
|
client_setup_decor_and_functions(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -544,7 +544,7 @@ static void client_get_all(ObClient *self)
|
||||||
self->layer = -1;
|
self->layer = -1;
|
||||||
self->urgent = FALSE;
|
self->urgent = FALSE;
|
||||||
self->positioned = FALSE;
|
self->positioned = FALSE;
|
||||||
self->disabled_decorations = 0;
|
self->decorate = TRUE;
|
||||||
self->group = NULL;
|
self->group = NULL;
|
||||||
self->nicons = 0;
|
self->nicons = 0;
|
||||||
|
|
||||||
|
@ -914,22 +914,28 @@ void client_update_normal_hints(ObClient *self)
|
||||||
void client_setup_decor_and_functions(ObClient *self)
|
void client_setup_decor_and_functions(ObClient *self)
|
||||||
{
|
{
|
||||||
/* start with everything (cept fullscreen) */
|
/* start with everything (cept fullscreen) */
|
||||||
self->decorations = Decor_Titlebar | Decor_Handle | Decor_Border |
|
self->decorations = (OB_FRAME_DECOR_TITLEBAR |
|
||||||
Decor_Icon | Decor_AllDesktops | Decor_Iconify | Decor_Maximize |
|
OB_FRAME_DECOR_HANDLE |
|
||||||
Decor_Shade;
|
OB_FRAME_DECOR_GRIPS |
|
||||||
self->functions = OB_CLIENT_FUNC_RESIZE | OB_CLIENT_FUNC_MOVE |
|
OB_FRAME_DECOR_BORDER |
|
||||||
OB_CLIENT_FUNC_ICONIFY | OB_CLIENT_FUNC_MAXIMIZE |
|
OB_FRAME_DECOR_ICON |
|
||||||
OB_CLIENT_FUNC_SHADE;
|
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) {
|
if (self->delete_window) {
|
||||||
self->decorations |= Decor_Close;
|
|
||||||
self->functions |= OB_CLIENT_FUNC_CLOSE;
|
self->functions |= OB_CLIENT_FUNC_CLOSE;
|
||||||
|
self->decorations |= OB_FRAME_DECOR_CLOSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(self->min_size.width < self->max_size.width ||
|
if (!(self->min_size.width < self->max_size.width ||
|
||||||
self->min_size.height < self->max_size.height)) {
|
self->min_size.height < self->max_size.height))
|
||||||
self->decorations &= ~(Decor_Maximize | Decor_Handle);
|
|
||||||
self->functions &= ~OB_CLIENT_FUNC_RESIZE;
|
self->functions &= ~OB_CLIENT_FUNC_RESIZE;
|
||||||
}
|
|
||||||
|
|
||||||
switch (self->type) {
|
switch (self->type) {
|
||||||
case OB_CLIENT_TYPE_NORMAL:
|
case OB_CLIENT_TYPE_NORMAL:
|
||||||
|
@ -941,14 +947,12 @@ void client_setup_decor_and_functions(ObClient *self)
|
||||||
case OB_CLIENT_TYPE_DIALOG:
|
case OB_CLIENT_TYPE_DIALOG:
|
||||||
case OB_CLIENT_TYPE_UTILITY:
|
case OB_CLIENT_TYPE_UTILITY:
|
||||||
/* these windows cannot be maximized */
|
/* these windows cannot be maximized */
|
||||||
self->decorations &= ~Decor_Maximize;
|
|
||||||
self->functions &= ~OB_CLIENT_FUNC_MAXIMIZE;
|
self->functions &= ~OB_CLIENT_FUNC_MAXIMIZE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OB_CLIENT_TYPE_MENU:
|
case OB_CLIENT_TYPE_MENU:
|
||||||
case OB_CLIENT_TYPE_TOOLBAR:
|
case OB_CLIENT_TYPE_TOOLBAR:
|
||||||
/* these windows get less functionality */
|
/* these windows get less functionality */
|
||||||
self->decorations &= ~(Decor_Iconify | Decor_Handle);
|
|
||||||
self->functions &= ~(OB_CLIENT_FUNC_ICONIFY | OB_CLIENT_FUNC_RESIZE);
|
self->functions &= ~(OB_CLIENT_FUNC_ICONIFY | OB_CLIENT_FUNC_RESIZE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -965,16 +969,11 @@ void client_setup_decor_and_functions(ObClient *self)
|
||||||
decor and functionality */
|
decor and functionality */
|
||||||
if (self->mwmhints.flags & OB_MWM_FLAG_DECORATIONS) {
|
if (self->mwmhints.flags & OB_MWM_FLAG_DECORATIONS) {
|
||||||
if (! (self->mwmhints.decorations & OB_MWM_DECOR_ALL)) {
|
if (! (self->mwmhints.decorations & OB_MWM_DECOR_ALL)) {
|
||||||
if (! (self->mwmhints.decorations & OB_MWM_DECOR_BORDER))
|
if (! ((self->mwmhints.decorations & OB_MWM_DECOR_HANDLE) ||
|
||||||
self->decorations &= ~Decor_Border;
|
(self->mwmhints.decorations & OB_MWM_DECOR_TITLE)))
|
||||||
if (! (self->mwmhints.decorations & OB_MWM_DECOR_HANDLE))
|
/* if the mwm hints request no handle or title, then all
|
||||||
self->decorations &= ~Decor_Handle;
|
decorations are disabled */
|
||||||
if (! (self->mwmhints.decorations & OB_MWM_DECOR_TITLE))
|
self->decorations = 0;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -984,43 +983,40 @@ void client_setup_decor_and_functions(ObClient *self)
|
||||||
self->functions &= ~OB_CLIENT_FUNC_RESIZE;
|
self->functions &= ~OB_CLIENT_FUNC_RESIZE;
|
||||||
if (! (self->mwmhints.functions & OB_MWM_FUNC_MOVE))
|
if (! (self->mwmhints.functions & OB_MWM_FUNC_MOVE))
|
||||||
self->functions &= ~OB_CLIENT_FUNC_MOVE;
|
self->functions &= ~OB_CLIENT_FUNC_MOVE;
|
||||||
|
/* dont let mwm hints kill any buttons
|
||||||
if (! (self->mwmhints.functions & OB_MWM_FUNC_ICONIFY))
|
if (! (self->mwmhints.functions & OB_MWM_FUNC_ICONIFY))
|
||||||
self->functions &= ~OB_CLIENT_FUNC_ICONIFY;
|
self->functions &= ~OB_CLIENT_FUNC_ICONIFY;
|
||||||
if (! (self->mwmhints.functions & OB_MWM_FUNC_MAXIMIZE))
|
if (! (self->mwmhints.functions & OB_MWM_FUNC_MAXIMIZE))
|
||||||
self->functions &= ~OB_CLIENT_FUNC_MAXIMIZE;
|
self->functions &= ~OB_CLIENT_FUNC_MAXIMIZE;
|
||||||
|
*/
|
||||||
/* dont let mwm hints kill the close button
|
/* dont let mwm hints kill the close button
|
||||||
if (! (self->mwmhints.functions & MwmFunc_Close))
|
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 */
|
/* can't maximize without moving/resizing */
|
||||||
if (!((self->functions & OB_CLIENT_FUNC_MOVE) &&
|
if (!((self->functions & OB_CLIENT_FUNC_MAXIMIZE) &&
|
||||||
(self->functions & OB_CLIENT_FUNC_RESIZE)))
|
(self->functions & OB_CLIENT_FUNC_MOVE) &&
|
||||||
self->functions &= ~(OB_CLIENT_FUNC_MAXIMIZE |
|
(self->functions & OB_CLIENT_FUNC_RESIZE))) {
|
||||||
OB_CLIENT_FUNC_FULLSCREEN);
|
self->functions &= ~OB_CLIENT_FUNC_MAXIMIZE;
|
||||||
|
self->decorations &= ~OB_FRAME_DECOR_MAXIMIZE;
|
||||||
|
}
|
||||||
|
|
||||||
/* finally, user specified disabled decorations are applied to subtract
|
/* finally, the user can have requested no decorations, which overrides
|
||||||
decorations */
|
everything */
|
||||||
if (self->disabled_decorations & Decor_Titlebar)
|
if (!self->decorate)
|
||||||
self->decorations &= ~Decor_Titlebar;
|
self->decorations = 0;
|
||||||
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 we don't have a titlebar, then we cannot shade! */
|
/* 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;
|
self->functions &= ~OB_CLIENT_FUNC_SHADE;
|
||||||
|
|
||||||
/* now we need to check against rules for the client's current state */
|
/* now we need to check against rules for the client's current state */
|
||||||
|
|
|
@ -53,21 +53,6 @@ typedef enum
|
||||||
OB_CLIENT_FUNC_CLOSE = 1 << 6 /*!< Allow to be closed */
|
OB_CLIENT_FUNC_CLOSE = 1 << 6 /*!< Allow to be closed */
|
||||||
} ObFunctions;
|
} 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
|
struct _ObClient
|
||||||
{
|
{
|
||||||
ObWindow obwin;
|
ObWindow obwin;
|
||||||
|
@ -225,16 +210,16 @@ struct _ObClient
|
||||||
are always below windows in higher layers. */
|
are always below windows in higher layers. */
|
||||||
ObStackingLayer layer;
|
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
|
The values in the variable are the decorations that the client wants to
|
||||||
be displayed around it.
|
be displayed around it.
|
||||||
*/
|
*/
|
||||||
guint decorations;
|
guint decorations;
|
||||||
|
|
||||||
/*! A bitmask of values in the Decoration enum.
|
/*! A user option. When this is set to FALSE the client will not ever
|
||||||
Specifies the decorations that should NOT be displayed on the client.
|
be decorated.
|
||||||
*/
|
*/
|
||||||
guint disabled_decorations;
|
gboolean decorate;
|
||||||
|
|
||||||
/*! A bitmask of values in the ObFunctions enum
|
/*! A bitmask of values in the ObFunctions enum
|
||||||
The values in the variable specify the ways in which the user is allowed
|
The values in the variable specify the ways in which the user is allowed
|
||||||
|
|
|
@ -16,14 +16,6 @@
|
||||||
|
|
||||||
static void layout_title(ObFrame *self);
|
static void layout_title(ObFrame *self);
|
||||||
|
|
||||||
void frame_startup()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void frame_shutdown()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static Window createWindow(Window parent, unsigned long mask,
|
static Window createWindow(Window parent, unsigned long mask,
|
||||||
XSetWindowAttributes *attrib)
|
XSetWindowAttributes *attrib)
|
||||||
{
|
{
|
||||||
|
@ -171,7 +163,7 @@ void frame_adjust_shape(ObFrame *self)
|
||||||
ShapeBounding, ShapeSet);
|
ShapeBounding, ShapeSet);
|
||||||
|
|
||||||
num = 0;
|
num = 0;
|
||||||
if (self->decorations & Decor_Titlebar) {
|
if (self->decorations & OB_FRAME_DECOR_TITLEBAR) {
|
||||||
xrect[0].x = -ob_rr_theme->bevel;
|
xrect[0].x = -ob_rr_theme->bevel;
|
||||||
xrect[0].y = -ob_rr_theme->bevel;
|
xrect[0].y = -ob_rr_theme->bevel;
|
||||||
xrect[0].width = self->width + self->bwidth * 2;
|
xrect[0].width = self->width + self->bwidth * 2;
|
||||||
|
@ -180,7 +172,7 @@ void frame_adjust_shape(ObFrame *self)
|
||||||
++num;
|
++num;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self->decorations & Decor_Handle) {
|
if (self->decorations & OB_FRAME_DECOR_HANDLE) {
|
||||||
xrect[1].x = -ob_rr_theme->bevel;
|
xrect[1].x = -ob_rr_theme->bevel;
|
||||||
xrect[1].y = FRAME_HANDLE_Y(self);
|
xrect[1].y = FRAME_HANDLE_Y(self);
|
||||||
xrect[1].width = self->width + self->bwidth * 2;
|
xrect[1].width = self->width + self->bwidth * 2;
|
||||||
|
@ -200,7 +192,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved, gboolean resized)
|
||||||
{
|
{
|
||||||
if (resized) {
|
if (resized) {
|
||||||
self->decorations = self->client->decorations;
|
self->decorations = self->client->decorations;
|
||||||
if (self->decorations & Decor_Border) {
|
if (self->decorations & OB_FRAME_DECOR_BORDER) {
|
||||||
self->bwidth = ob_rr_theme->bwidth;
|
self->bwidth = ob_rr_theme->bwidth;
|
||||||
self->cbwidth = ob_rr_theme->cbwidth;
|
self->cbwidth = ob_rr_theme->cbwidth;
|
||||||
} else {
|
} else {
|
||||||
|
@ -230,7 +222,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved, gboolean resized)
|
||||||
self->max_x = -1;
|
self->max_x = -1;
|
||||||
self->close_x = -1;
|
self->close_x = -1;
|
||||||
|
|
||||||
if (self->decorations & Decor_Titlebar) {
|
if (self->decorations & OB_FRAME_DECOR_TITLEBAR) {
|
||||||
XMoveResizeWindow(ob_display, self->title,
|
XMoveResizeWindow(ob_display, self->title,
|
||||||
-self->bwidth, -self->bwidth,
|
-self->bwidth, -self->bwidth,
|
||||||
self->width, ob_rr_theme->title_height);
|
self->width, ob_rr_theme->title_height);
|
||||||
|
@ -242,18 +234,26 @@ void frame_adjust_area(ObFrame *self, gboolean moved, gboolean resized)
|
||||||
} else
|
} else
|
||||||
XUnmapWindow(ob_display, self->title);
|
XUnmapWindow(ob_display, self->title);
|
||||||
|
|
||||||
if (self->decorations & Decor_Handle) {
|
if (self->decorations & OB_FRAME_DECOR_HANDLE) {
|
||||||
XMoveResizeWindow(ob_display, self->handle,
|
XMoveResizeWindow(ob_display, self->handle,
|
||||||
-self->bwidth, FRAME_HANDLE_Y(self),
|
-self->bwidth, FRAME_HANDLE_Y(self),
|
||||||
self->width, ob_rr_theme->handle_height);
|
self->width, ob_rr_theme->handle_height);
|
||||||
|
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,
|
XMoveWindow(ob_display, self->lgrip,
|
||||||
-self->bwidth, -self->bwidth);
|
-self->bwidth, -self->bwidth);
|
||||||
XMoveWindow(ob_display, self->rgrip,
|
XMoveWindow(ob_display, self->rgrip,
|
||||||
-self->bwidth + self->width -
|
-self->bwidth + self->width -
|
||||||
ob_rr_theme->grip_width, -self->bwidth);
|
ob_rr_theme->grip_width, -self->bwidth);
|
||||||
self->innersize.bottom += ob_rr_theme->handle_height +
|
XMapWindow(ob_display, self->lgrip);
|
||||||
self->bwidth;
|
XMapWindow(ob_display, self->rgrip);
|
||||||
XMapWindow(ob_display, self->handle);
|
} else {
|
||||||
|
XUnmapWindow(ob_display, self->lgrip);
|
||||||
|
XUnmapWindow(ob_display, self->rgrip);
|
||||||
|
}
|
||||||
|
|
||||||
/* XXX make a subwindow with these dimentions?
|
/* XXX make a subwindow with these dimentions?
|
||||||
ob_rr_theme->grip_width + self->bwidth, 0,
|
ob_rr_theme->grip_width + self->bwidth, 0,
|
||||||
|
@ -433,28 +433,24 @@ static void layout_title(ObFrame *self)
|
||||||
for (lc = ob_rr_theme->title_layout; *lc != '\0'; ++lc) {
|
for (lc = ob_rr_theme->title_layout; *lc != '\0'; ++lc) {
|
||||||
switch (*lc) {
|
switch (*lc) {
|
||||||
case 'N':
|
case 'N':
|
||||||
if (!(self->decorations & Decor_Icon)) break;
|
|
||||||
if (n) { *lc = ' '; break; } /* rm duplicates */
|
if (n) { *lc = ' '; break; } /* rm duplicates */
|
||||||
n = TRUE;
|
n = TRUE;
|
||||||
self->label_width -= (ob_rr_theme->button_size + 2 +
|
self->label_width -= (ob_rr_theme->button_size + 2 +
|
||||||
ob_rr_theme->bevel + 1);
|
ob_rr_theme->bevel + 1);
|
||||||
break;
|
break;
|
||||||
case 'D':
|
case 'D':
|
||||||
if (!(self->decorations & Decor_AllDesktops)) break;
|
|
||||||
if (d) { *lc = ' '; break; } /* rm duplicates */
|
if (d) { *lc = ' '; break; } /* rm duplicates */
|
||||||
d = TRUE;
|
d = TRUE;
|
||||||
self->label_width -= (ob_rr_theme->button_size +
|
self->label_width -= (ob_rr_theme->button_size +
|
||||||
ob_rr_theme->bevel + 1);
|
ob_rr_theme->bevel + 1);
|
||||||
break;
|
break;
|
||||||
case 'S':
|
case 'S':
|
||||||
if (!(self->decorations & Decor_Shade)) break;
|
|
||||||
if (s) { *lc = ' '; break; } /* rm duplicates */
|
if (s) { *lc = ' '; break; } /* rm duplicates */
|
||||||
s = TRUE;
|
s = TRUE;
|
||||||
self->label_width -= (ob_rr_theme->button_size +
|
self->label_width -= (ob_rr_theme->button_size +
|
||||||
ob_rr_theme->bevel + 1);
|
ob_rr_theme->bevel + 1);
|
||||||
break;
|
break;
|
||||||
case 'I':
|
case 'I':
|
||||||
if (!(self->decorations & Decor_Iconify)) break;
|
|
||||||
if (i) { *lc = ' '; break; } /* rm duplicates */
|
if (i) { *lc = ' '; break; } /* rm duplicates */
|
||||||
i = TRUE;
|
i = TRUE;
|
||||||
self->label_width -= (ob_rr_theme->button_size +
|
self->label_width -= (ob_rr_theme->button_size +
|
||||||
|
@ -465,14 +461,12 @@ static void layout_title(ObFrame *self)
|
||||||
l = TRUE;
|
l = TRUE;
|
||||||
break;
|
break;
|
||||||
case 'M':
|
case 'M':
|
||||||
if (!(self->decorations & Decor_Maximize)) break;
|
|
||||||
if (m) { *lc = ' '; break; } /* rm duplicates */
|
if (m) { *lc = ' '; break; } /* rm duplicates */
|
||||||
m = TRUE;
|
m = TRUE;
|
||||||
self->label_width -= (ob_rr_theme->button_size +
|
self->label_width -= (ob_rr_theme->button_size +
|
||||||
ob_rr_theme->bevel + 1);
|
ob_rr_theme->bevel + 1);
|
||||||
break;
|
break;
|
||||||
case 'C':
|
case 'C':
|
||||||
if (!(self->decorations & Decor_Close)) break;
|
|
||||||
if (c) { *lc = ' '; break; } /* rm duplicates */
|
if (c) { *lc = ' '; break; } /* rm duplicates */
|
||||||
c = TRUE;
|
c = TRUE;
|
||||||
self->label_width -= (ob_rr_theme->button_size +
|
self->label_width -= (ob_rr_theme->button_size +
|
||||||
|
|
|
@ -26,6 +26,22 @@ typedef enum {
|
||||||
OB_FRAME_NUM_CONTEXTS
|
OB_FRAME_NUM_CONTEXTS
|
||||||
} ObFrameContext;
|
} 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 _ObFrame
|
||||||
{
|
{
|
||||||
struct _ObClient *client;
|
struct _ObClient *client;
|
||||||
|
@ -83,9 +99,6 @@ struct _ObFrame
|
||||||
gboolean focused;
|
gboolean focused;
|
||||||
};
|
};
|
||||||
|
|
||||||
void frame_startup();
|
|
||||||
void frame_shutdown();
|
|
||||||
|
|
||||||
ObFrame *frame_new();
|
ObFrame *frame_new();
|
||||||
void frame_show(ObFrame *self);
|
void frame_show(ObFrame *self);
|
||||||
void frame_hide(ObFrame *self);
|
void frame_hide(ObFrame *self);
|
||||||
|
|
|
@ -22,14 +22,18 @@ void framerender_frame(ObFrame *self)
|
||||||
XSetWindowBorder(ob_display, self->plate,
|
XSetWindowBorder(ob_display, self->plate,
|
||||||
RrColorPixel(ob_rr_theme->cb_unfocused_color));
|
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;
|
RrAppearance *t, *l, *m, *n, *i, *d, *s, *c;
|
||||||
|
|
||||||
t = (self->focused ?
|
t = (self->focused ?
|
||||||
self->a_focused_title : self->a_unfocused_title);
|
self->a_focused_title : self->a_unfocused_title);
|
||||||
l = (self->focused ?
|
l = (self->focused ?
|
||||||
self->a_focused_label : self->a_unfocused_label);
|
self->a_focused_label : self->a_unfocused_label);
|
||||||
m = (self->focused ?
|
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 ?
|
(self->client->max_vert || self->client->max_horz ?
|
||||||
ob_rr_theme->a_focused_pressed_set_max :
|
ob_rr_theme->a_focused_pressed_set_max :
|
||||||
(self->max_press ?
|
(self->max_press ?
|
||||||
|
@ -39,16 +43,24 @@ void framerender_frame(ObFrame *self)
|
||||||
ob_rr_theme->a_unfocused_pressed_set_max :
|
ob_rr_theme->a_unfocused_pressed_set_max :
|
||||||
(self->max_press ?
|
(self->max_press ?
|
||||||
ob_rr_theme->a_unfocused_pressed_max :
|
ob_rr_theme->a_unfocused_pressed_max :
|
||||||
ob_rr_theme->a_unfocused_unpressed_max)));
|
ob_rr_theme->a_unfocused_unpressed_max))));
|
||||||
n = self->a_icon;
|
n = self->a_icon;
|
||||||
i = (self->focused ?
|
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 ?
|
(self->iconify_press ?
|
||||||
ob_rr_theme->a_focused_pressed_iconify :
|
ob_rr_theme->a_focused_pressed_iconify :
|
||||||
ob_rr_theme->a_focused_unpressed_iconify) :
|
ob_rr_theme->a_focused_unpressed_iconify) :
|
||||||
(self->iconify_press ?
|
(self->iconify_press ?
|
||||||
ob_rr_theme->a_unfocused_pressed_iconify :
|
ob_rr_theme->a_unfocused_pressed_iconify :
|
||||||
ob_rr_theme->a_unfocused_unpressed_iconify));
|
ob_rr_theme->a_unfocused_unpressed_iconify)));
|
||||||
d = (self->focused ?
|
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 ?
|
(self->client->desktop == DESKTOP_ALL ?
|
||||||
ob_rr_theme->a_focused_pressed_set_desk :
|
ob_rr_theme->a_focused_pressed_set_desk :
|
||||||
(self->desk_press ?
|
(self->desk_press ?
|
||||||
|
@ -58,8 +70,12 @@ void framerender_frame(ObFrame *self)
|
||||||
ob_rr_theme->a_unfocused_pressed_set_desk :
|
ob_rr_theme->a_unfocused_pressed_set_desk :
|
||||||
(self->desk_press ?
|
(self->desk_press ?
|
||||||
ob_rr_theme->a_unfocused_pressed_desk :
|
ob_rr_theme->a_unfocused_pressed_desk :
|
||||||
ob_rr_theme->a_unfocused_unpressed_desk)));
|
ob_rr_theme->a_unfocused_unpressed_desk))));
|
||||||
s = (self->focused ?
|
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 ?
|
(self->client->shaded ?
|
||||||
ob_rr_theme->a_focused_pressed_set_shade :
|
ob_rr_theme->a_focused_pressed_set_shade :
|
||||||
(self->shade_press ?
|
(self->shade_press ?
|
||||||
|
@ -69,14 +85,18 @@ void framerender_frame(ObFrame *self)
|
||||||
ob_rr_theme->a_unfocused_pressed_set_shade :
|
ob_rr_theme->a_unfocused_pressed_set_shade :
|
||||||
(self->shade_press ?
|
(self->shade_press ?
|
||||||
ob_rr_theme->a_unfocused_pressed_shade :
|
ob_rr_theme->a_unfocused_pressed_shade :
|
||||||
ob_rr_theme->a_unfocused_unpressed_shade)));
|
ob_rr_theme->a_unfocused_unpressed_shade))));
|
||||||
c = (self->focused ?
|
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 ?
|
(self->close_press ?
|
||||||
ob_rr_theme->a_focused_pressed_close :
|
ob_rr_theme->a_focused_pressed_close :
|
||||||
ob_rr_theme->a_focused_unpressed_close) :
|
ob_rr_theme->a_focused_unpressed_close) :
|
||||||
(self->close_press ?
|
(self->close_press ?
|
||||||
ob_rr_theme->a_unfocused_pressed_close :
|
ob_rr_theme->a_unfocused_pressed_close :
|
||||||
ob_rr_theme->a_unfocused_unpressed_close));
|
ob_rr_theme->a_unfocused_unpressed_close)));
|
||||||
|
|
||||||
RrPaint(t, self->title, self->width, ob_rr_theme->title_height);
|
RrPaint(t, self->title, self->width, ob_rr_theme->title_height);
|
||||||
|
|
||||||
|
@ -118,7 +138,7 @@ void framerender_frame(ObFrame *self)
|
||||||
framerender_close(self, c);
|
framerender_close(self, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self->client->decorations & Decor_Handle) {
|
if (self->decorations & OB_FRAME_DECOR_HANDLE) {
|
||||||
RrAppearance *h, *g;
|
RrAppearance *h, *g;
|
||||||
|
|
||||||
h = (self->focused ?
|
h = (self->focused ?
|
||||||
|
@ -126,6 +146,7 @@ void framerender_frame(ObFrame *self)
|
||||||
|
|
||||||
RrPaint(h, self->handle, self->width, ob_rr_theme->handle_height);
|
RrPaint(h, self->handle, self->width, ob_rr_theme->handle_height);
|
||||||
|
|
||||||
|
if (self->decorations & OB_FRAME_DECOR_GRIPS) {
|
||||||
g = (self->focused ?
|
g = (self->focused ?
|
||||||
ob_rr_theme->a_focused_grip : ob_rr_theme->a_unfocused_grip);
|
ob_rr_theme->a_focused_grip : ob_rr_theme->a_unfocused_grip);
|
||||||
|
|
||||||
|
@ -145,6 +166,7 @@ void framerender_frame(ObFrame *self)
|
||||||
ob_rr_theme->grip_width, ob_rr_theme->handle_height);
|
ob_rr_theme->grip_width, ob_rr_theme->handle_height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void framerender_label(ObFrame *self, RrAppearance *a)
|
static void framerender_label(ObFrame *self, RrAppearance *a)
|
||||||
{
|
{
|
||||||
|
|
|
@ -243,7 +243,6 @@ int main(int argc, char **argv)
|
||||||
if (ob_rr_theme == NULL)
|
if (ob_rr_theme == NULL)
|
||||||
exit_with_error("Unable to load a theme.");
|
exit_with_error("Unable to load a theme.");
|
||||||
|
|
||||||
frame_startup();
|
|
||||||
moveresize_startup();
|
moveresize_startup();
|
||||||
screen_startup();
|
screen_startup();
|
||||||
group_startup();
|
group_startup();
|
||||||
|
@ -271,7 +270,6 @@ int main(int argc, char **argv)
|
||||||
screen_shutdown();
|
screen_shutdown();
|
||||||
focus_shutdown();
|
focus_shutdown();
|
||||||
moveresize_shutdown();
|
moveresize_shutdown();
|
||||||
frame_shutdown();
|
|
||||||
menu_shutdown();
|
menu_shutdown();
|
||||||
window_shutdown();
|
window_shutdown();
|
||||||
grab_shutdown();
|
grab_shutdown();
|
||||||
|
|
|
@ -31,44 +31,14 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
|
||||||
|
|
||||||
theme->inst = inst;
|
theme->inst = inst;
|
||||||
|
|
||||||
theme->b_color = theme->cb_unfocused_color = theme->cb_focused_color =
|
theme->a_disabled_focused_max = RrAppearanceNew(inst, 1);
|
||||||
theme->title_unfocused_color = theme->title_focused_color =
|
theme->a_disabled_unfocused_max = RrAppearanceNew(inst, 1);
|
||||||
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_focused_unpressed_max = RrAppearanceNew(inst, 1);
|
theme->a_focused_unpressed_max = RrAppearanceNew(inst, 1);
|
||||||
theme->a_focused_pressed_max = RrAppearanceNew(inst, 1);
|
theme->a_focused_pressed_max = RrAppearanceNew(inst, 1);
|
||||||
theme->a_focused_pressed_set_max = RrAppearanceNew(inst, 1);
|
theme->a_focused_pressed_set_max = RrAppearanceNew(inst, 1);
|
||||||
theme->a_unfocused_unpressed_max = RrAppearanceNew(inst, 1);
|
theme->a_unfocused_unpressed_max = RrAppearanceNew(inst, 1);
|
||||||
theme->a_unfocused_pressed_max = RrAppearanceNew(inst, 1);
|
theme->a_unfocused_pressed_max = RrAppearanceNew(inst, 1);
|
||||||
theme->a_unfocused_pressed_set_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_focused_grip = RrAppearanceNew(inst, 0);
|
||||||
theme->a_unfocused_grip = RrAppearanceNew(inst, 0);
|
theme->a_unfocused_grip = RrAppearanceNew(inst, 0);
|
||||||
theme->a_focused_title = RrAppearanceNew(inst, 0);
|
theme->a_focused_title = RrAppearanceNew(inst, 0);
|
||||||
|
@ -194,6 +164,15 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
|
||||||
"window.label.unfocus.textColor",
|
"window.label.unfocus.textColor",
|
||||||
&theme->title_unfocused_color))
|
&theme->title_unfocused_color))
|
||||||
theme->title_unfocused_color = RrColorNew(inst, 0xff, 0xff, 0xff);
|
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,
|
if (!read_color(db, inst,
|
||||||
"window.button.focus.picColor",
|
"window.button.focus.picColor",
|
||||||
&theme->titlebut_focused_color))
|
&theme->titlebut_focused_color))
|
||||||
|
@ -322,6 +301,14 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
|
||||||
set_default_appearance(theme->app_unhilite_label);
|
set_default_appearance(theme->app_unhilite_label);
|
||||||
|
|
||||||
/* read buttons textures */
|
/* 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,
|
if (!read_appearance(db, inst,
|
||||||
"window.button.pressed.focus",
|
"window.button.pressed.focus",
|
||||||
theme->a_focused_pressed_max))
|
theme->a_focused_pressed_max))
|
||||||
|
@ -345,6 +332,10 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
|
||||||
theme->a_unfocused_unpressed_max))
|
theme->a_unfocused_unpressed_max))
|
||||||
set_default_appearance(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 =
|
theme->a_unfocused_unpressed_close =
|
||||||
RrAppearanceCopy(theme->a_unfocused_unpressed_max);
|
RrAppearanceCopy(theme->a_unfocused_unpressed_max);
|
||||||
theme->a_unfocused_pressed_close =
|
theme->a_unfocused_pressed_close =
|
||||||
|
@ -353,6 +344,10 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
|
||||||
RrAppearanceCopy(theme->a_focused_unpressed_max);
|
RrAppearanceCopy(theme->a_focused_unpressed_max);
|
||||||
theme->a_focused_pressed_close =
|
theme->a_focused_pressed_close =
|
||||||
RrAppearanceCopy(theme->a_focused_pressed_max);
|
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 =
|
theme->a_unfocused_unpressed_desk =
|
||||||
RrAppearanceCopy(theme->a_unfocused_unpressed_max);
|
RrAppearanceCopy(theme->a_unfocused_unpressed_max);
|
||||||
theme->a_unfocused_pressed_desk =
|
theme->a_unfocused_pressed_desk =
|
||||||
|
@ -365,6 +360,10 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
|
||||||
RrAppearanceCopy(theme->a_focused_pressed_max);
|
RrAppearanceCopy(theme->a_focused_pressed_max);
|
||||||
theme->a_focused_pressed_set_desk =
|
theme->a_focused_pressed_set_desk =
|
||||||
RrAppearanceCopy(theme->a_focused_pressed_max);
|
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 =
|
theme->a_unfocused_unpressed_shade =
|
||||||
RrAppearanceCopy(theme->a_unfocused_unpressed_max);
|
RrAppearanceCopy(theme->a_unfocused_unpressed_max);
|
||||||
theme->a_unfocused_pressed_shade =
|
theme->a_unfocused_pressed_shade =
|
||||||
|
@ -377,6 +376,10 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
|
||||||
RrAppearanceCopy(theme->a_focused_pressed_max);
|
RrAppearanceCopy(theme->a_focused_pressed_max);
|
||||||
theme->a_focused_pressed_set_shade =
|
theme->a_focused_pressed_set_shade =
|
||||||
RrAppearanceCopy(theme->a_focused_pressed_max);
|
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 =
|
theme->a_unfocused_unpressed_iconify =
|
||||||
RrAppearanceCopy(theme->a_unfocused_unpressed_max);
|
RrAppearanceCopy(theme->a_unfocused_unpressed_max);
|
||||||
theme->a_unfocused_pressed_iconify =
|
theme->a_unfocused_pressed_iconify =
|
||||||
|
@ -437,32 +440,44 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
|
||||||
theme->a_menu_hilite->texture[0].data.text.color =
|
theme->a_menu_hilite->texture[0].data.text.color =
|
||||||
theme->menu_hilite_color;
|
theme->menu_hilite_color;
|
||||||
|
|
||||||
|
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_unpressed_max->texture[0].type =
|
||||||
theme->a_focused_pressed_max->texture[0].type =
|
theme->a_focused_pressed_max->texture[0].type =
|
||||||
theme->a_focused_pressed_set_max->texture[0].type =
|
theme->a_focused_pressed_set_max->texture[0].type =
|
||||||
theme->a_unfocused_unpressed_max->texture[0].type =
|
theme->a_unfocused_unpressed_max->texture[0].type =
|
||||||
theme->a_unfocused_pressed_max->texture[0].type =
|
theme->a_unfocused_pressed_max->texture[0].type =
|
||||||
theme->a_unfocused_pressed_set_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_unpressed_close->texture[0].type =
|
||||||
theme->a_focused_pressed_close->texture[0].type =
|
theme->a_focused_pressed_close->texture[0].type =
|
||||||
theme->a_unfocused_unpressed_close->texture[0].type =
|
theme->a_unfocused_unpressed_close->texture[0].type =
|
||||||
theme->a_unfocused_pressed_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_unpressed_desk->texture[0].type =
|
||||||
theme->a_focused_pressed_desk->texture[0].type =
|
theme->a_focused_pressed_desk->texture[0].type =
|
||||||
theme->a_focused_pressed_set_desk->texture[0].type =
|
theme->a_focused_pressed_set_desk->texture[0].type =
|
||||||
theme->a_unfocused_unpressed_desk->texture[0].type =
|
theme->a_unfocused_unpressed_desk->texture[0].type =
|
||||||
theme->a_unfocused_pressed_desk->texture[0].type =
|
theme->a_unfocused_pressed_desk->texture[0].type =
|
||||||
theme->a_unfocused_pressed_set_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_unpressed_shade->texture[0].type =
|
||||||
theme->a_focused_pressed_shade->texture[0].type =
|
theme->a_focused_pressed_shade->texture[0].type =
|
||||||
theme->a_focused_pressed_set_shade->texture[0].type =
|
theme->a_focused_pressed_set_shade->texture[0].type =
|
||||||
theme->a_unfocused_unpressed_shade->texture[0].type =
|
theme->a_unfocused_unpressed_shade->texture[0].type =
|
||||||
theme->a_unfocused_pressed_shade->texture[0].type =
|
theme->a_unfocused_pressed_shade->texture[0].type =
|
||||||
theme->a_unfocused_pressed_set_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_unpressed_iconify->texture[0].type =
|
||||||
theme->a_focused_pressed_iconify->texture[0].type =
|
theme->a_focused_pressed_iconify->texture[0].type =
|
||||||
theme->a_unfocused_unpressed_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_unfocused_pressed_iconify->texture[0].type = RR_TEXTURE_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_focused_unpressed_max->texture[0].data.mask.mask =
|
||||||
theme->a_unfocused_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_focused_pressed_max->texture[0].data.mask.mask =
|
||||||
|
@ -471,11 +486,15 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
|
||||||
theme->a_focused_pressed_set_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->a_unfocused_pressed_set_max->texture[0].data.mask.mask =
|
||||||
theme->max_set_mask;
|
theme->max_set_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_focused_pressed_close->texture[0].data.mask.mask =
|
||||||
theme->a_unfocused_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_focused_unpressed_close->texture[0].data.mask.mask =
|
||||||
theme->a_unfocused_unpressed_close->texture[0].data.mask.mask =
|
theme->a_unfocused_unpressed_close->texture[0].data.mask.mask =
|
||||||
theme->close_mask;
|
theme->close_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_focused_unpressed_desk->texture[0].data.mask.mask =
|
||||||
theme->a_unfocused_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_focused_pressed_desk->texture[0].data.mask.mask =
|
||||||
|
@ -484,6 +503,8 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
|
||||||
theme->a_focused_pressed_set_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->a_unfocused_pressed_set_desk->texture[0].data.mask.mask =
|
||||||
theme->desk_set_mask;
|
theme->desk_set_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_focused_unpressed_shade->texture[0].data.mask.mask =
|
||||||
theme->a_unfocused_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_focused_pressed_shade->texture[0].data.mask.mask =
|
||||||
|
@ -492,11 +513,25 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
|
||||||
theme->a_focused_pressed_set_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->a_unfocused_pressed_set_shade->texture[0].data.mask.mask =
|
||||||
theme->shade_set_mask;
|
theme->shade_set_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_focused_unpressed_iconify->texture[0].data.mask.mask =
|
||||||
theme->a_unfocused_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_focused_pressed_iconify->texture[0].data.mask.mask =
|
||||||
theme->a_unfocused_pressed_iconify->texture[0].data.mask.mask =
|
theme->a_unfocused_pressed_iconify->texture[0].data.mask.mask =
|
||||||
theme->iconify_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_unpressed_max->texture[0].data.mask.color =
|
||||||
theme->a_focused_pressed_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 =
|
theme->a_focused_pressed_set_max->texture[0].data.mask.color =
|
||||||
|
|
|
@ -27,6 +27,8 @@ struct _RrTheme {
|
||||||
RrColor *cb_unfocused_color;
|
RrColor *cb_unfocused_color;
|
||||||
RrColor *title_focused_color;
|
RrColor *title_focused_color;
|
||||||
RrColor *title_unfocused_color;
|
RrColor *title_unfocused_color;
|
||||||
|
RrColor *titlebut_disabled_focused_color;
|
||||||
|
RrColor *titlebut_disabled_unfocused_color;
|
||||||
RrColor *titlebut_focused_color;
|
RrColor *titlebut_focused_color;
|
||||||
RrColor *titlebut_unfocused_color;
|
RrColor *titlebut_unfocused_color;
|
||||||
RrColor *menu_title_color;
|
RrColor *menu_title_color;
|
||||||
|
@ -56,28 +58,38 @@ struct _RrTheme {
|
||||||
RrPixmapMask *close_mask;
|
RrPixmapMask *close_mask;
|
||||||
|
|
||||||
/* global appearances */
|
/* global appearances */
|
||||||
|
RrAppearance *a_disabled_focused_max;
|
||||||
|
RrAppearance *a_disabled_unfocused_max;
|
||||||
RrAppearance *a_focused_unpressed_max;
|
RrAppearance *a_focused_unpressed_max;
|
||||||
RrAppearance *a_focused_pressed_max;
|
RrAppearance *a_focused_pressed_max;
|
||||||
RrAppearance *a_focused_pressed_set_max;
|
RrAppearance *a_focused_pressed_set_max;
|
||||||
RrAppearance *a_unfocused_unpressed_max;
|
RrAppearance *a_unfocused_unpressed_max;
|
||||||
RrAppearance *a_unfocused_pressed_max;
|
RrAppearance *a_unfocused_pressed_max;
|
||||||
RrAppearance *a_unfocused_pressed_set_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_unpressed_close;
|
||||||
RrAppearance *a_focused_pressed_close;
|
RrAppearance *a_focused_pressed_close;
|
||||||
RrAppearance *a_unfocused_unpressed_close;
|
RrAppearance *a_unfocused_unpressed_close;
|
||||||
RrAppearance *a_unfocused_pressed_close;
|
RrAppearance *a_unfocused_pressed_close;
|
||||||
|
RrAppearance *a_disabled_focused_desk;
|
||||||
|
RrAppearance *a_disabled_unfocused_desk;
|
||||||
RrAppearance *a_focused_unpressed_desk;
|
RrAppearance *a_focused_unpressed_desk;
|
||||||
RrAppearance *a_focused_pressed_desk;
|
RrAppearance *a_focused_pressed_desk;
|
||||||
RrAppearance *a_focused_pressed_set_desk;
|
RrAppearance *a_focused_pressed_set_desk;
|
||||||
RrAppearance *a_unfocused_unpressed_desk;
|
RrAppearance *a_unfocused_unpressed_desk;
|
||||||
RrAppearance *a_unfocused_pressed_desk;
|
RrAppearance *a_unfocused_pressed_desk;
|
||||||
RrAppearance *a_unfocused_pressed_set_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_unpressed_shade;
|
||||||
RrAppearance *a_focused_pressed_shade;
|
RrAppearance *a_focused_pressed_shade;
|
||||||
RrAppearance *a_focused_pressed_set_shade;
|
RrAppearance *a_focused_pressed_set_shade;
|
||||||
RrAppearance *a_unfocused_unpressed_shade;
|
RrAppearance *a_unfocused_unpressed_shade;
|
||||||
RrAppearance *a_unfocused_pressed_shade;
|
RrAppearance *a_unfocused_pressed_shade;
|
||||||
RrAppearance *a_unfocused_pressed_set_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_unpressed_iconify;
|
||||||
RrAppearance *a_focused_pressed_iconify;
|
RrAppearance *a_focused_pressed_iconify;
|
||||||
RrAppearance *a_unfocused_unpressed_iconify;
|
RrAppearance *a_unfocused_unpressed_iconify;
|
||||||
|
|
|
@ -7,3 +7,4 @@ modal3
|
||||||
urgent
|
urgent
|
||||||
icons
|
icons
|
||||||
override
|
override
|
||||||
|
noresize
|
||||||
|
|
61
tests/noresize.c
Normal file
61
tests/noresize.c
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
#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;
|
||||||
|
}
|
Loading…
Reference in a new issue