1285
/***********************************************************************
1288
* resizeFromCenter -
1290
***********************************************************************
1293
resizeFromCenter(Window w, TwmWindow *tmp_win)
1295
int lastx, lasty, bw2;
1297
bw2 = tmp_win->frame_bw * 2;
1298
AddingW = tmp_win->attr.width + bw2 + 2 * tmp_win->frame_bw3D;
1299
AddingH = tmp_win->attr.height + tmp_win->title_height + bw2 + 2 *
1300
tmp_win->frame_bw3D;
1302
XGetGeometry(dpy, w, &JunkRoot, &origDragX, &origDragY,
1303
&DragWidth, &DragHeight,
1304
&JunkBW, &JunkDepth);
1306
XWarpPointer(dpy, None, w,
1307
0, 0, 0, 0, DragWidth / 2, DragHeight / 2);
1308
XQueryPointer(dpy, Scr->Root, &JunkRoot,
1309
&JunkChild, &JunkX, &JunkY,
1310
&AddingX, &AddingY, &JunkMask);
1315
MenuStartResize(tmp_win, origDragX, origDragY, DragWidth, DragHeight);
1318
ButtonPressMask | PointerMotionMask | ExposureMask, &Event);
1320
if(Event.type == MotionNotify) {
1321
/* discard any extra motion events before a release */
1322
while(XCheckMaskEvent(dpy,
1323
ButtonMotionMask | ButtonPressMask, &Event))
1324
if(Event.type == ButtonPress) {
1329
if(Event.type == ButtonPress) {
1330
MenuEndResize(tmp_win);
1331
// Next line should be unneeded, done by MenuEndResize() ?
1332
XMoveResizeWindow(dpy, w, AddingX, AddingY, AddingW, AddingH);
1336
if(Event.type != MotionNotify) {
1340
MenuEndResize(tmp_win);
1347
* XXX - if we are going to do a loop, we ought to consider
1348
* using multiple GXxor lines so that we don't need to
1351
XQueryPointer(dpy, Scr->Root, &JunkRoot, &JunkChild,
1352
&JunkX, &JunkY, &AddingX, &AddingY, &JunkMask);
1354
if(lastx != AddingX || lasty != AddingY) {
1355
MenuDoResize(AddingX, AddingY, tmp_win);