diff --git a/ChangeLog b/ChangeLog index 4c47080..8fcb25a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,12 @@ * 。 **************************************************************************/ +2023年 06月 14日 星期三 00:40:39 CST gsm <406643764@qq.com> + * 發布第2.2.5版; + * 修復縮微窗口顏色異常的缺陷; + * 調整縮微窗口最大寬度; + * 調整配色方案。 + 2023年 06月 13日 星期二 16:04:07 CST gsm <406643764@qq.com> * 發布第2.2.4版; * 修復在堆疊模式和預覽模式下缺失標題欄按鈕的缺陷; diff --git a/NEWS b/NEWS index 0f932e1..51b14ff 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,11 @@ * 。 * ************************************************************************/ +第2.2.5版: + * 修復縮微窗口顏色異常的缺陷; + * 調整縮微窗口最大寬度; + * 調整配色方案。 + 第2.2.4版: * 修復在堆疊模式和預覽模式下缺失標題欄按鈕的缺陷; * 調整文字對齊方式、與構件的間距; diff --git a/TODO b/TODO index af8aa5f..d2e1bd3 100644 --- a/TODO +++ b/TODO @@ -9,6 +9,9 @@ * 。 * ************************************************************************/ +第2.2.5版的下一步的開發計劃: + * 支持EWMH的_NET_WM_*NAME應用程序窗口特性。 + 第2.2.4版的下一步的開發計劃: * 支持EWMH的_NET_WM_*NAME應用程序窗口特性; * 對外觀進行微調。 diff --git a/man/en_GB/man1/gwm.1 b/man/en_GB/man1/gwm.1 index b340eef..b5ab4f4 100644 --- a/man/en_GB/man1/gwm.1 +++ b/man/en_GB/man1/gwm.1 @@ -12,7 +12,7 @@ ./" program. Otherwise, see . ./" ************************************************* ***************************/ -.TH gwm 1 June 2023 "gwm 2.2.4" gwm +.TH gwm 1 June 2023 "gwm 2.2.5" gwm . .SH NAME gwm \- gwm (gsm's window manager), is an X11-based dynamic window manager written in C language. diff --git a/man/zh_CN/man1/gwm.1 b/man/zh_CN/man1/gwm.1 index 566fe83..fb1f2e4 100644 --- a/man/zh_CN/man1/gwm.1 +++ b/man/zh_CN/man1/gwm.1 @@ -9,7 +9,7 @@ ./" 。 ./" ************************************************************************/ -.TH gwm 1 2023年6月 "gwm 2.2.4" gwm +.TH gwm 1 2023年6月 "gwm 2.2.5" gwm . .SH 名称 .B diff --git a/man/zh_HK/man1/gwm.1 b/man/zh_HK/man1/gwm.1 index 563971e..67ebef2 100644 --- a/man/zh_HK/man1/gwm.1 +++ b/man/zh_HK/man1/gwm.1 @@ -8,7 +8,7 @@ ./" 你應該已經收到一份附隨此程序的GNU通用公共許可證副本。否則,請參閱 ./" 。 ./" ************************************************************************/ -.TH gwm 1 2023年6月 "gwm 2.2.4" gwm +.TH gwm 1 2023年6月 "gwm 2.2.5" gwm . .SH 名稱 gwm \- gwm(gsm's window manager),是一個用C語言編寫的基於X11的動態窗口管理器。 diff --git a/po/en_GB/LC_MESSAGES/gwm.po b/po/en_GB/LC_MESSAGES/gwm.po index 98c9d46..8fecbbc 100644 --- a/po/en_GB/LC_MESSAGES/gwm.po +++ b/po/en_GB/LC_MESSAGES/gwm.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: gwm 2.2.4\n" +"Project-Id-Version: gwm 2.2.5\n" "Report-Msgid-Bugs-To: 406643764@qq.com\n" "POT-Creation-Date: 2023-06-13 16:05+0800\n" "PO-Revision-Date: 2023-05-05 11:26+0800\n" diff --git a/po/zh_CN/LC_MESSAGES/gwm.po b/po/zh_CN/LC_MESSAGES/gwm.po index 0d1c3d1..a4c2c88 100644 --- a/po/zh_CN/LC_MESSAGES/gwm.po +++ b/po/zh_CN/LC_MESSAGES/gwm.po @@ -6,7 +6,7 @@ # msgid "" msgstr "" -"Project-Id-Version: gwm 2.2.4\n" +"Project-Id-Version: gwm 2.2.5\n" "Report-Msgid-Bugs-To: 406643764@qq.com\n" "POT-Creation-Date: 2023-06-13 16:05+0800\n" "PO-Revision-Date: 2023-05-05 09:56+0800\n" diff --git a/src/config.c b/src/config.c index 69ef2d6..4faa626 100644 --- a/src/config.c +++ b/src/config.c @@ -290,7 +290,7 @@ static void config_widget_size(WM *wm) c->win_gap=c->border_width*2; c->status_area_width_max=c->font_size[TASKBAR_FONT]*30; c->taskbar_button_width=get_font_height_by_pad(wm, TASKBAR_FONT)/0.618+0.5; - c->icon_win_width_max=c->font_size[TASKBAR_FONT]*10; + c->icon_win_width_max=c->font_size[TASKBAR_FONT]*15; c->icon_gap=c->font_size[TASKBAR_FONT]/2.0+0.5; c->act_center_item_width=c->font_size[ACT_CENTER_FONT]*8; c->run_cmd_entry_width=c->font_size[ACT_CENTER_FONT]*16; @@ -327,10 +327,10 @@ static void config_cursor_shape(WM *wm) */ static void config_widget_color_for_dark(WM *wm) { - SET_WIDGET_COLOR_NAME(wm, DARK_THEME, NORMAL_BORDER_COLOR, "grey31"); - SET_WIDGET_COLOR_NAME(wm, DARK_THEME, CURRENT_BORDER_COLOR, "grey11"); - SET_WIDGET_COLOR_NAME(wm, DARK_THEME, NORMAL_TITLEBAR_COLOR, "grey31"); - SET_WIDGET_COLOR_NAME(wm, DARK_THEME, CURRENT_TITLEBAR_COLOR, "grey11"); + SET_WIDGET_COLOR_NAME(wm, DARK_THEME, NORMAL_BORDER_COLOR, "grey11"); + SET_WIDGET_COLOR_NAME(wm, DARK_THEME, CURRENT_BORDER_COLOR, "grey31"); + SET_WIDGET_COLOR_NAME(wm, DARK_THEME, NORMAL_TITLEBAR_COLOR, "grey11"); + SET_WIDGET_COLOR_NAME(wm, DARK_THEME, CURRENT_TITLEBAR_COLOR, "grey31"); SET_WIDGET_COLOR_NAME(wm, DARK_THEME, ENTERED_NORMAL_BUTTON_COLOR, "DarkOrange"); SET_WIDGET_COLOR_NAME(wm, DARK_THEME, ENTERED_CLOSE_BUTTON_COLOR, "red"); SET_WIDGET_COLOR_NAME(wm, DARK_THEME, NORMAL_BUTTON_COLOR, "grey21"); @@ -338,7 +338,7 @@ static void config_widget_color_for_dark(WM *wm) SET_WIDGET_COLOR_NAME(wm, DARK_THEME, ACT_CENTER_COLOR, "grey31"); SET_WIDGET_COLOR_NAME(wm, DARK_THEME, TASKBAR_COLOR, "grey21"); SET_WIDGET_COLOR_NAME(wm, DARK_THEME, ENTRY_COLOR, "white"); - SET_WIDGET_COLOR_NAME(wm, DARK_THEME, HINT_WIN_COLOR, "grey91"); + SET_WIDGET_COLOR_NAME(wm, DARK_THEME, HINT_WIN_COLOR, "grey81"); SET_WIDGET_COLOR_NAME(wm, DARK_THEME, ROOT_WIN_COLOR, "black"); } @@ -395,13 +395,13 @@ static void config_widget_color(WM *wm) */ static void config_text_color_for_dark(WM *wm) { - SET_TEXT_COLOR_NAME(wm, DARK_THEME, NORMAL_TITLEBAR_TEXT_COLOR, "grey61"); + SET_TEXT_COLOR_NAME(wm, DARK_THEME, NORMAL_TITLEBAR_TEXT_COLOR, "grey71"); SET_TEXT_COLOR_NAME(wm, DARK_THEME, CURRENT_TITLEBAR_TEXT_COLOR, "LightGreen"); SET_TEXT_COLOR_NAME(wm, DARK_THEME, TASKBAR_TEXT_COLOR, "white"); SET_TEXT_COLOR_NAME(wm, DARK_THEME, CLASS_TEXT_COLOR, "RosyBrown"); SET_TEXT_COLOR_NAME(wm, DARK_THEME, ACT_CENTER_ITEM_TEXT_COLOR, "white"); SET_TEXT_COLOR_NAME(wm, DARK_THEME, ENTRY_TEXT_COLOR, "black"); - SET_TEXT_COLOR_NAME(wm, DARK_THEME, HINT_TEXT_COLOR, "grey41"); + SET_TEXT_COLOR_NAME(wm, DARK_THEME, HINT_TEXT_COLOR, "SkyBlue4"); } /* 功能:爲默認顏色主題設置文字顏色。 diff --git a/src/font.c b/src/font.c index afb7d94..b5c073a 100644 --- a/src/font.c +++ b/src/font.c @@ -56,17 +56,15 @@ void draw_string(WM *wm, Drawable d, const char *str, const String_format *f) } XftDraw *draw=XftDrawCreate(wm->display, d, wm->visual, wm->colormap); - const char *es="︙"; + XftDrawStringUtf8(draw, &f->fg, font, sx, sy, (const FcChar8 *)str, n); if(f->trunc && sw+2*pad>w) { + const char *es="︙"; int ew, en=strlen(es); get_string_size(wm, font, es, &ew, NULL); - XftDrawStringUtf8(draw, &f->fg, font, sx, sy, (const FcChar8 *)str, n); XClearArea(wm->display, d, x+w-ew, 0, ew, h, False); XftDrawStringUtf8(draw, &TEXT_COLOR(wm, HINT), font, x+w-ew, sy, (const FcChar8 *)es, en); } - else - XftDrawStringUtf8(draw, &f->fg, font, sx, sy, (const FcChar8 *)str, n); XftDrawDestroy(draw); } diff --git a/src/icon.c b/src/icon.c index bbe0e8b..0a4bc80 100644 --- a/src/icon.c +++ b/src/icon.c @@ -40,6 +40,8 @@ static FILE *open_index_theme(const char *base_dir, const char *theme); static size_t get_spec_char_num(const char *str, int ch); static char **get_parent_themes(const char *base_dir, const char *theme); static bool is_accessible(const char *filename); +static bool have_same_class_icon_client(WM *wm, Client *c); + void draw_image(WM *wm, Imlib_Image image, Drawable d, int x, int y, int w, int h) { @@ -383,17 +385,15 @@ static bool is_accessible(const char *filename) return !stat(filename, &buf); } -static bool have_same_class_icon_client(WM *wm, Client *c); - void iconify(WM *wm, Client *c) { - c->icon->area_type=c->area_type==ICONIFY_AREA ? wm->cfg->default_area_type : c->area_type; + Icon *i=c->icon; + + update_win_bg(wm, i->win, WIDGET_COLOR(wm, TASKBAR), None); + i->area_type=c->area_type==ICONIFY_AREA ? wm->cfg->default_area_type : c->area_type; c->area_type=ICONIFY_AREA; - c->icon->title_text=get_text_prop(wm, c->win, XA_WM_ICON_NAME); - if(!c->icon->title_text) - c->icon->title_text=copy_string(c->title_text); update_icon_area(wm); - XMapWindow(wm->display, c->icon->win); + XMapWindow(wm->display, i->win); XUnmapWindow(wm->display, c->frame); if(c == DESKTOP(wm)->cur_focus_client) { @@ -405,8 +405,11 @@ void iconify(WM *wm, Client *c) void create_icon(WM *wm, Client *c) { Icon *i=c->icon=malloc_s(sizeof(Icon)); - i->x=0, i->y=0, i->w=i->h=wm->taskbar->h, i->title_text=NULL; - i->win=XCreateSimpleWindow(wm->display, wm->taskbar->icon_area, i->x, i->y, + i->x=i->y=0, i->w=i->h=wm->taskbar->h; + i->title_text=get_text_prop(wm, c->win, XA_WM_ICON_NAME); + if(!i->title_text) + i->title_text=copy_string(c->title_text); + i->win=XCreateSimpleWindow(wm->display, wm->taskbar->icon_area, 0, 0, i->w, i->h, 0, 0, WIDGET_COLOR(wm, TASKBAR)); XSelectInput(wm->display, c->icon->win, ICON_WIN_EVENT_MASK); set_icon_image(wm, c); @@ -459,15 +462,18 @@ void deiconify(WM *wm, Client *c) void del_icon(WM *wm, Client *c) { - XDestroyWindow(wm->display, c->icon->win); - c->area_type=c->icon->area_type; if(c->icon->image) { imlib_context_set_image(c->icon->image); imlib_free_image(); } - vfree(c->icon->title_text, c->icon, NULL); - update_icon_area(wm); + if(c->area_type == ICONIFY_AREA) + { + XDestroyWindow(wm->display, c->icon->win); + c->area_type=c->icon->area_type; + vfree(c->icon->title_text, c->icon, NULL); + update_icon_area(wm); + } } void iconify_all_clients(WM *wm) diff --git a/src/taskbar.c b/src/taskbar.c index a69f16c..17446d1 100644 --- a/src/taskbar.c +++ b/src/taskbar.c @@ -132,9 +132,8 @@ void update_client_icon_win(WM *wm, Window win) if(i->show_text) { String_format f={{wm->taskbar->h, 0, i->w-wm->taskbar->h, i->h}, - CENTER_LEFT, true, true, false, 0, c==CUR_FOC_CLI(wm) ? - TEXT_COLOR(wm, CURRENT_TITLEBAR) - : TEXT_COLOR(wm, NORMAL_TITLEBAR), TITLEBAR_FONT}; + CENTER, true, false, false, 0, + TEXT_COLOR(wm, TASKBAR), TASKBAR_FONT}; draw_string(wm, i->win, i->title_text, &f); } }