Store phys_screen in SimpleWindow, and resize drawable on window resize
This commit is contained in:
parent
d144c53395
commit
aa5138bc1d
|
@ -48,6 +48,7 @@ simplewindow_new(Display *disp, int phys_screen, int x, int y,
|
||||||
sw->geometry.width = w;
|
sw->geometry.width = w;
|
||||||
sw->geometry.height = h;
|
sw->geometry.height = h;
|
||||||
sw->display = disp;
|
sw->display = disp;
|
||||||
|
sw->phys_screen = phys_screen;
|
||||||
|
|
||||||
wa.event_mask = SubstructureRedirectMask | SubstructureNotifyMask
|
wa.event_mask = SubstructureRedirectMask | SubstructureNotifyMask
|
||||||
| EnterWindowMask | LeaveWindowMask | StructureNotifyMask;
|
| EnterWindowMask | LeaveWindowMask | StructureNotifyMask;
|
||||||
|
@ -107,6 +108,11 @@ simplewindow_resize(SimpleWindow *sw, unsigned int w, unsigned int h)
|
||||||
{
|
{
|
||||||
sw->geometry.width = w;
|
sw->geometry.width = w;
|
||||||
sw->geometry.height = h;
|
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);
|
return XResizeWindow(sw->display, sw->window, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
typedef struct SimpleWindow
|
typedef struct SimpleWindow
|
||||||
{
|
{
|
||||||
Display *display;
|
Display *display;
|
||||||
|
int phys_screen;
|
||||||
Window window;
|
Window window;
|
||||||
Drawable drawable;
|
Drawable drawable;
|
||||||
area_t geometry;
|
area_t geometry;
|
||||||
|
|
Loading…
Reference in New Issue