1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00

- Fixed a bug that crashed wmaker when closing a window if multiple screens

were managed by wmaker (Valery Kotchiev <aggregator@nospam.dk>)
- Fixed a problem that crashed wmaker when trying to read an unexisting
  WMState.<number> file on multihead system.
- Fixed problem with keyboard shortcuts executed an every screen for
  multihead systems.
This commit is contained in:
dan
2001-12-28 03:29:50 +00:00
parent 9031641ba6
commit 9e615bcff9
12 changed files with 173 additions and 140 deletions

View File

@@ -1,3 +1,14 @@
Changes since version 0.80.0:
.............................
- Fixed a bug that crashed wmaker when closing a window if multiple screens
were managed by wmaker (Valery Kotchiev <aggregator@nospam.dk>)
- Fixed a problem that crashed wmaker when trying to read an unexisting
WMState.<number> file on multihead system.
- Fixed problem with keyboard shortcuts executed an every screen for
multihead systems.
Changes since version 0.70.0:
.............................

View File

@@ -38,7 +38,7 @@ static ConnectionDelegate socketDelegate = {
void
wAbort(Bool foo) /*FOLD00*/
wAbort(Bool foo)
{
exit(1);
}
@@ -89,7 +89,7 @@ inputHandler(int fd, int mask, void *clientData)
static void
didReceiveInput(ConnectionDelegate *self, WMConnection *cPtr) /*FOLD00*/
didReceiveInput(ConnectionDelegate *self, WMConnection *cPtr)
{
char *buffer;
@@ -106,7 +106,7 @@ didReceiveInput(ConnectionDelegate *self, WMConnection *cPtr) /*FOLD00*/
static void
connectionDidDie(ConnectionDelegate *self, WMConnection *cPtr) /*FOLD00*/
connectionDidDie(ConnectionDelegate *self, WMConnection *cPtr)
{
WMCloseConnection(cPtr);
@@ -138,7 +138,7 @@ didInitialize(ConnectionDelegate *self, WMConnection *cPtr)
int
main(int argc, char **argv) /*FOLD00*/
main(int argc, char **argv)
{
char *ProgName, *host, *port;
int i;

View File

@@ -52,14 +52,14 @@ static ConnectionDelegate socketDelegate = {
void
wAbort(Bool foo) /*FOLD00*/
wAbort(Bool foo)
{
exit(1);
}
static void
printHelp(char *progname) /*FOLD00*/
printHelp(char *progname)
{
printf(_("usage: %s [options]\n\n"), progname);
puts(_(" --help print this message"));
@@ -226,7 +226,7 @@ getAvailableMessages(WMConnection *cPtr)
static void
complainAboutBadArgs(WMConnection *cPtr, char *cmdName, char *badArgs) /*FOLD00*/
complainAboutBadArgs(WMConnection *cPtr, char *cmdName, char *badArgs)
{
char *buf = wmalloc(strlen(cmdName) + strlen(badArgs) + 100);
@@ -238,7 +238,7 @@ complainAboutBadArgs(WMConnection *cPtr, char *cmdName, char *badArgs) /*FOLD00*
static void
sendUpdateMessage(WMConnection *cPtr, char *id, int time) /*FOLD00*/
sendUpdateMessage(WMConnection *cPtr, char *id, int time)
{
char *buf = wmalloc(strlen(id) + 100);
@@ -256,7 +256,7 @@ showId(WMConnection *cPtr)
static void
showHelp(WMConnection *cPtr) /*FOLD00*/
showHelp(WMConnection *cPtr)
{
char *buf = wmalloc(strlen(WMGetApplicationName()) + 16);
@@ -307,7 +307,7 @@ listUsers(WMConnection *cPtr)
static void
setTimeForUser(WMConnection *cPtr, char *cmdArgs) /*FOLD00*/
setTimeForUser(WMConnection *cPtr, char *cmdArgs)
{
char *id;
int i, time;
@@ -332,7 +332,7 @@ setTimeForUser(WMConnection *cPtr, char *cmdArgs) /*FOLD00*/
static void
addTimeToUser(WMConnection *cPtr, char *cmdArgs) /*FOLD00*/
addTimeToUser(WMConnection *cPtr, char *cmdArgs)
{
char *id;
int i, time, newTime;
@@ -359,7 +359,7 @@ addTimeToUser(WMConnection *cPtr, char *cmdArgs) /*FOLD00*/
static void
subTimeFromUser(WMConnection *cPtr, char *cmdArgs) /*FOLD00*/
subTimeFromUser(WMConnection *cPtr, char *cmdArgs)
{
char *id;
int i, time, newTime;
@@ -386,7 +386,7 @@ subTimeFromUser(WMConnection *cPtr, char *cmdArgs) /*FOLD00*/
static void
removeTimeForUser(WMConnection *cPtr, char *cmdArgs) /*FOLD00*/
removeTimeForUser(WMConnection *cPtr, char *cmdArgs)
{
char *ptr;
int i;
@@ -412,7 +412,7 @@ removeTimeForUser(WMConnection *cPtr, char *cmdArgs) /*FOLD00*/
static void
getTimeForUser(WMConnection *cPtr, char *cmdArgs) /*FOLD00*/
getTimeForUser(WMConnection *cPtr, char *cmdArgs)
{
char *ptr;
int time;
@@ -525,7 +525,7 @@ isAllowedToConnect(WMConnection *cPtr)
static void
didReceiveInput(ConnectionDelegate *self, WMConnection *cPtr) /*FOLD00*/
didReceiveInput(ConnectionDelegate *self, WMConnection *cPtr)
{
if (cPtr == serverPtr) {
WMConnection *newPtr = WMAcceptConnection(cPtr);
@@ -548,7 +548,7 @@ didReceiveInput(ConnectionDelegate *self, WMConnection *cPtr) /*FOLD00*/
static void
connectionDidTimeout(ConnectionDelegate *self, WMConnection *cPtr) /*FOLD00*/
connectionDidTimeout(ConnectionDelegate *self, WMConnection *cPtr)
{
WMHost *hPtr;
@@ -600,7 +600,7 @@ updatedDomain(void *observer, WMNotification *notification)
#if 0
static Bool
isDifferent(char *str1, char *str2) /*FOLD00*/
isDifferent(char *str1, char *str2)
{
if ((!str1 && !str2) || (str1 && str2 && strcmp(str1, str2)==0))
return False;
@@ -611,7 +611,7 @@ isDifferent(char *str1, char *str2) /*FOLD00*/
int
main(int argc, char **argv) /*FOLD00*/
main(int argc, char **argv)
{
int i;

View File

@@ -129,7 +129,7 @@ typedef struct W_Connection {
static void
clearOutputQueue(WMConnection *cPtr) /*FOLD00*/
clearOutputQueue(WMConnection *cPtr)
{
cPtr->bufPos = 0;
WMEmptyArray(cPtr->outputQueue);
@@ -137,7 +137,7 @@ clearOutputQueue(WMConnection *cPtr) /*FOLD00*/
static void
openTimeout(void *cdata) /*FOLD00*/
openTimeout(void *cdata)
{
WMConnection *cPtr = (WMConnection*) cdata;
@@ -160,7 +160,7 @@ openTimeout(void *cdata) /*FOLD00*/
static void
sendTimeout(void *cdata) /*FOLD00*/
sendTimeout(void *cdata)
{
WMConnection *cPtr = (WMConnection*) cdata;
@@ -184,7 +184,7 @@ sendTimeout(void *cdata) /*FOLD00*/
static void
inputHandler(int fd, int mask, void *clientData) /*FOLD00*/
inputHandler(int fd, int mask, void *clientData)
{
WMConnection *cPtr = (WMConnection*)clientData;
@@ -249,7 +249,7 @@ inputHandler(int fd, int mask, void *clientData) /*FOLD00*/
static Bool
setSocketNonBlocking(int sock, Bool flag) /*FOLD00*/
setSocketNonBlocking(int sock, Bool flag)
{
int state;
Bool isNonBlock;
@@ -283,7 +283,7 @@ setSocketNonBlocking(int sock, Bool flag) /*FOLD00*/
static void
setConnectionAddress(WMConnection *cPtr, struct sockaddr_in *socketaddr) /*FOLD00*/
setConnectionAddress(WMConnection *cPtr, struct sockaddr_in *socketaddr)
{
wassertr(cPtr->address==NULL);
@@ -295,7 +295,7 @@ setConnectionAddress(WMConnection *cPtr, struct sockaddr_in *socketaddr) /*FOLD0
static struct sockaddr_in*
getSocketAddress(char* name, char* service, char* protocol) /*FOLD00*/
getSocketAddress(char* name, char* service, char* protocol)
{
static struct sockaddr_in socketaddr;
struct servent *sp;
@@ -359,7 +359,7 @@ dummyHandler(int signum)
static WMConnection*
createConnectionWithSocket(int sock, Bool closeOnRelease) /*FOLD00*/
createConnectionWithSocket(int sock, Bool closeOnRelease)
{
WMConnection *cPtr;
struct sigaction sig_action;
@@ -399,7 +399,7 @@ createConnectionWithSocket(int sock, Bool closeOnRelease) /*FOLD00*/
#if 0
WMConnection*
WMCreateConnectionWithSocket(int sock, Bool closeOnRelease) /*FOLD00*/
WMCreateConnectionWithSocket(int sock, Bool closeOnRelease)
{
WMConnection *cPtr;
struct sockaddr_in clientname;
@@ -448,7 +448,7 @@ WMCreateConnectionWithSocket(int sock, Bool closeOnRelease) /*FOLD00*/
* currently only "tcp" is supported.
*/
WMConnection*
WMCreateConnectionAsServerAtAddress(char *host, char *service, char *protocol) /*FOLD00*/
WMCreateConnectionAsServerAtAddress(char *host, char *service, char *protocol)
{
WMConnection *cPtr;
struct sockaddr_in *socketaddr;
@@ -509,7 +509,7 @@ WMCreateConnectionAsServerAtAddress(char *host, char *service, char *protocol) /
WMConnection*
WMCreateConnectionToAddress(char *host, char *service, char *protocol) /*FOLD00*/
WMCreateConnectionToAddress(char *host, char *service, char *protocol)
{
WMConnection *cPtr;
struct sockaddr_in *socketaddr;
@@ -551,7 +551,7 @@ WMCreateConnectionToAddress(char *host, char *service, char *protocol) /*FOLD00*
WMConnection*
WMCreateConnectionToAddressAndNotify(char *host, char *service, char *protocol) /*FOLD00*/
WMCreateConnectionToAddressAndNotify(char *host, char *service, char *protocol)
{
WMConnection *cPtr;
struct sockaddr_in *socketaddr;
@@ -602,7 +602,7 @@ WMCreateConnectionToAddressAndNotify(char *host, char *service, char *protocol)
static void
removeAllHandlers(WMConnection *cPtr) /*FOLD00*/
removeAllHandlers(WMConnection *cPtr)
{
if (cPtr->handler.read)
WMDeleteInputHandler(cPtr->handler.read);
@@ -624,7 +624,7 @@ removeAllHandlers(WMConnection *cPtr) /*FOLD00*/
void
WMDestroyConnection(WMConnection *cPtr) /*FOLD00*/
WMDestroyConnection(WMConnection *cPtr)
{
if (cPtr->closeOnRelease && cPtr->sock>=0) {
shutdown(cPtr->sock, SHUT_RDWR);
@@ -645,7 +645,7 @@ WMDestroyConnection(WMConnection *cPtr) /*FOLD00*/
void
WMCloseConnection(WMConnection *cPtr) /*FOLD00*/
WMCloseConnection(WMConnection *cPtr)
{
if (cPtr->sock>=0) {
shutdown(cPtr->sock, SHUT_RDWR);
@@ -661,7 +661,7 @@ WMCloseConnection(WMConnection *cPtr) /*FOLD00*/
WMConnection*
WMAcceptConnection(WMConnection *listener) /*FOLD00*/
WMAcceptConnection(WMConnection *listener)
{
struct sockaddr_in clientname;
int size;
@@ -688,49 +688,49 @@ WMAcceptConnection(WMConnection *listener) /*FOLD00*/
char*
WMGetConnectionAddress(WMConnection *cPtr) /*FOLD00*/
WMGetConnectionAddress(WMConnection *cPtr)
{
return cPtr->address;
}
char*
WMGetConnectionService(WMConnection *cPtr) /*FOLD00*/
WMGetConnectionService(WMConnection *cPtr)
{
return cPtr->service;
}
char*
WMGetConnectionProtocol(WMConnection *cPtr) /*FOLD00*/
WMGetConnectionProtocol(WMConnection *cPtr)
{
return cPtr->protocol;
}
int
WMGetConnectionSocket(WMConnection *cPtr) /*FOLD00*/
WMGetConnectionSocket(WMConnection *cPtr)
{
return cPtr->sock;
}
WMConnectionState
WMGetConnectionState(WMConnection *cPtr) /*FOLD00*/
WMGetConnectionState(WMConnection *cPtr)
{
return cPtr->state;
}
WMConnectionTimeoutState
WMGetConnectionTimeoutState(WMConnection *cPtr) /*FOLD00*/
WMGetConnectionTimeoutState(WMConnection *cPtr)
{
return cPtr->timeoutState;
}
Bool
WMEnqueueConnectionData(WMConnection *cPtr, WMData *data) /*FOLD00*/
WMEnqueueConnectionData(WMConnection *cPtr, WMData *data)
{
wassertrv(cPtr->state!=WCNotConnected && cPtr->state!=WCListening, False);
wassertrv(cPtr->state!=WCInProgress && cPtr->state!=WCFailed, False);
@@ -744,7 +744,7 @@ WMEnqueueConnectionData(WMConnection *cPtr, WMData *data) /*FOLD00*/
int
WMSendConnectionData(WMConnection *cPtr, WMData *data) /*FOLD00*/
WMSendConnectionData(WMConnection *cPtr, WMData *data)
{
int bytes, pos, len, totalTransfer;
TimeoutData *tPtr = &cPtr->sendTimeout;
@@ -835,7 +835,7 @@ WMSendConnectionData(WMConnection *cPtr, WMData *data) /*FOLD00*/
* considered to be an error condition, and will return NULL.
*/
WMData*
WMGetConnectionAvailableData(WMConnection *cPtr) /*FOLD00*/
WMGetConnectionAvailableData(WMConnection *cPtr)
{
char buffer[NETBUF_SIZE];
int nbytes;
@@ -880,7 +880,7 @@ again:
void
WMSetConnectionDelegate(WMConnection *cPtr, ConnectionDelegate *delegate) /*FOLD00*/
WMSetConnectionDelegate(WMConnection *cPtr, ConnectionDelegate *delegate)
{
wassertr(cPtr->sock >= 0);
/* Don't try to set the delegate multiple times */
@@ -898,7 +898,7 @@ WMSetConnectionDelegate(WMConnection *cPtr, ConnectionDelegate *delegate) /*FOLD
#if 0
Bool
WMIsConnectionNonBlocking(WMConnection *cPtr) /*FOLD00*/
WMIsConnectionNonBlocking(WMConnection *cPtr)
{
#if 1
int state;
@@ -921,7 +921,7 @@ WMIsConnectionNonBlocking(WMConnection *cPtr) /*FOLD00*/
Bool
WMSetConnectionNonBlocking(WMConnection *cPtr, Bool flag) /*FOLD00*/
WMSetConnectionNonBlocking(WMConnection *cPtr, Bool flag)
{
wassertrv(cPtr!=NULL && cPtr->sock>=0, False);
@@ -951,28 +951,28 @@ WMSetConnectionCloseOnExec(WMConnection *cPtr, Bool flag)
void*
WMGetConnectionClientData(WMConnection *cPtr) /*FOLD00*/
WMGetConnectionClientData(WMConnection *cPtr)
{
return cPtr->clientData;
}
void
WMSetConnectionClientData(WMConnection *cPtr, void *data) /*FOLD00*/
WMSetConnectionClientData(WMConnection *cPtr, void *data)
{
cPtr->clientData = data;
}
unsigned int
WMGetConnectionFlags(WMConnection *cPtr) /*FOLD00*/
WMGetConnectionFlags(WMConnection *cPtr)
{
return cPtr->uflags;
}
void
WMSetConnectionFlags(WMConnection *cPtr, unsigned int flags) /*FOLD00*/
WMSetConnectionFlags(WMConnection *cPtr, unsigned int flags)
{
cPtr->uflags = flags;
}
@@ -986,7 +986,7 @@ WMGetConnectionUnsentData(WMConnection *cPtr)
void
WMSetConnectionDefaultTimeout(unsigned int timeout) /*FOLD00*/
WMSetConnectionDefaultTimeout(unsigned int timeout)
{
if (timeout == 0) {
DefaultTimeout = DEF_TIMEOUT;
@@ -997,7 +997,7 @@ WMSetConnectionDefaultTimeout(unsigned int timeout) /*FOLD00*/
void
WMSetConnectionOpenTimeout(unsigned int timeout) /*FOLD00*/
WMSetConnectionOpenTimeout(unsigned int timeout)
{
if (timeout == 0) {
OpenTimeout = DefaultTimeout;
@@ -1008,7 +1008,7 @@ WMSetConnectionOpenTimeout(unsigned int timeout) /*FOLD00*/
void
WMSetConnectionSendTimeout(WMConnection *cPtr, unsigned int timeout) /*FOLD00*/
WMSetConnectionSendTimeout(WMConnection *cPtr, unsigned int timeout)
{
if (timeout == 0) {
cPtr->sendTimeout.timeout = DefaultTimeout;

View File

@@ -40,7 +40,7 @@ typedef struct W_Data {
/* Creating and destroying data objects */
WMData*
WMCreateDataWithCapacity(unsigned capacity) /*FOLD00*/
WMCreateDataWithCapacity(unsigned capacity)
{
WMData *aData;
@@ -63,7 +63,7 @@ WMCreateDataWithCapacity(unsigned capacity) /*FOLD00*/
WMData*
WMCreateDataWithLength(unsigned length) /*FOLD00*/
WMCreateDataWithLength(unsigned length)
{
WMData *aData;
@@ -78,7 +78,7 @@ WMCreateDataWithLength(unsigned length) /*FOLD00*/
WMData*
WMCreateDataWithBytes(void *bytes, unsigned length) /*FOLD00*/
WMCreateDataWithBytes(void *bytes, unsigned length)
{
WMData *aData;
@@ -91,7 +91,7 @@ WMCreateDataWithBytes(void *bytes, unsigned length) /*FOLD00*/
WMData*
WMCreateDataWithBytesNoCopy(void *bytes, unsigned length, /*FOLD00*/
WMCreateDataWithBytesNoCopy(void *bytes, unsigned length,
WMFreeDataProc *destructor)
{
WMData *aData;
@@ -110,7 +110,7 @@ WMCreateDataWithBytesNoCopy(void *bytes, unsigned length, /*FOLD00*/
WMData*
WMCreateDataWithData(WMData *aData) /*FOLD00*/
WMCreateDataWithData(WMData *aData)
{
WMData *newData;
@@ -126,7 +126,7 @@ WMCreateDataWithData(WMData *aData) /*FOLD00*/
WMData*
WMRetainData(WMData *aData) /*FOLD00*/
WMRetainData(WMData *aData)
{
aData->retainCount++;
return aData;
@@ -134,7 +134,7 @@ WMRetainData(WMData *aData) /*FOLD00*/
void
WMReleaseData(WMData *aData) /*FOLD00*/
WMReleaseData(WMData *aData)
{
aData->retainCount--;
if (aData->retainCount > 0)
@@ -150,7 +150,7 @@ WMReleaseData(WMData *aData) /*FOLD00*/
/* Adjusting capacity */
void
WMSetDataCapacity(WMData *aData, unsigned capacity) /*FOLD00*/
WMSetDataCapacity(WMData *aData, unsigned capacity)
{
if (aData->capacity != capacity) {
aData->bytes = wrealloc(aData->bytes, capacity);
@@ -164,7 +164,7 @@ WMSetDataCapacity(WMData *aData, unsigned capacity) /*FOLD00*/
void
WMSetDataLength(WMData *aData, unsigned length) /*FOLD00*/
WMSetDataLength(WMData *aData, unsigned length)
{
if (length > aData->capacity) {
WMSetDataCapacity(aData, length);
@@ -185,7 +185,7 @@ WMSetDataFormat(WMData *aData, unsigned format)
void
WMIncreaseDataLengthBy(WMData *aData, unsigned extraLength) /*FOLD00*/
WMIncreaseDataLengthBy(WMData *aData, unsigned extraLength)
{
WMSetDataLength(aData, aData->length + extraLength);
}
@@ -194,14 +194,14 @@ WMIncreaseDataLengthBy(WMData *aData, unsigned extraLength) /*FOLD00*/
/* Accessing data */
const void*
WMDataBytes(WMData *aData) /*FOLD00*/
WMDataBytes(WMData *aData)
{
return aData->bytes;
}
void
WMGetDataBytes(WMData *aData, void *buffer) /*FOLD00*/
WMGetDataBytes(WMData *aData, void *buffer)
{
wassertr(aData->length > 0);
@@ -217,7 +217,7 @@ WMGetDataFormat(WMData *aData)
void
WMGetDataBytesWithLength(WMData *aData, void *buffer, unsigned length) /*FOLD00*/
WMGetDataBytesWithLength(WMData *aData, void *buffer, unsigned length)
{
wassertr(aData->length > 0);
wassertr(length <= aData->length);
@@ -227,7 +227,7 @@ WMGetDataBytesWithLength(WMData *aData, void *buffer, unsigned length) /*FOLD00*
void
WMGetDataBytesWithRange(WMData *aData, void *buffer, WMRange aRange) /*FOLD00*/
WMGetDataBytesWithRange(WMData *aData, void *buffer, WMRange aRange)
{
wassertr(aRange.position < aData->length);
wassertr(aRange.count <= aData->length-aRange.position);
@@ -238,7 +238,7 @@ WMGetDataBytesWithRange(WMData *aData, void *buffer, WMRange aRange) /*FOLD00*/
WMData*
WMGetSubdataWithRange(WMData *aData, WMRange aRange) /*FOLD00*/
WMGetSubdataWithRange(WMData *aData, WMRange aRange)
{
void *buffer;
WMData *newData;
@@ -258,7 +258,7 @@ WMGetSubdataWithRange(WMData *aData, WMRange aRange) /*FOLD00*/
/* Testing data */
Bool
WMIsDataEqualToData(WMData *aData, WMData *anotherData) /*FOLD00*/
WMIsDataEqualToData(WMData *aData, WMData *anotherData)
{
if (aData->length != anotherData->length)
return False;
@@ -271,7 +271,7 @@ WMIsDataEqualToData(WMData *aData, WMData *anotherData) /*FOLD00*/
unsigned
WMGetDataLength(WMData *aData) /*FOLD00*/
WMGetDataLength(WMData *aData)
{
return aData->length;
}
@@ -279,7 +279,7 @@ WMGetDataLength(WMData *aData) /*FOLD00*/
/* Adding data */
void
WMAppendDataBytes(WMData *aData, void *bytes, unsigned length) /*FOLD00*/
WMAppendDataBytes(WMData *aData, void *bytes, unsigned length)
{
unsigned oldLength = aData->length;
unsigned newLength = oldLength + length;
@@ -303,7 +303,7 @@ WMAppendDataBytes(WMData *aData, void *bytes, unsigned length) /*FOLD00*/
void
WMAppendData(WMData *aData, WMData *anotherData) /*FOLD00*/
WMAppendData(WMData *aData, WMData *anotherData)
{
if (anotherData->length > 0)
WMAppendDataBytes(aData, anotherData->bytes, anotherData->length);
@@ -314,7 +314,7 @@ WMAppendData(WMData *aData, WMData *anotherData) /*FOLD00*/
/* Modifying data */
void
WMReplaceDataBytesInRange(WMData *aData, WMRange aRange, void *bytes) /*FOLD00*/
WMReplaceDataBytesInRange(WMData *aData, WMRange aRange, void *bytes)
{
wassertr(aRange.position < aData->length);
wassertr(aRange.count <= aData->length-aRange.position);
@@ -324,7 +324,7 @@ WMReplaceDataBytesInRange(WMData *aData, WMRange aRange, void *bytes) /*FOLD00*/
void
WMResetDataBytesInRange(WMData *aData, WMRange aRange) /*FOLD00*/
WMResetDataBytesInRange(WMData *aData, WMRange aRange)
{
wassertr(aRange.position < aData->length);
wassertr(aRange.count <= aData->length-aRange.position);
@@ -334,7 +334,7 @@ WMResetDataBytesInRange(WMData *aData, WMRange aRange) /*FOLD00*/
void
WMSetData(WMData *aData, WMData *anotherData) /*FOLD00*/
WMSetData(WMData *aData, WMData *anotherData)
{
unsigned length = anotherData->length;

View File

@@ -94,38 +94,44 @@ WMUnregisterViewDraggedTypes(WMView *view)
/***********************************************************************/
static unsigned defDraggingEntered(WMView *self, WMDraggingInfo *info)
static unsigned
defDraggingEntered(WMView *self, WMDraggingInfo *info)
{
printf("%x drag entered\n", W_VIEW_DRAWABLE(self));
return WDOperationNone;
}
static unsigned defDraggingUpdated(WMView *self, WMDraggingInfo *info)
static unsigned
defDraggingUpdated(WMView *self, WMDraggingInfo *info)
{
printf("%x drag updat\n", W_VIEW_DRAWABLE(self));
printf("%x drag update\n", W_VIEW_DRAWABLE(self));
return WDOperationNone;
}
static void defDraggingExited(WMView *self, WMDraggingInfo *info)
static void
defDraggingExited(WMView *self, WMDraggingInfo *info)
{
printf("%x drag exit\n", W_VIEW_DRAWABLE(self));
}
static Bool defPrepareForDragOperation(WMView *self, WMDraggingInfo *info)
static Bool
defPrepareForDragOperation(WMView *self, WMDraggingInfo *info)
{
printf("%x drag prep\n", W_VIEW_DRAWABLE(self));
printf("%x drag prepare\n", W_VIEW_DRAWABLE(self));
return False;
}
static Bool defPerformDragOperation(WMView *self, WMDraggingInfo *info)
static Bool
defPerformDragOperation(WMView *self, WMDraggingInfo *info)
{
printf("%x drag perf\n", W_VIEW_DRAWABLE(self));
printf("%x drag perform\n", W_VIEW_DRAWABLE(self));
return False;
}
static void defConcludeDragOperation(WMView *self, WMDraggingInfo *info)
static void
defConcludeDragOperation(WMView *self, WMDraggingInfo *info)
{
printf("%x drag concl\n", W_VIEW_DRAWABLE(self));
printf("%x drag conclude\n", W_VIEW_DRAWABLE(self));
}
@@ -166,11 +172,8 @@ WMSetViewDragDestinationProcs(WMView *view, WMDragDestinationProcs *procs)
WMPoint WMGetDraggingInfoImageLocation(WMDraggingInfo *info)
WMPoint
WMGetDraggingInfoImageLocation(WMDraggingInfo *info)
{
return info->imageLocation;
}
@@ -179,15 +182,16 @@ WMPoint WMGetDraggingInfoImageLocation(WMDraggingInfo *info)
static void
receivedData(WMView *view, Atom selection, Atom target, Time timestamp,
void *cdata, WMData *data)
void *cdata, WMData *data)
{
}
Bool WMRequestDroppedData(WMView *view, WMDraggingInfo *info, char *type,
WMDropDataCallback *callback)
Bool
WMRequestDroppedData(WMView *view, WMDraggingInfo *info, char *type,
WMDropDataCallback *callback)
{
#if 0
WMScreen *scr = W_VIEW_SCREEN(view);

View File

@@ -31,23 +31,27 @@ static Bool _XErrorOccured = False;
static unsigned defDraggingSourceOperation(WMView *self, Bool local)
static unsigned
defDraggingSourceOperation(WMView *self, Bool local)
{
return WDOperationCopy;
}
static void defBeganDragImage(WMView *self, WMPixmap *image, WMPoint point)
static void
defBeganDragImage(WMView *self, WMPixmap *image, WMPoint point)
{
}
static void defEndedDragImage(WMView *self, WMPixmap *image, WMPoint point,
Bool deposited)
static void
defEndedDragImage(WMView *self, WMPixmap *image, WMPoint point, Bool deposited)
{
}
static WMData* defFetchDragData(WMView *self, char *type)
static WMData*
defFetchDragData(WMView *self, char *type)
{
return NULL;
}

View File

@@ -117,26 +117,28 @@ static Bool
writeSelection(Display *dpy, Window requestor, Atom property, Atom type,
WMData *data)
{
int format;
int format, bpi;
format = WMGetDataFormat(data);
if (format == 0)
format = 8;
/*
printf("write to %x: %s\n", requestor, XGetAtomName(dpy, property));
*/
bpi = format/8;
/* printf("write to %x: %s\n", requestor, XGetAtomName(dpy, property)); */
gotError = False;
#ifndef __sgi
if (!XChangeProperty(dpy, requestor, property, type, format,
PropModeReplace, WMDataBytes(data),
WMGetDataLength(data)))
WMGetDataLength(data)/bpi))
return False;
#else
/* in sgi seems this seems to return void */
XChangeProperty(dpy, requestor, property, type, format,
PropModeReplace, WMDataBytes(data), WMGetDataLength(data));
PropModeReplace, WMDataBytes(data),
WMGetDataLength(data)/bpi);
#endif
XFlush(dpy);
@@ -149,9 +151,9 @@ static void
notifySelection(XEvent *event, Atom prop)
{
XEvent ev;
/*
printf("envent to %x\n", event->xselectionrequest.requestor);
*/
/* printf("envent to %x\n", event->xselectionrequest.requestor); */
ev.xselection.type = SelectionNotify;
ev.xselection.serial = 0;
ev.xselection.send_event = True;
@@ -278,22 +280,24 @@ getSelectionData(Display *dpy, Window win, Atom where)
WMData *wdata;
unsigned char *data;
Atom rtype;
unsigned bits;
unsigned bits, bpi;
unsigned long len, bytes;
if (XGetWindowProperty(dpy, win, where, 0, MAX_PROPERTY_SIZE,
False, AnyPropertyType, &rtype, &bits, &len,
&bytes, &data)!=Success) {
return NULL;
}
wdata = WMCreateDataWithBytesNoCopy(data, len, (WMFreeDataProc*)XFree);
bpi = bits/8;
wdata = WMCreateDataWithBytesNoCopy(data, len*bpi, (WMFreeDataProc*)XFree);
if (wdata == NULL) {
return NULL;
}
WMSetDataFormat(wdata, bits);
return wdata;
}

View File

@@ -388,7 +388,7 @@ msgstr "Pou
#: ../Expert.c:79
msgid "Use Windoze style cycling."
msgstr "Pou¾ívat Windousodní styl opakování pøepínání oken."
msgstr "Pou¾ívat Windousoidní styl opakování pøepínání oken."
#: ../Expert.c:80
msgid "Disable confirmation panel for the Kill command."
@@ -1889,11 +1889,11 @@ msgstr "Ru
#: ../WindowHandling.c:253
msgid "Cascade"
msgstr "Kaskádovì"
msgstr "Kaskádové"
#: ../WindowHandling.c:254
msgid "Smart"
msgstr "Chytøé"
msgstr "Chytré"
#: ../WindowHandling.c:260
msgid "Placement Origin"

View File

@@ -556,23 +556,24 @@ handleDestroyNotify(XEvent *event)
wUnmanageWindow(wwin, False, True);
}
while ((index = WMFindInArray(scr->fakeGroupLeaders, matchWindow,
(void*)window)) != WANotFound) {
WFakeGroupLeader *fPtr;
if (scr != NULL) {
while ((index = WMFindInArray(scr->fakeGroupLeaders, matchWindow,
(void*)window)) != WANotFound) {
WFakeGroupLeader *fPtr;
fPtr = WMGetFromArray(scr->fakeGroupLeaders, index);
if (fPtr->retainCount > 0) {
fPtr->retainCount--;
if (fPtr->retainCount==0 && fPtr->leader!=None) {
XDestroyWindow(dpy, fPtr->leader);
fPtr->leader = None;
XFlush(dpy);
fPtr = WMGetFromArray(scr->fakeGroupLeaders, index);
if (fPtr->retainCount > 0) {
fPtr->retainCount--;
if (fPtr->retainCount==0 && fPtr->leader!=None) {
XDestroyWindow(dpy, fPtr->leader);
fPtr->leader = None;
XFlush(dpy);
}
}
fPtr->origLeader = None;
}
fPtr->origLeader = None;
}
app = wApplicationOf(window);
if (app) {
if (window == app->main_window) {
@@ -1364,8 +1365,8 @@ handleKeyPress(XEvent *event)
break;
}
}
if (command < 0) {
#ifdef LITE
{

View File

@@ -419,10 +419,19 @@ wRootMenuPerformShortcut(XEvent *event)
Shortcut *ptr;
int modifiers;
int done = 0;
Window dummy;
int foo;
if (wScreenCount>1 &&
XQueryPointer(dpy, event->xkey.root, &dummy, &dummy, &foo, &foo, &foo,
&foo, &foo)==False) {
/* Pointer is not on this screen. */
return True;
}
/* ignore CapsLock */
modifiers = event->xkey.state & ValidModMask;
for (ptr = shortcutList; ptr!=NULL; ptr = ptr->next) {
if (ptr->keycode==0)
continue;

View File

@@ -1018,9 +1018,9 @@ wScreenRestoreState(WScreen *scr)
make_keys();
if (wScreenCount == 1)
if (wScreenCount == 1) {
path = wdefaultspathfordomain("WMState");
else {
} else {
char buf[16];
snprintf(buf, sizeof(buf), "WMState.%i", scr->screen);
path = wdefaultspathfordomain(buf);
@@ -1028,14 +1028,14 @@ wScreenRestoreState(WScreen *scr)
scr->session_state = WMReadPropListFromFile(path);
wfree(path);
if (!scr->session_state && wScreenCount>1) {
char buf[16];
snprintf(buf, sizeof(buf), "WMState.%i", scr->screen);
path = wdefaultspathfordomain(buf);
/*char buf[16];
snprintf(buf, sizeof(buf), "WMState.%i", scr->screen);*/
path = wdefaultspathfordomain("WMState");
scr->session_state = WMReadPropListFromFile(path);
wfree(path);
}
if (!wPreferences.flags.noclip) {
if (!wPreferences.flags.noclip && scr->session_state) {
state = WMGetFromPLDictionary(scr->session_state, dClip);
scr->clip_icon = wClipRestoreState(scr, state);
}