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;
|
||||
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);
|
||||
|
|
2
config.h
2
config.h
|
@ -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 *);
|
||||
|
|
3
event.c
3
event.c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue