restart on XRandR event

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Nikos Ntarmos 2008-01-11 13:40:08 +01:00 committed by Julien Danjou
parent 956ce4ab8e
commit a245b2c033
3 changed files with 15 additions and 1 deletions

View File

@ -207,6 +207,7 @@ main(int argc, char *argv[])
Display * dpy;
int shape_event, randr_event_base;
int screen, screen_count;
int i, cmdlen;
event_handler **handler;
struct sockaddr_un *addr;
@ -235,6 +236,16 @@ main(int argc, char *argv[])
if(!(dpy = XOpenDisplay(NULL)))
eprint("cannot open display\n");
for(cmdlen = 0, i = 0; i < argc; i++)
cmdlen += a_strlen(argv[i] + 1);
globalconf.argv = p_new(char, cmdlen);
a_strcpy(globalconf.argv, cmdlen, argv[0]);
for(i = 1; i < argc; i++)
{
a_strcat(globalconf.argv, cmdlen, " ");
a_strcat(globalconf.argv, cmdlen, argv[i]);
}
xfd = ConnectionNumber(dpy);
XSetErrorHandler(xerrorstart);

View File

@ -313,6 +313,8 @@ struct AwesomeConf
FocusList *focus;
/** Link between tags and clients */
TagClientLink *tclink;
/** Command line passed to awesome */
char *argv;
};
void config_parse(const char *);

View File

@ -37,7 +37,7 @@
#include "widget.h"
#include "layouts/tile.h"
#include "layouts/floating.h"
#include "xutil.h"
extern AwesomeConf globalconf;
@ -410,6 +410,7 @@ void
handle_event_randr_screen_change_notify(XEvent *e)
{
XRRUpdateConfiguration(e);
uicb_exec(0, globalconf.argv);
}
void