mirror of
https://github.com/gryf/wmaker.git
synced 2026-04-27 19:23:31 +02:00
Remove warnings
* Remove assigned but not used variables (GCC 4.6) * Bump _XOPEN_SOURCE to 600, ridding of FreeBSD warnings (this probably need to be tweaked on a per-implementation basis as problems arise)
This commit is contained in:
committed by
Carlos R. Mafra
parent
43c7abe79f
commit
f65b99e615
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <strings.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
|
|
||||||
#if __GLIBC__ && \
|
|
||||||
(_XOPEN_SOURCE && _XOPEN_SOURCE < 500) || \
|
|
||||||
!_XOPEN_SOURCE
|
|
||||||
#define _XOPEN_SOURCE 500 /* nftw */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
|||||||
+9
-2
@@ -1,3 +1,10 @@
|
|||||||
|
/*
|
||||||
|
* Until FreeBSD gets their act together;
|
||||||
|
* http://www.mail-archive.com/freebsd-hackers@freebsd.org/msg69469.html
|
||||||
|
*/
|
||||||
|
#if defined( FREEBSD )
|
||||||
|
# undef _XOPEN_SOURCE
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "wconfig.h"
|
#include "wconfig.h"
|
||||||
|
|
||||||
@@ -234,7 +241,7 @@ char *wstrappend(char *dst, char *src)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_STRLCAT
|
#if HAVE_STRLCAT
|
||||||
size_t
|
size_t
|
||||||
wstrlcat(char *dst, const char *src, size_t siz)
|
wstrlcat(char *dst, const char *src, size_t siz)
|
||||||
{
|
{
|
||||||
@@ -295,7 +302,7 @@ wstrlcat(char *dst, const char *src, size_t siz)
|
|||||||
}
|
}
|
||||||
#endif /* HAVE_STRLCAT */
|
#endif /* HAVE_STRLCAT */
|
||||||
|
|
||||||
#ifdef HAVE_STRLCPY
|
#if HAVE_STRLCPY
|
||||||
size_t
|
size_t
|
||||||
wstrlcpy(char *dst, const char *src, size_t siz)
|
wstrlcpy(char *dst, const char *src, size_t siz)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <strings.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|||||||
+2
-3
@@ -2725,7 +2725,6 @@ static void customSetPalette(W_ColorPanel * panel)
|
|||||||
W_Screen *scr = WMWidgetScreen(panel->win);
|
W_Screen *scr = WMWidgetScreen(panel->win);
|
||||||
RImage *scaledImg;
|
RImage *scaledImg;
|
||||||
Pixmap image;
|
Pixmap image;
|
||||||
int item;
|
|
||||||
|
|
||||||
image = XCreatePixmap(scr->display, W_DRAWABLE(scr), customPaletteWidth, customPaletteHeight, scr->depth);
|
image = XCreatePixmap(scr->display, W_DRAWABLE(scr), customPaletteWidth, customPaletteHeight, scr->depth);
|
||||||
scaledImg = RScaleImage(panel->customPaletteImg, customPaletteWidth, customPaletteHeight);
|
scaledImg = RScaleImage(panel->customPaletteImg, customPaletteWidth, customPaletteHeight);
|
||||||
@@ -2751,7 +2750,7 @@ static void customSetPalette(W_ColorPanel * panel)
|
|||||||
panel->palXRatio = (double)(panel->customPaletteImg->width) / (double)(customPaletteWidth);
|
panel->palXRatio = (double)(panel->customPaletteImg->width) / (double)(customPaletteWidth);
|
||||||
panel->palYRatio = (double)(panel->customPaletteImg->height) / (double)(customPaletteHeight);
|
panel->palYRatio = (double)(panel->customPaletteImg->height) / (double)(customPaletteHeight);
|
||||||
|
|
||||||
item = WMGetPopUpButtonSelectedItem(panel->customPaletteHistoryBtn);
|
WMGetPopUpButtonSelectedItem(panel->customPaletteHistoryBtn);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void customPalettePositionSelection(W_ColorPanel * panel, int x, int y)
|
static void customPalettePositionSelection(W_ColorPanel * panel, int x, int y)
|
||||||
@@ -3366,7 +3365,7 @@ static int fetchFile(char *toPath, char *srcFile, char *destFile)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
RETRY( nwritten = fwrite(buf, 1, nread, dst) )
|
RETRY( nwritten = fwrite(buf, 1, nread, dst) )
|
||||||
if (ferror(dst) || feof(src))
|
if (ferror(dst) || feof(src) || nread != nwritten)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
} while (1);
|
} while (1);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <strings.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <X11/Xft/Xft.h>
|
#include <X11/Xft/Xft.h>
|
||||||
|
|||||||
@@ -390,12 +390,9 @@ static void scrollByAmount(WMList * lPtr, int amount)
|
|||||||
static void vScrollCallBack(WMWidget * scroller, void *self)
|
static void vScrollCallBack(WMWidget * scroller, void *self)
|
||||||
{
|
{
|
||||||
WMList *lPtr = (WMList *) self;
|
WMList *lPtr = (WMList *) self;
|
||||||
int height;
|
|
||||||
int oldTopItem = lPtr->topItem;
|
int oldTopItem = lPtr->topItem;
|
||||||
int itemCount = WMGetArrayItemCount(lPtr->items);
|
int itemCount = WMGetArrayItemCount(lPtr->items);
|
||||||
|
|
||||||
height = lPtr->view->size.height - 4;
|
|
||||||
|
|
||||||
switch (WMGetScrollerHitPart((WMScroller *) scroller)) {
|
switch (WMGetScrollerHitPart((WMScroller *) scroller)) {
|
||||||
case WSDecrementLine:
|
case WSDecrementLine:
|
||||||
scrollByAmount(lPtr, -1);
|
scrollByAmount(lPtr, -1);
|
||||||
|
|||||||
@@ -330,7 +330,7 @@ static void paintMenuEntry(PopUpButton * bPtr, int index, int highlight)
|
|||||||
{
|
{
|
||||||
W_Screen *scr = bPtr->view->screen;
|
W_Screen *scr = bPtr->view->screen;
|
||||||
int yo;
|
int yo;
|
||||||
int width, height, itemHeight, itemCount;
|
int width, itemHeight, itemCount;
|
||||||
char *title;
|
char *title;
|
||||||
|
|
||||||
itemCount = WMGetArrayItemCount(bPtr->items);
|
itemCount = WMGetArrayItemCount(bPtr->items);
|
||||||
@@ -339,7 +339,6 @@ static void paintMenuEntry(PopUpButton * bPtr, int index, int highlight)
|
|||||||
|
|
||||||
itemHeight = bPtr->view->size.height;
|
itemHeight = bPtr->view->size.height;
|
||||||
width = bPtr->view->size.width;
|
width = bPtr->view->size.width;
|
||||||
height = itemHeight * itemCount;
|
|
||||||
yo = (itemHeight - WMFontHeight(scr->normalFont)) / 2;
|
yo = (itemHeight - WMFontHeight(scr->normalFont)) / 2;
|
||||||
|
|
||||||
if (!highlight) {
|
if (!highlight) {
|
||||||
|
|||||||
@@ -1,4 +1,12 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* Until FreeBSD gets their act together;
|
||||||
|
* http://www.mail-archive.com/freebsd-hackers@freebsd.org/msg69469.html
|
||||||
|
*/
|
||||||
|
#if defined( FREEBSD )
|
||||||
|
# undef _XOPEN_SOURCE
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "WINGsP.h"
|
#include "WINGsP.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|||||||
@@ -722,13 +722,10 @@ void WMRemoveSplitViewSubview(WMSplitView * sPtr, WMView * view)
|
|||||||
|
|
||||||
void WMRemoveSplitViewSubviewAt(WMSplitView * sPtr, int index)
|
void WMRemoveSplitViewSubviewAt(WMSplitView * sPtr, int index)
|
||||||
{
|
{
|
||||||
W_SplitViewSubview *p;
|
|
||||||
|
|
||||||
CHECK_CLASS(sPtr, WC_SplitView);
|
CHECK_CLASS(sPtr, WC_SplitView);
|
||||||
|
|
||||||
/* TODO: same about rewrite */
|
/* TODO: same about rewrite */
|
||||||
if (index >= 0 && index < _GetSubviewsCount()) {
|
if (index >= 0 && index < _GetSubviewsCount()) {
|
||||||
p = _GetPSubviewStructAt(index);
|
|
||||||
WMDeleteFromArray(sPtr->subviews, index);
|
WMDeleteFromArray(sPtr->subviews, index);
|
||||||
sPtr->flags.adjustOnPaint = 1;
|
sPtr->flags.adjustOnPaint = 1;
|
||||||
paintSplitView(sPtr);
|
paintSplitView(sPtr);
|
||||||
|
|||||||
+1
-7
@@ -755,7 +755,7 @@ static void paintTextField(TextField * tPtr)
|
|||||||
W_Screen *screen = tPtr->view->screen;
|
W_Screen *screen = tPtr->view->screen;
|
||||||
W_View *view = tPtr->view;
|
W_View *view = tPtr->view;
|
||||||
W_View viewbuffer;
|
W_View viewbuffer;
|
||||||
int tx, ty, tw, th;
|
int tx, ty, tw;
|
||||||
int rx;
|
int rx;
|
||||||
int bd;
|
int bd;
|
||||||
int totalWidth;
|
int totalWidth;
|
||||||
@@ -792,8 +792,6 @@ static void paintTextField(TextField * tPtr)
|
|||||||
if (tPtr->textLen > 0) {
|
if (tPtr->textLen > 0) {
|
||||||
tw = WMWidthOfString(tPtr->font, &(text[tPtr->viewPosition]), tPtr->textLen - tPtr->viewPosition);
|
tw = WMWidthOfString(tPtr->font, &(text[tPtr->viewPosition]), tPtr->textLen - tPtr->viewPosition);
|
||||||
|
|
||||||
th = WMFontHeight(tPtr->font);
|
|
||||||
|
|
||||||
ty = tPtr->offsetWidth;
|
ty = tPtr->offsetWidth;
|
||||||
switch (tPtr->flags.alignment) {
|
switch (tPtr->flags.alignment) {
|
||||||
case WALeft:
|
case WALeft:
|
||||||
@@ -1334,7 +1332,6 @@ static void pasteText(WMView * view, Atom selection, Atom target, Time timestamp
|
|||||||
static void handleTextFieldActionEvents(XEvent * event, void *data)
|
static void handleTextFieldActionEvents(XEvent * event, void *data)
|
||||||
{
|
{
|
||||||
TextField *tPtr = (TextField *) data;
|
TextField *tPtr = (TextField *) data;
|
||||||
static int move = 0;
|
|
||||||
static Time lastButtonReleasedEvent = 0;
|
static Time lastButtonReleasedEvent = 0;
|
||||||
static Time lastButtonReleasedEvent2 = 0;
|
static Time lastButtonReleasedEvent2 = 0;
|
||||||
Display *dpy = event->xany.display;
|
Display *dpy = event->xany.display;
|
||||||
@@ -1406,7 +1403,6 @@ static void handleTextFieldActionEvents(XEvent * event, void *data)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
move = 1;
|
|
||||||
switch (tPtr->flags.alignment) {
|
switch (tPtr->flags.alignment) {
|
||||||
int textWidth;
|
int textWidth;
|
||||||
case WARight:
|
case WARight:
|
||||||
@@ -1485,8 +1481,6 @@ static void handleTextFieldActionEvents(XEvent * event, void *data)
|
|||||||
XStoreBuffer(dpy, &tPtr->text[start], count, 0);
|
XStoreBuffer(dpy, &tPtr->text[start], count, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
move = 0;
|
|
||||||
|
|
||||||
if (!tPtr->flags.secure &&
|
if (!tPtr->flags.secure &&
|
||||||
event->xbutton.time - lastButtonReleasedEvent <= WINGsConfiguration.doubleClickDelay) {
|
event->xbutton.time - lastButtonReleasedEvent <= WINGsConfiguration.doubleClickDelay) {
|
||||||
|
|
||||||
|
|||||||
@@ -1060,8 +1060,6 @@ static void changePage(WMWidget * w, void *data)
|
|||||||
{
|
{
|
||||||
_Panel *panel = (_Panel *) data;
|
_Panel *panel = (_Panel *) data;
|
||||||
int section;
|
int section;
|
||||||
WMListItem *item;
|
|
||||||
TextureListItem *titem;
|
|
||||||
WMScreen *scr = WMWidgetScreen(panel->box);
|
WMScreen *scr = WMWidgetScreen(panel->box);
|
||||||
RContext *rc = WMScreenRContext(scr);
|
RContext *rc = WMScreenRContext(scr);
|
||||||
static WMPoint positions[] = {
|
static WMPoint positions[] = {
|
||||||
@@ -1080,10 +1078,6 @@ static void changePage(WMWidget * w, void *data)
|
|||||||
WMSelectListItem(panel->texLs, panel->textureIndex[section]);
|
WMSelectListItem(panel->texLs, panel->textureIndex[section]);
|
||||||
|
|
||||||
WMSetListPosition(panel->texLs, panel->textureIndex[section] - 2);
|
WMSetListPosition(panel->texLs, panel->textureIndex[section] - 2);
|
||||||
|
|
||||||
item = WMGetListItem(panel->texLs, panel->textureIndex[section]);
|
|
||||||
|
|
||||||
titem = (TextureListItem *) item->clientData;
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
WMColor *color;
|
WMColor *color;
|
||||||
|
|||||||
+8
-10
@@ -466,20 +466,18 @@ static void createPanel(_Panel * p)
|
|||||||
|
|
||||||
{
|
{
|
||||||
WEditMenu *pad;
|
WEditMenu *pad;
|
||||||
WEditMenu *smenu;
|
|
||||||
ItemData *data;
|
|
||||||
|
|
||||||
pad = makeFactoryMenu(panel->box, 150);
|
pad = makeFactoryMenu(panel->box, 150);
|
||||||
WMMoveWidget(pad, 10, 40);
|
WMMoveWidget(pad, 10, 40);
|
||||||
|
|
||||||
data = putNewItem(panel, pad, ExecInfo, _("Run Program"));
|
putNewItem(panel, pad, ExecInfo, _("Run Program"));
|
||||||
data = putNewItem(panel, pad, CommandInfo, _("Internal Command"));
|
putNewItem(panel, pad, CommandInfo, _("Internal Command"));
|
||||||
smenu = putNewSubmenu(pad, _("Submenu"));
|
putNewSubmenu(pad, _("Submenu"));
|
||||||
data = putNewItem(panel, pad, ExternalInfo, _("External Submenu"));
|
putNewItem(panel, pad, ExternalInfo, _("External Submenu"));
|
||||||
data = putNewItem(panel, pad, PipeInfo, _("Generated Submenu"));
|
putNewItem(panel, pad, PipeInfo, _("Generated Submenu"));
|
||||||
data = putNewItem(panel, pad, DirectoryInfo, _("Directory Contents"));
|
putNewItem(panel, pad, DirectoryInfo, _("Directory Contents"));
|
||||||
data = putNewItem(panel, pad, WSMenuInfo, _("Workspace Menu"));
|
putNewItem(panel, pad, WSMenuInfo, _("Workspace Menu"));
|
||||||
data = putNewItem(panel, pad, WWindowListInfo, _("Window List Menu"));
|
putNewItem(panel, pad, WWindowListInfo, _("Window List Menu"));
|
||||||
|
|
||||||
panel->itemPad[0] = pad;
|
panel->itemPad[0] = pad;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -427,7 +427,6 @@ static void paintGradListItem(WMList * lPtr, int index, Drawable d, char *text,
|
|||||||
WMColor *white = WMWhiteColor(scr);
|
WMColor *white = WMWhiteColor(scr);
|
||||||
WMColor *black = WMBlackColor(scr);
|
WMColor *black = WMBlackColor(scr);
|
||||||
WMColor *gray = WMGrayColor(scr);
|
WMColor *gray = WMGrayColor(scr);
|
||||||
WMListItem *item;
|
|
||||||
int width, height, x, y;
|
int width, height, x, y;
|
||||||
Display *dpy;
|
Display *dpy;
|
||||||
|
|
||||||
@@ -443,8 +442,6 @@ static void paintGradListItem(WMList * lPtr, int index, Drawable d, char *text,
|
|||||||
else
|
else
|
||||||
XFillRectangle(dpy, d, WMColorGC(gray), x, y, width, height);
|
XFillRectangle(dpy, d, WMColorGC(gray), x, y, width, height);
|
||||||
|
|
||||||
item = WMGetListItem(lPtr, index);
|
|
||||||
|
|
||||||
if (panel->gimage) {
|
if (panel->gimage) {
|
||||||
XCopyArea(WMScreenDisplay(scr), panel->gimage, d, WMColorGC(white),
|
XCopyArea(WMScreenDisplay(scr), panel->gimage, d, WMColorGC(white),
|
||||||
0, height * index, 30, height, x + 5, y);
|
0, height * index, 30, height, x + 5, y);
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <strings.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
|
|||||||
+1
-2
@@ -88,7 +88,7 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
Display *dpy;
|
Display *dpy;
|
||||||
WMScreen *scr;
|
WMScreen *scr;
|
||||||
char *locale, *path;
|
char *path;
|
||||||
int i;
|
int i;
|
||||||
char *display_name = "";
|
char *display_name = "";
|
||||||
|
|
||||||
@@ -131,7 +131,6 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
locale = getenv("LANG");
|
|
||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
|
|
||||||
#ifdef I18N
|
#ifdef I18N
|
||||||
|
|||||||
+6
-12
@@ -32,6 +32,7 @@ Perpetrator: Sudish Joseph <sj@eng.mindspring.net>, Sept. 1997. */
|
|||||||
Boston, MA 02110-1301 USA. */
|
Boston, MA 02110-1301 USA. */
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <strings.h>
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
|
|
||||||
@@ -110,9 +111,6 @@ static const char *index_to_name(int indice)
|
|||||||
static void x_reset_modifier_mapping(Display * display)
|
static void x_reset_modifier_mapping(Display * display)
|
||||||
{
|
{
|
||||||
int modifier_index, modifier_key, column, mkpm;
|
int modifier_index, modifier_key, column, mkpm;
|
||||||
int warned_about_overlapping_modifiers = 0;
|
|
||||||
int warned_about_predefined_modifiers = 0;
|
|
||||||
int warned_about_duplicate_modifiers = 0;
|
|
||||||
int meta_bit = 0;
|
int meta_bit = 0;
|
||||||
int hyper_bit = 0;
|
int hyper_bit = 0;
|
||||||
int super_bit = 0;
|
int super_bit = 0;
|
||||||
@@ -122,26 +120,22 @@ static void x_reset_modifier_mapping(Display * display)
|
|||||||
|
|
||||||
#define modwarn(name,old,other) \
|
#define modwarn(name,old,other) \
|
||||||
wwarning ("%s (0x%x) generates %s, which is generated by %s.", \
|
wwarning ("%s (0x%x) generates %s, which is generated by %s.", \
|
||||||
name, code, index_to_name (old), other), \
|
name, code, index_to_name (old), other)
|
||||||
warned_about_overlapping_modifiers = 1
|
|
||||||
|
|
||||||
#define modbarf(name,other) \
|
#define modbarf(name,other) \
|
||||||
wwarning ("%s (0x%x) generates %s, which is nonsensical.", \
|
wwarning ("%s (0x%x) generates %s, which is nonsensical.", \
|
||||||
name, code, other), \
|
name, code, other)
|
||||||
warned_about_predefined_modifiers = 1
|
|
||||||
|
|
||||||
#define check_modifier(name,mask) \
|
#define check_modifier(name,mask) \
|
||||||
if ((1<<modifier_index) != mask) \
|
if ((1<<modifier_index) != mask) \
|
||||||
wwarning ("%s (0x%x) generates %s, which is nonsensical.", \
|
wwarning ("%s (0x%x) generates %s, which is nonsensical.", \
|
||||||
name, code, index_to_name (modifier_index)), \
|
name, code, index_to_name (modifier_index))
|
||||||
warned_about_predefined_modifiers = 1
|
|
||||||
|
|
||||||
#define store_modifier(name,old) \
|
#define store_modifier(name,old) \
|
||||||
if (old && old != modifier_index) \
|
if (old && old != modifier_index) \
|
||||||
wwarning ("%s (0x%x) generates both %s and %s, which is nonsensical.", \
|
wwarning ("%s (0x%x) generates both %s and %s, which is nonsensical.", \
|
||||||
name, code, index_to_name (old), \
|
name, code, index_to_name (old), \
|
||||||
index_to_name (modifier_index)), \
|
index_to_name (modifier_index)); \
|
||||||
warned_about_duplicate_modifiers = 1; \
|
|
||||||
if (modifier_index == ShiftMapIndex) modbarf (name,"ModShift"); \
|
if (modifier_index == ShiftMapIndex) modbarf (name,"ModShift"); \
|
||||||
else if (modifier_index == LockMapIndex) modbarf (name,"ModLock"); \
|
else if (modifier_index == LockMapIndex) modbarf (name,"ModLock"); \
|
||||||
else if (modifier_index == ControlMapIndex) modbarf (name,"ModControl"); \
|
else if (modifier_index == ControlMapIndex) modbarf (name,"ModControl"); \
|
||||||
@@ -253,7 +247,7 @@ static void x_reset_modifier_mapping(Display * display)
|
|||||||
warn = "Alt", alt_bit = 0;
|
warn = "Alt", alt_bit = 0;
|
||||||
if (warn) {
|
if (warn) {
|
||||||
wwarning("%s is being used for both Mode_switch and %s.",
|
wwarning("%s is being used for both Mode_switch and %s.",
|
||||||
index_to_name(mode_bit), warn), warned_about_overlapping_modifiers = 1;
|
index_to_name(mode_bit), warn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -82,10 +82,11 @@ dnl ================================
|
|||||||
case "${host}" in
|
case "${host}" in
|
||||||
*-*-linux*|*-*-cygwin*)
|
*-*-linux*|*-*-cygwin*)
|
||||||
WM_OSDEP="linux"
|
WM_OSDEP="linux"
|
||||||
|
CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600"
|
||||||
;;
|
;;
|
||||||
*-*-freebsd*)
|
*-*-freebsd*)
|
||||||
WM_OSDEP="bsd"
|
WM_OSDEP="bsd"
|
||||||
CFLAGS="$CFLAGS -DFREEBSD"
|
CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600 -DFREEBSD"
|
||||||
;;
|
;;
|
||||||
*-*-netbsd*)
|
*-*-netbsd*)
|
||||||
WM_OSDEP="bsd"
|
WM_OSDEP="bsd"
|
||||||
|
|||||||
@@ -377,7 +377,6 @@ WApplication *wApplicationCreate(WWindow * wwin)
|
|||||||
|
|
||||||
void wApplicationDestroy(WApplication * wapp)
|
void wApplicationDestroy(WApplication * wapp)
|
||||||
{
|
{
|
||||||
Window main_window;
|
|
||||||
WWindow *wwin;
|
WWindow *wwin;
|
||||||
WScreen *scr;
|
WScreen *scr;
|
||||||
|
|
||||||
@@ -400,7 +399,6 @@ void wApplicationDestroy(WApplication * wapp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
scr = wapp->main_window_desc->screen_ptr;
|
scr = wapp->main_window_desc->screen_ptr;
|
||||||
main_window = wapp->main_window;
|
|
||||||
|
|
||||||
if (wapp == scr->wapp_list) {
|
if (wapp == scr->wapp_list) {
|
||||||
if (wapp->next)
|
if (wapp->next)
|
||||||
|
|||||||
+2
-4
@@ -27,6 +27,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <strings.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@@ -1009,14 +1010,12 @@ void wReadDefaults(WScreen * scr, WMPropList * new_dict)
|
|||||||
{
|
{
|
||||||
WMPropList *plvalue, *old_value;
|
WMPropList *plvalue, *old_value;
|
||||||
WDefaultEntry *entry;
|
WDefaultEntry *entry;
|
||||||
unsigned int i, must_update;
|
unsigned int i;
|
||||||
int update_workspace_back = 0; /* kluge :/ */
|
int update_workspace_back = 0; /* kluge :/ */
|
||||||
unsigned int needs_refresh;
|
unsigned int needs_refresh;
|
||||||
void *tdata;
|
void *tdata;
|
||||||
WMPropList *old_dict = (WDWindowMaker->dictionary != new_dict ? WDWindowMaker->dictionary : NULL);
|
WMPropList *old_dict = (WDWindowMaker->dictionary != new_dict ? WDWindowMaker->dictionary : NULL);
|
||||||
|
|
||||||
must_update = 0;
|
|
||||||
|
|
||||||
needs_refresh = 0;
|
needs_refresh = 0;
|
||||||
|
|
||||||
for (i = 0; i < sizeof(optionList) / sizeof(WDefaultEntry); i++) {
|
for (i = 0; i < sizeof(optionList) / sizeof(WDefaultEntry); i++) {
|
||||||
@@ -1037,7 +1036,6 @@ void wReadDefaults(WScreen * scr, WMPropList * new_dict)
|
|||||||
plvalue = entry->plvalue;
|
plvalue = entry->plvalue;
|
||||||
if (plvalue && new_dict) {
|
if (plvalue && new_dict) {
|
||||||
WMPutInPLDictionary(new_dict, entry->plkey, plvalue);
|
WMPutInPLDictionary(new_dict, entry->plkey, plvalue);
|
||||||
must_update = 1;
|
|
||||||
}
|
}
|
||||||
} else if (!plvalue) {
|
} else if (!plvalue) {
|
||||||
/* value was deleted from DB. Keep current value */
|
/* value was deleted from DB. Keep current value */
|
||||||
|
|||||||
+1
-4
@@ -808,7 +808,6 @@ static void keyPressHandler(XEvent * event, void *data)
|
|||||||
{
|
{
|
||||||
IconPanel *panel = (IconPanel *) data;
|
IconPanel *panel = (IconPanel *) data;
|
||||||
char buffer[32];
|
char buffer[32];
|
||||||
int count;
|
|
||||||
KeySym ksym;
|
KeySym ksym;
|
||||||
int iidx;
|
int iidx;
|
||||||
int didx;
|
int didx;
|
||||||
@@ -819,7 +818,7 @@ static void keyPressHandler(XEvent * event, void *data)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
buffer[0] = 0;
|
buffer[0] = 0;
|
||||||
count = XLookupString(&event->xkey, buffer, sizeof(buffer), &ksym, NULL);
|
XLookupString(&event->xkey, buffer, sizeof(buffer), &ksym, NULL);
|
||||||
|
|
||||||
iidx = WMGetListSelectedItemRow(panel->iconList);
|
iidx = WMGetListSelectedItemRow(panel->iconList);
|
||||||
didx = WMGetListSelectedItemRow(panel->dirList);
|
didx = WMGetListSelectedItemRow(panel->dirList);
|
||||||
@@ -1103,7 +1102,6 @@ void wShowInfoPanel(WScreen * scr)
|
|||||||
{
|
{
|
||||||
InfoPanel *panel;
|
InfoPanel *panel;
|
||||||
WMPixmap *logo;
|
WMPixmap *logo;
|
||||||
WMSize size;
|
|
||||||
WMFont *font;
|
WMFont *font;
|
||||||
char *strbuf = NULL;
|
char *strbuf = NULL;
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
@@ -1142,7 +1140,6 @@ void wShowInfoPanel(WScreen * scr)
|
|||||||
logo = WMRetainPixmap(WMGetApplicationIconPixmap(scr->wmscreen));
|
logo = WMRetainPixmap(WMGetApplicationIconPixmap(scr->wmscreen));
|
||||||
}
|
}
|
||||||
if (logo) {
|
if (logo) {
|
||||||
size = WMGetPixmapSize(logo);
|
|
||||||
panel->logoL = WMCreateLabel(panel->win);
|
panel->logoL = WMCreateLabel(panel->win);
|
||||||
WMResizeWidget(panel->logoL, 64, 64);
|
WMResizeWidget(panel->logoL, 64, 64);
|
||||||
WMMoveWidget(panel->logoL, 30, 20);
|
WMMoveWidget(panel->logoL, 30, 20);
|
||||||
|
|||||||
+2
-2
@@ -26,6 +26,7 @@
|
|||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <strings.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
@@ -2262,10 +2263,9 @@ Bool wDockSnapIcon(WDock * dock, WAppIcon * icon, int req_x, int req_y, int *ret
|
|||||||
int i, offset = ICON_SIZE / 2;
|
int i, offset = ICON_SIZE / 2;
|
||||||
WAppIcon *aicon = NULL;
|
WAppIcon *aicon = NULL;
|
||||||
WAppIcon *nicon = NULL;
|
WAppIcon *nicon = NULL;
|
||||||
int max_y_icons, max_x_icons;
|
int max_y_icons;
|
||||||
|
|
||||||
/* TODO: XINERAMA, for these */
|
/* TODO: XINERAMA, for these */
|
||||||
max_x_icons = scr->scr_width / ICON_SIZE;
|
|
||||||
max_y_icons = scr->scr_height / ICON_SIZE - 1;
|
max_y_icons = scr->scr_height / ICON_SIZE - 1;
|
||||||
|
|
||||||
if (wPreferences.flags.noupdates)
|
if (wPreferences.flags.noupdates)
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include "wconfig.h"
|
#include "wconfig.h"
|
||||||
|
|
||||||
#ifdef HAVE_INOTIFY
|
#ifdef HAVE_INOTIFY
|
||||||
|
#include <sys/select.h>
|
||||||
#include <sys/inotify.h>
|
#include <sys/inotify.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -29,6 +30,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <strings.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
|
|||||||
+1
-3
@@ -625,7 +625,7 @@ void wIconUpdate(WIcon * icon)
|
|||||||
int x, y;
|
int x, y;
|
||||||
unsigned int w, h;
|
unsigned int w, h;
|
||||||
Window jw;
|
Window jw;
|
||||||
int ji, dotitle;
|
int ji;
|
||||||
unsigned int ju, d;
|
unsigned int ju, d;
|
||||||
Pixmap pixmap;
|
Pixmap pixmap;
|
||||||
|
|
||||||
@@ -646,7 +646,6 @@ void wIconUpdate(WIcon * icon)
|
|||||||
|
|
||||||
if (icon->show_title && (title_height < wPreferences.icon_size)) {
|
if (icon->show_title && (title_height < wPreferences.icon_size)) {
|
||||||
drawIconTitle(scr, pixmap, title_height);
|
drawIconTitle(scr, pixmap, title_height);
|
||||||
dotitle = 1;
|
|
||||||
|
|
||||||
if (h > wPreferences.icon_size - title_height - 2) {
|
if (h > wPreferences.icon_size - title_height - 2) {
|
||||||
h = wPreferences.icon_size - title_height - 2;
|
h = wPreferences.icon_size - title_height - 2;
|
||||||
@@ -655,7 +654,6 @@ void wIconUpdate(WIcon * icon)
|
|||||||
y = (wPreferences.icon_size - h - title_height) / 2 + title_height + 1;
|
y = (wPreferences.icon_size - h - title_height) / 2 + title_height + 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dotitle = 0;
|
|
||||||
if (w > wPreferences.icon_size)
|
if (w > wPreferences.icon_size)
|
||||||
w = wPreferences.icon_size;
|
w = wPreferences.icon_size;
|
||||||
y = (wPreferences.icon_size - h) / 2;
|
y = (wPreferences.icon_size - h) / 2;
|
||||||
|
|||||||
+1
-5
@@ -592,10 +592,9 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
static int real_main(int argc, char **argv)
|
static int real_main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i, restart = 0;
|
int i;
|
||||||
char *pos;
|
char *pos;
|
||||||
int d, s;
|
int d, s;
|
||||||
int flag;
|
|
||||||
|
|
||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
wsetabort(wAbort);
|
wsetabort(wAbort);
|
||||||
@@ -603,7 +602,6 @@ static int real_main(int argc, char **argv)
|
|||||||
/* for telling WPrefs what's the name of the wmaker binary being ran */
|
/* for telling WPrefs what's the name of the wmaker binary being ran */
|
||||||
setenv("WMAKER_BIN_NAME", argv[0], 1);
|
setenv("WMAKER_BIN_NAME", argv[0], 1);
|
||||||
|
|
||||||
flag = 0;
|
|
||||||
ArgCount = argc;
|
ArgCount = argc;
|
||||||
Arguments = wmalloc(sizeof(char *) * (ArgCount + 1));
|
Arguments = wmalloc(sizeof(char *) * (ArgCount + 1));
|
||||||
for (i = 0; i < argc; i++) {
|
for (i = 0; i < argc; i++) {
|
||||||
@@ -619,8 +617,6 @@ static int real_main(int argc, char **argv)
|
|||||||
else
|
else
|
||||||
ProgName++;
|
ProgName++;
|
||||||
|
|
||||||
restart = 0;
|
|
||||||
|
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
#ifdef USECPP
|
#ifdef USECPP
|
||||||
|
|||||||
+1
-6
@@ -802,7 +802,7 @@ static void move_menus(WMenu * menu, int x, int y)
|
|||||||
static void makeVisible(WMenu * menu)
|
static void makeVisible(WMenu * menu)
|
||||||
{
|
{
|
||||||
WScreen *scr = menu->frame->screen_ptr;
|
WScreen *scr = menu->frame->screen_ptr;
|
||||||
int x1, y1, x2, y2, new_x, new_y, move;
|
int x1, y1, x2, y2, new_x, new_y;
|
||||||
WMRect rect = wGetRectForHead(scr, wGetHeadForPointerLocation(scr));
|
WMRect rect = wGetRectForHead(scr, wGetHeadForPointerLocation(scr));
|
||||||
|
|
||||||
if (menu->entry_no < 0)
|
if (menu->entry_no < 0)
|
||||||
@@ -815,22 +815,17 @@ static void makeVisible(WMenu * menu)
|
|||||||
|
|
||||||
new_x = x1;
|
new_x = x1;
|
||||||
new_y = y1;
|
new_y = y1;
|
||||||
move = 0;
|
|
||||||
|
|
||||||
if (x1 < rect.pos.x) {
|
if (x1 < rect.pos.x) {
|
||||||
new_x = rect.pos.x;
|
new_x = rect.pos.x;
|
||||||
move = 1;
|
|
||||||
} else if (x2 >= rect.pos.x + rect.size.width) {
|
} else if (x2 >= rect.pos.x + rect.size.width) {
|
||||||
new_x = rect.pos.x + rect.size.width - MENUW(menu) - 1;
|
new_x = rect.pos.x + rect.size.width - MENUW(menu) - 1;
|
||||||
move = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (y1 < rect.pos.y) {
|
if (y1 < rect.pos.y) {
|
||||||
new_y = rect.pos.y;
|
new_y = rect.pos.y;
|
||||||
move = 1;
|
|
||||||
} else if (y2 >= rect.pos.y + rect.size.height) {
|
} else if (y2 >= rect.pos.y + rect.size.height) {
|
||||||
new_y = rect.pos.y + rect.size.height - menu->entry_height - 1;
|
new_y = rect.pos.y + rect.size.height - menu->entry_height - 1;
|
||||||
move = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
new_y = new_y - menu->frame->top_width - menu->selected_entry * menu->entry_height;
|
new_y = new_y - menu->frame->top_width - menu->selected_entry * menu->entry_height;
|
||||||
|
|||||||
+1
-2
@@ -26,6 +26,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <strings.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
@@ -92,14 +93,12 @@ static char *username(void)
|
|||||||
|
|
||||||
char *MakeCPPArgs(char *path)
|
char *MakeCPPArgs(char *path)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
char buffer[MAXLINE], *buf, *line;
|
char buffer[MAXLINE], *buf, *line;
|
||||||
Visual *visual;
|
Visual *visual;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
|
||||||
line = wmalloc(MAXLINE);
|
line = wmalloc(MAXLINE);
|
||||||
*line = 0;
|
*line = 0;
|
||||||
i = 1;
|
|
||||||
if ((buf = getenv("HOSTNAME")) != NULL) {
|
if ((buf = getenv("HOSTNAME")) != NULL) {
|
||||||
if (buf[0] == '(') {
|
if (buf[0] == '(') {
|
||||||
wwarning(_("your machine is misconfigured. HOSTNAME is set to %s"), buf);
|
wwarning(_("your machine is misconfigured. HOSTNAME is set to %s"), buf);
|
||||||
|
|||||||
+2
-11
@@ -902,14 +902,11 @@ updateWindowPosition(WWindow * wwin, MoveData * data, Bool doResistance,
|
|||||||
int winL, winR, winT, winB; /* requested new window position */
|
int winL, winR, winT, winB; /* requested new window position */
|
||||||
int newX, newY; /* actual new window position */
|
int newX, newY; /* actual new window position */
|
||||||
Bool hresist, vresist;
|
Bool hresist, vresist;
|
||||||
Bool updateIndex;
|
|
||||||
Bool attract;
|
Bool attract;
|
||||||
|
|
||||||
hresist = False;
|
hresist = False;
|
||||||
vresist = False;
|
vresist = False;
|
||||||
|
|
||||||
updateIndex = False;
|
|
||||||
|
|
||||||
/* check the direction of the movement */
|
/* check the direction of the movement */
|
||||||
dx = newMouseX - data->mouseX;
|
dx = newMouseX - data->mouseX;
|
||||||
dy = newMouseY - data->mouseY;
|
dy = newMouseY - data->mouseY;
|
||||||
@@ -1211,7 +1208,7 @@ int wKeyboardMoveResizeWindow(WWindow * wwin)
|
|||||||
int done, off_x, off_y, ww, wh;
|
int done, off_x, off_y, ww, wh;
|
||||||
int kspeed = _KS;
|
int kspeed = _KS;
|
||||||
Time lastTime = 0;
|
Time lastTime = 0;
|
||||||
KeyCode shiftl, shiftr, ctrll, ctrlmode;
|
KeyCode shiftl, shiftr, ctrlmode;
|
||||||
KeySym keysym = NoSymbol;
|
KeySym keysym = NoSymbol;
|
||||||
int moment = 0;
|
int moment = 0;
|
||||||
int modes = ((IS_MOVABLE(wwin) ? MOVABLE_BIT : 0) | (IS_RESIZABLE(wwin) ? RESIZABLE_BIT : 0));
|
int modes = ((IS_MOVABLE(wwin) ? MOVABLE_BIT : 0) | (IS_RESIZABLE(wwin) ? RESIZABLE_BIT : 0));
|
||||||
@@ -1221,7 +1218,6 @@ int wKeyboardMoveResizeWindow(WWindow * wwin)
|
|||||||
|
|
||||||
shiftl = XKeysymToKeycode(dpy, XK_Shift_L);
|
shiftl = XKeysymToKeycode(dpy, XK_Shift_L);
|
||||||
shiftr = XKeysymToKeycode(dpy, XK_Shift_R);
|
shiftr = XKeysymToKeycode(dpy, XK_Shift_R);
|
||||||
ctrll = XKeysymToKeycode(dpy, XK_Control_L);
|
|
||||||
ctrlmode = done = off_x = off_y = 0;
|
ctrlmode = done = off_x = off_y = 0;
|
||||||
|
|
||||||
if (modes == RESIZABLE_BIT) {
|
if (modes == RESIZABLE_BIT) {
|
||||||
@@ -1851,7 +1847,6 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev)
|
|||||||
int rx1, ry1, rx2, ry2;
|
int rx1, ry1, rx2, ry2;
|
||||||
int res = 0;
|
int res = 0;
|
||||||
KeyCode shiftl, shiftr;
|
KeyCode shiftl, shiftr;
|
||||||
int h = 0;
|
|
||||||
int orig_fx = fx;
|
int orig_fx = fx;
|
||||||
int orig_fy = fy;
|
int orig_fy = fy;
|
||||||
int orig_fw = fw;
|
int orig_fw = fw;
|
||||||
@@ -1878,11 +1873,7 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev)
|
|||||||
ry2 = fy + fh - 1;
|
ry2 = fy + fh - 1;
|
||||||
shiftl = XKeysymToKeycode(dpy, XK_Shift_L);
|
shiftl = XKeysymToKeycode(dpy, XK_Shift_L);
|
||||||
shiftr = XKeysymToKeycode(dpy, XK_Shift_R);
|
shiftr = XKeysymToKeycode(dpy, XK_Shift_R);
|
||||||
if (HAS_TITLEBAR(wwin))
|
|
||||||
h = WMFontHeight(wwin->screen_ptr->title_font) + (wPreferences.window_title_clearance +
|
|
||||||
TITLEBAR_EXTEND_SPACE) * 2;
|
|
||||||
else
|
|
||||||
h = 0;
|
|
||||||
while (1) {
|
while (1) {
|
||||||
WMMaskEvent(dpy, KeyPressMask | ButtonMotionMask
|
WMMaskEvent(dpy, KeyPressMask | ButtonMotionMask
|
||||||
| ButtonReleaseMask | PointerMotionHintMask | ButtonPressMask | ExposureMask, &event);
|
| ButtonReleaseMask | PointerMotionHintMask | ButtonPressMask | ExposureMask, &event);
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
/*
|
||||||
|
* Until FreeBSD gets their act together;
|
||||||
|
* http://www.mail-archive.com/freebsd-hackers@freebsd.org/msg69469.html
|
||||||
|
*/
|
||||||
|
#if defined( FREEBSD )
|
||||||
|
# undef _XOPEN_SOURCE
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined( FREEBSD ) || defined( DRAGONFLYBSD )
|
#if defined( FREEBSD ) || defined( DRAGONFLYBSD )
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
|
|||||||
+2
-4
@@ -29,6 +29,7 @@
|
|||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <strings.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
@@ -1151,7 +1152,7 @@ static WMenu *readMenuFile(WScreen * scr, char *file_name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CPP
|
#ifdef USECPP
|
||||||
if (cpp) {
|
if (cpp) {
|
||||||
if (pclose(file) == -1) {
|
if (pclose(file) == -1) {
|
||||||
werror(_("error reading preprocessed menu data"));
|
werror(_("error reading preprocessed menu data"));
|
||||||
@@ -1183,7 +1184,6 @@ static WMenu *readMenuPipe(WScreen * scr, char **file_name)
|
|||||||
int i;
|
int i;
|
||||||
#ifdef USECPP
|
#ifdef USECPP
|
||||||
char *args;
|
char *args;
|
||||||
int cpp = 0;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
flat_file[0] = '\0';
|
flat_file[0] = '\0';
|
||||||
@@ -1206,8 +1206,6 @@ static WMenu *readMenuPipe(WScreen * scr, char **file_name)
|
|||||||
file = popen(command, "r");
|
file = popen(command, "r");
|
||||||
if (!file) {
|
if (!file) {
|
||||||
werror(_("%s:could not open/preprocess menu file"), filename);
|
werror(_("%s:could not open/preprocess menu file"), filename);
|
||||||
} else {
|
|
||||||
cpp = 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <strings.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <strings.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <strings.h>
|
||||||
|
|
||||||
#include "WindowMaker.h"
|
#include "WindowMaker.h"
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
|
|||||||
+2
-4
@@ -647,12 +647,11 @@ static void newWSCommand(WMenu * menu, WMenuEntry * foo)
|
|||||||
|
|
||||||
static char *cropline(char *line)
|
static char *cropline(char *line)
|
||||||
{
|
{
|
||||||
char *start, *end;
|
char *end;
|
||||||
|
|
||||||
if (strlen(line) == 0)
|
if (strlen(line) == 0)
|
||||||
return line;
|
return line;
|
||||||
|
|
||||||
start = line;
|
|
||||||
end = &(line[strlen(line)]) - 1;
|
end = &(line[strlen(line)]) - 1;
|
||||||
while (isspace(*line) && *line != 0)
|
while (isspace(*line) && *line != 0)
|
||||||
line++;
|
line++;
|
||||||
@@ -821,7 +820,7 @@ void wWorkspaceSaveState(WScreen * scr, WMPropList * old_state)
|
|||||||
void wWorkspaceRestoreState(WScreen * scr)
|
void wWorkspaceRestoreState(WScreen * scr)
|
||||||
{
|
{
|
||||||
WMPropList *parr, *pstr, *wks_state, *clip_state;
|
WMPropList *parr, *pstr, *wks_state, *clip_state;
|
||||||
int i, j, wscount;
|
int i, j;
|
||||||
|
|
||||||
make_keys();
|
make_keys();
|
||||||
|
|
||||||
@@ -833,7 +832,6 @@ void wWorkspaceRestoreState(WScreen * scr)
|
|||||||
if (!parr)
|
if (!parr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wscount = scr->workspace_count;
|
|
||||||
for (i = 0; i < WMIN(WMGetPropListItemCount(parr), MAX_WORKSPACES); i++) {
|
for (i = 0; i < WMIN(WMGetPropListItemCount(parr), MAX_WORKSPACES); i++) {
|
||||||
wks_state = WMGetFromPLArray(parr, i);
|
wks_state = WMGetFromPLArray(parr, i);
|
||||||
if (WMIsPLDictionary(wks_state))
|
if (WMIsPLDictionary(wks_state))
|
||||||
|
|||||||
+6
-41
@@ -30,6 +30,7 @@ Perpetrator: Sudish Joseph <sj@eng.mindspring.net>, Sept. 1997. */
|
|||||||
#include "wconfig.h"
|
#include "wconfig.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <strings.h>
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
|
|
||||||
@@ -111,9 +112,6 @@ static const char *index_to_name(int indice)
|
|||||||
static void x_reset_modifier_mapping(Display * display)
|
static void x_reset_modifier_mapping(Display * display)
|
||||||
{
|
{
|
||||||
int modifier_index, modifier_key, column, mkpm;
|
int modifier_index, modifier_key, column, mkpm;
|
||||||
int warned_about_overlapping_modifiers = 0;
|
|
||||||
int warned_about_predefined_modifiers = 0;
|
|
||||||
int warned_about_duplicate_modifiers = 0;
|
|
||||||
int meta_bit = 0;
|
int meta_bit = 0;
|
||||||
int hyper_bit = 0;
|
int hyper_bit = 0;
|
||||||
int super_bit = 0;
|
int super_bit = 0;
|
||||||
@@ -123,26 +121,22 @@ static void x_reset_modifier_mapping(Display * display)
|
|||||||
|
|
||||||
#define modwarn(name,old,other) \
|
#define modwarn(name,old,other) \
|
||||||
wwarning ("%s (0x%x) generates %s, which is generated by %s.", \
|
wwarning ("%s (0x%x) generates %s, which is generated by %s.", \
|
||||||
name, code, index_to_name (old), other), \
|
name, code, index_to_name (old), other)
|
||||||
warned_about_overlapping_modifiers = 1
|
|
||||||
|
|
||||||
#define modbarf(name,other) \
|
#define modbarf(name,other) \
|
||||||
wwarning ("%s (0x%x) generates %s, which is nonsensical.", \
|
wwarning ("%s (0x%x) generates %s, which is nonsensical.", \
|
||||||
name, code, other), \
|
name, code, other)
|
||||||
warned_about_predefined_modifiers = 1
|
|
||||||
|
|
||||||
#define check_modifier(name,mask) \
|
#define check_modifier(name,mask) \
|
||||||
if ((1<<modifier_index) != mask) \
|
if ((1<<modifier_index) != mask) \
|
||||||
wwarning ("%s (0x%x) generates %s, which is nonsensical.", \
|
wwarning ("%s (0x%x) generates %s, which is nonsensical.", \
|
||||||
name, code, index_to_name (modifier_index)), \
|
name, code, index_to_name (modifier_index))
|
||||||
warned_about_predefined_modifiers = 1
|
|
||||||
|
|
||||||
#define store_modifier(name,old) \
|
#define store_modifier(name,old) \
|
||||||
if (old && old != modifier_index) \
|
if (old && old != modifier_index) \
|
||||||
wwarning ("%s (0x%x) generates both %s and %s, which is nonsensical.", \
|
wwarning ("%s (0x%x) generates both %s and %s, which is nonsensical.", \
|
||||||
name, code, index_to_name (old), \
|
name, code, index_to_name (old), \
|
||||||
index_to_name (modifier_index)), \
|
index_to_name (modifier_index)); \
|
||||||
warned_about_duplicate_modifiers = 1; \
|
|
||||||
if (modifier_index == ShiftMapIndex) modbarf (name,"ModShift"); \
|
if (modifier_index == ShiftMapIndex) modbarf (name,"ModShift"); \
|
||||||
else if (modifier_index == LockMapIndex) modbarf (name,"ModLock"); \
|
else if (modifier_index == LockMapIndex) modbarf (name,"ModLock"); \
|
||||||
else if (modifier_index == ControlMapIndex) modbarf (name,"ModControl"); \
|
else if (modifier_index == ControlMapIndex) modbarf (name,"ModControl"); \
|
||||||
@@ -254,7 +248,7 @@ static void x_reset_modifier_mapping(Display * display)
|
|||||||
warn = "Alt", alt_bit = 0;
|
warn = "Alt", alt_bit = 0;
|
||||||
if (warn) {
|
if (warn) {
|
||||||
wwarning("%s is being used for both Mode_switch and %s.",
|
wwarning("%s is being used for both Mode_switch and %s.",
|
||||||
index_to_name(mode_bit), warn), warned_about_overlapping_modifiers = 1;
|
index_to_name(mode_bit), warn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -264,35 +258,6 @@ static void x_reset_modifier_mapping(Display * display)
|
|||||||
AltMask = (alt_bit ? (1 << alt_bit) : 0);
|
AltMask = (alt_bit ? (1 << alt_bit) : 0);
|
||||||
ModeMask = (mode_bit ? (1 << mode_bit) : 0); /* unused */
|
ModeMask = (mode_bit ? (1 << mode_bit) : 0); /* unused */
|
||||||
|
|
||||||
#if 0
|
|
||||||
if (warned_about_overlapping_modifiers)
|
|
||||||
wwarning("\n"
|
|
||||||
" Two distinct modifier keys (such as Meta and Hyper) cannot generate\n"
|
|
||||||
" the same modifier bit, because Emacs won't be able to tell which\n"
|
|
||||||
" modifier was actually held down when some other key is pressed. It\n"
|
|
||||||
" won't be able to tell Meta-x and Hyper-x apart, for example. Change\n"
|
|
||||||
" one of these keys to use some other modifier bit. If you intend for\n"
|
|
||||||
" these keys to have the same behavior, then change them to have the\n"
|
|
||||||
" same keysym as well as the same modifier bit.\n");
|
|
||||||
|
|
||||||
if (warned_about_predefined_modifiers)
|
|
||||||
wwarning("\n"
|
|
||||||
" The semantics of the modifier bits ModShift, ModLock, and ModControl\n"
|
|
||||||
" are predefined. It does not make sense to assign ModControl to any\n"
|
|
||||||
" keysym other than Control_L or Control_R, or to assign any modifier\n"
|
|
||||||
" bits to the \"control\" keysyms other than ModControl. You can't\n"
|
|
||||||
" turn a \"control\" key into a \"meta\" key (or vice versa) by simply\n"
|
|
||||||
" assigning the key a different modifier bit. You must also make that\n"
|
|
||||||
" key generate an appropriate keysym (Control_L, Meta_L, etc).\n");
|
|
||||||
|
|
||||||
/* No need to say anything more for warned_about_duplicate_modifiers. */
|
|
||||||
|
|
||||||
if (warned_about_overlapping_modifiers || warned_about_predefined_modifiers)
|
|
||||||
wwarning("\n"
|
|
||||||
" The meanings of the modifier bits Mod1 through Mod5 are determined\n"
|
|
||||||
" by the keysyms used to control those bits. Mod1 does NOT always\n"
|
|
||||||
" mean Meta, although some non-ICCCM-compliant programs assume that.\n");
|
|
||||||
#endif
|
|
||||||
XFreeModifiermap(x_modifier_keymap);
|
XFreeModifiermap(x_modifier_keymap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -35,6 +35,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <strings.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <WINGs/WUtil.h>
|
#include <WINGs/WUtil.h>
|
||||||
@@ -216,7 +217,7 @@ void copyFile(char *dir, char *file)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
RETRY( nwritten = fwrite(buf, 1, nread, dst) )
|
RETRY( nwritten = fwrite(buf, 1, nread, dst) )
|
||||||
if (ferror(dst) || feof(src))
|
if (ferror(dst) || feof(src) || nread != nwritten)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
} while (1);
|
} while (1);
|
||||||
|
|||||||
+1
-2
@@ -48,7 +48,7 @@ void print_help(int print_usage, int exitval)
|
|||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
WMPropList *window_name, *icon_key, *window_attrs, *icon_value;
|
WMPropList *window_name, *window_attrs, *icon_value;
|
||||||
WMPropList *all_windows, *iconset, *keylist;
|
WMPropList *all_windows, *iconset, *keylist;
|
||||||
int i, ch;
|
int i, ch;
|
||||||
char *path = NULL;
|
char *path = NULL;
|
||||||
@@ -96,7 +96,6 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
keylist = WMGetPLDictionaryKeys(iconset);
|
keylist = WMGetPLDictionaryKeys(iconset);
|
||||||
icon_key = WMCreatePLString("Icon");
|
|
||||||
|
|
||||||
for (i = 0; i < WMGetPropListItemCount(keylist); i++) {
|
for (i = 0; i < WMGetPropListItemCount(keylist); i++) {
|
||||||
window_name = WMGetFromPLArray(keylist, i);
|
window_name = WMGetFromPLArray(keylist, i);
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <strings.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -56,7 +56,7 @@ void print_help(int print_usage, int exitval)
|
|||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
char path[PATH_MAX];
|
char path[PATH_MAX];
|
||||||
WMPropList *dom, *key, *value, *dict;
|
WMPropList *key, *value, *dict;
|
||||||
int ch;
|
int ch;
|
||||||
|
|
||||||
struct option longopts[] = {
|
struct option longopts[] = {
|
||||||
@@ -87,7 +87,6 @@ int main(int argc, char **argv)
|
|||||||
if (argc != 3)
|
if (argc != 3)
|
||||||
print_help(0, 1);
|
print_help(0, 1);
|
||||||
|
|
||||||
dom = WMCreatePLString(argv[0]);
|
|
||||||
key = WMCreatePLString(argv[1]);
|
key = WMCreatePLString(argv[1]);
|
||||||
value = WMCreatePropListFromDescription(argv[2]);
|
value = WMCreatePropListFromDescription(argv[2]);
|
||||||
if (!value) {
|
if (!value) {
|
||||||
|
|||||||
@@ -397,7 +397,6 @@ static BufferData *newWindow(int magfactor)
|
|||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
BufferData *data;
|
|
||||||
int i;
|
int i;
|
||||||
char *display = "";
|
char *display = "";
|
||||||
char *vdisplay = NULL;
|
char *vdisplay = NULL;
|
||||||
@@ -481,8 +480,6 @@ int main(int argc, char **argv)
|
|||||||
cursorColor1 = WMCreateNamedColor(scr, "#ff0000", False);
|
cursorColor1 = WMCreateNamedColor(scr, "#ff0000", False);
|
||||||
cursorColor2 = WMCreateNamedColor(scr, "#00ff00", False);
|
cursorColor2 = WMCreateNamedColor(scr, "#00ff00", False);
|
||||||
|
|
||||||
data = newWindow(magfactor);
|
|
||||||
|
|
||||||
WMScreenMainLoop(scr);
|
WMScreenMainLoop(scr);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#define _GNU_SOURCE /* getopt_long */
|
#define _GNU_SOURCE /* getopt_long */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
|
|||||||
@@ -18,12 +18,6 @@
|
|||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if __GLIBC__ && \
|
|
||||||
(_XOPEN_SOURCE && _XOPEN_SOURCE < 500) || \
|
|
||||||
!_XOPEN_SOURCE
|
|
||||||
#define _XOPEN_SOURCE 500 /* nftw */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
|||||||
@@ -20,12 +20,6 @@
|
|||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if __GLIBC__ && \
|
|
||||||
(_XOPEN_SOURCE && _XOPEN_SOURCE < 500) || \
|
|
||||||
!_XOPEN_SOURCE
|
|
||||||
#define _XOPEN_SOURCE 500 /* nftw */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
|||||||
@@ -36,12 +36,6 @@
|
|||||||
* Basic validation of the .desktop file is done.
|
* Basic validation of the .desktop file is done.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if __GLIBC__ && \
|
|
||||||
(_XOPEN_SOURCE && _XOPEN_SOURCE < 500) || \
|
|
||||||
!_XOPEN_SOURCE
|
|
||||||
#define _XOPEN_SOURCE 500 /* nftw */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <strings.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user