fix get_screen_info() and free() ScreenInfo in maximizing uicb functions
This commit is contained in:
parent
fb5582cdbf
commit
e2883bf28b
3
layout.c
3
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
|
||||
|
|
14
screen.c
14
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++)
|
||||
|
|
Loading…
Reference in New Issue