mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
fix solid color for framewin with plugin
This commit is contained in:
@@ -946,6 +946,11 @@ void
|
|||||||
wFrameWindowPaint(WFrameWindow *fwin)
|
wFrameWindowPaint(WFrameWindow *fwin)
|
||||||
{
|
{
|
||||||
WScreen *scr = fwin->screen_ptr;
|
WScreen *scr = fwin->screen_ptr;
|
||||||
|
#ifdef DRAWSTRING_PLUGIN
|
||||||
|
Pixmap *background;
|
||||||
|
Pixmap tmp_bg;
|
||||||
|
int tb = fwin->top_width;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (fwin->flags.is_client_window_frame)
|
if (fwin->flags.is_client_window_frame)
|
||||||
fwin->flags.justification = wPreferences.title_justification;
|
fwin->flags.justification = wPreferences.title_justification;
|
||||||
@@ -980,11 +985,27 @@ wFrameWindowPaint(WFrameWindow *fwin)
|
|||||||
|
|
||||||
if (fwin->titlebar && !fwin->flags.repaint_only_resizebar
|
if (fwin->titlebar && !fwin->flags.repaint_only_resizebar
|
||||||
&& fwin->title_texture[fwin->flags.state]->any.type==WTEX_SOLID) {
|
&& fwin->title_texture[fwin->flags.state]->any.type==WTEX_SOLID) {
|
||||||
|
#ifdef DRAWSTRING_PLUGIN
|
||||||
|
tmp_bg = XCreatePixmap(dpy, fwin->titlebar->window,
|
||||||
|
fwin->titlebar->width, tb,
|
||||||
|
DefaultDepth(dpy, DefaultScreen(dpy)));
|
||||||
|
XFillRectangle(dpy, tmp_bg, (*fwin->title_texture)->solid.normal_gc,
|
||||||
|
0, 0, fwin->titlebar->width, tb);
|
||||||
|
wDrawBevel(tmp_bg, fwin->titlebar->width,
|
||||||
|
fwin->titlebar->height,
|
||||||
|
(WTexSolid*)fwin->title_texture[fwin->flags.state],
|
||||||
|
WREL_RAISED);
|
||||||
|
background = &tmp_bg;
|
||||||
|
#else
|
||||||
wDrawBevel(fwin->titlebar->window, fwin->titlebar->width,
|
wDrawBevel(fwin->titlebar->window, fwin->titlebar->width,
|
||||||
fwin->titlebar->height,
|
fwin->titlebar->height,
|
||||||
(WTexSolid*)fwin->title_texture[fwin->flags.state],
|
(WTexSolid*)fwin->title_texture[fwin->flags.state],
|
||||||
WREL_RAISED);
|
WREL_RAISED);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
#ifdef DRAWSTRING_PLUGIN
|
||||||
|
else background = &fwin->title_back[fwin->flags.state];
|
||||||
|
#endif
|
||||||
|
|
||||||
if (fwin->resizebar && !fwin->flags.repaint_only_titlebar
|
if (fwin->resizebar && !fwin->flags.repaint_only_titlebar
|
||||||
&& fwin->resizebar_texture[0]->any.type == WTEX_SOLID) {
|
&& fwin->resizebar_texture[0]->any.type == WTEX_SOLID) {
|
||||||
@@ -1077,19 +1098,19 @@ wFrameWindowPaint(WFrameWindow *fwin)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
XSetForeground(dpy, *fwin->title_gc,
|
XSetForeground(dpy, *fwin->title_gc,
|
||||||
fwin->title_pixel[fwin->flags.state]);
|
fwin->title_pixel[fwin->flags.state]);
|
||||||
|
|
||||||
#ifdef DRAWSTRING_PLUGIN
|
#ifdef DRAWSTRING_PLUGIN
|
||||||
#define DRAWSTRING_CURRENT_STATE fwin->flags.state + fwin->drawstring_proc_offset
|
#define DRAWSTRING_CURRENT_STATE fwin->flags.state + fwin->drawstring_proc_offset
|
||||||
if (scr->drawstring_func[DRAWSTRING_CURRENT_STATE]) {
|
if (scr->drawstring_func[DRAWSTRING_CURRENT_STATE]) {
|
||||||
int tb = fwin->top_width;
|
void **p;
|
||||||
void **p = wPluginPackData(6,
|
|
||||||
|
p = wPluginPackData(6,
|
||||||
/* 0 number of argument, will be passed */
|
/* 0 number of argument, will be passed */
|
||||||
scr->drawstring_func[DRAWSTRING_CURRENT_STATE]->data,
|
scr->drawstring_func[DRAWSTRING_CURRENT_STATE]->data,
|
||||||
/* 1 plugin data, as it was initialized */
|
/* 1 plugin data, as it was initialized */
|
||||||
&fwin->title_back[fwin->flags.state],
|
background,
|
||||||
/* 2 current background Pixmap */
|
/* 2 current background Pixmap */
|
||||||
fwin->title_gc, /* 3 gc */
|
fwin->title_gc, /* 3 gc */
|
||||||
*fwin->font, /* 4 WMFont** */
|
*fwin->font, /* 4 WMFont** */
|
||||||
@@ -1109,6 +1130,11 @@ wFrameWindowPaint(WFrameWindow *fwin)
|
|||||||
x, ((signed)fwin->top_width - (signed)WMFontHeight(*fwin->font))/2,
|
x, ((signed)fwin->top_width - (signed)WMFontHeight(*fwin->font))/2,
|
||||||
title, titlelen);
|
title, titlelen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fwin->titlebar && !fwin->flags.repaint_only_resizebar
|
||||||
|
&& fwin->title_texture[fwin->flags.state]->any.type==WTEX_SOLID) {
|
||||||
|
XFreePixmap(dpy, tmp_bg);
|
||||||
|
}
|
||||||
#undef DRAWSTRING_CURRENT_STATE
|
#undef DRAWSTRING_CURRENT_STATE
|
||||||
#else
|
#else
|
||||||
WMDrawString(scr->wmscreen, fwin->titlebar->window,
|
WMDrawString(scr->wmscreen, fwin->titlebar->window,
|
||||||
|
|||||||
@@ -814,7 +814,8 @@ paintEntry(WMenu *menu, int index, int selected)
|
|||||||
DefaultDepth(dpy, DefaultScreen(dpy)));
|
DefaultDepth(dpy, DefaultScreen(dpy)));
|
||||||
|
|
||||||
if (scr->menu_item_texture->any.type == WTEX_SOLID) {
|
if (scr->menu_item_texture->any.type == WTEX_SOLID) {
|
||||||
XFillRectangle(dpy, tmp_bg, scr->menu_item_texture->solid.normal_gc, 0, 0, w, h);
|
XFillRectangle(dpy, tmp_bg, scr->menu_item_texture->solid.normal_gc,
|
||||||
|
0, 0, w, h);
|
||||||
drawFrame(scr, tmp_bg, 0, w, h, type);
|
drawFrame(scr, tmp_bg, 0, w, h, type);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user