From 80fefd29e403991e8d286bb7ba1cf006ddd2a146 Mon Sep 17 00:00:00 2001 From: kojima Date: Mon, 3 Sep 2001 22:31:30 +0000 Subject: [PATCH] fixed crash bug on startup added paste-launch on dock --- ChangeLog | 6 ++ NEWS | 11 ++++ README | 22 ------- WINGs/Makefile.am | 3 + WindowMaker/Defaults/WMGLOBAL | 4 +- WindowMaker/Defaults/WindowMaker.in | 13 ++-- WindowMaker/Makefile.am | 1 + src/appicon.h | 3 + src/dock.c | 78 +++++++++++++++++------ src/dockedapp.c | 121 ++++++++++++++++++++++++++---------- src/main.c | 13 +++- src/misc.c | 16 ++--- src/startup.c | 9 ++- util/wmaker.inst.in | 6 ++ 14 files changed, 212 insertions(+), 94 deletions(-) diff --git a/ChangeLog b/ChangeLog index e915b48c..dce93b48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,11 +5,17 @@ Changes since version 0.65.1: - Fixed some more bash specific constructs in wsetfont. (Marcelo E. Magallon ) - fixed crash with broken apps that set null WM_CLASS +- fixed crash when with gnome panel and multi-screens, some menu + updates and applied various other patches from + (Crutcher Dunnavant ) +- po file fixes (Crutcher Dunnavant ) - replaced I18N_MB with I18N in one place in src/wconfig.h.in - fixed default clip title font in WindowMaker.in - fixed some locale related problems (Yukihiro Nakai ) - fixed a bug in RCombineAreaWithOpaqueness() (Brad ) - added spanish INSTALL file (Efrain Maximiliano Palermo ) +- updated Finnish pots (Tomi Kajala ) +- copy/paste launching in Dock Changes since version 0.65.0: ............................. diff --git a/NEWS b/NEWS index 682850ca..4c02b642 100644 --- a/NEWS +++ b/NEWS @@ -2,11 +2,22 @@ NEWS for veteran Window Maker users ----------------------------------- +--- 0.66.0 + +Copy/paste launch in dock. For example, put +netscape %s in the Docked icon for Netscape, +select an url somewhere and then middle-click the icon. +The command will be launched with the "pasted" string. + + +--- 0.65.1 Removed FocusFollowMouse option, only SloppyFocus present now. Added None option to MoveDisplay and ResizeDisplay + + --- 0.65.0 Single AppIcon diff --git a/README b/README index b5c27789..8101ff8b 100644 --- a/README +++ b/README @@ -376,25 +376,3 @@ can be found in po/README and Window Maker/README If you have any comments, fixes and bug reports (filled BUGFORMs) send them to developers@windowmaker.org - - - -Musicware -========= - -If you use Window Maker and *really* like it, please consider making my day -by sending me a music CD (or a MiniDisc or even a MP3 CDR) of your favorite -band, singer, instrumentist, composer or whatever :^). I like listening to -music and would love to get new CDs, especially from other parts of the -world. I like almost any kind of music, from Ozzy Osbourne to Bach (mas não -pagode e sertanejo pelamordideus :), so I will be happy to receive just about -anything. - -Snail mail address: - -Alfredo Kengi Kojima -Rua Firmino O. Bimbi, 255/25B -Porto Alegre - RS -CEP 91751-330 -Brazil - diff --git a/WINGs/Makefile.am b/WINGs/Makefile.am index b130886e..eff8c39d 100644 --- a/WINGs/Makefile.am +++ b/WINGs/Makefile.am @@ -18,6 +18,9 @@ LDADD= libWINGs.a $(top_builddir)/wrlib/libwraster.la @LIBPL@ @INTLIBS@ EXTRA_DIST = BUGS +wingsincludedir = $(includedir)/WINGs +wingsinclude_HEADERS = WINGs.h WUtil.h WINGsP.h + # wbutton.c libWINGs_a_SOURCES = \ array.c \ diff --git a/WindowMaker/Defaults/WMGLOBAL b/WindowMaker/Defaults/WMGLOBAL index b9d436f2..35f11141 100644 --- a/WindowMaker/Defaults/WMGLOBAL +++ b/WindowMaker/Defaults/WMGLOBAL @@ -1,6 +1,6 @@ { - SystemFont = "-*-helvetica-medium-r-normal-*-%d-*-*-*-*-*-*-*"; - BoldSystemFont = "-*-helvetica-bold-r-normal-*-%d-*-*-*-*-*-*-*"; + SystemFont = "-*-helvetica-medium-r-normal-*-%d-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-%d-*,-*-*-medium-r-normal-*-*-*"; + BoldSystemFont = "-*-helvetica-bold-r-normal-*-%d-*-*-*-*-*-*-*,-*-*-bold-r-normal-*-%d-*,-*-*-medium-r-normal-*-*-*"; FloppyPath = "/floppy"; MultiByteText = AUTO; DoubleClickTime = 250; diff --git a/WindowMaker/Defaults/WindowMaker.in b/WindowMaker/Defaults/WindowMaker.in index 54970784..e7023325 100644 --- a/WindowMaker/Defaults/WindowMaker.in +++ b/WindowMaker/Defaults/WindowMaker.in @@ -104,12 +104,13 @@ ConstrainWindowSize = NO; ClipRaiseLowerKey = None; TitleJustify = center; - WindowTitleFont = "-*-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*"; - MenuTitleFont = "-*-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*"; - MenuTextFont = "-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*"; - IconTitleFont = "-*-helvetica-medium-r-normal-*-8-*-*-*-*-*-*-*"; - ClipTitleFont = "-*-helvetica-bold-r-normal-*-10-*-*-*-*-*-*-*"; - DisplayFont = "-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*"; + WindowTitleFont = "-*-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-14-*,-*-*-medium-r-normal-*-*-*"; + MenuTitleFont = "-*-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-14-*,-*-*-medium-r-normal-*-*-*"; + MenuTextFont = "-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-14-*,-*-*-medium-r-normal-*-*-*"; + IconTitleFont = "-*-helvetica-medium-r-normal-*-8-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-12-*,-*-*-medium-r-normal-*-*-*"; + ClipTitleFont = "-*-helvetica-bold-r-normal-*-10-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-12-*,-*-*-medium-r-normal-*-*-*"; + DisplayFont = "-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-14-*,-*-*-medium-r-normal-*-*-*"; + LargeDisplayFont = "-*-helvetica-medium-r-*-*-24-*-*-*-*-*-*-*,-*-*-medium-r-*--24-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-*-*"; HighlightColor = white; HighlightTextColor = black; ClipTitleColor = black; diff --git a/WindowMaker/Makefile.am b/WindowMaker/Makefile.am index dbd05b9f..7f7b9b7c 100644 --- a/WindowMaker/Makefile.am +++ b/WindowMaker/Makefile.am @@ -51,6 +51,7 @@ prefsdata_DATA =\ plmenu.ro\ plmenu.sk\ plmenu.zh_CN\ + plmenu.zh_TW.Big5\ wmmacros\ xtree.dat diff --git a/src/appicon.h b/src/appicon.h index 9babdd00..152a9cc4 100644 --- a/src/appicon.h +++ b/src/appicon.h @@ -50,6 +50,8 @@ typedef struct WAppIcon { /* dropped on us */ #endif + char *paste_command; /* command to run when something is pasted */ + char *wm_class; char *wm_instance; pid_t pid; /* for apps launched from the dock */ @@ -73,6 +75,7 @@ typedef struct WAppIcon { unsigned int updated:1; unsigned int editing:1; /* editing docked icon */ unsigned int drop_launch:1; /* launching from drop action */ + unsigned int paste_launch:1; /* launching from paste action */ unsigned int destroyed:1; /* appicon was destroyed */ unsigned int buggy_app:1; /* do not make dock rely on hints * set by app */ diff --git a/src/dock.c b/src/dock.c index 4b015a16..f8f5d25c 100644 --- a/src/dock.c +++ b/src/dock.c @@ -98,6 +98,7 @@ extern void appIconMouseDown(WObjDescriptor *desc, XEvent *event); /***** Local variables ****/ static proplist_t dCommand=NULL; +static proplist_t dPasteCommand=NULL; #ifdef OFFIX_DND static proplist_t dDropCommand=NULL; #endif @@ -136,7 +137,7 @@ static void clipEnterNotify(WObjDescriptor *desc, XEvent *event); static void clipLeaveNotify(WObjDescriptor *desc, XEvent *event); static void clipAutoCollapse(void *cdata); static void clipAutoExpand(void *cdata); -static void launchDockedApplication(WAppIcon *btn); +static void launchDockedApplication(WAppIcon *btn, Bool withSelection); static void clipAutoLower(void *cdata); static void clipAutoRaise(void *cdata); @@ -168,9 +169,8 @@ make_keys() return; dCommand = PLRetain(PLMakeString("Command")); -#ifdef OFFIX_DND + dPasteCommand = PLRetain(PLMakeString("PasteCommand")); dDropCommand = PLRetain(PLMakeString("DropCommand")); -#endif dLock = PLRetain(PLMakeString("Lock")); dAutoLaunch = PLRetain(PLMakeString("AutoLaunch")); dName = PLRetain(PLMakeString("Name")); @@ -771,7 +771,7 @@ launchCallback(WMenu *menu, WMenuEntry *entry) { WAppIcon *btn = (WAppIcon*)entry->clientdata; - launchDockedApplication(btn); + launchDockedApplication(btn, False); } @@ -890,11 +890,13 @@ switchWSCommand(WMenu *menu, WMenuEntry *entry) static void -launchDockedApplication(WAppIcon *btn) +launchDockedApplication(WAppIcon *btn, Bool withSelection) { WScreen *scr = btn->icon->core->screen_ptr; - if (!btn->launching && btn->command!=NULL) { + if (!btn->launching && + ((!withSelection && btn->command!=NULL) || + (withSelection && btn->paste_command!=NULL))) { if (!btn->forced_dock) { btn->relaunching = btn->running; btn->running = 1; @@ -911,8 +913,11 @@ launchDockedApplication(WAppIcon *btn) btn->running = 0; } btn->drop_launch = 0; + btn->paste_launch = withSelection; scr->last_dock = btn->dock; - btn->pid = execCommand(btn, btn->command, NULL); + btn->pid = execCommand(btn, + withSelection ? btn->paste_command : btn->command, + NULL); if (btn->pid>0) { if (btn->buggy_app) { /* give feedback that the app was launched */ @@ -1361,6 +1366,12 @@ make_icon_state(WAppIcon *btn) PLRelease(command); } #endif /* OFFIX_DND */ + + if (btn->paste_command) { + command = PLMakeString(btn->paste_command); + PLInsertDictionaryEntry(node, dPasteCommand, command); + PLRelease(command); + } if (btn->client_machine && btn->remote_start) { host = PLMakeString(btn->client_machine); @@ -1578,6 +1589,10 @@ restore_icon_state(WScreen *scr, proplist_t info, int type, int index) if (cmd) aicon->dnd_command = wstrdup(PLGetString(cmd)); #endif + + cmd = PLGetDictionaryEntry(info, dPasteCommand); + if (cmd) + aicon->paste_command = wstrdup(PLGetString(cmd)); /* check auto launch */ value = PLGetDictionaryEntry(info, dAutoLaunch); @@ -1679,6 +1694,10 @@ wClipRestoreState(WScreen *scr, proplist_t clip_state) if (value && PLIsString(value)) icon->dnd_command = wstrdup(PLGetString(value)); #endif + + value = PLGetDictionaryEntry(clip_state, dPasteCommand); + if (value && PLIsString(value)) + icon->paste_command = wstrdup(PLGetString(value)); PLRelease(clip_state); @@ -1930,6 +1949,7 @@ wDockLaunchWithState(WDock *dock, WAppIcon *btn, WSavedState *state) if (btn && btn->command && !btn->running && !btn->launching) { btn->drop_launch = 0; + btn->paste_launch = 0; btn->pid = execCommand(btn, btn->command, state); @@ -2040,6 +2060,7 @@ wDockReceiveDNDDrop(WScreen *scr, XEvent *event) btn->running = 0; } + btn->paste_launch = 0; btn->drop_launch = 1; scr->last_dock = dock; btn->pid = execCommand(btn, btn->dnd_command, NULL); @@ -2159,6 +2180,12 @@ wDockAttachIcon(WDock *dock, WAppIcon *icon, int x, int y) } #endif + if (icon->command && !icon->paste_command) { + int len = strlen(icon->command)+8; + icon->paste_command = wmalloc(len); + snprintf(icon->paste_command, len, "%s %%s", icon->command); + } + return True; } @@ -2337,6 +2364,10 @@ wDockDetach(WDock *dock, WAppIcon *icon) icon->dnd_command = NULL; } #endif + if (icon->paste_command) { + wfree(icon->paste_command); + icon->paste_command = NULL; + } for (index=1; indexmax_icons; index++) if (dock->icon_array[index] == icon) @@ -2936,9 +2967,7 @@ execCommand(WAppIcon *btn, char *command, WSavedState *state) execvp(argv[0], args); exit(111); } - while (argc > 0) - wfree(argv[--argc]); - wfree(argv); + wtokenfree(argv, argc); if (pid > 0) { if (!state) { @@ -3233,14 +3262,17 @@ trackDeadProcess(pid_t pid, unsigned char status, WDock *dock) icon->pid = 0; if (status==111) { char msg[PATH_MAX]; -#ifdef OFFIX_DND - snprintf(msg, sizeof(msg), _("Could not execute command \"%s\""), - icon->drop_launch && icon->dnd_command - ? icon->dnd_command : icon->command); -#else - snprintf(msg, sizeof(msg), _("Could not execute command \"%s\""), - icon->command); -#endif + + if (icon->drop_launch) + snprintf(msg, sizeof(msg), _("Could not execute command \"%s\""), + icon->dnd_command); + else if (icon->paste_launch) + snprintf(msg, sizeof(msg), _("Could not execute command \"%s\""), + icon->paste_command); + else + snprintf(msg, sizeof(msg), _("Could not execute command \"%s\""), + icon->command); + wMessageDialog(dock->screen_ptr, _("Error"), msg, _("OK"), NULL, NULL); } @@ -3506,7 +3538,7 @@ iconDblClick(WObjDescriptor *desc, XEvent *event) } else if (btn->command) { if (!btn->launching && (!btn->running || (event->xbutton.state & ControlMask))) { - launchDockedApplication(btn); + launchDockedApplication(btn, False); } } else if (btn->xindex == 0 && btn->yindex == 0 && btn->dock->type == WM_DOCK) { @@ -3518,6 +3550,7 @@ iconDblClick(WObjDescriptor *desc, XEvent *event) } + static void handleDockMove(WDock *dock, WAppIcon *aicon, XEvent *event) { @@ -4076,6 +4109,13 @@ iconMouseDown(WObjDescriptor *desc, XEvent *event) } openDockMenu(dock, aicon, event); + } else if (event->xbutton.button == Button2) { + WAppIcon *btn = desc->parent; + + if (!btn->launching && + (!btn->running || (event->xbutton.state & ControlMask))) { + launchDockedApplication(btn, True); + } } } diff --git a/src/dockedapp.c b/src/dockedapp.c index 2d97c861..56f70a27 100644 --- a/src/dockedapp.c +++ b/src/dockedapp.c @@ -61,6 +61,10 @@ typedef struct _AppSettingsPanel { WMTextField *dndCommandField; WMLabel *dndCommandLabel; + WMFrame *pasteCommandFrame; + WMTextField *pasteCommandField; + WMLabel *pasteCommandLabel; + WMFrame *iconFrame; WMTextField *iconField; WMButton *browseBtn; @@ -100,6 +104,20 @@ updateCommand(WAppIcon *icon, char *command) } +static void +updatePasteCommand(WAppIcon *icon, char *command) +{ + if (icon->paste_command) + wfree(icon->paste_command); + if (command && (command[0]==0 || (command[0]=='-' && command[1]==0))) { + wfree(command); + command = NULL; + } + icon->paste_command = command; +} + + + #ifdef OFFIX_DND static void updateDNDCommand(WAppIcon *icon, char *command) @@ -245,6 +263,9 @@ panelBtnCallback(WMWidget *self, void *data) text = WMGetTextFieldText(panel->dndCommandField); updateDNDCommand(panel->editedIcon, text); #endif + text = WMGetTextFieldText(panel->pasteCommandField); + updatePasteCommand(panel->editedIcon, text); + panel->editedIcon->auto_launch = WMGetButtonSelected(panel->autoLaunchBtn); @@ -259,7 +280,7 @@ panelBtnCallback(WMWidget *self, void *data) #define PWIDTH 295 -#define PHEIGHT 365 +#define PHEIGHT 430 void @@ -270,6 +291,7 @@ ShowDockAppSettingsPanel(WAppIcon *aicon) Window parent; WMFont *font; int x, y; + WMBox *vbox; panel = wmalloc(sizeof(AppSettingsPanel)); memset(panel, 0, sizeof(AppSettingsPanel)); @@ -281,7 +303,7 @@ ShowDockAppSettingsPanel(WAppIcon *aicon) panel->win = WMCreateWindow(scr->wmscreen, "applicationSettings"); WMResizeWidget(panel->win, PWIDTH, PHEIGHT); - + panel->iconLabel = WMCreateLabel(panel->win); WMResizeWidget(panel->iconLabel, 64, 64); WMMoveWidget(panel->iconLabel, 10, 10); @@ -299,35 +321,61 @@ ShowDockAppSettingsPanel(WAppIcon *aicon) else WMSetLabelText(panel->nameLabel, aicon->wm_class); - panel->autoLaunchBtn = WMCreateSwitchButton(panel->win); - WMResizeWidget(panel->autoLaunchBtn, PWIDTH-30, 20); - WMMoveWidget(panel->autoLaunchBtn, 15, 80); + + vbox = WMCreateBox(panel->win); + WMResizeWidget(vbox, PWIDTH-20, PHEIGHT-84-10); + WMMoveWidget(vbox, 10, 84); + + panel->autoLaunchBtn = WMCreateSwitchButton(vbox); + WMAddBoxSubview(vbox, WMWidgetView(panel->autoLaunchBtn), False, True, + 20, 20, 2); WMSetButtonText(panel->autoLaunchBtn, _("Start when Window Maker is started")); WMSetButtonSelected(panel->autoLaunchBtn, aicon->auto_launch); - panel->lockBtn = WMCreateSwitchButton(panel->win); - WMResizeWidget(panel->lockBtn, PWIDTH-30, 20); - WMMoveWidget(panel->lockBtn, 15, 100); + panel->lockBtn = WMCreateSwitchButton(vbox); + WMAddBoxSubview(vbox, WMWidgetView(panel->lockBtn), False, True, + 20, 20, 5); WMSetButtonText(panel->lockBtn, _("Lock (prevent accidental removal)")); WMSetButtonSelected(panel->lockBtn, aicon->lock); - panel->commandFrame = WMCreateFrame(panel->win); - WMResizeWidget(panel->commandFrame, 275, 50); - WMMoveWidget(panel->commandFrame, 10, 125); + panel->commandFrame = WMCreateFrame(vbox); WMSetFrameTitle(panel->commandFrame, _("Application path and arguments")); + WMAddBoxSubview(vbox, WMWidgetView(panel->commandFrame), False, True, + 50, 50, 5); panel->commandField = WMCreateTextField(panel->commandFrame); WMResizeWidget(panel->commandField, 256, 20); WMMoveWidget(panel->commandField, 10, 20); WMSetTextFieldText(panel->commandField, aicon->command); - panel->dndCommandFrame = WMCreateFrame(panel->win); - WMResizeWidget(panel->dndCommandFrame, 275, 70); - WMMoveWidget(panel->dndCommandFrame, 10, 185); + WMMapSubwidgets(panel->commandFrame); + + panel->pasteCommandFrame = WMCreateFrame(vbox); + WMSetFrameTitle(panel->pasteCommandFrame, + _("Command for middle-click launch")); + WMAddBoxSubview(vbox, WMWidgetView(panel->pasteCommandFrame), False, True, + 70, 70, 5); + + panel->pasteCommandField = WMCreateTextField(panel->pasteCommandFrame); + WMResizeWidget(panel->pasteCommandField, 256, 20); + WMMoveWidget(panel->pasteCommandField, 10, 20); + + panel->pasteCommandLabel = WMCreateLabel(panel->pasteCommandFrame); + WMResizeWidget(panel->pasteCommandLabel, 256, 18); + WMMoveWidget(panel->pasteCommandLabel, 10, 45); + + WMSetTextFieldText(panel->pasteCommandField, aicon->paste_command); + WMSetLabelText(panel->pasteCommandLabel, + _("%s will be replaced with current selection")); + WMMapSubwidgets(panel->pasteCommandFrame); + + panel->dndCommandFrame = WMCreateFrame(vbox); WMSetFrameTitle(panel->dndCommandFrame, - _("Command for files dropped with DND")); + _("Command for files dropped with DND")); + WMAddBoxSubview(vbox, WMWidgetView(panel->dndCommandFrame), False, True, + 70, 70, 5); panel->dndCommandField = WMCreateTextField(panel->dndCommandFrame); WMResizeWidget(panel->dndCommandField, 256, 20); @@ -345,11 +393,12 @@ ShowDockAppSettingsPanel(WAppIcon *aicon) WMSetLabelText(panel->dndCommandLabel, _("DND support was not compiled in")); #endif + WMMapSubwidgets(panel->dndCommandFrame); - panel->iconFrame = WMCreateFrame(panel->win); - WMResizeWidget(panel->iconFrame, 275, 50); - WMMoveWidget(panel->iconFrame, 10, 265); + panel->iconFrame = WMCreateFrame(vbox); WMSetFrameTitle(panel->iconFrame, _("Icon Image")); + WMAddBoxSubview(vbox, WMWidgetView(panel->iconFrame), False, True, + 50, 50, 10); panel->iconField = WMCreateTextField(panel->iconFrame); WMResizeWidget(panel->iconField, 176, 20); @@ -365,22 +414,30 @@ ShowDockAppSettingsPanel(WAppIcon *aicon) WMSetButtonAction(panel->browseBtn, chooseIconCallback, panel); - panel->okBtn = WMCreateCommandButton(panel->win); - WMResizeWidget(panel->okBtn, 80, 26); - WMMoveWidget(panel->okBtn, 200, 328); - WMSetButtonText(panel->okBtn, _("OK")); - WMSetButtonAction(panel->okBtn, panelBtnCallback, panel); - - panel->cancelBtn = WMCreateCommandButton(panel->win); - WMResizeWidget(panel->cancelBtn, 80, 26); - WMMoveWidget(panel->cancelBtn, 110, 328); - WMSetButtonText(panel->cancelBtn, _("Cancel")); - WMSetButtonAction(panel->cancelBtn, panelBtnCallback, panel); - + { + WMBox *hbox; + + hbox = WMCreateBox(vbox); + WMSetBoxHorizontal(hbox, True); + WMAddBoxSubview(vbox, WMWidgetView(hbox), False, True, 24, 24, 0); + + + panel->okBtn = WMCreateCommandButton(hbox); + WMSetButtonText(panel->okBtn, _("OK")); + WMSetButtonAction(panel->okBtn, panelBtnCallback, panel); + WMAddBoxSubviewAtEnd(hbox, WMWidgetView(panel->okBtn), False, True, 80, 80, 0); + + panel->cancelBtn = WMCreateCommandButton(hbox); + WMSetButtonText(panel->cancelBtn, _("Cancel")); + WMSetButtonAction(panel->cancelBtn, panelBtnCallback, panel); + WMAddBoxSubviewAtEnd(hbox, WMWidgetView(panel->cancelBtn), False, True, 80, 80, 5); + + WMMapSubwidgets(hbox); + } + WMRealizeWidget(panel->win); WMMapSubwidgets(panel->win); - WMMapSubwidgets(panel->commandFrame); - WMMapSubwidgets(panel->dndCommandFrame); + WMMapSubwidgets(vbox); WMMapSubwidgets(panel->iconFrame); updateSettingsPanelIcon(panel); diff --git a/src/main.c b/src/main.c index 3f39c1c3..28dc4a11 100644 --- a/src/main.c +++ b/src/main.c @@ -453,10 +453,21 @@ check_defaults() path = wdefaultspathfordomain(""); if (access(path, R_OK)!=0) { +#if 0 wfatal(_("could not find user GNUstep directory (%s).\n" - "Make sure you have installed Window Maker correctly and run wmaker.inst"), + "Make sure you have installed Window Maker correctly and run wmaker.inst"), path); exit(1); +#else + wwarning(_("could not find user GNUstep directory (%s)."), path); + + if (system("wmaker.inst --batch") != 0) { + wwarning(_("There was an error while creating GNUstep directory, please " + "make sure you have installed Window Maker correctly and run wmaker.inst")); + } else { + wwarning(_("%s directory created with default configuration."), path); + } +#endif } wfree(path); diff --git a/src/misc.c b/src/misc.c index 8c813041..b6ffa2d6 100644 --- a/src/misc.c +++ b/src/misc.c @@ -621,8 +621,10 @@ getuserinput(WScreen *scr, char *line, int *ptr) char *prompt; int j, state; int begin = 0; - char tbuffer[256], pbuffer[256]; +#define BUFSIZE 512 + char tbuffer[BUFSIZE], pbuffer[BUFSIZE]; + title = _("Program Arguments"); prompt = _("Enter command arguments:"); ret = NULL; @@ -650,8 +652,8 @@ getuserinput(WScreen *scr, char *line, int *ptr) j = 0; if (*ptr > begin) { - strncpy(tbuffer, &line[begin], WMIN(*ptr-begin, 255)); - tbuffer[WMIN(*ptr-begin, 255)] = 0; + strncpy(tbuffer, &line[begin], WMIN(*ptr-begin, BUFSIZE)); + tbuffer[WMIN(*ptr-begin, BUFSIZE)] = 0; title = (char*)tbuffer; } begin = *ptr+1; @@ -660,8 +662,8 @@ getuserinput(WScreen *scr, char *line, int *ptr) } else if (j <= 0 && line[*ptr]==')') { if (*ptr > begin) { - strncpy(tbuffer, &line[begin], WMIN(*ptr-begin, 255)); - tbuffer[WMIN(*ptr-begin, 255)] = 0; + strncpy(tbuffer, &line[begin], WMIN(*ptr-begin, BUFSIZE)); + tbuffer[WMIN(*ptr-begin, BUFSIZE)] = 0; title = (char*)tbuffer; } state = _DONE; @@ -678,8 +680,8 @@ getuserinput(WScreen *scr, char *line, int *ptr) if (line[*ptr]==')' && j==0) { if (*ptr-begin > 1) { - strncpy(pbuffer, &line[begin], WMIN(*ptr-begin, 255)); - pbuffer[WMIN(*ptr-begin, 255)] = 0; + strncpy(pbuffer, &line[begin], WMIN(*ptr-begin, BUFSIZE)); + pbuffer[WMIN(*ptr-begin, BUFSIZE)] = 0; prompt = (char*)pbuffer; } state = _DONE; diff --git a/src/startup.c b/src/startup.c index 1c7b91a2..7f731004 100644 --- a/src/startup.c +++ b/src/startup.c @@ -653,9 +653,7 @@ wScreenForRootWindow(Window window) } } - assert("bad_root_window" && 0); - - return NULL; + return wScreenForWindow(window); } @@ -678,7 +676,7 @@ wScreenSearchForRootWindow(Window window) } } - return NULL; + return wScreenForWindow(window); } @@ -1125,7 +1123,8 @@ manageAllWindows(WScreen *scr, int crashRecovery) wWindowMove(wwin, wwin->frame_x - border, wwin->frame_y - border - - wwin->frame->titlebar->height); + (wwin->frame->titlebar ? + wwin->frame->titlebar->height : 0)); } } } diff --git a/util/wmaker.inst.in b/util/wmaker.inst.in index ed07d782..98b67257 100644 --- a/util/wmaker.inst.in +++ b/util/wmaker.inst.in @@ -72,8 +72,14 @@ copy() { source=$GLOBALDIR/plmenu.${LOCALE%.*} elif [ -f $GLOBALDIR/plmenu.${LOCALE%_*} ]; then source=$GLOBALDIR/plmenu.${LOCALE%_*} + if [ -f $GLOBALDIR/plmenu.${LOCALE%_*.*} ]; then + source=$GLOBALDIR/plmenu.${LOCALE%_*.*} + elif [ -f $GLOBALDIR/menu.${LOCALE} ]; then + source=$GLOBALDIR/menu.${LOCALE} elif [ -f $GLOBALDIR/menu.${LOCALE%_*} ]; then source=$GLOBALDIR/menu.${LOCALE%_*} + elif [ -f $GLOBALDIR/menu.${LOCALE%_*.*} ]; then + source=$GLOBALDIR/menu.${LOCALE%_*.*} else source=$GLOBALDIR/plmenu fi -- 2.11.4.GIT