mirror of
https://github.com/libretro/RetroArch
synced 2025-03-02 19:13:34 +00:00
Add xrandr implementation for get_output_options
This commit is contained in:
parent
1acad3522e
commit
4ca7ebc9da
@ -903,7 +903,7 @@ ifeq ($(HAVE_X11), 1)
|
|||||||
gfx/common/xinerama_common.o \
|
gfx/common/xinerama_common.o \
|
||||||
gfx/display_servers/dispserv_x11.o
|
gfx/display_servers/dispserv_x11.o
|
||||||
|
|
||||||
LIBS += $(X11_LIBS) $(XEXT_LIBS) $(XF86VM_LIBS) $(XINERAMA_LIBS)
|
LIBS += $(X11_LIBS) $(XEXT_LIBS) $(XF86VM_LIBS) $(XINERAMA_LIBS) $(XRANDR_LIBS)
|
||||||
DEFINES += -DHAVE_X11 $(X11_CFLAGS) $(XEXT_CFLAGS) $(XF86VM_CFLAGS) $(XINERAMA_CFLAGS)
|
DEFINES += -DHAVE_X11 $(X11_CFLAGS) $(XEXT_CFLAGS) $(XF86VM_CFLAGS) $(XINERAMA_CFLAGS)
|
||||||
ifeq ($(HAVE_XCB),1)
|
ifeq ($(HAVE_XCB),1)
|
||||||
LIBS += -lX11-xcb
|
LIBS += -lX11-xcb
|
||||||
|
@ -14,9 +14,18 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <compat/strl.h>
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "../../config.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_XRANDR
|
||||||
|
#include <X11/extensions/Xrandr.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "../video_display_server.h"
|
#include "../video_display_server.h"
|
||||||
#include "../common/x11_common.h"
|
#include "../common/x11_common.h"
|
||||||
#include "../../configuration.h"
|
#include "../../configuration.h"
|
||||||
@ -284,8 +293,37 @@ static bool x11_display_server_set_resolution(void *data,
|
|||||||
|
|
||||||
const char *x11_display_server_get_output_options(void *data)
|
const char *x11_display_server_get_output_options(void *data)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_XRANDR
|
||||||
|
Display *dpy;
|
||||||
|
XRRScreenResources *res;
|
||||||
|
XRROutputInfo *info;
|
||||||
|
Window root;
|
||||||
|
int i;
|
||||||
|
static char s[PATH_MAX_LENGTH];
|
||||||
|
|
||||||
|
if (!(dpy = XOpenDisplay(0)))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
root = RootWindow(dpy, DefaultScreen(dpy));
|
||||||
|
|
||||||
|
if (!(res = XRRGetScreenResources(dpy, root)))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
for (i = 0; i < res->noutput; i++)
|
||||||
|
{
|
||||||
|
if (!(info = XRRGetOutputInfo(dpy, res, res->outputs[i])))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
strlcat(s, info->name, sizeof(s));
|
||||||
|
if ((i+1) < res->noutput)
|
||||||
|
strlcat(s, "|", sizeof(s));
|
||||||
|
}
|
||||||
|
|
||||||
|
return s;
|
||||||
|
#else
|
||||||
/* TODO/FIXME - hardcoded for now; list should be built up dynamically later */
|
/* TODO/FIXME - hardcoded for now; list should be built up dynamically later */
|
||||||
return "HDMI-0|HDMI-1|HDMI-2|HDMI-3|DVI-0|DVI-1|DVI-2|DVI-3|VGA-0|VGA-1|VGA-2|VGA-3|Config";
|
return "HDMI-0|HDMI-1|HDMI-2|HDMI-3|DVI-0|DVI-1|DVI-2|DVI-3|VGA-0|VGA-1|VGA-2|VGA-3|Config";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
const video_display_server_t dispserv_x11 = {
|
const video_display_server_t dispserv_x11 = {
|
||||||
|
@ -482,9 +482,10 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$HAVE_X11" = 'no' ]; then
|
if [ "$HAVE_X11" = 'no' ]; then
|
||||||
HAVE_XEXT=no; HAVE_XF86VM=no; HAVE_XINERAMA=no; HAVE_XSHM=no
|
HAVE_XEXT=no; HAVE_XF86VM=no; HAVE_XINERAMA=no; HAVE_XSHM=no; HAVE_XRANDR=no
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
check_lib '' XRANDR -lXrandr
|
||||||
check_pkgconf XINERAMA xinerama
|
check_pkgconf XINERAMA xinerama
|
||||||
check_val '' XINERAMA -lXinerama
|
check_val '' XINERAMA -lXinerama
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@ HAVE_OPENDINGUX_FBDEV=no # Opendingux fbdev context support
|
|||||||
HAVE_OPENGLES=no # Use GLESv2 instead of desktop GL
|
HAVE_OPENGLES=no # Use GLESv2 instead of desktop GL
|
||||||
HAVE_OPENGLES3=no # OpenGLES3 support
|
HAVE_OPENGLES3=no # OpenGLES3 support
|
||||||
HAVE_X11=auto # everything X11.
|
HAVE_X11=auto # everything X11.
|
||||||
|
HAVE_XRANDR=auto # Xrandr support.
|
||||||
HAVE_OMAP=no # OMAP video support
|
HAVE_OMAP=no # OMAP video support
|
||||||
HAVE_XINERAMA=auto # Xinerama support.
|
HAVE_XINERAMA=auto # Xinerama support.
|
||||||
HAVE_KMS=auto # KMS context support
|
HAVE_KMS=auto # KMS context support
|
||||||
|
Loading…
x
Reference in New Issue
Block a user