1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-18 12:00:31 +01:00

fixed crash bug on startup

added paste-launch on dock
This commit is contained in:
kojima
2001-09-03 22:31:30 +00:00
parent eecf75029f
commit 80fefd29e4
14 changed files with 211 additions and 93 deletions

View File

@@ -5,11 +5,17 @@ Changes since version 0.65.1:
- Fixed some more bash specific constructs in wsetfont.
(Marcelo E. Magallon <marcelo.magallon@bigfoot.com>)
- 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 <crutcher@redhat.com>)
- po file fixes (Crutcher Dunnavant <crutcher@redhat.com>)
- 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 <ynakai@redhat.com>)
- fixed a bug in RCombineAreaWithOpaqueness() (Brad <lists@anomie.yi.org>)
- added spanish INSTALL file (Efrain Maximiliano Palermo <max_drake2001@yahoo.com.ar>)
- updated Finnish pots (Tomi Kajala <tomi@iki.fi>)
- copy/paste launching in Dock
Changes since version 0.65.0:
.............................

11
NEWS
View File

@@ -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

22
README
View File

@@ -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

View File

@@ -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 \

View File

@@ -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;

View File

@@ -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;

View File

@@ -51,6 +51,7 @@ prefsdata_DATA =\
plmenu.ro\
plmenu.sk\
plmenu.zh_CN\
plmenu.zh_TW.Big5\
wmmacros\
xtree.dat

View File

@@ -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 */

View File

@@ -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; index<dock->max_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);
}
}
}

View File

@@ -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);

View File

@@ -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);

View File

@@ -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;

View File

@@ -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));
}
}
}

View File

@@ -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