diff --git a/src/WindowMaker.h b/src/WindowMaker.h index 3bbcb740..6fdb4c5e 100644 --- a/src/WindowMaker.h +++ b/src/WindowMaker.h @@ -311,6 +311,8 @@ typedef struct WPreferences { same workspace as parent */ signed char title_justification; /* titlebar text alignment */ + int title_clearance; + char multi_byte_text; #ifdef KEEP_XKB_LOCK_STATUS char modelock; diff --git a/src/defaults.c b/src/defaults.c index 8ff4d9d3..f985422a 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -141,6 +141,7 @@ static int getRImage(); /* value setting functions */ static int setJustify(); +static int setClearance(); static int setIfDockPresent(); static int setStickyIcons(); /* @@ -557,6 +558,9 @@ WDefaultEntry optionList[] = { {"WindowTitleFont", DEF_TITLE_FONT, NULL, NULL, getFont, setWinTitleFont, }, + {"WindowTitleClearance", DEF_TITLE_CLEARANCE, NULL, + &wPreferences.title_clearance, getInt, setClearance + }, {"MenuTitleFont", DEF_MENU_TITLE_FONT, NULL, NULL, getFont, setMenuTitleFont }, @@ -2407,6 +2411,11 @@ setJustify(WScreen *scr, WDefaultEntry *entry, WTexture **texture, void *foo) return REFRESH_WINDOW_TITLE_COLOR; } +static int +setClearance(WScreen *scr, WDefaultEntry *entry, void *bar, void *foo) +{ + return REFRESH_WINDOW_FONT|REFRESH_BUTTON_IMAGES|REFRESH_MENU_TITLE_FONT; +} static int setIfDockPresent(WScreen *scr, WDefaultEntry *entry, int *flag, long which) diff --git a/src/framewin.c b/src/framewin.c index e3ef3380..2c888002 100644 --- a/src/framewin.c +++ b/src/framewin.c @@ -136,7 +136,7 @@ wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags) height = fwin->core->height - fwin->top_width - fwin->bottom_width; if (flags & WFF_TITLEBAR) - theight = WMFontHeight(*fwin->font) + TITLEBAR_EXTRA_HEIGHT; + theight = WMFontHeight(*fwin->font) + TITLEBAR_EXTRA_HEIGHT + (wPreferences.title_clearance << 1); else theight = 0; @@ -470,7 +470,7 @@ updateTitlebar(WFrameWindow *fwin) int x, w; int theight; - theight = WMFontHeight(*fwin->font) + TITLEBAR_EXTRA_HEIGHT; + theight = WMFontHeight(*fwin->font) + TITLEBAR_EXTRA_HEIGHT + (wPreferences.title_clearance << 1); x = 0; w = fwin->core->width + 1; @@ -1081,16 +1081,16 @@ wFrameWindowPaint(WFrameWindow *fwin) proc.drawString(scr->drawstring_func[fwin->flags.state + fwin->drawstring_proc_offset]->arg, fwin->titlebar->window, *fwin->title_gc, - *fwin->font, x, TITLEBAR_EXTRA_HEIGHT/2, + *fwin->font, x, wPreferences.title_clearance + TITLEBAR_EXTRA_HEIGHT/2, fwin->titlebar->width, fwin->top_width, title, titlelen); } else { WMDrawString(scr->wmscreen, fwin->titlebar->window, - *fwin->title_gc, *fwin->font, x, TITLEBAR_EXTRA_HEIGHT/2, + *fwin->title_gc, *fwin->font, x, wPreferences.title_clearance + TITLEBAR_EXTRA_HEIGHT/2, title, titlelen); } #else WMDrawString(scr->wmscreen, fwin->titlebar->window, - *fwin->title_gc, *fwin->font, x, TITLEBAR_EXTRA_HEIGHT/2, + *fwin->title_gc, *fwin->font, x, wPreferences.title_clearance + TITLEBAR_EXTRA_HEIGHT/2, title, titlelen); #endif /* DRAWSTRING_PLUGIN */ diff --git a/src/wconfig.h.in b/src/wconfig.h.in index 6b5e7d68..035ec796 100644 --- a/src/wconfig.h.in +++ b/src/wconfig.h.in @@ -315,6 +315,8 @@ #define DEF_FRAME_THICKNESS 1 /* linewidth of the move/resize frame */ +#define DEF_TITLE_CLEARANCE 0 + #define DEF_XPM_CLOSENESS 40000 /* default position of application menus */ diff --git a/src/window.c b/src/window.c index 6c62664c..81d32fcd 100644 --- a/src/window.c +++ b/src/window.c @@ -145,7 +145,15 @@ appearanceObserver(void *self, WMNotification *notif) return; if (flags & WFontSettings) { - wWindowConfigureBorders(wwin); + wWindowConfigureBorders(wwin); + if(wwin->flags.shaded) { + wFrameWindowResize(wwin->frame, wwin->frame->core->width, + wwin->frame->top_width - 1); + + wwin->client.y = wwin->frame_y - wwin->client.height + + wwin->frame->top_width; + wWindowSynthConfigureNotify(wwin); + } } if (flags & WTextureSettings) { wwin->frame->flags.need_texture_remake = 1;