restart on XRandR event
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
956ce4ab8e
commit
a245b2c033
11
awesome.c
11
awesome.c
|
@ -207,6 +207,7 @@ main(int argc, char *argv[])
|
||||||
Display * dpy;
|
Display * dpy;
|
||||||
int shape_event, randr_event_base;
|
int shape_event, randr_event_base;
|
||||||
int screen, screen_count;
|
int screen, screen_count;
|
||||||
|
int i, cmdlen;
|
||||||
event_handler **handler;
|
event_handler **handler;
|
||||||
struct sockaddr_un *addr;
|
struct sockaddr_un *addr;
|
||||||
|
|
||||||
|
@ -235,6 +236,16 @@ main(int argc, char *argv[])
|
||||||
if(!(dpy = XOpenDisplay(NULL)))
|
if(!(dpy = XOpenDisplay(NULL)))
|
||||||
eprint("cannot open display\n");
|
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);
|
xfd = ConnectionNumber(dpy);
|
||||||
|
|
||||||
XSetErrorHandler(xerrorstart);
|
XSetErrorHandler(xerrorstart);
|
||||||
|
|
2
config.h
2
config.h
|
@ -313,6 +313,8 @@ struct AwesomeConf
|
||||||
FocusList *focus;
|
FocusList *focus;
|
||||||
/** Link between tags and clients */
|
/** Link between tags and clients */
|
||||||
TagClientLink *tclink;
|
TagClientLink *tclink;
|
||||||
|
/** Command line passed to awesome */
|
||||||
|
char *argv;
|
||||||
};
|
};
|
||||||
|
|
||||||
void config_parse(const char *);
|
void config_parse(const char *);
|
||||||
|
|
3
event.c
3
event.c
|
@ -37,7 +37,7 @@
|
||||||
#include "widget.h"
|
#include "widget.h"
|
||||||
#include "layouts/tile.h"
|
#include "layouts/tile.h"
|
||||||
#include "layouts/floating.h"
|
#include "layouts/floating.h"
|
||||||
|
#include "xutil.h"
|
||||||
|
|
||||||
extern AwesomeConf globalconf;
|
extern AwesomeConf globalconf;
|
||||||
|
|
||||||
|
@ -410,6 +410,7 @@ void
|
||||||
handle_event_randr_screen_change_notify(XEvent *e)
|
handle_event_randr_screen_change_notify(XEvent *e)
|
||||||
{
|
{
|
||||||
XRRUpdateConfiguration(e);
|
XRRUpdateConfiguration(e);
|
||||||
|
uicb_exec(0, globalconf.argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue