From ab05059696a8a0ccb7623f131739d8e9b83b17d0 Mon Sep 17 00:00:00 2001 From: Scott Tringali Date: Fri, 23 May 2003 14:27:05 +0000 Subject: [PATCH] Avoid a crash when trying to drag widgets (not text) in non-default visual. This appears to be a OSF Motif bug so we just disable dragging entirely. Not a great solution. --- source/nedit.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/source/nedit.c b/source/nedit.c index 2b50958..a8d3aec 100644 --- a/source/nedit.c +++ b/source/nedit.c @@ -1,4 +1,4 @@ -static const char CVSID[] = "$Id: nedit.c,v 1.47 2003/05/18 20:05:43 edg Exp $"; +static const char CVSID[] = "$Id: nedit.c,v 1.48 2003/05/23 14:27:05 tringali Exp $"; /******************************************************************************* * * * nedit.c -- Nirvana Editor main program * @@ -76,11 +76,11 @@ static const char CVSID[] = "$Id: nedit.c,v 1.47 2003/05/18 20:05:43 edg Exp $"; #endif #endif /*VMS*/ + #ifdef HAVE_DEBUG_H #include "../debug.h" #endif - static void nextArg(int argc, char **argv, int *argIndex); static int checkDoMacroArg(const char *macro); static String neditLanguageProc(Display *dpy, String xnl, XtPointer closure); @@ -127,6 +127,7 @@ static char *fallbackResources[] = { "*XmList.background: " NEDIT_DEFAULT_TEXT_BG, "*XmTextField.foreground: " NEDIT_DEFAULT_FG, "*XmTextField.background: " NEDIT_DEFAULT_TEXT_BG, + "*XmText.translations: #override\\n" "Ctrl~Alt~Metav: paste-clipboard()\\n" "Ctrl~Alt~Metac: copy-clipboard()\\n" @@ -678,6 +679,17 @@ static void patchResourcesForVisual(void) if (!usingDefaultVisual) { +#ifndef LESSTIF_VERSION + /* Drag-and-drop visuals do not work well when using a different + visual. One some systems, you'll just get a funny-looking icon + (maybe all-black) but on other systems it crashes with a BadMatch + error. This appears to be an OSF Motif bug. It would be nicer + to just disable the visual itself, instead of the entire drag + operation. */ + + XrmPutStringResource(&db, "*dragInitiatorProtocolStyle", "DRAG_NONE"); +#endif + for (i = 1; i < XtNumber(fallbackResources); ++i) { Cardinal resIndex = i - 1; -- 2.11.4.GIT