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:
11
ChangeLog
11
ChangeLog
@@ -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:
|
Changes since version 0.70.0:
|
||||||
.............................
|
.............................
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ static ConnectionDelegate socketDelegate = {
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
wAbort(Bool foo) /*FOLD00*/
|
wAbort(Bool foo)
|
||||||
{
|
{
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@@ -89,7 +89,7 @@ inputHandler(int fd, int mask, void *clientData)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
didReceiveInput(ConnectionDelegate *self, WMConnection *cPtr) /*FOLD00*/
|
didReceiveInput(ConnectionDelegate *self, WMConnection *cPtr)
|
||||||
{
|
{
|
||||||
char *buffer;
|
char *buffer;
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ didReceiveInput(ConnectionDelegate *self, WMConnection *cPtr) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
connectionDidDie(ConnectionDelegate *self, WMConnection *cPtr) /*FOLD00*/
|
connectionDidDie(ConnectionDelegate *self, WMConnection *cPtr)
|
||||||
{
|
{
|
||||||
WMCloseConnection(cPtr);
|
WMCloseConnection(cPtr);
|
||||||
|
|
||||||
@@ -138,7 +138,7 @@ didInitialize(ConnectionDelegate *self, WMConnection *cPtr)
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv) /*FOLD00*/
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
char *ProgName, *host, *port;
|
char *ProgName, *host, *port;
|
||||||
int i;
|
int i;
|
||||||
|
|||||||
@@ -52,14 +52,14 @@ static ConnectionDelegate socketDelegate = {
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
wAbort(Bool foo) /*FOLD00*/
|
wAbort(Bool foo)
|
||||||
{
|
{
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
printHelp(char *progname) /*FOLD00*/
|
printHelp(char *progname)
|
||||||
{
|
{
|
||||||
printf(_("usage: %s [options]\n\n"), progname);
|
printf(_("usage: %s [options]\n\n"), progname);
|
||||||
puts(_(" --help print this message"));
|
puts(_(" --help print this message"));
|
||||||
@@ -226,7 +226,7 @@ getAvailableMessages(WMConnection *cPtr)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
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);
|
char *buf = wmalloc(strlen(cmdName) + strlen(badArgs) + 100);
|
||||||
|
|
||||||
@@ -238,7 +238,7 @@ complainAboutBadArgs(WMConnection *cPtr, char *cmdName, char *badArgs) /*FOLD00*
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
sendUpdateMessage(WMConnection *cPtr, char *id, int time) /*FOLD00*/
|
sendUpdateMessage(WMConnection *cPtr, char *id, int time)
|
||||||
{
|
{
|
||||||
char *buf = wmalloc(strlen(id) + 100);
|
char *buf = wmalloc(strlen(id) + 100);
|
||||||
|
|
||||||
@@ -256,7 +256,7 @@ showId(WMConnection *cPtr)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
showHelp(WMConnection *cPtr) /*FOLD00*/
|
showHelp(WMConnection *cPtr)
|
||||||
{
|
{
|
||||||
char *buf = wmalloc(strlen(WMGetApplicationName()) + 16);
|
char *buf = wmalloc(strlen(WMGetApplicationName()) + 16);
|
||||||
|
|
||||||
@@ -307,7 +307,7 @@ listUsers(WMConnection *cPtr)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
setTimeForUser(WMConnection *cPtr, char *cmdArgs) /*FOLD00*/
|
setTimeForUser(WMConnection *cPtr, char *cmdArgs)
|
||||||
{
|
{
|
||||||
char *id;
|
char *id;
|
||||||
int i, time;
|
int i, time;
|
||||||
@@ -332,7 +332,7 @@ setTimeForUser(WMConnection *cPtr, char *cmdArgs) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
addTimeToUser(WMConnection *cPtr, char *cmdArgs) /*FOLD00*/
|
addTimeToUser(WMConnection *cPtr, char *cmdArgs)
|
||||||
{
|
{
|
||||||
char *id;
|
char *id;
|
||||||
int i, time, newTime;
|
int i, time, newTime;
|
||||||
@@ -359,7 +359,7 @@ addTimeToUser(WMConnection *cPtr, char *cmdArgs) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
subTimeFromUser(WMConnection *cPtr, char *cmdArgs) /*FOLD00*/
|
subTimeFromUser(WMConnection *cPtr, char *cmdArgs)
|
||||||
{
|
{
|
||||||
char *id;
|
char *id;
|
||||||
int i, time, newTime;
|
int i, time, newTime;
|
||||||
@@ -386,7 +386,7 @@ subTimeFromUser(WMConnection *cPtr, char *cmdArgs) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
removeTimeForUser(WMConnection *cPtr, char *cmdArgs) /*FOLD00*/
|
removeTimeForUser(WMConnection *cPtr, char *cmdArgs)
|
||||||
{
|
{
|
||||||
char *ptr;
|
char *ptr;
|
||||||
int i;
|
int i;
|
||||||
@@ -412,7 +412,7 @@ removeTimeForUser(WMConnection *cPtr, char *cmdArgs) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
getTimeForUser(WMConnection *cPtr, char *cmdArgs) /*FOLD00*/
|
getTimeForUser(WMConnection *cPtr, char *cmdArgs)
|
||||||
{
|
{
|
||||||
char *ptr;
|
char *ptr;
|
||||||
int time;
|
int time;
|
||||||
@@ -525,7 +525,7 @@ isAllowedToConnect(WMConnection *cPtr)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
didReceiveInput(ConnectionDelegate *self, WMConnection *cPtr) /*FOLD00*/
|
didReceiveInput(ConnectionDelegate *self, WMConnection *cPtr)
|
||||||
{
|
{
|
||||||
if (cPtr == serverPtr) {
|
if (cPtr == serverPtr) {
|
||||||
WMConnection *newPtr = WMAcceptConnection(cPtr);
|
WMConnection *newPtr = WMAcceptConnection(cPtr);
|
||||||
@@ -548,7 +548,7 @@ didReceiveInput(ConnectionDelegate *self, WMConnection *cPtr) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
connectionDidTimeout(ConnectionDelegate *self, WMConnection *cPtr) /*FOLD00*/
|
connectionDidTimeout(ConnectionDelegate *self, WMConnection *cPtr)
|
||||||
{
|
{
|
||||||
WMHost *hPtr;
|
WMHost *hPtr;
|
||||||
|
|
||||||
@@ -600,7 +600,7 @@ updatedDomain(void *observer, WMNotification *notification)
|
|||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static Bool
|
static Bool
|
||||||
isDifferent(char *str1, char *str2) /*FOLD00*/
|
isDifferent(char *str1, char *str2)
|
||||||
{
|
{
|
||||||
if ((!str1 && !str2) || (str1 && str2 && strcmp(str1, str2)==0))
|
if ((!str1 && !str2) || (str1 && str2 && strcmp(str1, str2)==0))
|
||||||
return False;
|
return False;
|
||||||
@@ -611,7 +611,7 @@ isDifferent(char *str1, char *str2) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv) /*FOLD00*/
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ typedef struct W_Connection {
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clearOutputQueue(WMConnection *cPtr) /*FOLD00*/
|
clearOutputQueue(WMConnection *cPtr)
|
||||||
{
|
{
|
||||||
cPtr->bufPos = 0;
|
cPtr->bufPos = 0;
|
||||||
WMEmptyArray(cPtr->outputQueue);
|
WMEmptyArray(cPtr->outputQueue);
|
||||||
@@ -137,7 +137,7 @@ clearOutputQueue(WMConnection *cPtr) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
openTimeout(void *cdata) /*FOLD00*/
|
openTimeout(void *cdata)
|
||||||
{
|
{
|
||||||
WMConnection *cPtr = (WMConnection*) cdata;
|
WMConnection *cPtr = (WMConnection*) cdata;
|
||||||
|
|
||||||
@@ -160,7 +160,7 @@ openTimeout(void *cdata) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
sendTimeout(void *cdata) /*FOLD00*/
|
sendTimeout(void *cdata)
|
||||||
{
|
{
|
||||||
WMConnection *cPtr = (WMConnection*) cdata;
|
WMConnection *cPtr = (WMConnection*) cdata;
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ sendTimeout(void *cdata) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
inputHandler(int fd, int mask, void *clientData) /*FOLD00*/
|
inputHandler(int fd, int mask, void *clientData)
|
||||||
{
|
{
|
||||||
WMConnection *cPtr = (WMConnection*)clientData;
|
WMConnection *cPtr = (WMConnection*)clientData;
|
||||||
|
|
||||||
@@ -249,7 +249,7 @@ inputHandler(int fd, int mask, void *clientData) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
setSocketNonBlocking(int sock, Bool flag) /*FOLD00*/
|
setSocketNonBlocking(int sock, Bool flag)
|
||||||
{
|
{
|
||||||
int state;
|
int state;
|
||||||
Bool isNonBlock;
|
Bool isNonBlock;
|
||||||
@@ -283,7 +283,7 @@ setSocketNonBlocking(int sock, Bool flag) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
setConnectionAddress(WMConnection *cPtr, struct sockaddr_in *socketaddr) /*FOLD00*/
|
setConnectionAddress(WMConnection *cPtr, struct sockaddr_in *socketaddr)
|
||||||
{
|
{
|
||||||
wassertr(cPtr->address==NULL);
|
wassertr(cPtr->address==NULL);
|
||||||
|
|
||||||
@@ -295,7 +295,7 @@ setConnectionAddress(WMConnection *cPtr, struct sockaddr_in *socketaddr) /*FOLD0
|
|||||||
|
|
||||||
|
|
||||||
static struct sockaddr_in*
|
static struct sockaddr_in*
|
||||||
getSocketAddress(char* name, char* service, char* protocol) /*FOLD00*/
|
getSocketAddress(char* name, char* service, char* protocol)
|
||||||
{
|
{
|
||||||
static struct sockaddr_in socketaddr;
|
static struct sockaddr_in socketaddr;
|
||||||
struct servent *sp;
|
struct servent *sp;
|
||||||
@@ -359,7 +359,7 @@ dummyHandler(int signum)
|
|||||||
|
|
||||||
|
|
||||||
static WMConnection*
|
static WMConnection*
|
||||||
createConnectionWithSocket(int sock, Bool closeOnRelease) /*FOLD00*/
|
createConnectionWithSocket(int sock, Bool closeOnRelease)
|
||||||
{
|
{
|
||||||
WMConnection *cPtr;
|
WMConnection *cPtr;
|
||||||
struct sigaction sig_action;
|
struct sigaction sig_action;
|
||||||
@@ -399,7 +399,7 @@ createConnectionWithSocket(int sock, Bool closeOnRelease) /*FOLD00*/
|
|||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
WMConnection*
|
WMConnection*
|
||||||
WMCreateConnectionWithSocket(int sock, Bool closeOnRelease) /*FOLD00*/
|
WMCreateConnectionWithSocket(int sock, Bool closeOnRelease)
|
||||||
{
|
{
|
||||||
WMConnection *cPtr;
|
WMConnection *cPtr;
|
||||||
struct sockaddr_in clientname;
|
struct sockaddr_in clientname;
|
||||||
@@ -448,7 +448,7 @@ WMCreateConnectionWithSocket(int sock, Bool closeOnRelease) /*FOLD00*/
|
|||||||
* currently only "tcp" is supported.
|
* currently only "tcp" is supported.
|
||||||
*/
|
*/
|
||||||
WMConnection*
|
WMConnection*
|
||||||
WMCreateConnectionAsServerAtAddress(char *host, char *service, char *protocol) /*FOLD00*/
|
WMCreateConnectionAsServerAtAddress(char *host, char *service, char *protocol)
|
||||||
{
|
{
|
||||||
WMConnection *cPtr;
|
WMConnection *cPtr;
|
||||||
struct sockaddr_in *socketaddr;
|
struct sockaddr_in *socketaddr;
|
||||||
@@ -509,7 +509,7 @@ WMCreateConnectionAsServerAtAddress(char *host, char *service, char *protocol) /
|
|||||||
|
|
||||||
|
|
||||||
WMConnection*
|
WMConnection*
|
||||||
WMCreateConnectionToAddress(char *host, char *service, char *protocol) /*FOLD00*/
|
WMCreateConnectionToAddress(char *host, char *service, char *protocol)
|
||||||
{
|
{
|
||||||
WMConnection *cPtr;
|
WMConnection *cPtr;
|
||||||
struct sockaddr_in *socketaddr;
|
struct sockaddr_in *socketaddr;
|
||||||
@@ -551,7 +551,7 @@ WMCreateConnectionToAddress(char *host, char *service, char *protocol) /*FOLD00*
|
|||||||
|
|
||||||
|
|
||||||
WMConnection*
|
WMConnection*
|
||||||
WMCreateConnectionToAddressAndNotify(char *host, char *service, char *protocol) /*FOLD00*/
|
WMCreateConnectionToAddressAndNotify(char *host, char *service, char *protocol)
|
||||||
{
|
{
|
||||||
WMConnection *cPtr;
|
WMConnection *cPtr;
|
||||||
struct sockaddr_in *socketaddr;
|
struct sockaddr_in *socketaddr;
|
||||||
@@ -602,7 +602,7 @@ WMCreateConnectionToAddressAndNotify(char *host, char *service, char *protocol)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
removeAllHandlers(WMConnection *cPtr) /*FOLD00*/
|
removeAllHandlers(WMConnection *cPtr)
|
||||||
{
|
{
|
||||||
if (cPtr->handler.read)
|
if (cPtr->handler.read)
|
||||||
WMDeleteInputHandler(cPtr->handler.read);
|
WMDeleteInputHandler(cPtr->handler.read);
|
||||||
@@ -624,7 +624,7 @@ removeAllHandlers(WMConnection *cPtr) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WMDestroyConnection(WMConnection *cPtr) /*FOLD00*/
|
WMDestroyConnection(WMConnection *cPtr)
|
||||||
{
|
{
|
||||||
if (cPtr->closeOnRelease && cPtr->sock>=0) {
|
if (cPtr->closeOnRelease && cPtr->sock>=0) {
|
||||||
shutdown(cPtr->sock, SHUT_RDWR);
|
shutdown(cPtr->sock, SHUT_RDWR);
|
||||||
@@ -645,7 +645,7 @@ WMDestroyConnection(WMConnection *cPtr) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WMCloseConnection(WMConnection *cPtr) /*FOLD00*/
|
WMCloseConnection(WMConnection *cPtr)
|
||||||
{
|
{
|
||||||
if (cPtr->sock>=0) {
|
if (cPtr->sock>=0) {
|
||||||
shutdown(cPtr->sock, SHUT_RDWR);
|
shutdown(cPtr->sock, SHUT_RDWR);
|
||||||
@@ -661,7 +661,7 @@ WMCloseConnection(WMConnection *cPtr) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
WMConnection*
|
WMConnection*
|
||||||
WMAcceptConnection(WMConnection *listener) /*FOLD00*/
|
WMAcceptConnection(WMConnection *listener)
|
||||||
{
|
{
|
||||||
struct sockaddr_in clientname;
|
struct sockaddr_in clientname;
|
||||||
int size;
|
int size;
|
||||||
@@ -688,49 +688,49 @@ WMAcceptConnection(WMConnection *listener) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
char*
|
char*
|
||||||
WMGetConnectionAddress(WMConnection *cPtr) /*FOLD00*/
|
WMGetConnectionAddress(WMConnection *cPtr)
|
||||||
{
|
{
|
||||||
return cPtr->address;
|
return cPtr->address;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char*
|
char*
|
||||||
WMGetConnectionService(WMConnection *cPtr) /*FOLD00*/
|
WMGetConnectionService(WMConnection *cPtr)
|
||||||
{
|
{
|
||||||
return cPtr->service;
|
return cPtr->service;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char*
|
char*
|
||||||
WMGetConnectionProtocol(WMConnection *cPtr) /*FOLD00*/
|
WMGetConnectionProtocol(WMConnection *cPtr)
|
||||||
{
|
{
|
||||||
return cPtr->protocol;
|
return cPtr->protocol;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
WMGetConnectionSocket(WMConnection *cPtr) /*FOLD00*/
|
WMGetConnectionSocket(WMConnection *cPtr)
|
||||||
{
|
{
|
||||||
return cPtr->sock;
|
return cPtr->sock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WMConnectionState
|
WMConnectionState
|
||||||
WMGetConnectionState(WMConnection *cPtr) /*FOLD00*/
|
WMGetConnectionState(WMConnection *cPtr)
|
||||||
{
|
{
|
||||||
return cPtr->state;
|
return cPtr->state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WMConnectionTimeoutState
|
WMConnectionTimeoutState
|
||||||
WMGetConnectionTimeoutState(WMConnection *cPtr) /*FOLD00*/
|
WMGetConnectionTimeoutState(WMConnection *cPtr)
|
||||||
{
|
{
|
||||||
return cPtr->timeoutState;
|
return cPtr->timeoutState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
WMEnqueueConnectionData(WMConnection *cPtr, WMData *data) /*FOLD00*/
|
WMEnqueueConnectionData(WMConnection *cPtr, WMData *data)
|
||||||
{
|
{
|
||||||
wassertrv(cPtr->state!=WCNotConnected && cPtr->state!=WCListening, False);
|
wassertrv(cPtr->state!=WCNotConnected && cPtr->state!=WCListening, False);
|
||||||
wassertrv(cPtr->state!=WCInProgress && cPtr->state!=WCFailed, False);
|
wassertrv(cPtr->state!=WCInProgress && cPtr->state!=WCFailed, False);
|
||||||
@@ -744,7 +744,7 @@ WMEnqueueConnectionData(WMConnection *cPtr, WMData *data) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
WMSendConnectionData(WMConnection *cPtr, WMData *data) /*FOLD00*/
|
WMSendConnectionData(WMConnection *cPtr, WMData *data)
|
||||||
{
|
{
|
||||||
int bytes, pos, len, totalTransfer;
|
int bytes, pos, len, totalTransfer;
|
||||||
TimeoutData *tPtr = &cPtr->sendTimeout;
|
TimeoutData *tPtr = &cPtr->sendTimeout;
|
||||||
@@ -835,7 +835,7 @@ WMSendConnectionData(WMConnection *cPtr, WMData *data) /*FOLD00*/
|
|||||||
* considered to be an error condition, and will return NULL.
|
* considered to be an error condition, and will return NULL.
|
||||||
*/
|
*/
|
||||||
WMData*
|
WMData*
|
||||||
WMGetConnectionAvailableData(WMConnection *cPtr) /*FOLD00*/
|
WMGetConnectionAvailableData(WMConnection *cPtr)
|
||||||
{
|
{
|
||||||
char buffer[NETBUF_SIZE];
|
char buffer[NETBUF_SIZE];
|
||||||
int nbytes;
|
int nbytes;
|
||||||
@@ -880,7 +880,7 @@ again:
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WMSetConnectionDelegate(WMConnection *cPtr, ConnectionDelegate *delegate) /*FOLD00*/
|
WMSetConnectionDelegate(WMConnection *cPtr, ConnectionDelegate *delegate)
|
||||||
{
|
{
|
||||||
wassertr(cPtr->sock >= 0);
|
wassertr(cPtr->sock >= 0);
|
||||||
/* Don't try to set the delegate multiple times */
|
/* Don't try to set the delegate multiple times */
|
||||||
@@ -898,7 +898,7 @@ WMSetConnectionDelegate(WMConnection *cPtr, ConnectionDelegate *delegate) /*FOLD
|
|||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
Bool
|
Bool
|
||||||
WMIsConnectionNonBlocking(WMConnection *cPtr) /*FOLD00*/
|
WMIsConnectionNonBlocking(WMConnection *cPtr)
|
||||||
{
|
{
|
||||||
#if 1
|
#if 1
|
||||||
int state;
|
int state;
|
||||||
@@ -921,7 +921,7 @@ WMIsConnectionNonBlocking(WMConnection *cPtr) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
WMSetConnectionNonBlocking(WMConnection *cPtr, Bool flag) /*FOLD00*/
|
WMSetConnectionNonBlocking(WMConnection *cPtr, Bool flag)
|
||||||
{
|
{
|
||||||
wassertrv(cPtr!=NULL && cPtr->sock>=0, False);
|
wassertrv(cPtr!=NULL && cPtr->sock>=0, False);
|
||||||
|
|
||||||
@@ -951,28 +951,28 @@ WMSetConnectionCloseOnExec(WMConnection *cPtr, Bool flag)
|
|||||||
|
|
||||||
|
|
||||||
void*
|
void*
|
||||||
WMGetConnectionClientData(WMConnection *cPtr) /*FOLD00*/
|
WMGetConnectionClientData(WMConnection *cPtr)
|
||||||
{
|
{
|
||||||
return cPtr->clientData;
|
return cPtr->clientData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WMSetConnectionClientData(WMConnection *cPtr, void *data) /*FOLD00*/
|
WMSetConnectionClientData(WMConnection *cPtr, void *data)
|
||||||
{
|
{
|
||||||
cPtr->clientData = data;
|
cPtr->clientData = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
unsigned int
|
unsigned int
|
||||||
WMGetConnectionFlags(WMConnection *cPtr) /*FOLD00*/
|
WMGetConnectionFlags(WMConnection *cPtr)
|
||||||
{
|
{
|
||||||
return cPtr->uflags;
|
return cPtr->uflags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WMSetConnectionFlags(WMConnection *cPtr, unsigned int flags) /*FOLD00*/
|
WMSetConnectionFlags(WMConnection *cPtr, unsigned int flags)
|
||||||
{
|
{
|
||||||
cPtr->uflags = flags;
|
cPtr->uflags = flags;
|
||||||
}
|
}
|
||||||
@@ -986,7 +986,7 @@ WMGetConnectionUnsentData(WMConnection *cPtr)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WMSetConnectionDefaultTimeout(unsigned int timeout) /*FOLD00*/
|
WMSetConnectionDefaultTimeout(unsigned int timeout)
|
||||||
{
|
{
|
||||||
if (timeout == 0) {
|
if (timeout == 0) {
|
||||||
DefaultTimeout = DEF_TIMEOUT;
|
DefaultTimeout = DEF_TIMEOUT;
|
||||||
@@ -997,7 +997,7 @@ WMSetConnectionDefaultTimeout(unsigned int timeout) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WMSetConnectionOpenTimeout(unsigned int timeout) /*FOLD00*/
|
WMSetConnectionOpenTimeout(unsigned int timeout)
|
||||||
{
|
{
|
||||||
if (timeout == 0) {
|
if (timeout == 0) {
|
||||||
OpenTimeout = DefaultTimeout;
|
OpenTimeout = DefaultTimeout;
|
||||||
@@ -1008,7 +1008,7 @@ WMSetConnectionOpenTimeout(unsigned int timeout) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WMSetConnectionSendTimeout(WMConnection *cPtr, unsigned int timeout) /*FOLD00*/
|
WMSetConnectionSendTimeout(WMConnection *cPtr, unsigned int timeout)
|
||||||
{
|
{
|
||||||
if (timeout == 0) {
|
if (timeout == 0) {
|
||||||
cPtr->sendTimeout.timeout = DefaultTimeout;
|
cPtr->sendTimeout.timeout = DefaultTimeout;
|
||||||
|
|||||||
44
WINGs/data.c
44
WINGs/data.c
@@ -40,7 +40,7 @@ typedef struct W_Data {
|
|||||||
/* Creating and destroying data objects */
|
/* Creating and destroying data objects */
|
||||||
|
|
||||||
WMData*
|
WMData*
|
||||||
WMCreateDataWithCapacity(unsigned capacity) /*FOLD00*/
|
WMCreateDataWithCapacity(unsigned capacity)
|
||||||
{
|
{
|
||||||
WMData *aData;
|
WMData *aData;
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ WMCreateDataWithCapacity(unsigned capacity) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
WMData*
|
WMData*
|
||||||
WMCreateDataWithLength(unsigned length) /*FOLD00*/
|
WMCreateDataWithLength(unsigned length)
|
||||||
{
|
{
|
||||||
WMData *aData;
|
WMData *aData;
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ WMCreateDataWithLength(unsigned length) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
WMData*
|
WMData*
|
||||||
WMCreateDataWithBytes(void *bytes, unsigned length) /*FOLD00*/
|
WMCreateDataWithBytes(void *bytes, unsigned length)
|
||||||
{
|
{
|
||||||
WMData *aData;
|
WMData *aData;
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ WMCreateDataWithBytes(void *bytes, unsigned length) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
WMData*
|
WMData*
|
||||||
WMCreateDataWithBytesNoCopy(void *bytes, unsigned length, /*FOLD00*/
|
WMCreateDataWithBytesNoCopy(void *bytes, unsigned length,
|
||||||
WMFreeDataProc *destructor)
|
WMFreeDataProc *destructor)
|
||||||
{
|
{
|
||||||
WMData *aData;
|
WMData *aData;
|
||||||
@@ -110,7 +110,7 @@ WMCreateDataWithBytesNoCopy(void *bytes, unsigned length, /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
WMData*
|
WMData*
|
||||||
WMCreateDataWithData(WMData *aData) /*FOLD00*/
|
WMCreateDataWithData(WMData *aData)
|
||||||
{
|
{
|
||||||
WMData *newData;
|
WMData *newData;
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ WMCreateDataWithData(WMData *aData) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
WMData*
|
WMData*
|
||||||
WMRetainData(WMData *aData) /*FOLD00*/
|
WMRetainData(WMData *aData)
|
||||||
{
|
{
|
||||||
aData->retainCount++;
|
aData->retainCount++;
|
||||||
return aData;
|
return aData;
|
||||||
@@ -134,7 +134,7 @@ WMRetainData(WMData *aData) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WMReleaseData(WMData *aData) /*FOLD00*/
|
WMReleaseData(WMData *aData)
|
||||||
{
|
{
|
||||||
aData->retainCount--;
|
aData->retainCount--;
|
||||||
if (aData->retainCount > 0)
|
if (aData->retainCount > 0)
|
||||||
@@ -150,7 +150,7 @@ WMReleaseData(WMData *aData) /*FOLD00*/
|
|||||||
/* Adjusting capacity */
|
/* Adjusting capacity */
|
||||||
|
|
||||||
void
|
void
|
||||||
WMSetDataCapacity(WMData *aData, unsigned capacity) /*FOLD00*/
|
WMSetDataCapacity(WMData *aData, unsigned capacity)
|
||||||
{
|
{
|
||||||
if (aData->capacity != capacity) {
|
if (aData->capacity != capacity) {
|
||||||
aData->bytes = wrealloc(aData->bytes, capacity);
|
aData->bytes = wrealloc(aData->bytes, capacity);
|
||||||
@@ -164,7 +164,7 @@ WMSetDataCapacity(WMData *aData, unsigned capacity) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WMSetDataLength(WMData *aData, unsigned length) /*FOLD00*/
|
WMSetDataLength(WMData *aData, unsigned length)
|
||||||
{
|
{
|
||||||
if (length > aData->capacity) {
|
if (length > aData->capacity) {
|
||||||
WMSetDataCapacity(aData, length);
|
WMSetDataCapacity(aData, length);
|
||||||
@@ -185,7 +185,7 @@ WMSetDataFormat(WMData *aData, unsigned format)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WMIncreaseDataLengthBy(WMData *aData, unsigned extraLength) /*FOLD00*/
|
WMIncreaseDataLengthBy(WMData *aData, unsigned extraLength)
|
||||||
{
|
{
|
||||||
WMSetDataLength(aData, aData->length + extraLength);
|
WMSetDataLength(aData, aData->length + extraLength);
|
||||||
}
|
}
|
||||||
@@ -194,14 +194,14 @@ WMIncreaseDataLengthBy(WMData *aData, unsigned extraLength) /*FOLD00*/
|
|||||||
/* Accessing data */
|
/* Accessing data */
|
||||||
|
|
||||||
const void*
|
const void*
|
||||||
WMDataBytes(WMData *aData) /*FOLD00*/
|
WMDataBytes(WMData *aData)
|
||||||
{
|
{
|
||||||
return aData->bytes;
|
return aData->bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WMGetDataBytes(WMData *aData, void *buffer) /*FOLD00*/
|
WMGetDataBytes(WMData *aData, void *buffer)
|
||||||
{
|
{
|
||||||
wassertr(aData->length > 0);
|
wassertr(aData->length > 0);
|
||||||
|
|
||||||
@@ -217,7 +217,7 @@ WMGetDataFormat(WMData *aData)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WMGetDataBytesWithLength(WMData *aData, void *buffer, unsigned length) /*FOLD00*/
|
WMGetDataBytesWithLength(WMData *aData, void *buffer, unsigned length)
|
||||||
{
|
{
|
||||||
wassertr(aData->length > 0);
|
wassertr(aData->length > 0);
|
||||||
wassertr(length <= aData->length);
|
wassertr(length <= aData->length);
|
||||||
@@ -227,7 +227,7 @@ WMGetDataBytesWithLength(WMData *aData, void *buffer, unsigned length) /*FOLD00*
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WMGetDataBytesWithRange(WMData *aData, void *buffer, WMRange aRange) /*FOLD00*/
|
WMGetDataBytesWithRange(WMData *aData, void *buffer, WMRange aRange)
|
||||||
{
|
{
|
||||||
wassertr(aRange.position < aData->length);
|
wassertr(aRange.position < aData->length);
|
||||||
wassertr(aRange.count <= aData->length-aRange.position);
|
wassertr(aRange.count <= aData->length-aRange.position);
|
||||||
@@ -238,7 +238,7 @@ WMGetDataBytesWithRange(WMData *aData, void *buffer, WMRange aRange) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
WMData*
|
WMData*
|
||||||
WMGetSubdataWithRange(WMData *aData, WMRange aRange) /*FOLD00*/
|
WMGetSubdataWithRange(WMData *aData, WMRange aRange)
|
||||||
{
|
{
|
||||||
void *buffer;
|
void *buffer;
|
||||||
WMData *newData;
|
WMData *newData;
|
||||||
@@ -258,7 +258,7 @@ WMGetSubdataWithRange(WMData *aData, WMRange aRange) /*FOLD00*/
|
|||||||
/* Testing data */
|
/* Testing data */
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
WMIsDataEqualToData(WMData *aData, WMData *anotherData) /*FOLD00*/
|
WMIsDataEqualToData(WMData *aData, WMData *anotherData)
|
||||||
{
|
{
|
||||||
if (aData->length != anotherData->length)
|
if (aData->length != anotherData->length)
|
||||||
return False;
|
return False;
|
||||||
@@ -271,7 +271,7 @@ WMIsDataEqualToData(WMData *aData, WMData *anotherData) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
unsigned
|
unsigned
|
||||||
WMGetDataLength(WMData *aData) /*FOLD00*/
|
WMGetDataLength(WMData *aData)
|
||||||
{
|
{
|
||||||
return aData->length;
|
return aData->length;
|
||||||
}
|
}
|
||||||
@@ -279,7 +279,7 @@ WMGetDataLength(WMData *aData) /*FOLD00*/
|
|||||||
|
|
||||||
/* Adding data */
|
/* Adding data */
|
||||||
void
|
void
|
||||||
WMAppendDataBytes(WMData *aData, void *bytes, unsigned length) /*FOLD00*/
|
WMAppendDataBytes(WMData *aData, void *bytes, unsigned length)
|
||||||
{
|
{
|
||||||
unsigned oldLength = aData->length;
|
unsigned oldLength = aData->length;
|
||||||
unsigned newLength = oldLength + length;
|
unsigned newLength = oldLength + length;
|
||||||
@@ -303,7 +303,7 @@ WMAppendDataBytes(WMData *aData, void *bytes, unsigned length) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WMAppendData(WMData *aData, WMData *anotherData) /*FOLD00*/
|
WMAppendData(WMData *aData, WMData *anotherData)
|
||||||
{
|
{
|
||||||
if (anotherData->length > 0)
|
if (anotherData->length > 0)
|
||||||
WMAppendDataBytes(aData, anotherData->bytes, anotherData->length);
|
WMAppendDataBytes(aData, anotherData->bytes, anotherData->length);
|
||||||
@@ -314,7 +314,7 @@ WMAppendData(WMData *aData, WMData *anotherData) /*FOLD00*/
|
|||||||
/* Modifying data */
|
/* Modifying data */
|
||||||
|
|
||||||
void
|
void
|
||||||
WMReplaceDataBytesInRange(WMData *aData, WMRange aRange, void *bytes) /*FOLD00*/
|
WMReplaceDataBytesInRange(WMData *aData, WMRange aRange, void *bytes)
|
||||||
{
|
{
|
||||||
wassertr(aRange.position < aData->length);
|
wassertr(aRange.position < aData->length);
|
||||||
wassertr(aRange.count <= aData->length-aRange.position);
|
wassertr(aRange.count <= aData->length-aRange.position);
|
||||||
@@ -324,7 +324,7 @@ WMReplaceDataBytesInRange(WMData *aData, WMRange aRange, void *bytes) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WMResetDataBytesInRange(WMData *aData, WMRange aRange) /*FOLD00*/
|
WMResetDataBytesInRange(WMData *aData, WMRange aRange)
|
||||||
{
|
{
|
||||||
wassertr(aRange.position < aData->length);
|
wassertr(aRange.position < aData->length);
|
||||||
wassertr(aRange.count <= aData->length-aRange.position);
|
wassertr(aRange.count <= aData->length-aRange.position);
|
||||||
@@ -334,7 +334,7 @@ WMResetDataBytesInRange(WMData *aData, WMRange aRange) /*FOLD00*/
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WMSetData(WMData *aData, WMData *anotherData) /*FOLD00*/
|
WMSetData(WMData *aData, WMData *anotherData)
|
||||||
{
|
{
|
||||||
unsigned length = anotherData->length;
|
unsigned length = anotherData->length;
|
||||||
|
|
||||||
|
|||||||
@@ -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));
|
printf("%x drag entered\n", W_VIEW_DRAWABLE(self));
|
||||||
return WDOperationNone;
|
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;
|
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));
|
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;
|
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;
|
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;
|
return info->imageLocation;
|
||||||
}
|
}
|
||||||
@@ -179,15 +182,16 @@ WMPoint WMGetDraggingInfoImageLocation(WMDraggingInfo *info)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
receivedData(WMView *view, Atom selection, Atom target, Time timestamp,
|
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,
|
Bool
|
||||||
WMDropDataCallback *callback)
|
WMRequestDroppedData(WMView *view, WMDraggingInfo *info, char *type,
|
||||||
|
WMDropDataCallback *callback)
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
WMScreen *scr = W_VIEW_SCREEN(view);
|
WMScreen *scr = W_VIEW_SCREEN(view);
|
||||||
|
|||||||
@@ -31,23 +31,27 @@ static Bool _XErrorOccured = False;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static unsigned defDraggingSourceOperation(WMView *self, Bool local)
|
static unsigned
|
||||||
|
defDraggingSourceOperation(WMView *self, Bool local)
|
||||||
{
|
{
|
||||||
return WDOperationCopy;
|
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,
|
static void
|
||||||
Bool deposited)
|
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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,26 +117,28 @@ static Bool
|
|||||||
writeSelection(Display *dpy, Window requestor, Atom property, Atom type,
|
writeSelection(Display *dpy, Window requestor, Atom property, Atom type,
|
||||||
WMData *data)
|
WMData *data)
|
||||||
{
|
{
|
||||||
int format;
|
int format, bpi;
|
||||||
|
|
||||||
format = WMGetDataFormat(data);
|
format = WMGetDataFormat(data);
|
||||||
if (format == 0)
|
if (format == 0)
|
||||||
format = 8;
|
format = 8;
|
||||||
|
|
||||||
/*
|
bpi = format/8;
|
||||||
printf("write to %x: %s\n", requestor, XGetAtomName(dpy, property));
|
|
||||||
*/
|
/* printf("write to %x: %s\n", requestor, XGetAtomName(dpy, property)); */
|
||||||
|
|
||||||
gotError = False;
|
gotError = False;
|
||||||
|
|
||||||
#ifndef __sgi
|
#ifndef __sgi
|
||||||
if (!XChangeProperty(dpy, requestor, property, type, format,
|
if (!XChangeProperty(dpy, requestor, property, type, format,
|
||||||
PropModeReplace, WMDataBytes(data),
|
PropModeReplace, WMDataBytes(data),
|
||||||
WMGetDataLength(data)))
|
WMGetDataLength(data)/bpi))
|
||||||
return False;
|
return False;
|
||||||
#else
|
#else
|
||||||
/* in sgi seems this seems to return void */
|
/* in sgi seems this seems to return void */
|
||||||
XChangeProperty(dpy, requestor, property, type, format,
|
XChangeProperty(dpy, requestor, property, type, format,
|
||||||
PropModeReplace, WMDataBytes(data), WMGetDataLength(data));
|
PropModeReplace, WMDataBytes(data),
|
||||||
|
WMGetDataLength(data)/bpi);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
XFlush(dpy);
|
XFlush(dpy);
|
||||||
@@ -149,9 +151,9 @@ static void
|
|||||||
notifySelection(XEvent *event, Atom prop)
|
notifySelection(XEvent *event, Atom prop)
|
||||||
{
|
{
|
||||||
XEvent ev;
|
XEvent ev;
|
||||||
/*
|
|
||||||
printf("envent to %x\n", event->xselectionrequest.requestor);
|
/* printf("envent to %x\n", event->xselectionrequest.requestor); */
|
||||||
*/
|
|
||||||
ev.xselection.type = SelectionNotify;
|
ev.xselection.type = SelectionNotify;
|
||||||
ev.xselection.serial = 0;
|
ev.xselection.serial = 0;
|
||||||
ev.xselection.send_event = True;
|
ev.xselection.send_event = True;
|
||||||
@@ -278,22 +280,24 @@ getSelectionData(Display *dpy, Window win, Atom where)
|
|||||||
WMData *wdata;
|
WMData *wdata;
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
Atom rtype;
|
Atom rtype;
|
||||||
unsigned bits;
|
unsigned bits, bpi;
|
||||||
unsigned long len, bytes;
|
unsigned long len, bytes;
|
||||||
|
|
||||||
|
|
||||||
if (XGetWindowProperty(dpy, win, where, 0, MAX_PROPERTY_SIZE,
|
if (XGetWindowProperty(dpy, win, where, 0, MAX_PROPERTY_SIZE,
|
||||||
False, AnyPropertyType, &rtype, &bits, &len,
|
False, AnyPropertyType, &rtype, &bits, &len,
|
||||||
&bytes, &data)!=Success) {
|
&bytes, &data)!=Success) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wdata = WMCreateDataWithBytesNoCopy(data, len, (WMFreeDataProc*)XFree);
|
bpi = bits/8;
|
||||||
|
|
||||||
|
wdata = WMCreateDataWithBytesNoCopy(data, len*bpi, (WMFreeDataProc*)XFree);
|
||||||
if (wdata == NULL) {
|
if (wdata == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
WMSetDataFormat(wdata, bits);
|
WMSetDataFormat(wdata, bits);
|
||||||
|
|
||||||
return wdata;
|
return wdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -388,7 +388,7 @@ msgstr "Pou
|
|||||||
|
|
||||||
#: ../Expert.c:79
|
#: ../Expert.c:79
|
||||||
msgid "Use Windoze style cycling."
|
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
|
#: ../Expert.c:80
|
||||||
msgid "Disable confirmation panel for the Kill command."
|
msgid "Disable confirmation panel for the Kill command."
|
||||||
@@ -1889,11 +1889,11 @@ msgstr "Ru
|
|||||||
|
|
||||||
#: ../WindowHandling.c:253
|
#: ../WindowHandling.c:253
|
||||||
msgid "Cascade"
|
msgid "Cascade"
|
||||||
msgstr "Kaskádovì"
|
msgstr "Kaskádové"
|
||||||
|
|
||||||
#: ../WindowHandling.c:254
|
#: ../WindowHandling.c:254
|
||||||
msgid "Smart"
|
msgid "Smart"
|
||||||
msgstr "Chytøé"
|
msgstr "Chytré"
|
||||||
|
|
||||||
#: ../WindowHandling.c:260
|
#: ../WindowHandling.c:260
|
||||||
msgid "Placement Origin"
|
msgid "Placement Origin"
|
||||||
|
|||||||
29
src/event.c
29
src/event.c
@@ -556,23 +556,24 @@ handleDestroyNotify(XEvent *event)
|
|||||||
wUnmanageWindow(wwin, False, True);
|
wUnmanageWindow(wwin, False, True);
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((index = WMFindInArray(scr->fakeGroupLeaders, matchWindow,
|
if (scr != NULL) {
|
||||||
(void*)window)) != WANotFound) {
|
while ((index = WMFindInArray(scr->fakeGroupLeaders, matchWindow,
|
||||||
WFakeGroupLeader *fPtr;
|
(void*)window)) != WANotFound) {
|
||||||
|
WFakeGroupLeader *fPtr;
|
||||||
|
|
||||||
fPtr = WMGetFromArray(scr->fakeGroupLeaders, index);
|
fPtr = WMGetFromArray(scr->fakeGroupLeaders, index);
|
||||||
if (fPtr->retainCount > 0) {
|
if (fPtr->retainCount > 0) {
|
||||||
fPtr->retainCount--;
|
fPtr->retainCount--;
|
||||||
if (fPtr->retainCount==0 && fPtr->leader!=None) {
|
if (fPtr->retainCount==0 && fPtr->leader!=None) {
|
||||||
XDestroyWindow(dpy, fPtr->leader);
|
XDestroyWindow(dpy, fPtr->leader);
|
||||||
fPtr->leader = None;
|
fPtr->leader = None;
|
||||||
XFlush(dpy);
|
XFlush(dpy);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
fPtr->origLeader = None;
|
||||||
}
|
}
|
||||||
fPtr->origLeader = None;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
app = wApplicationOf(window);
|
app = wApplicationOf(window);
|
||||||
if (app) {
|
if (app) {
|
||||||
if (window == app->main_window) {
|
if (window == app->main_window) {
|
||||||
@@ -1364,8 +1365,8 @@ handleKeyPress(XEvent *event)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (command < 0) {
|
if (command < 0) {
|
||||||
#ifdef LITE
|
#ifdef LITE
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -419,10 +419,19 @@ wRootMenuPerformShortcut(XEvent *event)
|
|||||||
Shortcut *ptr;
|
Shortcut *ptr;
|
||||||
int modifiers;
|
int modifiers;
|
||||||
int done = 0;
|
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 */
|
/* ignore CapsLock */
|
||||||
modifiers = event->xkey.state & ValidModMask;
|
modifiers = event->xkey.state & ValidModMask;
|
||||||
|
|
||||||
for (ptr = shortcutList; ptr!=NULL; ptr = ptr->next) {
|
for (ptr = shortcutList; ptr!=NULL; ptr = ptr->next) {
|
||||||
if (ptr->keycode==0)
|
if (ptr->keycode==0)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
12
src/screen.c
12
src/screen.c
@@ -1018,9 +1018,9 @@ wScreenRestoreState(WScreen *scr)
|
|||||||
|
|
||||||
make_keys();
|
make_keys();
|
||||||
|
|
||||||
if (wScreenCount == 1)
|
if (wScreenCount == 1) {
|
||||||
path = wdefaultspathfordomain("WMState");
|
path = wdefaultspathfordomain("WMState");
|
||||||
else {
|
} else {
|
||||||
char buf[16];
|
char buf[16];
|
||||||
snprintf(buf, sizeof(buf), "WMState.%i", scr->screen);
|
snprintf(buf, sizeof(buf), "WMState.%i", scr->screen);
|
||||||
path = wdefaultspathfordomain(buf);
|
path = wdefaultspathfordomain(buf);
|
||||||
@@ -1028,14 +1028,14 @@ wScreenRestoreState(WScreen *scr)
|
|||||||
scr->session_state = WMReadPropListFromFile(path);
|
scr->session_state = WMReadPropListFromFile(path);
|
||||||
wfree(path);
|
wfree(path);
|
||||||
if (!scr->session_state && wScreenCount>1) {
|
if (!scr->session_state && wScreenCount>1) {
|
||||||
char buf[16];
|
/*char buf[16];
|
||||||
snprintf(buf, sizeof(buf), "WMState.%i", scr->screen);
|
snprintf(buf, sizeof(buf), "WMState.%i", scr->screen);*/
|
||||||
path = wdefaultspathfordomain(buf);
|
path = wdefaultspathfordomain("WMState");
|
||||||
scr->session_state = WMReadPropListFromFile(path);
|
scr->session_state = WMReadPropListFromFile(path);
|
||||||
wfree(path);
|
wfree(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wPreferences.flags.noclip) {
|
if (!wPreferences.flags.noclip && scr->session_state) {
|
||||||
state = WMGetFromPLDictionary(scr->session_state, dClip);
|
state = WMGetFromPLDictionary(scr->session_state, dClip);
|
||||||
scr->clip_icon = wClipRestoreState(scr, state);
|
scr->clip_icon = wClipRestoreState(scr, state);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user