RetroArch
Macros | Functions | Variables
x11_common.c File Reference
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <errno.h>
#include <unistd.h>
#include <X11/Xatom.h>
#include "x11_common.h"
#include <X11/extensions/xf86vmode.h>
#include <encodings/utf.h>
#include "../../frontend/frontend_driver.h"
#include "../../input/input_driver.h"
#include "../../input/input_keymaps.h"
#include "../../input/common/input_x11_common.h"
#include "../../verbosity.h"
Include dependency graph for x11_common.c:

Macros

#define _NET_WM_STATE_ADD   1
 
#define MOVERESIZE_GRAVITY_CENTER   5
 
#define MOVERESIZE_X_SHIFT   8
 
#define MOVERESIZE_Y_SHIFT   9
 

Functions

static void x11_hide_mouse (Display *dpy, Window win)
 
void x11_show_mouse (Display *dpy, Window win, bool state)
 
void x11_set_net_wm_fullscreen (Display *dpy, Window win)
 
void x11_move_window (Display *dpy, Window win, int x, int y, unsigned width, unsigned height)
 
static void x11_set_window_class (Display *dpy, Window win)
 
static void x11_set_window_pid (Display *dpy, Window win)
 
void x11_set_window_attr (Display *dpy, Window win)
 
static void xdg_screensaver_inhibit (Window wnd)
 
void x11_suspend_screensaver_xdg_screensaver (Window wnd, bool enable)
 
void x11_suspend_screensaver (Window wnd, bool enable)
 
float x11_get_refresh_rate (void *data)
 
static bool get_video_mode (video_frame_info_t *video_info, Display *dpy, unsigned width, unsigned height, XF86VidModeModeInfo *mode, XF86VidModeModeInfo *desktop_mode)
 
bool x11_enter_fullscreen (video_frame_info_t *video_info, Display *dpy, unsigned width, unsigned height)
 
void x11_exit_fullscreen (Display *dpy)
 
bool x11_create_input_context (Display *dpy, Window win, XIM *xim, XIC *xic)
 
void x11_destroy_input_context (XIM *xim, XIC *xic)
 
bool x11_get_metrics (void *data, enum display_metric_types type, float *value)
 
static void x11_handle_key_event (XEvent *event, XIC ic, bool filter)
 
bool x11_alive (void *data)
 
void x11_check_window (void *data, bool *quit, bool *resize, unsigned *width, unsigned *height, bool is_shutdown)
 
void x11_get_video_size (void *data, unsigned *width, unsigned *height)
 
bool x11_has_focus_internal (void *data)
 
bool x11_has_focus (void *data)
 
bool x11_connect (void)
 
void x11_update_title (void *data, void *data2)
 
bool x11_input_ctx_new (bool true_full)
 
void x11_input_ctx_destroy (void)
 
void x11_window_destroy (bool fullscreen)
 
void x11_colormap_destroy (void)
 
void x11_install_quit_atom (void)
 
static Bool x11_wait_notify (Display *d, XEvent *e, char *arg)
 
void x11_event_queue_check (XEvent *event)
 
static bool x11_check_atom_supported (Display *dpy, Atom atom)
 
bool x11_has_net_wm_fullscreen (Display *dpy)
 
char * x11_get_wm_name (Display *dpy)
 

Variables

static XF86VidModeModeInfo desktop_mode
 
static bool xdg_screensaver_available = true
 
bool g_x11_entered = false
 
static bool g_x11_has_focus = false
 
static bool g_x11_true_full = false
 
Display * g_x11_dpy = NULL
 
unsigned g_x11_screen = 0
 
Colormap g_x11_cmap
 
Window g_x11_win = None
 
static Atom XA_NET_WM_STATE
 
static Atom XA_NET_WM_STATE_FULLSCREEN
 
static Atom XA_NET_MOVERESIZE_WINDOW
 
static Atom g_x11_quit_atom
 
static XIM g_x11_xim
 
static XIC g_x11_xic
 

Macro Definition Documentation

◆ _NET_WM_STATE_ADD

#define _NET_WM_STATE_ADD   1

◆ MOVERESIZE_GRAVITY_CENTER

#define MOVERESIZE_GRAVITY_CENTER   5

◆ MOVERESIZE_X_SHIFT

#define MOVERESIZE_X_SHIFT   8

◆ MOVERESIZE_Y_SHIFT

#define MOVERESIZE_Y_SHIFT   9

Function Documentation

◆ get_video_mode()

static bool get_video_mode ( video_frame_info_t video_info,
Display *  dpy,
unsigned  width,
unsigned  height,
XF86VidModeModeInfo *  mode,
XF86VidModeModeInfo *  desktop_mode 
)
static
Here is the caller graph for this function:

◆ x11_alive()

bool x11_alive ( void data)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ x11_check_atom_supported()

static bool x11_check_atom_supported ( Display *  dpy,
Atom  atom 
)
static
Here is the caller graph for this function:

◆ x11_check_window()

void x11_check_window ( void data,
bool quit,
bool resize,
unsigned *  width,
unsigned *  height,
bool  is_shutdown 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ x11_colormap_destroy()

void x11_colormap_destroy ( void  )
Here is the caller graph for this function:

◆ x11_connect()

bool x11_connect ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ x11_create_input_context()

bool x11_create_input_context ( Display *  dpy,
Window  win,
XIM *  xim,
XIC *  xic 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ x11_destroy_input_context()

void x11_destroy_input_context ( XIM *  xim,
XIC *  xic 
)
Here is the caller graph for this function:

◆ x11_enter_fullscreen()

bool x11_enter_fullscreen ( video_frame_info_t video_info,
Display *  dpy,
unsigned  width,
unsigned  height 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ x11_event_queue_check()

void x11_event_queue_check ( XEvent *  event)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ x11_exit_fullscreen()

void x11_exit_fullscreen ( Display *  dpy)
Here is the caller graph for this function:

◆ x11_get_metrics()

bool x11_get_metrics ( void data,
enum display_metric_types  type,
float *  value 
)
Here is the call graph for this function:

◆ x11_get_refresh_rate()

float x11_get_refresh_rate ( void data)

◆ x11_get_video_size()

void x11_get_video_size ( void data,
unsigned *  width,
unsigned *  height 
)
Here is the caller graph for this function:

◆ x11_get_wm_name()

char* x11_get_wm_name ( Display *  dpy)
Here is the caller graph for this function:

◆ x11_handle_key_event()

static void x11_handle_key_event ( XEvent *  event,
XIC  ic,
bool  filter 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ x11_has_focus()

bool x11_has_focus ( void data)

◆ x11_has_focus_internal()

bool x11_has_focus_internal ( void data)

◆ x11_has_net_wm_fullscreen()

bool x11_has_net_wm_fullscreen ( Display *  dpy)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ x11_hide_mouse()

static void x11_hide_mouse ( Display *  dpy,
Window  win 
)
static
Here is the caller graph for this function:

◆ x11_input_ctx_destroy()

void x11_input_ctx_destroy ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ x11_input_ctx_new()

bool x11_input_ctx_new ( bool  true_full)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ x11_install_quit_atom()

void x11_install_quit_atom ( void  )
Here is the caller graph for this function:

◆ x11_move_window()

void x11_move_window ( Display *  dpy,
Window  win,
int  x,
int  y,
unsigned  width,
unsigned  height 
)
Here is the caller graph for this function:

◆ x11_set_net_wm_fullscreen()

void x11_set_net_wm_fullscreen ( Display *  dpy,
Window  win 
)
Here is the caller graph for this function:

◆ x11_set_window_attr()

void x11_set_window_attr ( Display *  dpy,
Window  win 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ x11_set_window_class()

static void x11_set_window_class ( Display *  dpy,
Window  win 
)
static
Here is the caller graph for this function:

◆ x11_set_window_pid()

static void x11_set_window_pid ( Display *  dpy,
Window  win 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ x11_show_mouse()

void x11_show_mouse ( Display *  dpy,
Window  win,
bool  state 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ x11_suspend_screensaver()

void x11_suspend_screensaver ( Window  wnd,
bool  enable 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ x11_suspend_screensaver_xdg_screensaver()

void x11_suspend_screensaver_xdg_screensaver ( Window  wnd,
bool  enable 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ x11_update_title()

void x11_update_title ( void data,
void data2 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ x11_wait_notify()

static Bool x11_wait_notify ( Display *  d,
XEvent *  e,
char *  arg 
)
static
Here is the caller graph for this function:

◆ x11_window_destroy()

void x11_window_destroy ( bool  fullscreen)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xdg_screensaver_inhibit()

static void xdg_screensaver_inhibit ( Window  wnd)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ desktop_mode

XF86VidModeModeInfo desktop_mode
static

◆ g_x11_cmap

Colormap g_x11_cmap

◆ g_x11_dpy

Display* g_x11_dpy = NULL

◆ g_x11_entered

bool g_x11_entered = false

◆ g_x11_has_focus

bool g_x11_has_focus = false
static

◆ g_x11_quit_atom

Atom g_x11_quit_atom
static

◆ g_x11_screen

unsigned g_x11_screen = 0

◆ g_x11_true_full

bool g_x11_true_full = false
static

◆ g_x11_win

Window g_x11_win = None

◆ g_x11_xic

XIC g_x11_xic
static

◆ g_x11_xim

XIM g_x11_xim
static

◆ XA_NET_MOVERESIZE_WINDOW

Atom XA_NET_MOVERESIZE_WINDOW
static

◆ XA_NET_WM_STATE

Atom XA_NET_WM_STATE
static

◆ XA_NET_WM_STATE_FULLSCREEN

Atom XA_NET_WM_STATE_FULLSCREEN
static

◆ xdg_screensaver_available

bool xdg_screensaver_available = true
static