Store phys_screen in SimpleWindow, and resize drawable on window resize

This commit is contained in:
Julien Danjou 2008-03-14 13:14:21 +01:00
parent d144c53395
commit aa5138bc1d
2 changed files with 7 additions and 0 deletions

View file

@ -48,6 +48,7 @@ simplewindow_new(Display *disp, int phys_screen, int x, int y,
sw->geometry.width = w;
sw->geometry.height = h;
sw->display = disp;
sw->phys_screen = phys_screen;
wa.event_mask = SubstructureRedirectMask | SubstructureNotifyMask
| EnterWindowMask | LeaveWindowMask | StructureNotifyMask;
@ -107,6 +108,11 @@ simplewindow_resize(SimpleWindow *sw, unsigned int w, unsigned int h)
{
sw->geometry.width = w;
sw->geometry.height = h;
XFreePixmap(sw->display, sw->drawable);
sw->drawable = XCreatePixmap(sw->display,
RootWindow(sw->display, sw->phys_screen),
w, h,
DefaultDepth(sw->display, sw->phys_screen));
return XResizeWindow(sw->display, sw->window, w, h);
}

View file

@ -28,6 +28,7 @@
typedef struct SimpleWindow
{
Display *display;
int phys_screen;
Window window;
Drawable drawable;
area_t geometry;