Launcher/Signal/Mouse: Set wmfs ANSI approved, use signal instead sigaction and fix mouse_resize tiny bug.

This commit is contained in:
martin 2009-06-20 01:20:41 +02:00
parent 62a7fcf33f
commit 3fc2571b92
4 changed files with 10 additions and 20 deletions

View File

@ -50,7 +50,7 @@ add_executable(wmfs ${wmfs_src})
set(VERSION "0.1rc4 (On The Run)")
# FLAGS
set(CFLAGS "-g -Wall")
set(CFLAGS "-g -Wall -ansi")
set(CMAKE_C_FLAGS ${CFLAGS})
set(LDFLAGS "-L /usr/local/lib")
set_target_properties(wmfs PROPERTIES LINK_FLAGS ${LDFLAGS})

View File

@ -32,7 +32,8 @@
#include "wmfs.h"
#include <dirent.h>
#include <limits.h>
#define PATH_MAX 4095
void
launcher_execute(Launcher launcher)

View File

@ -242,7 +242,7 @@ mouse_resize(Client *c)
}
else
{
geo.x = ocx - (ocx - ev.xmotion.x);
geo.x = (geo.width != c->maxw) ? ocx - (ocx - ev.xmotion.x) : geo.x;
geo.width = ((c->geo.width + (ocx - geo.x) < c->minw)
? c->minw && (geo.x = (c->geo.x + c->geo.width) - c->minw)
: c->geo.width + (ocx - geo.x));

View File

@ -138,6 +138,7 @@ quit(void)
/* }}} */
XSync(dpy, False);
XCloseDisplay(dpy);
return;
}
@ -238,7 +239,6 @@ void
uicb_reload(uicb_t cmd)
{
quit();
XCloseDisplay(dpy);
for(; argv_global[0] && argv_global[0] == ' '; ++argv_global);
@ -326,16 +326,11 @@ set_statustext(char *str)
}
/** Signal handle function
* \param signum Signal number
*/
void
handle_signal(int signum)
signal_handle(int sig)
{
if(signum == SIGTERM || signum == SIGINT)
{
quit();
exit(EXIT_FAILURE);
}
exiting = True;
return;
}
@ -349,7 +344,6 @@ int
main(int argc, char **argv)
{
int i;
struct sigaction sig;
argv_global = _strdup(argv[0]);
@ -411,12 +405,9 @@ main(int argc, char **argv)
exit(EXIT_FAILURE);
}
/* Set signal handle */
sig.sa_handler = handle_signal;
sig.sa_flags = 0;
memset(&sig.sa_mask, 0, sizeof(sigset_t));
sigaction(SIGTERM, &sig, NULL);
sigaction(SIGINT, &sig, NULL);
/* Set signal handler */
(void)signal(SIGTERM, &signal_handle);
(void)signal(SIGINT, &signal_handle);
/* Check if an other WM is already running; set the error handler */
XSetErrorHandler(errorhandler);
@ -427,8 +418,6 @@ main(int argc, char **argv)
mainloop();
quit();
XCloseDisplay(dpy);
return 0;
}