mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
- fixed problem with WINGs based apps exiting with a "X_RotateProperties"
related error when text was selected in a textfiled (this included WPrefs.app and Window Maker itself). - replaced some malloc's with wmalloc's
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
- removed FocusFollowMouse from wmaker and WPrefs
|
||||
- fixed problem with alpha images showing a blue tint on big endian machines
|
||||
- fixed problem with WINGs based apps exiting with a "X_RotateProperties"
|
||||
related error when text was selected in a textfiled (including WPrefs.app
|
||||
and Window Maker itself).
|
||||
|
||||
|
||||
Changes since version 0.64.0:
|
||||
.............................
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
- fixed problem with WINGs based apps exiting with a "X_RotateProperties"
|
||||
related error when text was selected in a textfiled.
|
||||
|
||||
|
||||
Changes since wmaker 0.64.0:
|
||||
............................
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "WINGsP.h"
|
||||
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/keysym.h>
|
||||
#include <X11/cursorfont.h>
|
||||
|
||||
@@ -583,7 +584,7 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
|
||||
"WM_STATE"
|
||||
};
|
||||
Atom atoms[sizeof(atomNames)/sizeof(char*)];
|
||||
int i = 0;
|
||||
int i;
|
||||
|
||||
if (!initialized) {
|
||||
|
||||
@@ -616,6 +617,45 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
|
||||
|
||||
scrPtr->fontCache = WMCreateHashTable(WMStringPointerHashCallbacks);
|
||||
|
||||
/* Create missing CUT_BUFFERs */
|
||||
{
|
||||
Atom *rootWinProps;
|
||||
int exists[8] = {0, 0, 0, 0, 0, 0, 0, 0};
|
||||
int count;
|
||||
|
||||
rootWinProps = XListProperties(display, scrPtr->rootWin, &count);
|
||||
for (i=0; i<count; i++) {
|
||||
switch(rootWinProps[i]) {
|
||||
case XA_CUT_BUFFER0:
|
||||
exists[0] = 1; break;
|
||||
case XA_CUT_BUFFER1:
|
||||
exists[1] = 1; break;
|
||||
case XA_CUT_BUFFER2:
|
||||
exists[2] = 1; break;
|
||||
case XA_CUT_BUFFER3:
|
||||
exists[3] = 1; break;
|
||||
case XA_CUT_BUFFER4:
|
||||
exists[4] = 1; break;
|
||||
case XA_CUT_BUFFER5:
|
||||
exists[5] = 1; break;
|
||||
case XA_CUT_BUFFER6:
|
||||
exists[6] = 1; break;
|
||||
case XA_CUT_BUFFER7:
|
||||
exists[7] = 1; break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (rootWinProps) {
|
||||
XFree(rootWinProps);
|
||||
}
|
||||
for (i=0; i<8; i++) {
|
||||
if (!exists[i]) {
|
||||
XStoreBuffer(display, "", 0, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scrPtr->ignoredModifierMask = 0;
|
||||
{
|
||||
int i;
|
||||
@@ -816,11 +856,8 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
|
||||
XInternAtoms(display, atomNames, sizeof(atomNames)/sizeof(char*), False,
|
||||
atoms);
|
||||
#else
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < sizeof(atomNames)/sizeof(char*); i++) {
|
||||
atoms[i] = XInternAtom(display, atomNames[i], False);
|
||||
}
|
||||
for (i = 0; i < sizeof(atomNames)/sizeof(char*); i++) {
|
||||
atoms[i] = XInternAtom(display, atomNames[i], False);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -852,15 +889,14 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
|
||||
scrPtr->wmIconDragOffsetAtom = atoms[i++];
|
||||
|
||||
scrPtr->wmStateAtom = atoms[i++];
|
||||
|
||||
scrPtr->rootView = W_CreateRootView(scrPtr);
|
||||
|
||||
scrPtr->rootView = W_CreateRootView(scrPtr);
|
||||
|
||||
scrPtr->balloon = W_CreateBalloon(scrPtr);
|
||||
|
||||
|
||||
W_InitApplication(scrPtr);
|
||||
|
||||
|
||||
return scrPtr;
|
||||
}
|
||||
|
||||
|
||||
@@ -674,7 +674,7 @@ didResizeTextField(W_ViewDelegate *self, WMView *view)
|
||||
tPtr->offsetWidth =
|
||||
WMAX((tPtr->view->size.height - WMFontHeight(tPtr->font))/2, 1);
|
||||
|
||||
tPtr->usableWidth = tPtr->view->size.width - 2*tPtr->offsetWidth + 2;
|
||||
tPtr->usableWidth = tPtr->view->size.width - 2*tPtr->offsetWidth /*+ 2*/;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -319,7 +319,7 @@ updateDockNumbers(WScreen *scr)
|
||||
numbers_gc = XCreateGC(dpy, dicon->icon->core->window,
|
||||
my_v_mask, &my_gc_values);
|
||||
|
||||
ws_numbers = malloc(20);
|
||||
ws_numbers = wmalloc(20);
|
||||
sprintf(ws_numbers, "%i [ %i ]", scr->current_workspace+1,
|
||||
((scr->current_workspace/10)+1));
|
||||
length = strlen(ws_numbers);
|
||||
|
||||
@@ -1249,7 +1249,7 @@ wClipIconPaint(WAppIcon *aicon)
|
||||
wIconPaint(aicon->icon);
|
||||
|
||||
length = strlen(workspace->name);
|
||||
ws_name = malloc(length + 1);
|
||||
ws_name = wmalloc(length + 1);
|
||||
sprintf(ws_name, "%s", workspace->name);
|
||||
sprintf(ws_number, "%i", scr->current_workspace + 1);
|
||||
nlength = strlen(ws_number);
|
||||
|
||||
@@ -38,8 +38,8 @@ char *ProgName;
|
||||
char*
|
||||
defaultsPathForDomain(char *domain)
|
||||
{
|
||||
char path[1024];
|
||||
char *gspath, *tmp;
|
||||
static char path[1024];
|
||||
char *gspath;
|
||||
|
||||
gspath = getenv("GNUSTEP_USER_ROOT");
|
||||
if (gspath) {
|
||||
@@ -60,10 +60,7 @@ defaultsPathForDomain(char *domain)
|
||||
strcat(path, "/");
|
||||
strcat(path, domain);
|
||||
|
||||
tmp = malloc(strlen(path)+2);
|
||||
strcpy(tmp, path);
|
||||
|
||||
return tmp;
|
||||
return path;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -114,24 +114,19 @@ print_help()
|
||||
char*
|
||||
globalDefaultsPathForDomain(char *domain)
|
||||
{
|
||||
char path[1024];
|
||||
char *tmp;
|
||||
static char path[1024];
|
||||
|
||||
sprintf(path, "%s/WindowMaker/%s", SYSCONFDIR, domain);
|
||||
|
||||
tmp = malloc(strlen(path)+2);
|
||||
assert(tmp!=NULL);
|
||||
strcpy(tmp, path);
|
||||
|
||||
return tmp;
|
||||
return path;
|
||||
}
|
||||
|
||||
|
||||
char*
|
||||
defaultsPathForDomain(char *domain)
|
||||
{
|
||||
char path[1024];
|
||||
char *gspath, *tmp;
|
||||
static char path[1024];
|
||||
char *gspath;
|
||||
|
||||
gspath = getenv("GNUSTEP_USER_ROOT");
|
||||
if (gspath) {
|
||||
@@ -152,10 +147,7 @@ defaultsPathForDomain(char *domain)
|
||||
strcat(path, "/");
|
||||
strcat(path, domain);
|
||||
|
||||
tmp = malloc(strlen(path)+2);
|
||||
strcpy(tmp, path);
|
||||
|
||||
return tmp;
|
||||
return path;
|
||||
}
|
||||
|
||||
|
||||
@@ -602,7 +594,6 @@ main(int argc, char **argv)
|
||||
ProgName, path);
|
||||
exit(1);
|
||||
}
|
||||
free(path);
|
||||
|
||||
/* get global value */
|
||||
path = globalDefaultsPathForDomain("WindowMaker");
|
||||
|
||||
@@ -36,8 +36,8 @@ char *ProgName;
|
||||
char*
|
||||
defaultsPathForDomain(char *domain)
|
||||
{
|
||||
char path[1024];
|
||||
char *gspath, *tmp;
|
||||
static char path[1024];
|
||||
char *gspath;
|
||||
|
||||
gspath = getenv("GNUSTEP_USER_ROOT");
|
||||
if (gspath) {
|
||||
@@ -59,10 +59,7 @@ defaultsPathForDomain(char *domain)
|
||||
strcat(path, "/");
|
||||
strcat(path, domain);
|
||||
|
||||
tmp = malloc(strlen(path)+2);
|
||||
strcpy(tmp, path);
|
||||
|
||||
return tmp;
|
||||
return path;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -64,8 +64,8 @@ proplist_t readBlackBoxStyle(char *path);
|
||||
char*
|
||||
defaultsPathForDomain(char *domain)
|
||||
{
|
||||
char path[1024];
|
||||
char *gspath, *tmp;
|
||||
static char path[1024];
|
||||
char *gspath;
|
||||
|
||||
gspath = getenv("GNUSTEP_USER_ROOT");
|
||||
if (gspath) {
|
||||
@@ -87,10 +87,7 @@ defaultsPathForDomain(char *domain)
|
||||
strcat(path, "/");
|
||||
strcat(path, domain);
|
||||
|
||||
tmp = malloc(strlen(path)+2);
|
||||
strcpy(tmp, path);
|
||||
|
||||
return tmp;
|
||||
return path;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1156,9 +1156,8 @@ getFullPixmapPath(char *file)
|
||||
char *path = wmalloc(bsize);
|
||||
|
||||
while (!getcwd(path, bsize)) {
|
||||
wfree(path);
|
||||
bsize += bsize/2;
|
||||
path = malloc(bsize);
|
||||
path = wrealloc(path, bsize);
|
||||
}
|
||||
|
||||
tmp = wstrconcat(path, "/");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* wxcopy.c- copy stdin or file into cutbuffer
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1997-1999 Alfredo K. Kojima
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -82,7 +82,7 @@ main(int argc, char **argv)
|
||||
if (i<argc-1) {
|
||||
i++;
|
||||
if (sscanf(argv[i],"%i", &buffer)!=1) {
|
||||
fprintf(stderr, "%s: could not convert '%s' to int\n",
|
||||
fprintf(stderr, "%s: could not convert '%s' to int\n",
|
||||
argv[0], argv[i]);
|
||||
exit(1);
|
||||
}
|
||||
@@ -136,17 +136,56 @@ main(int argc, char **argv)
|
||||
XDisplayName(display_name));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (buffer<0) {
|
||||
Atom *rootWinProps;
|
||||
int exists[8] = {0, 0, 0, 0, 0, 0, 0, 0};
|
||||
int i, count;
|
||||
|
||||
/* Create missing CUT_BUFFERs */
|
||||
rootWinProps = XListProperties(dpy, DefaultRootWindow(dpy), &count);
|
||||
for (i=0; i<count; i++) {
|
||||
switch(rootWinProps[i]) {
|
||||
case XA_CUT_BUFFER0:
|
||||
exists[0] = 1; break;
|
||||
case XA_CUT_BUFFER1:
|
||||
exists[1] = 1; break;
|
||||
case XA_CUT_BUFFER2:
|
||||
exists[2] = 1; break;
|
||||
case XA_CUT_BUFFER3:
|
||||
exists[3] = 1; break;
|
||||
case XA_CUT_BUFFER4:
|
||||
exists[4] = 1; break;
|
||||
case XA_CUT_BUFFER5:
|
||||
exists[5] = 1; break;
|
||||
case XA_CUT_BUFFER6:
|
||||
exists[6] = 1; break;
|
||||
case XA_CUT_BUFFER7:
|
||||
exists[7] = 1; break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (rootWinProps) {
|
||||
XFree(rootWinProps);
|
||||
}
|
||||
for (i=0; i<8; i++) {
|
||||
if (!exists[i]) {
|
||||
XStoreBuffer(dpy, "", 0, i);
|
||||
}
|
||||
}
|
||||
|
||||
XRotateBuffers(dpy, 1);
|
||||
buffer=0;
|
||||
}
|
||||
|
||||
while (!feof(file)) {
|
||||
char *nbuf;
|
||||
char tmp[LINESIZE+2];
|
||||
int nl=0;
|
||||
|
||||
/*
|
||||
* Use read() instead of fgets() to preserve NULs, since
|
||||
* Use read() instead of fgets() to preserve NULLs, since
|
||||
* especially since there's no reason to read one line at a time.
|
||||
*/
|
||||
if ((nl = fread(tmp, 1, LINESIZE, file)) <= 0) {
|
||||
@@ -154,21 +193,22 @@ main(int argc, char **argv)
|
||||
}
|
||||
if (buf_len == 0) {
|
||||
nbuf = malloc(buf_len = l+nl+1);
|
||||
}
|
||||
else {
|
||||
if (buf_len < l+nl+1) {
|
||||
/*
|
||||
* To avoid terrible performance on big input buffers,
|
||||
* grow by doubling, not by the minimum needed for the
|
||||
* current line.
|
||||
*/
|
||||
buf_len = 2 * buf_len + nl + 1;
|
||||
nbuf = realloc(buf, buf_len);
|
||||
}
|
||||
else {
|
||||
nbuf = buf;
|
||||
}
|
||||
}
|
||||
} else if (buf_len < l+nl+1) {
|
||||
/*
|
||||
* To avoid terrible performance on big input buffers,
|
||||
* grow by doubling, not by the minimum needed for the
|
||||
* current line.
|
||||
*/
|
||||
buf_len = 2 * buf_len + nl + 1;
|
||||
/* some realloc implementations don't do malloc if buf==NULL */
|
||||
if (buf == NULL) {
|
||||
nbuf = malloc(buf_len);
|
||||
} else {
|
||||
nbuf = realloc(buf, buf_len);
|
||||
}
|
||||
} else {
|
||||
nbuf = buf;
|
||||
}
|
||||
if (!nbuf) {
|
||||
fprintf(stderr, "%s: out of memory\n", argv[0]);
|
||||
exit(1);
|
||||
|
||||
Reference in New Issue
Block a user