Lines Matching refs:window

44 #define WINDOW_NAME window->title
174 return ( event->type == MapNotify && event->xmap.window == (Window)arg );
179 * Return the X Visual ID of the given window
409 XSelectInput(render_spu.WinCmdVisual.dpy, render_spu.WinCmdWindow.window, StructureNotifyMask);
442 /* the window is not in the table, this will just ensure the key is freed */
458 crHashtableAdd(render_spu.pWinToInfoTable, pWinCmd->pWindow->window, pWinCmd->pWindow);
459 XSelectInput(render_spu.WinCmdVisual.dpy, pWinCmd->pWindow->window, ExposureMask);
463 crHashtableDelete(render_spu.pWinToInfoTable, pWinCmd->pWindow->window, NULL);
517 CRASSERT(event.xclient.window == render_spu.WinCmdWindow.window);
518 if (event.xclient.window == render_spu.WinCmdWindow.window)
534 WindowInfo *pWindow = (WindowInfo*)crHashtableSearch(render_spu.pWinToInfoTable, event.xexpose.window);
571 event.xclient.window = render_spu.WinCmdWindow.window;
576 status = XSendEvent(render_spu.pCommunicationDisplay, render_spu.WinCmdWindow.window, False, StructureNotifyMask, &event);
789 * Add a GLX window to a swap group for inter-machine SwapBuffer
794 JoinSwapGroup(Display *dpy, int screen, Window window,
827 /* add this window to the swap group */
828 b = render_spu.ws.glXJoinSwapGroupNV(dpy, window, group);
837 /* ... and bind window to barrier of same ID */
847 crDebug("Render SPU: window has joined swap group %d", group);
853 createWindow( VisualInfo *visual, GLboolean showIt, WindowInfo *window )
868 window->visual = visual;
869 window->nativeWindow = 0;
896 /* Figure out how big the screen is, and make the window that size */
900 crDebug( "Render SPU: root window size: %d x %d", xwa.width, xwa.height );
902 window->x = 0;
903 window->y = 0;
904 window->BltInfo.width = xwa.width;
905 window->BltInfo.height = xwa.height;
908 /* i've changed default window size to be 0,0 but X doesn't like it */
909 /*CRASSERT(window->BltInfo.width >= 1);
910 CRASSERT(window->BltInfo.height >= 1);*/
911 if (window->BltInfo.width < 1) window->BltInfo.width = 1;
912 if (window->BltInfo.height < 1) window->BltInfo.height = 1;
926 /* destroy existing window if there is one */
927 if (window->window) {
928 XDestroyWindow(dpy, window->window);
932 * Create the window
936 * (or DMX) we may never actually use this X window. So we could perhaps
940 * etc should set the default window size very small to avoid this.
954 * child of the vncviewer's desktop window.
969 window->window = XCreateWindow(dpy, render_spu_parent_window_id,
970 window->x, window->y,
971 window->BltInfo.width, window->BltInfo.height,
978 * know render_spu_parent_window_id yet, nor we need it for default window which is hidden.
981 crDebug("Render SPU: Creating global window, parent: %x", RootWindow(dpy, visual->visual->screen));
982 window->window = XCreateWindow(dpy, RootWindow(dpy, visual->visual->screen),
983 window->x, window->y,
984 window->BltInfo.width, window->BltInfo.height,
989 if (!window->window) {
990 crWarning( "Render SPU: unable to create window" );
994 crDebug( "Render SPU: Created window 0x%x on display %s, Xvisual 0x%x",
995 (int) window->window,
1003 * modern window managers.
1017 XChangeProperty( dpy, window->window, /* display, window */
1036 pixmap = XCreatePixmapFromBitmapData(dpy, window->window, &clearByte,
1048 XDefineCursor(dpy, window->window, cursor);
1052 hints.x = window->x;
1053 hints.y = window->y;
1054 hints.width = window->BltInfo.width;
1055 hints.height = window->BltInfo.height;
1064 XSetStandardProperties( dpy, window->window,
1069 * the crDebug window.
1073 XSetWMName( dpy, window->window, &text_prop );
1075 /* Set window name, resource class */
1079 XSetClassHint( dpy, window->window, class_hints );
1085 XMapWindow( dpy, window->window );
1087 (char *) window->window );
1090 if ((window->visual->visAttribs & CR_DOUBLE_BIT) && render_spu.nvSwapGroup) {
1094 * By adding the window ID to the nvSwapGroup ID we can be sure each
1095 * app window is in a separate swap group while all the back-end windows
1098 GLuint group = 0; /*render_spu.nvSwapGroup + window->BltInfo.Base.id;*/
1100 JoinSwapGroup(dpy, visual->visual->screen, window->window, group, barrier);
1106 crDebug( "Render SPU: actual window x, y, width, height: %d, %d, %d, %d",
1107 window->x, window->y, window->BltInfo.width, window->BltInfo.height );
1111 if (window->BltInfo.Base.id != CR_RENDER_WINCMD_ID)
1113 int rc = renderspuWinCmdSubmit(CR_RENDER_WINCMD_TYPE_WIN_ON_CREATE, window);
1122 createPBuffer( VisualInfo *visual, WindowInfo *window )
1124 window->visual = visual;
1125 window->x = 0;
1126 window->y = 0;
1127 window->nativeWindow = 0;
1129 CRASSERT(window->BltInfo.width > 0);
1130 CRASSERT(window->BltInfo.height > 0);
1136 w = window->BltInfo.width;
1137 h = window->BltInfo.height;
1145 window->window = render_spu.ws.glXCreatePbuffer(visual->dpy,
1147 if (window->window) {
1162 renderspu_SystemCreateWindow( VisualInfo *visual, GLboolean showIt, WindowInfo *window )
1165 window->BltInfo.width = render_spu.defaultWidth;
1166 window->BltInfo.height = render_spu.defaultHeight;
1167 return createPBuffer(visual, window);
1170 return createWindow(visual, showIt, window);
1175 renderspu_SystemVBoxCreateWindow( VisualInfo *visual, GLboolean showIt, WindowInfo *window )
1177 return renderspu_SystemCreateWindow(visual, showIt, window);
1181 renderspu_SystemDestroyWindow( WindowInfo *window )
1183 CRASSERT(window);
1184 CRASSERT(window->visual);
1189 crFree(window->buffer);
1190 window->buffer = NULL;
1195 if (window->visual->visAttribs & CR_PBUFFER_BIT) {
1197 render_spu.ws.glXDestroyPbuffer(window->visual->dpy, window->window);
1201 /* The value window->nativeWindow will only be non-NULL if the
1204 * window. I know...personal responsibility and all...
1206 if (!window->nativeWindow) {
1207 if (window->BltInfo.Base.id != CR_RENDER_WINCMD_ID)
1209 int rc = renderspuWinCmdSubmit(CR_RENDER_WINCMD_TYPE_WIN_ON_DESTROY, window);
1212 XDestroyWindow(window->visual->dpy, window->window);
1213 XSync(window->visual->dpy, 0);
1217 window->visual = NULL;
1218 window->window = 0;
1424 check_buffer_size( WindowInfo *window )
1426 if (window->BltInfo.width != window->in_buffer_width
1427 || window->BltInfo.height != window->in_buffer_height
1428 || ! window->buffer) {
1429 crFree(window->buffer);
1431 window->buffer = crCalloc(window->BltInfo.width * window->BltInfo.height
1434 window->in_buffer_width = window->BltInfo.width;
1435 window->in_buffer_height = window->BltInfo.height;
1437 crDebug("Render SPU: dimensions changed to %d x %d", window->BltInfo.width, window->BltInfo.height);
1444 renderspu_SystemMakeCurrent( WindowInfo *window, GLint nativeWindow,
1455 check_buffer_size(window);
1457 window->buffer, GL_UNSIGNED_BYTE,
1458 window->BltInfo.width, window->BltInfo.height);
1465 if (window && context) {
1466 window->appWindow = nativeWindow;
1468 if (window->visual != context->visual) {
1469 crDebug("Render SPU: MakeCurrent visual mismatch (win(%d) bits:0x%x != ctx(%d) bits:0x%x); remaking window.",
1470 window->BltInfo.Base.id, window->visual->visAttribs,
1475 * But for now we destroy the current window
1480 I'm having some really weird issues if I destroy this window
1489 the context from the window before destroying it. -Brian
1491 render_spu.ws.glXMakeCurrent(window->visual->dpy, 0, 0);
1492 renderspu_SystemDestroyWindow( window );
1494 renderspu_SystemCreateWindow( context->visual, window->visible, window );
1496 crError("In renderspu_SystemMakeCurrent() window and context"
1522 /* Continue with nativeWindow = 0; we'll render to the window that
1535 /* We're about to bind the rendering context to a window that we
1536 * (the Render SPU) did not create. The window was created by the
1538 * Make sure the window ID is valid and that the window's X visual is
1541 if (WindowExists(window->visual->dpy, nativeWindow))
1543 int vid = GetWindowVisualID(window->visual->dpy, nativeWindow);
1546 /* check that the window's visual and context's visual match */
1548 crWarning("Render SPU: Can't bind context %d to CRUT/native window "
1554 * GLX visual as the window.
1566 window->nativeWindow = (Window) nativeWindow;
1567 b = render_spu.ws.glXMakeCurrent( window->visual->dpy,
1568 window->nativeWindow,
1580 "the window ID 0x%x is invalid on the display named %s",
1582 DisplayString(window->visual->dpy));
1583 CRASSERT(window->window);
1584 b = render_spu.ws.glXMakeCurrent( window->visual->dpy,
1585 window->window, context->context );
1591 /* This is the normal case - rendering to the render SPU's own window */
1592 CRASSERT(window->window);
1595 window->visual->dpy,
1596 (int) window->window, (int) context->context );
1598 b = render_spu.ws.glXMakeCurrent( window->visual->dpy,
1599 window->window, context->context );
1602 window->visual->dpy,
1603 (int) window->window, (void *) context->context,
1604 window->BltInfo.Base.id, context->BltInfo.Base.id );
1614 if (!window->everCurrent || f[1] < 0.0) {
1637 * Set window (or pbuffer) size.
1640 renderspu_SystemWindowSize( WindowInfo *window, GLint w, GLint h )
1644 window->BltInfo.width = w;
1645 window->BltInfo.height = h;
1646 check_buffer_size(window);
1651 CRASSERT(window);
1652 CRASSERT(window->visual);
1653 if (window->visual->visAttribs & CR_PBUFFER_BIT)
1678 if (window->BltInfo.width != w || window->BltInfo.height != h) {
1686 render_spu.ws.glXDestroyPbuffer(window->visual->dpy, window->window);
1687 window->BltInfo.width = w;
1688 window->BltInfo.height = h;
1690 w, h, window->BltInfo.Base.id);
1691 if (!createPBuffer(window->visual, window)) {
1694 else if (currentContext && currentContext->currentWindow == window) {
1696 render_spu.ws.glXMakeCurrent(window->visual->dpy,
1697 window->window,
1706 if (window->visible)
1708 renderspu_SystemShowWindow( window, GL_FALSE );
1712 /* Resize ordinary X window */
1718 * return the old window size. So, we use a loop to repeat the window
1722 crDebug("Render SPU: XResizeWindow (%x, %x, %d, %d)", window->visual->dpy, window->window, w, h);
1723 XResizeWindow(window->visual->dpy, window->window, w, h);
1724 XSync(window->visual->dpy, 0);
1726 if (!window->BltInfo.width || !window->BltInfo.height)
1728 /* we have hidden the window instead of sizing it to (0;0) since X is unable to handle zero sizes */
1729 if (window->visible)
1731 renderspu_SystemShowWindow( window, GL_TRUE );
1738 /* Now, query the window size */
1739 XGetWindowAttributes(window->visual->dpy, window->window, &attribs);
1751 renderspu_SystemGetWindowGeometry( WindowInfo *window,
1756 *w = window->BltInfo.width;
1757 *h = window->BltInfo.height;
1762 CRASSERT(window);
1763 CRASSERT(window->visual);
1764 CRASSERT(window->window);
1765 if (window->visual->visAttribs & CR_PBUFFER_BIT)
1769 *w = window->BltInfo.width;
1770 *h = window->BltInfo.height;
1779 && window->nativeWindow) {
1780 xw = window->nativeWindow;
1783 xw = window->window;
1786 XGetGeometry(window->visual->dpy, xw, &root,
1790 if (!XTranslateCoordinates(window->visual->dpy, xw, root,
1803 renderspu_SystemGetMaxWindowSize( WindowInfo *window, GLint *w, GLint *h )
1814 CRASSERT(window);
1815 CRASSERT(window->visual);
1816 CRASSERT(window->window);
1818 scrn = DefaultScreen(window->visual->dpy);
1819 *w = DisplayWidth(window->visual->dpy, scrn);
1820 *h = DisplayHeight(window->visual->dpy, scrn);
1825 renderspu_SystemWindowPosition( WindowInfo *window, GLint x, GLint y )
1832 CRASSERT(window);
1833 CRASSERT(window->visual);
1834 if ((window->visual->visAttribs & CR_PBUFFER_BIT) == 0)
1836 crDebug("Render SPU: XMoveWindow (%x, %x, %d, %d)", window->visual->dpy, window->window, x, y);
1837 XMoveWindow(window->visual->dpy, window->window, x, y);
1838 XSync(window->visual->dpy, 0);
1842 GLboolean renderspu_SystemWindowNeedEmptyPresent(WindowInfo *window)
1848 renderspu_SystemWindowVisibleRegion( WindowInfo *window, GLint cRects, const GLint *pRects )
1855 CRASSERT(window);
1856 CRASSERT(window->visual);
1857 if ((window->visual->visAttribs & CR_PBUFFER_BIT) == 0)
1862 if (!XShapeQueryExtension(window->visual->dpy, &evb, &erb))
1864 crWarning("Render SPU: Display %s doesn't support SHAPE extension", window->visual->displayName);
1890 crDebug("Render SPU: XShapeCombineRectangles (%x, %x, cRects=%i)", window->visual->dpy, window->window, cRects);
1892 XShapeCombineRectangles(window->visual->dpy, window->window, ShapeBounding, 0, 0,
1894 XSync(window->visual->dpy, 0);
1899 /* Either show or hide the render SPU's window. */
1901 renderspu_SystemShowWindow( WindowInfo *window, GLboolean showIt )
1908 if (window->visual->dpy && window->window &&
1909 (window->visual->visAttribs & CR_PBUFFER_BIT) == 0)
1913 if (window->BltInfo.width && window->BltInfo.height)
1915 XMapWindow( window->visual->dpy, window->window );
1916 XSync(window->visual->dpy, 0);
1921 XUnmapWindow( window->visual->dpy, window->window );
1922 XSync(window->visual->dpy, 0);
1929 void renderspu_SystemVBoxPresentComposition( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry )
1938 int rc = renderspuVBoxCompositorTryAcquire(window, &pCompositor);
1941 renderspuVBoxPresentCompositionGeneric(window, pCompositor, pChangedEntry, 0, false);
1942 renderspuVBoxCompositorRelease(window);
1950 // renderspuVBoxPresentBlitterEnsureCreated(window, 0);
1954 event.xexpose.window = window->window;
1955 event.xexpose.width = window->BltInfo.width;
1956 event.xexpose.height = window->BltInfo.height;
1957 status = XSendEvent(render_spu.pCommunicationDisplay, render_spu.WinCmdWindow.window, False, 0, &event);
1976 static GC gc = 0; /* XXX per-window??? */
2020 render_spu.ws.glXSwapBuffers( w->visual->dpy, w->window );
2024 void renderspu_SystemReparentWindow(WindowInfo *window)
2029 RootWindow(window->visual->dpy, window->visual->visual->screen);
2031 XReparentWindow(window->visual->dpy, window->window, parent, window->x, window->y);
2032 XSync(window->visual->dpy, False);