mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
Store phys_screen in SimpleWindow, and resize drawable on window resize
This commit is contained in:
parent
d144c53395
commit
aa5138bc1d
2 changed files with 7 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
typedef struct SimpleWindow
|
||||
{
|
||||
Display *display;
|
||||
int phys_screen;
|
||||
Window window;
|
||||
Drawable drawable;
|
||||
area_t geometry;
|
||||
|
|
Loading…
Reference in a new issue