/*********************************************************************** * X11DRV_resize_desktop */ void X11DRV_resize_desktop( unsigned int width, unsigned int height ) { HWND hwnd = GetDesktopWindow(); struct desktop_resize_data resize_data; resize_data.old_screen_rect = get_primary_monitor_rect(); resize_data.old_virtual_rect = get_virtual_screen_rect(); xinerama_init( width, height ); resize_data.new_virtual_rect = get_virtual_screen_rect(); if (GetWindowThreadProcessId( hwnd, NULL ) != GetCurrentThreadId()) { SendMessageW( hwnd, WM_X11DRV_RESIZE_DESKTOP, 0, MAKELPARAM( width, height ) ); } else { TRACE( "desktop %p change to (%dx%d)\n", hwnd, width, height ); update_desktop_fullscreen( width, height ); SetWindowPos( hwnd, 0, resize_data.new_virtual_rect.left, resize_data.new_virtual_rect.top, resize_data.new_virtual_rect.right - resize_data.new_virtual_rect.left, resize_data.new_virtual_rect.bottom - resize_data.new_virtual_rect.top, SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE ); ungrab_clipping_window(); SendMessageTimeoutW( HWND_BROADCAST, WM_DISPLAYCHANGE, screen_bpp, MAKELPARAM( width, height ), SMTO_ABORTIFHUNG, 2000, NULL ); } EnumWindows( update_windows_on_desktop_resize, (LPARAM)&resize_data ); }
/********************************************************************** * X11DRV_CreateDC */ static BOOL X11DRV_CreateDC( PHYSDEV *pdev, LPCWSTR driver, LPCWSTR device, LPCWSTR output, const DEVMODEW* initData ) { X11DRV_PDEVICE *physDev = create_x11_physdev( root_window ); if (!physDev) return FALSE; physDev->depth = default_visual.depth; physDev->color_shifts = &X11DRV_PALETTE_default_shifts; physDev->dc_rect = get_virtual_screen_rect(); OffsetRect( &physDev->dc_rect, -physDev->dc_rect.left, -physDev->dc_rect.top ); push_dc_driver( pdev, &physDev->dev, &x11drv_funcs ); if (xrender_funcs && !xrender_funcs->pCreateDC( pdev, driver, device, output, initData )) return FALSE; return TRUE; }
/*********************************************************************** * GetDeviceCaps (X11DRV.@) */ static INT X11DRV_GetDeviceCaps( PHYSDEV dev, INT cap ) { switch(cap) { case DRIVERVERSION: return 0x300; case TECHNOLOGY: return DT_RASDISPLAY; case HORZSIZE: { RECT primary_rect = get_primary_monitor_rect(); return MulDiv( primary_rect.right - primary_rect.left, 254, log_pixels_x * 10 ); } case VERTSIZE: { RECT primary_rect = get_primary_monitor_rect(); return MulDiv( primary_rect.bottom - primary_rect.top, 254, log_pixels_y * 10 ); } case HORZRES: { RECT primary_rect = get_primary_monitor_rect(); return primary_rect.right - primary_rect.left; } case VERTRES: { RECT primary_rect = get_primary_monitor_rect(); return primary_rect.bottom - primary_rect.top; } case DESKTOPHORZRES: { RECT virtual_rect = get_virtual_screen_rect(); return virtual_rect.right - virtual_rect.left; } case DESKTOPVERTRES: { RECT virtual_rect = get_virtual_screen_rect(); return virtual_rect.bottom - virtual_rect.top; } case BITSPIXEL: return screen_bpp; case PLANES: return 1; case NUMBRUSHES: return -1; case NUMPENS: return -1; case NUMMARKERS: return 0; case NUMFONTS: return 0; case NUMCOLORS: /* MSDN: Number of entries in the device's color table, if the device has * a color depth of no more than 8 bits per pixel.For devices with greater * color depths, -1 is returned. */ return (default_visual.depth > 8) ? -1 : (1 << default_visual.depth); case PDEVICESIZE: return sizeof(X11DRV_PDEVICE); case CURVECAPS: return (CC_CIRCLES | CC_PIE | CC_CHORD | CC_ELLIPSES | CC_WIDE | CC_STYLED | CC_WIDESTYLED | CC_INTERIORS | CC_ROUNDRECT); case LINECAPS: return (LC_POLYLINE | LC_MARKER | LC_POLYMARKER | LC_WIDE | LC_STYLED | LC_WIDESTYLED | LC_INTERIORS); case POLYGONALCAPS: return (PC_POLYGON | PC_RECTANGLE | PC_WINDPOLYGON | PC_SCANLINE | PC_WIDE | PC_STYLED | PC_WIDESTYLED | PC_INTERIORS); case TEXTCAPS: return (TC_OP_CHARACTER | TC_OP_STROKE | TC_CP_STROKE | TC_CR_ANY | TC_SF_X_YINDEP | TC_SA_DOUBLE | TC_SA_INTEGER | TC_SA_CONTIN | TC_UA_ABLE | TC_SO_ABLE | TC_RA_ABLE | TC_VA_ABLE); case CLIPCAPS: return CP_REGION; case COLORRES: /* The observed correspondence between BITSPIXEL and COLORRES is: * BITSPIXEL: 8 -> COLORRES: 18 * BITSPIXEL: 16 -> COLORRES: 16 * BITSPIXEL: 24 -> COLORRES: 24 * BITSPIXEL: 32 -> COLORRES: 24 */ return (screen_bpp <= 8) ? 18 : min( 24, screen_bpp ); case RASTERCAPS: return (RC_BITBLT | RC_BANDING | RC_SCALING | RC_BITMAP64 | RC_DI_BITMAP | RC_DIBTODEV | RC_BIGFONT | RC_STRETCHBLT | RC_STRETCHDIB | RC_DEVBITS | (palette_size ? RC_PALETTE : 0)); case SHADEBLENDCAPS: return (SB_GRAD_RECT | SB_GRAD_TRI | SB_CONST_ALPHA | SB_PIXEL_ALPHA); case ASPECTX: case ASPECTY: return 36; case ASPECTXY: return 51; case LOGPIXELSX: return log_pixels_x; case LOGPIXELSY: return log_pixels_y; case CAPS1: FIXME("(%p): CAPS1 is unimplemented, will return 0\n", dev->hdc ); /* please see wingdi.h for the possible bit-flag values that need to be returned. */ return 0; case SIZEPALETTE: return palette_size; case NUMRESERVED: case PHYSICALWIDTH: case PHYSICALHEIGHT: case PHYSICALOFFSETX: case PHYSICALOFFSETY: case SCALINGFACTORX: case SCALINGFACTORY: case VREFRESH: case BLTALIGNMENT: return 0; default: FIXME("(%p): unsupported capability %d, will return 0\n", dev->hdc, cap ); return 0; } }