MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / XGetGeometry

Function XGetGeometry

server/faker-x11.cpp:352–399  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350// VirtualGL to know that the window size has changed.
351
352Status XGetGeometry(Display *dpy, Drawable drawable, Window *root, int *x,
353 int *y, unsigned int *width_return, unsigned int *height_return,
354 unsigned int *border_width, unsigned int *depth)
355{
356 Status ret = 0;
357 unsigned int width = 0, height = 0;
358 TRY();
359
360 if(IS_EXCLUDED(dpy))
361 return _XGetGeometry(dpy, drawable, root, x, y, width_return,
362 height_return, border_width, depth);
363
364 /////////////////////////////////////////////////////////////////////////////
365 OPENTRACE(XGetGeometry); PRARGD(dpy); PRARGX(drawable); STARTTRACE();
366 /////////////////////////////////////////////////////////////////////////////
367
368 faker::VirtualWin *vw;
369 if((vw = WINHASH.find(NULL, drawable)) != NULL)
370 {
371 // Apparently drawable is a GLX drawable ID that backs a window, so we need
372 // to request the geometry of the window, not the GLX drawable. This
373 // prevents a BadDrawable error in Steam.
374 dpy = vw->getX11Display();
375 drawable = vw->getX11Drawable();
376 }
377 ret = _XGetGeometry(dpy, drawable, root, x, y, &width, &height, border_width,
378 depth);
379
380 if((vw = WINHASH.find(dpy, drawable)) != NULL && width > 0 && height > 0)
381 vw->resize(width, height);
382 faker::EGLXVirtualWin *eglxvw;
383 if((eglxvw = EGLXWINHASH.find(dpy, drawable)) != NULL && width > 0
384 && height > 0)
385 eglxvw->resize(width, height);
386
387 /////////////////////////////////////////////////////////////////////////////
388 STOPTRACE(); if(root) PRARGX(*root); if(x) PRARGI(*x); if(y) PRARGI(*y);
389 PRARGI(width); PRARGI(height); if(border_width) PRARGI(*border_width);
390 if(depth) PRARGI(*depth);
391 CLOSETRACE();
392 /////////////////////////////////////////////////////////////////////////////
393
394 if(width_return) *width_return = width;
395 if(height_return) *height_return = height;
396
397 CATCH();
398 return ret;
399}
400
401
402// If the pixmap has been used for 3D rendering, then we have to synchronize

Callers 3

alpha_blendFunction · 0.85
offscreen_sizeMethod · 0.85
fbx.cFile · 0.85

Calls 4

getX11DrawableMethod · 0.80
findMethod · 0.45
getX11DisplayMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected