From 2effbfafde8d20227c9b0bfe8f4a6c532a35d9ce Mon Sep 17 00:00:00 2001 From: kojima Date: Sun, 18 Apr 1999 21:08:00 +0000 Subject: [PATCH] various bug fixes --- ChangeLog | 6 ++-- NEWS | 7 +++++ WPrefs.app/Menu.c | 13 +++++++- WPrefs.app/MouseSettings.c | 11 +++---- src/dialog.c | 6 ++-- src/dock.c | 7 ++--- src/dockedapp.c | 13 ++++---- src/event.c | 16 +++++----- src/kwm.c | 2 -- src/placement.c | 1 + src/screen.h | 2 -- util/getstyle.c | 8 ++--- util/setstyle.c | 75 +++++++++++++++++++++++++++++++++------------- 13 files changed, 108 insertions(+), 59 deletions(-) diff --git a/ChangeLog b/ChangeLog index d69d2ef5..abb1b926 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,7 +8,6 @@ Changes since version 0.52.0: - fixed window move through workspaces in nonopaquemove - added message to immediately reread configuration data - fixed some bug in XKB modelock toggling -- KDE: added kfm icon selection - fixed crash bug when hiding apps with appicon disabled - fixed wrong initial workspace # being shown on attributes panel - XSMP updates @@ -24,10 +23,13 @@ Changes since version 0.52.0: - fixed the problem with showing a window as focused in the window list menu while it was on another workspace. - show workspace name on screen when switching workspaces +- made setstyle support WorkspaceSpecificBack +- fixed getstyle prob with filenames with spaces (Pierre Phaneuf + browser); if (pop == panel->cmd2P) { @@ -494,6 +495,10 @@ performCommand(WMWidget *w, void *data) updateForItemType(panel, TNothing); panel->editedItem = NULL; panel->unsaved = 1; + if (pop == panel->cmd1P) { + WMSetTextFieldText(panel->tit2T, NULL); + } + removed = True; return; case CCut: if (row < 0) @@ -505,7 +510,6 @@ performCommand(WMWidget *w, void *data) } if (panel->itemClipboard) PLRelease(panel->itemClipboard); - WMRemoveBrowserItem(panel->browser, column, row); menuItem = PLGetArrayElement(menu, row+1); PLRemoveArrayElement(menu, row+1); @@ -516,6 +520,7 @@ performCommand(WMWidget *w, void *data) WMSetPopUpButtonItemEnabled(panel->cmd1P, CPaste, True); WMSetPopUpButtonItemEnabled(panel->cmd2P, CPaste, True); panel->unsaved = 1; + removed = True; return; case CCopy: if (row < 0) @@ -553,6 +558,12 @@ performCommand(WMWidget *w, void *data) PLInsertArrayElement(menu, menuItem, row+1); free(title); panel->unsaved = 1; + + if (removed) { + if (pop == panel->cmd1P) { + WMSetTextFieldText(panel->tit2T, NULL); + } + } } diff --git a/WPrefs.app/MouseSettings.c b/WPrefs.app/MouseSettings.c index 184e067d..c48154c6 100644 --- a/WPrefs.app/MouseSettings.c +++ b/WPrefs.app/MouseSettings.c @@ -777,14 +777,11 @@ static void storeCommandInScript(char *cmd, char *line) { char *path; - char *p; FILE *f; char buffer[128]; - p = wusergnusteppath(); - path = wmalloc(strlen(p)+64); - sprintf(path, "%s/Library/WindowMaker/autostart", p); - + path = wstrappend(wusergnusteppath(), "/Library/WindowMaker/autostart"); + f = fopen(path, "r"); if (!f) { f = fopen(path, "w"); @@ -801,8 +798,8 @@ storeCommandInScript(char *cmd, char *line) char *tmppath; FILE *fo; - tmppath = wmalloc(strlen(p)+64); - sprintf(tmppath, "%s/Library/WindowMaker/autostart.tmp", p); + tmppath = wstrappend(wusergnusteppath(), + "/Library/WindowMaker/autostart.tmp"); fo = fopen(tmppath, "w"); if (!fo) { wsyserror(_("could not create temporary file %s"), tmppath); diff --git a/src/dialog.c b/src/dialog.c index d1a2e8be..15f51217 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -968,8 +968,10 @@ wShowInfoPanel(WScreen *scr) if (thePanel) { - wRaiseFrame(thePanel->wwin->frame->core); - wSetFocusTo(scr, thePanel->wwin); + if (thePanel->scr == scr) { + wRaiseFrame(thePanel->wwin->frame->core); + wSetFocusTo(scr, thePanel->wwin); + } return; } diff --git a/src/dock.c b/src/dock.c index 87f14414..eb0c566d 100644 --- a/src/dock.c +++ b/src/dock.c @@ -425,14 +425,12 @@ wClipMakeTile(WScreen *scr, RImage *normalTile) ROperateLine(tile, RAddOperation, tp, 2, wPreferences.icon_size-3, pt, &light); - //RDrawLine(tile, ICON_SIZE - 6 - as, 5, ICON_SIZE - 6, 5, &black); ROperateLine(tile, RSubtractOperation, ICON_SIZE - 5 - as, 5, ICON_SIZE - 6, 5, &dark); ROperateLine(tile, RSubtractOperation, ICON_SIZE - 6 - as, 5, ICON_SIZE - 6, 5 + as, &dark); ROperateLine(tile, RAddOperation, ICON_SIZE - 6, 5, ICON_SIZE - 6, 5 + as, &light); - /* bottom left */ ROperateLine(tile, RAddOperation, 2, tp+2, pt-2, @@ -443,14 +441,12 @@ wClipMakeTile(WScreen *scr, RImage *normalTile) ROperateLine(tile, RSubtractOperation, 5, ICON_SIZE - 6 - as, 5 + as, ICON_SIZE - 6, &dark); - //RDrawLine(tile, 5, ICON_SIZE - 6 - as, 5, ICON_SIZE - 6, &black); ROperateLine(tile, RSubtractOperation, 5, ICON_SIZE - 5 - as, 5, ICON_SIZE - 6, &dark); ROperateLine(tile, RAddOperation, 5, ICON_SIZE - 6, 5 + as, ICON_SIZE - 6, &light); - return tile; } @@ -3314,7 +3310,8 @@ iconDblClick(WObjDescriptor *desc, XEvent *event) unhideHere = (event->xbutton.state & ShiftMask); /* go to the last workspace that the user worked on the app */ - if (!unhideHere) { + if (wapp->last_workspace != dock->screen_ptr->current_workspace + && !unhideHere) { wWorkspaceChange(dock->screen_ptr, wapp->last_workspace); } diff --git a/src/dockedapp.c b/src/dockedapp.c index 4e8f222c..16b46c22 100644 --- a/src/dockedapp.c +++ b/src/dockedapp.c @@ -206,12 +206,15 @@ panelBtnCallback(WMWidget *self, void *data) char *buf; buf = wmalloc(strlen(text) + 64); - sprintf(buf, _("Could not open specified icon file:%s"), text); - wMessageDialog(panel->wwin->screen_ptr, _("Error"), buf, _("OK"), - NULL, NULL); + sprintf(buf, _("Could not open specified icon file: %s"), text); + if (wMessageDialog(panel->wwin->screen_ptr, _("Error"), buf, + _("OK"), _("Ignore"), NULL) == WAPRDefault) { + if (text) + free(text); + free(buf); + return; + } free(buf); - done = 0; - return; } else { WAppIcon *aicon = panel->editedIcon; diff --git a/src/event.c b/src/event.c index e4a4f36b..0138c92d 100644 --- a/src/event.c +++ b/src/event.c @@ -1025,16 +1025,16 @@ handleEnterNotify(XEvent *event) * is for the frame window and window doesn't have focus yet */ if ((wPreferences.focus_mode==WKF_POINTER || wPreferences.focus_mode==WKF_SLOPPY) - && wwin->frame->core->window==event->xcrossing.window + && wwin->frame->core->window==event->xcrossing.window && !scr->flags.doing_alt_tab) { - - if (!wwin->flags.focused) + + if (!wwin->flags.focused && !WFLAGP(wwin, no_focusable)) wSetFocusTo(scr, wwin); - - if (scr->autoRaiseTimer) - WMDeleteTimerHandler(scr->autoRaiseTimer); - scr->autoRaiseTimer = NULL; - + + if (scr->autoRaiseTimer) + WMDeleteTimerHandler(scr->autoRaiseTimer); + scr->autoRaiseTimer = NULL; + if (wPreferences.raise_delay && !WFLAGP(wwin, no_focusable)) { scr->autoRaiseWindow = wwin->frame->core->window; scr->autoRaiseTimer diff --git a/src/kwm.c b/src/kwm.c index 374970f2..b0392539 100644 --- a/src/kwm.c +++ b/src/kwm.c @@ -1752,8 +1752,6 @@ wKWMSelectRootRegion(WScreen *scr, int x, int y, int w, int h, Bool control) if (sock < 0) return; puts("SENDING DATA"); - - writeSocket(sock, "refreshDesktop"); sprintf(buffer, "selectRootIcons %i %i %i %i %c", x, y, w, h, control); writeSocket(sock, buffer); diff --git a/src/placement.c b/src/placement.c index f74201ee..ccfb559a 100644 --- a/src/placement.c +++ b/src/placement.c @@ -81,6 +81,7 @@ iconPosition(WCoreWindow *wcore, int sx1, int sy1, int sx2, int sy2, (((WIcon*)parent)->owner->frame->workspace == workspace || IS_OMNIPRESENT(((WIcon*)parent)->owner) || wPreferences.sticky_icons) + && ((WIcon*)parent)->mapped && (!((WIcon*)parent)->owner->flags.hidden || wcore->screen_ptr->flags.startup)) { diff --git a/src/screen.h b/src/screen.h index 03f8b787..e9befa3b 100644 --- a/src/screen.h +++ b/src/screen.h @@ -194,8 +194,6 @@ typedef struct _WScreen { GC disabled_menu_entry_gc; /* disabled menu entries */ GC info_text_gc; /* for size/position display */ GC icon_select_gc; - GC workspace_name_gc; /* for the name shown when workspace - * is changed */ GC frame_gc; /* gc for resize/move frame (root) */ GC line_gc; /* gc for drawing XORed lines (root) */ diff --git a/util/getstyle.c b/util/getstyle.c index 1b815d8d..4c10add0 100644 --- a/util/getstyle.c +++ b/util/getstyle.c @@ -21,7 +21,7 @@ */ -#define PROG_VERSION "getstyle (Window Maker) 0.3" +#define PROG_VERSION "getstyle (Window Maker) 0.4" @@ -182,7 +182,7 @@ abortar(char *reason) if (ThemePath) { printf("Removing unfinished theme pack\n"); - sprintf(buffer, "/bin/rm -fr %s", ThemePath); + sprintf(buffer, "/bin/rm -fr \"%s\"", ThemePath); if (system(buffer)!=0) { printf("%s: could not execute command %s\n", ProgName, buffer); @@ -420,7 +420,7 @@ copyFile(char *dir, char *file) { char buffer[4000]; - sprintf(buffer, "/bin/cp %s %s", file, dir); + sprintf(buffer, "/bin/cp \"%s\" \"%s\"", file, dir); if (system(buffer)!=0) { printf("%s: could not copy file %s\n", ProgName, file); } @@ -460,7 +460,7 @@ makeThemePack(proplist_t style, char *themeName) char *tmp; tmp = wmalloc(strlen(themeDir)+20); - sprintf(tmp, "/bin/mkdir %s", themeDir); + sprintf(tmp, "/bin/mkdir \"%s\"", themeDir); if (system(tmp)!=0) { printf("%s: could not create directory %s. Probably there's already a theme with that name in this directory.\n", ProgName, themeDir); exit(1); diff --git a/util/setstyle.c b/util/setstyle.c index 5995659d..316f1cdc 100644 --- a/util/setstyle.c +++ b/util/setstyle.c @@ -2,7 +2,7 @@ * * WindowMaker window manager * - * Copyright (c) 1997, 1998 Alfredo K. Kojima + * Copyright (c) 1997, 1998, 1999 Alfredo K. Kojima * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ */ -#define PROG_VERSION "setstyle (Window Maker) 0.3" +#define PROG_VERSION "setstyle (Window Maker) 0.4" #include #include @@ -86,6 +86,36 @@ defaultsPathForDomain(char *domain) } + +void +hackPathInTexture(proplist_t texture, char *prefix) +{ + proplist_t type; + char *t; + + /* get texture type */ + type = PLGetArrayElement(texture, 0); + t = PLGetString(type); + if (t && (strcasecmp(t, "tpixmap")==0 + || strcasecmp(t, "spixmap")==0 + || strcasecmp(t, "mpixmap")==0 + || strcasecmp(t, "cpixmap")==0 + || strcasecmp(t, "tvgradient")==0 + || strcasecmp(t, "thgradient")==0 + || strcasecmp(t, "tdgradient")==0)) { + proplist_t file; + char buffer[4018]; + + /* get pixmap file path */ + file = PLGetArrayElement(texture, 1); + sprintf(buffer, "%s/%s", prefix, PLGetString(file)); + /* replace path with full path */ + PLRemoveArrayElement(texture, 1); + PLInsertArrayElement(texture, PLMakeString(buffer), 1); + } +} + + void hackPaths(proplist_t style, char *prefix) { @@ -101,26 +131,29 @@ hackPaths(proplist_t style, char *prefix) key = PLGetArrayElement(keys, i); value = PLGetDictionaryEntry(style, key); - if (value && PLIsArray(value) && PLGetNumberOfElements(value) > 2) { - proplist_t type; - char *t; + if (!value) + continue; + + if (strcasecmp(PLGetString(key), "WorkspaceSpecificBack")==0) { + if (PLIsArray(value)) { + int j; + proplist_t texture; + + for (j = 0; j < PLGetNumberOfElements(value); j++) { + texture = PLGetArrayElement(value, j); + + if (texture && PLIsArray(texture) + && PLGetNumberOfElements(texture) > 2) { + + hackPathInTexture(texture, prefix); + } + } + } + } else { - type = PLGetArrayElement(value, 0); - t = PLGetString(type); - if (t && (strcasecmp(t, "tpixmap")==0 - || strcasecmp(t, "spixmap")==0 - || strcasecmp(t, "mpixmap")==0 - || strcasecmp(t, "cpixmap")==0 - || strcasecmp(t, "tvgradient")==0 - || strcasecmp(t, "thgradient")==0 - || strcasecmp(t, "tdgradient")==0)) { - proplist_t file; - char buffer[4018]; - - file = PLGetArrayElement(value, 1); - sprintf(buffer, "%s/%s", prefix, PLGetString(file)); - PLRemoveArrayElement(value, 1); - PLInsertArrayElement(value, PLMakeString(buffer), 1); + if (PLIsArray(value) && PLGetNumberOfElements(value) > 2) { + + hackPathInTexture(value, prefix); } } } -- 2.11.4.GIT