diff --git a/WINGs/Makefile.am b/WINGs/Makefile.am index 354996b9..ac849a1c 100644 --- a/WINGs/Makefile.am +++ b/WINGs/Makefile.am @@ -53,7 +53,7 @@ wmquery_SOURCES = wmquery.c wmquery_LDADD = libWINGs.a $(LIBLIST) -EXTRA_DIST = logo.xpm +EXTRA_DIST = logo.xpm BUGS # wbutton.c libWINGs_a_SOURCES = \ diff --git a/WINGs/Makefile.in b/WINGs/Makefile.in index 9949d1cf..37d5f2e7 100644 --- a/WINGs/Makefile.in +++ b/WINGs/Makefile.in @@ -140,7 +140,7 @@ wmquery_SOURCES = wmquery.c wmquery_LDADD = libWINGs.a $(LIBLIST) -EXTRA_DIST = logo.xpm +EXTRA_DIST = logo.xpm BUGS # wbutton.c libWINGs_a_SOURCES = WINGs.h WINGsP.h configuration.c llist.h llist.c international.c notification.c selection.c userdefaults.c wapplication.c wballoon.c wbrowser.c wbutton.c wcolor.c wcolorpanel.c wcolorwell.c wevent.c wfilepanel.c wframe.c wfont.c wfontpanel.c widgets.c wlabel.c wlist.c wmisc.c wpanel.c wpixmap.c wpopupbutton.c wscroller.c wscrollview.c wslider.c wsplitview.c wtabview.c wtextfield.c wwindow.c wview.c error.c findfile.c hashtable.c memory.c usleep.c diff --git a/WINGs/WINGs.h b/WINGs/WINGs.h index a9de8d3c..2c60ab64 100644 --- a/WINGs/WINGs.h +++ b/WINGs/WINGs.h @@ -543,6 +543,14 @@ WMHandlerID WMAddInputHandler(int fd, int condition, WMInputProc *proc, void WMDeleteInputHandler(WMHandlerID handlerID); +Bool WMCreateSelectionHandler(WMWidget *w, Atom selection, Time timestamp, + WMConvertSelectionProc *convProc, + WMLoseSelectionProc *loseProc, + WMSelectionDoneProc *doneProc); + +void WMDeleteSelectionHandler(WMWidget *widget, Atom selection); + + /* ....................................................................... */ /* void WMDragImageFromView(WMView *view, WMPixmap *image, WMPoint atLocation, diff --git a/WINGs/testnot.c b/WINGs/testnot.c index a745801c..6cca5314 100644 --- a/WINGs/testnot.c +++ b/WINGs/testnot.c @@ -44,7 +44,7 @@ observer2(void *data, WMNotification *notification) - +int main(int argc, char **argv) { int i; diff --git a/WINGs/wfilepanel.c b/WINGs/wfilepanel.c index 8fb58c1d..b95b7492 100644 --- a/WINGs/wfilepanel.c +++ b/WINGs/wfilepanel.c @@ -594,56 +594,65 @@ browserClick(WMBrowser *bPtr, WMFilePanel *panel) } } -#define ERROR_PANEL(s) err_str = wmalloc(strlen(file)+strlen(s)); \ - sprintf(err_str, s, file); \ - WMRunAlertPanel(WMWidgetScreen(panel->win), panel->win, \ - "Error", err_str, "OK", NULL, NULL); + +static void +showError(WMScreen *scr, WMWindow *owner, char *s, char *file) +{ + char *errStr; + + if (file) { + errStr = wmalloc(strlen(file)+strlen(s)); + sprintf(errStr, s, file); + } else { + errStr = wstrdup(s); + } + WMRunAlertPanel(scr, owner, "Error", errStr, "OK", NULL, NULL); + free(errStr); +} + static void deleteFile(WMButton *bPre, WMFilePanel *panel) { + WMScreen *scr = WMWidgetScreen(panel->win); char *file; char *buffer; - char *err_str; - - WMFilePanel *deletePanel; file = getCurrentFileName(panel); if (file[strlen(file)-1] == '/') { - ERROR_PANEL("%s is a directory."); - free(err_str); + showError(scr, panel->win, "%s is a directory.", file); free(file); return; } - buffer = wmalloc(strlen(file)+15); - sprintf(buffer,"Delete file %s ?\x0",file); + buffer = wmalloc(strlen(file)+16); + sprintf(buffer,"Delete file %s ?",file); if (!WMRunAlertPanel(WMWidgetScreen(panel->win), panel->win, "Warning", buffer, "OK", "Cancel", NULL)) { - int rem_stat; - if (rem_stat = remove(file)) { + if (remove(file) != 0) { switch (errno) { case EISDIR: - ERROR_PANEL("%s is a directory."); + showError(scr, panel->win, "'%s' is a directory.", file); break; case ENOENT: - ERROR_PANEL("%s does not exist."); + showError(scr, panel->win, "'%s' does not exist.", file); break; case EACCES: - ERROR_PANEL("Permission denied."); + showError(scr, panel->win, "Permission denied.", NULL); break; case ENOMEM: - ERROR_PANEL("Insufficient kernel memory was available."); + showError(scr, panel->win, + "Insufficient memory available.", NULL); break; case EROFS: - ERROR_PANEL("%s refers to a file on a read-only filesystem."); + showError(scr, panel->win, + "'%s' is on a read-only filesystem.", file); break; default: - ERROR_PANEL("Can not delete %s."); + showError(scr, panel->win, "Can not delete '%s'.", file); } - free(err_str); } else { - char *s = strrchr(file,'/'); + char *s = strrchr(file, '/'); if (s) s[1] = 0; WMSetFilePanelDirectory(panel, file); } @@ -652,20 +661,18 @@ deleteFile(WMButton *bPre, WMFilePanel *panel) free(file); } + static void goFloppy(WMButton *bPtr, WMFilePanel *panel) { - char *file, *err_str; + WMScreen *scr = WMWidgetScreen(panel->win); struct stat filestat; - /* home is statically allocated. Don't free it! */ - if (stat("/floppy",&filestat)) { - ERROR_PANEL("An error occured browsing /floppy."); - free(err_str); + if (stat("/floppy", &filestat)) { + showError(scr, panel->win, "An error occured browsing /floppy.", NULL); return; } else if (!S_ISDIR(filestat.st_mode)) { - ERROR_PANEL("/floppy is not a directory."); - free(err_str); + showError(scr, panel->win, "/floppy is not a directory.", NULL); return; } diff --git a/WINGs/wtextfield.c b/WINGs/wtextfield.c index 8b8277fb..504c628e 100644 --- a/WINGs/wtextfield.c +++ b/WINGs/wtextfield.c @@ -182,7 +182,7 @@ requestHandler(WMWidget *w, Atom selection, Atom target, Atom *type, void **value, unsigned *length, int *format) { TextField *tPtr = w; - int count,count2; + int count; Display *dpy = tPtr->view->screen->display; Atom _TARGETS; char *text; @@ -952,7 +952,9 @@ handleTextFieldKeyPress(TextField *tPtr, XEvent *event) */ switch (ksym) { case XK_Tab: +#ifdef XK_ISO_Left_Tab case XK_ISO_Left_Tab: +#endif if (event->xkey.state & ShiftMask) { if (tPtr->view->prevFocusChain) { W_SetFocusOfTopLevel(W_TopLevelOfView(tPtr->view), diff --git a/WPrefs.app/Themes.c b/WPrefs.app/Themes.c index a860d820..789014a2 100644 --- a/WPrefs.app/Themes.c +++ b/WPrefs.app/Themes.c @@ -161,7 +161,6 @@ static void createPanel(Panel *p) { _Panel *panel = (_Panel*)p; - WMScreen *scr = WMWidgetScreen(panel->win); panel->frame = WMCreateFrame(panel->win); WMResizeWidget(panel->frame, FRAME_WIDTH, FRAME_HEIGHT); diff --git a/src/Makefile.in b/src/Makefile.in index 1bf752f4..ab0ecd8c 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -100,7 +100,7 @@ bin_PROGRAMS = wmaker EXTRA_DIST = wmnotify.c wmnotdef.h wmnotify.h -wmaker_SOURCES = GNUstep.h WindowMaker.h actions.c actions.h appicon.c appicon.h application.c application.h appmenu.c appmenu.h balloon.c balloon.h client.c client.h colormap.c def_pixmaps.h defaults.c defaults.h dialog.c dialog.h dock.c dockedapp.c dock.h event.c framewin.c framewin.h gnome.c gnome.h funcs.h icon.c icon.h keybind.h kwm.h kwm.c list.c list.h main.c menu.c menu.h misc.c motif.c motif.h moveres.c openlook.c openlook.h pixmap.c pixmap.h placement.c properties.c properties.h proplist.c resources.c resources.h rootmenu.c screen.c screen.h session.h session.c shutdown.c stacking.c stacking.h startup.c superfluous.c superfluous.h switchmenu.c texture.c texture.h usermenu.c usermenu.h xdnd.h xdnd.c xmodifier.h xmodifier.c xutil.c xutil.h wconfig.h wcore.c wcore.h wdefaults.c wdefaults.h window.c window.h winmenu.c winspector.h winspector.c workspace.c workspace.h wmsound.c wmsound.h text.c text.h +wmaker_SOURCES = GNUstep.h WindowMaker.h actions.c actions.h appicon.c appicon.h application.c application.h appmenu.c appmenu.h balloon.c balloon.h client.c client.h colormap.c def_pixmaps.h defaults.c defaults.h dialog.c dialog.h dock.c dockedapp.c dock.h event.c extend_pixmaps.h framewin.c framewin.h gnome.c gnome.h funcs.h icon.c icon.h keybind.h kwm.h kwm.c list.c list.h main.c menu.c menu.h misc.c motif.c motif.h moveres.c openlook.c openlook.h pixmap.c pixmap.h placement.c properties.c properties.h proplist.c resources.c resources.h rootmenu.c screen.c screen.h session.h session.c shutdown.c stacking.c stacking.h startup.c superfluous.c superfluous.h switchmenu.c texture.c texture.h usermenu.c usermenu.h xdnd.h xdnd.c xmodifier.h xmodifier.c xutil.c xutil.h wconfig.h wcore.c wcore.h wdefaults.c wdefaults.h window.c window.h winmenu.c winspector.h winspector.c workspace.c workspace.h wmsound.c wmsound.h text.c text.h CPPFLAGS = @CPPFLAGS@ @DFLAGS@ -DLOCALEDIR=\"$(NLSDIR)\" diff --git a/src/dock.c b/src/dock.c index e7b93ea7..a16a5838 100644 --- a/src/dock.c +++ b/src/dock.c @@ -505,7 +505,7 @@ omnipresentCallback(WMenu *menu, WMenuEntry *entry) } if (failed > 1) { - wMessageDialog(aicon->icon->core->screen_ptr, _("Warning"), + wMessageDialog(dock->screen_ptr, _("Warning"), _("Some icons cannot be made omnipresent. " "Please make sure that no other icon is " "docked in the same positions on the other " @@ -513,7 +513,7 @@ omnipresentCallback(WMenu *menu, WMenuEntry *entry) "some workspace."), _("OK"), NULL, NULL); } else if (failed == 1) { - wMessageDialog(aicon->icon->core->screen_ptr, _("Warning"), + wMessageDialog(dock->screen_ptr, _("Warning"), _("Icon cannot be made omnipresent. " "Please make sure that no other icon is " "docked in the same position on the other " diff --git a/util/Makefile.am b/util/Makefile.am index 95bb920c..a2bdca67 100644 --- a/util/Makefile.am +++ b/util/Makefile.am @@ -10,7 +10,7 @@ bin_SCRIPTS = wmaker.inst wm-oldmenu2new wsetfont wkdemenu.pl EXTRA_DIST = wmaker.inst.in bughint wm-oldmenu2new wsetfont directjpeg.c \ wkdemenu.pl -INCLUDES = @DFLAGS@ -I$(top_srcdir)/wrlib @HEADER_SEARCH_PATH@ +INCLUDES = @DFLAGS@ -I$(top_srcdir)/WINGs -I$(top_srcdir)/wrlib @HEADER_SEARCH_PATH@ # X_EXTRA_LIBS is for libproplist in systems that need -lsocket liblist= @LIBRARY_SEARCH_PATH@ @LIBPL@ @X_EXTRA_LIBS@ diff --git a/util/Makefile.in b/util/Makefile.in index 063b9aca..60b58704 100644 --- a/util/Makefile.in +++ b/util/Makefile.in @@ -101,7 +101,7 @@ bin_SCRIPTS = wmaker.inst wm-oldmenu2new wsetfont wkdemenu.pl EXTRA_DIST = wmaker.inst.in bughint wm-oldmenu2new wsetfont directjpeg.c wkdemenu.pl -INCLUDES = @DFLAGS@ -I$(top_srcdir)/wrlib @HEADER_SEARCH_PATH@ +INCLUDES = @DFLAGS@ -I$(top_srcdir)/WINGs -I$(top_srcdir)/wrlib @HEADER_SEARCH_PATH@ # X_EXTRA_LIBS is for libproplist in systems that need -lsocket liblist = @LIBRARY_SEARCH_PATH@ @LIBPL@ @X_EXTRA_LIBS@ diff --git a/util/setstyle.c b/util/setstyle.c index 22193e63..b167c873 100644 --- a/util/setstyle.c +++ b/util/setstyle.c @@ -374,7 +374,6 @@ main(int argc, char **argv) int i; int ignoreCount = 0; char *ignoreList[MAX_OPTIONS]; - int format = 0; dpy = XOpenDisplay(""); diff --git a/util/wmsetbg.c b/util/wmsetbg.c index 9442bdcd..f2ce9fd1 100644 --- a/util/wmsetbg.c +++ b/util/wmsetbg.c @@ -46,9 +46,8 @@ #include "../src/wconfig.h" -#include "../WINGs/WINGs.h" -#include "../WINGs/WUtil.h" -#include "../wrlib/wraster.h" +#include +#include #include @@ -529,7 +528,6 @@ parseTexture(RContext *rc, char *text) image = loadImage(rc, file); if (!image) { - RDestroyImage(gradient); goto error; } @@ -557,7 +555,8 @@ parseTexture(RContext *rc, char *text) if (!gradient) { wwarning("could not render texture:%s", RMessageForError(RErrorCode)); - RDestroyImage(gradient); + RDestroyImage(gradient); + RDestroyImage(image); goto error; } @@ -577,7 +576,7 @@ parseTexture(RContext *rc, char *text) if (!RConvertImage(rc, tiled, &pixmap)) { wwarning("could not convert texture:%s", RMessageForError(RErrorCode)); - RDestroyImage(image); + RDestroyImage(tiled); goto error; } texture->width = tiled->width;