fix get_screen_info() and free() ScreenInfo in maximizing uicb functions

This commit is contained in:
Julien Danjou 2007-09-20 22:56:18 +02:00
parent fb5582cdbf
commit e2883bf28b
2 changed files with 10 additions and 7 deletions

View File

@ -231,6 +231,7 @@ uicb_togglemax(Display *disp,
si[awesomeconf->screen].width - 2 * awesomeconf->borderpx, si[awesomeconf->screen].width - 2 * awesomeconf->borderpx,
si[awesomeconf->screen].height - 2 * awesomeconf->borderpx, si[awesomeconf->screen].height - 2 * awesomeconf->borderpx,
drawcontext, awesomeconf); drawcontext, awesomeconf);
XFree(si);
} }
void void
@ -246,6 +247,7 @@ uicb_toggleverticalmax(Display *disp,
maximize(sel->x, si[awesomeconf->screen].y_org, maximize(sel->x, si[awesomeconf->screen].y_org,
sel->w, si[awesomeconf->screen].height - 2 * awesomeconf->borderpx, sel->w, si[awesomeconf->screen].height - 2 * awesomeconf->borderpx,
drawcontext, awesomeconf); drawcontext, awesomeconf);
XFree(si);
} }
@ -262,6 +264,7 @@ uicb_togglehorizontalmax(Display *disp,
maximize(si[awesomeconf->screen].x_org, sel->y, maximize(si[awesomeconf->screen].x_org, sel->y,
si[awesomeconf->screen].height - 2 * awesomeconf->borderpx, sel->h, si[awesomeconf->screen].height - 2 * awesomeconf->borderpx, sel->h,
drawcontext, awesomeconf); drawcontext, awesomeconf);
XFree(si);
} }
void void

View File

@ -39,13 +39,13 @@ get_screen_info(Display *disp, int screen, Statusbar statusbar, int *screen_numb
si = XineramaQueryScreens(disp, screen_number); si = XineramaQueryScreens(disp, screen_number);
else else
{ {
/* emulate Xinerama info */ /* emulate Xinerama info but only fill the screen we want */
*screen_number = 1; *screen_number = screen + 1;
si = p_new(ScreenInfo, 1); si = p_new(ScreenInfo, screen + 1);
si->width = DisplayWidth(disp, screen); si[screen].width = DisplayWidth(disp, screen);
si->height = DisplayHeight(disp, screen); si[screen].height = DisplayHeight(disp, screen);
si->x_org = 0; si[screen].x_org = 0;
si->y_org = 0; si[screen].y_org = 0;
} }
for(i = 0; i < *screen_number; i++) for(i = 0; i < *screen_number; i++)