diff --git a/layout.c b/layout.c index 7d5d044c1..5e65e57b5 100644 --- a/layout.c +++ b/layout.c @@ -231,6 +231,7 @@ uicb_togglemax(Display *disp, si[awesomeconf->screen].width - 2 * awesomeconf->borderpx, si[awesomeconf->screen].height - 2 * awesomeconf->borderpx, drawcontext, awesomeconf); + XFree(si); } void @@ -246,6 +247,7 @@ uicb_toggleverticalmax(Display *disp, maximize(sel->x, si[awesomeconf->screen].y_org, sel->w, si[awesomeconf->screen].height - 2 * awesomeconf->borderpx, drawcontext, awesomeconf); + XFree(si); } @@ -262,6 +264,7 @@ uicb_togglehorizontalmax(Display *disp, maximize(si[awesomeconf->screen].x_org, sel->y, si[awesomeconf->screen].height - 2 * awesomeconf->borderpx, sel->h, drawcontext, awesomeconf); + XFree(si); } void diff --git a/screen.c b/screen.c index 902bdacd2..5b600d1ec 100644 --- a/screen.c +++ b/screen.c @@ -39,13 +39,13 @@ get_screen_info(Display *disp, int screen, Statusbar statusbar, int *screen_numb si = XineramaQueryScreens(disp, screen_number); else { - /* emulate Xinerama info */ - *screen_number = 1; - si = p_new(ScreenInfo, 1); - si->width = DisplayWidth(disp, screen); - si->height = DisplayHeight(disp, screen); - si->x_org = 0; - si->y_org = 0; + /* emulate Xinerama info but only fill the screen we want */ + *screen_number = screen + 1; + si = p_new(ScreenInfo, screen + 1); + si[screen].width = DisplayWidth(disp, screen); + si[screen].height = DisplayHeight(disp, screen); + si[screen].x_org = 0; + si[screen].y_org = 0; } for(i = 0; i < *screen_number; i++)