projects
/
screensavers
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a98a69c
)
Now NEDsim maintains the simulator when the window resizes, only resetting the displa...
author
Aaron Taylor
<ataylor@subgeniuskitty.com>
Thu, 8 Jul 2021 23:35:08 +0000
(16:35 -0700)
committer
Aaron Taylor
<ataylor@subgeniuskitty.com>
Thu, 8 Jul 2021 23:35:08 +0000
(16:35 -0700)
hacks/NEDsim/NEDsim.c
patch
|
blob
|
blame
|
history
diff --git
a/hacks/NEDsim/NEDsim.c
b/hacks/NEDsim/NEDsim.c
index
df95105
..
2b576f0
100644
(file)
--- a/
hacks/NEDsim/NEDsim.c
+++ b/
hacks/NEDsim/NEDsim.c
@@
-781,8
+781,12
@@
NEDsim_reshape(Display * dpy, Window win, void * closure, unsigned int w, unsign
XGetWindowAttributes(nedsim->dpy, nedsim->win, &xgwa);
/* Only restart the simulation if the window changed size. */
if (nedsim->dpy_width != xgwa.width || nedsim->dpy_height != xgwa.height) {
XGetWindowAttributes(nedsim->dpy, nedsim->win, &xgwa);
/* Only restart the simulation if the window changed size. */
if (nedsim->dpy_width != xgwa.width || nedsim->dpy_height != xgwa.height) {
- NEDsim_free(dpy, win, closure);
- closure = NEDsim_init(dpy, win);
+ struct NEDstate * original_nedstate = nedsim->nedstate;
+ nedsim->nedstate = NULL;
+ NEDsim_free(dpy, win, nedsim);
+ struct NEDsim * new_nedsim = NEDsim_init(dpy, win);
+ new_nedsim->nedstate = original_nedstate;
+ closure = new_nedsim;
}
}
}
}