158 |
|
oursizhints.min_height = MINHEIGHT; |
159 |
|
oursizhints.flags = PMinSize; |
160 |
|
XSetNormalHints(ourdisplay, gwind, &oursizhints); |
161 |
+ |
/* figure out sensible view */ |
162 |
+ |
pwidth = (double)DisplayWidthMM(ourdisplay, ourscreen) / |
163 |
+ |
DisplayWidth(ourdisplay, ourscreen); |
164 |
+ |
pheight = (double)DisplayHeightMM(ourdisplay, ourscreen) / |
165 |
+ |
DisplayHeight(ourdisplay, ourscreen); |
166 |
+ |
copystruct(&odev.v, &stdview); |
167 |
+ |
odev.v.type = VT_PER; |
168 |
|
/* map the window and get its size */ |
169 |
|
XMapWindow(ourdisplay, gwind); |
170 |
< |
dev_input(); |
170 |
> |
dev_input(); /* sets size and view angles */ |
171 |
|
/* allocate our leaf pile */ |
172 |
|
if (!qtAllocLeaves(DisplayWidth(ourdisplay,ourscreen) * |
173 |
|
DisplayHeight(ourdisplay,ourscreen) / |
174 |
|
(qtMinNodesiz*qtMinNodesiz))) |
175 |
|
error(SYSTEM, "insufficient memory for leaf storage"); |
169 |
– |
|
170 |
– |
/* figure out sensible view */ |
171 |
– |
pwidth = (double)DisplayWidthMM(ourdisplay, ourscreen) / |
172 |
– |
DisplayWidth(ourdisplay, ourscreen); |
173 |
– |
pheight = (double)DisplayHeightMM(ourdisplay, ourscreen) / |
174 |
– |
DisplayHeight(ourdisplay, ourscreen); |
175 |
– |
copystruct(&odev.v, &stdview); |
176 |
|
odev.name = id; |
177 |
– |
odev.v.type = VT_PER; |
178 |
– |
odev.v.horiz = 2.*180./PI * atan(0.5/VIEWDIST*pwidth*odev.hres); |
179 |
– |
odev.v.vert = 2.*180./PI * atan(0.5/VIEWDIST*pheight*odev.vres); |
177 |
|
odev.ifd = ConnectionNumber(ourdisplay); |
178 |
|
} |
179 |
|
|
233 |
|
odev.vres = dh; |
234 |
|
} |
235 |
|
XResizeWindow(ourdisplay, gwind, odev.hres, odev.vres); |
236 |
+ |
dev_input(); /* wait for resize event */ |
237 |
|
} |
238 |
|
copystruct(&odev.v, nv); |
239 |
|
} |