Ticket #1916: xrandr.patch
File xrandr.patch, 2.6 KB (added by , 11 years ago) |
---|
-
build/premake/extern_libs4.lua
649 649 }) 650 650 end, 651 651 }, 652 xrandr = { 653 link_settings = function() 654 add_default_links({ 655 unix_names = { "Xrandr" }, 656 }) 657 end, 658 }, 652 659 zlib = { 653 660 compile_settings = function() 654 661 if os.is("windows") then -
build/premake/premake4.lua
751 751 -- X11 should only be linked on *nix 752 752 table.insert(used_extern_libs, "x11") 753 753 table.insert(used_extern_libs, "xcursor") 754 table.insert(used_extern_libs, "xrandr") 754 755 end 755 756 756 757 if not _OPTIONS["without-audio"] then -
source/lib/sysdep/os/unix/x/x.cpp
44 44 #include <stdlib.h> 45 45 #include <Xatom.h> 46 46 #include <Xcursor/Xcursor.h> 47 #include <X11/extensions/Xrandr.h> 47 48 48 49 #include "SDL.h" 49 50 #include "SDL_syswm.h" … … 71 72 72 73 int screen = XDefaultScreen(disp); 73 74 74 /* 2004-07-13 75 NOTE: The XDisplayWidth/Height functions don't actually return the current 76 display mode - they return the size of the root window. This means that 77 users with "Virtual Desktops" bigger than what their monitors/graphics 78 card can handle will have to set their 0AD screen resolution manually. 79 80 There's supposed to be an X extension that can give you the actual display 81 mode, probably including refresh rate info etc, but it's not worth 82 researching and implementing that at this stage. 75 /* 2013-04-13 76 NOTE: Game starts on primary output. In multi-monitor configuration, 77 for SDL 1.2 users primary output has to be the left-most (at 0,0). 83 78 */ 84 79 80 XRRScreenResources *screen_resources = XRRGetScreenResources(disp, DefaultRootWindow(disp)); 81 RROutput primary_output = XRRGetOutputPrimary(disp, DefaultRootWindow(disp)); 82 XRROutputInfo *output_info = XRRGetOutputInfo(disp, screen_resources, primary_output); 83 XRRCrtcInfo *crtc_info = XRRGetCrtcInfo(disp, screen_resources, output_info->crtc); 84 85 85 if(xres) 86 *xres = XDisplayWidth(disp, screen);86 *xres = crtc_info->width; 87 87 if(yres) 88 *yres = XDisplayHeight(disp, screen); 88 *yres = crtc_info->height; 89 90 XRRFreeCrtcInfo(crtc_info); 91 XRRFreeOutputInfo(output_info); 92 XRRFreeScreenResources(screen_resources); 93 89 94 if(bpp) 90 95 *bpp = XDefaultDepth(disp, screen); 91 96 if(freq)