rofi  1.5.1
xcb.h File Reference
#include <xcb/xcb.h>
#include <cairo.h>
Include dependency graph for xcb.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _workarea
 

Macros

#define ATOM_ENUM(x)   x
 
#define ATOM_CHAR(x)   # x
 
#define EWMH_ATOMS(X)
 

Typedefs

typedef struct _xcb_stuff xcb_stuff
 
typedef struct _workarea workarea
 

Enumerations

enum  { EWMH_ATOMS =( ATOM_ENUM ), NUM_NETATOMS }
 
enum  WindowManagerQuirk { WM_EWHM = 0, WM_DO_NOT_CHANGE_CURRENT_DESKTOP = 1, WM_PANGO_WORKSPACE_NAMES = 2 }
 

Functions

xcb_window_t xcb_stuff_get_root_window (void)
 
char * window_get_text_prop (xcb_window_t w, xcb_atom_t atom)
 
void window_set_atom_prop (xcb_window_t w, xcb_atom_t prop, xcb_atom_t *atoms, int count)
 
int monitor_active (workarea *mon)
 
cairo_surface_t * x11_helper_get_bg_surface (void)
 
cairo_surface_t * x11_helper_get_screenshot_surface (void)
 
void x11_disable_decoration (xcb_window_t window)
 

Variables

xcb_stuffxcb
 
const char * netatom_names []
 
xcb_atom_t netatoms [NUM_NETATOMS]
 
xcb_depth_t * depth
 
xcb_visualtype_t * visual
 
xcb_colormap_t map
 
WindowManagerQuirk current_window_manager
 

Macro Definition Documentation

◆ ATOM_CHAR

#define ATOM_CHAR (   x)    # x

Get the atoms as strings.

Definition at line 75 of file xcb.h.

◆ ATOM_ENUM

#define ATOM_ENUM (   x)    x

For getting the atoms in an enum

Definition at line 73 of file xcb.h.

◆ EWMH_ATOMS

#define EWMH_ATOMS (   X)
Value:
X ( _NET_WM_WINDOW_OPACITY ), \
X ( I3_SOCKET_PATH ), \
X ( UTF8_STRING ), \
X ( STRING ), \
X ( CLIPBOARD ), \
X ( WM_WINDOW_ROLE ), \
X ( _XROOTPMAP_ID ), \
X ( _MOTIF_WM_HINTS ), \
X ( ESETROOT_PMAP_ID )

Atoms we want to pre-load

Definition at line 78 of file xcb.h.

Typedef Documentation

◆ workarea

typedef struct _workarea workarea

Structure describing a workarea/monitor.

◆ xcb_stuff

typedef struct _xcb_stuff xcb_stuff

xcb data structure type declaration.

Definition at line 37 of file xcb.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

enumeration of the atoms.

Enumerator
EWMH_ATOMS 
NUM_NETATOMS 

Definition at line 90 of file xcb.h.

◆ WindowManagerQuirk

List of window managers that need different behaviour to functioning.

Enumerator
WM_EWHM 

Default EWHM compatible window manager

WM_DO_NOT_CHANGE_CURRENT_DESKTOP 

I3 Window manager

WM_PANGO_WORKSPACE_NAMES 

PANGO WORKSPACE NAMES

Definition at line 168 of file xcb.h.

Function Documentation

◆ monitor_active()

int monitor_active ( workarea mon)
Parameters
monworkarea to be filled in.

Fills in mon with the information about the monitor rofi should show on.

Returns
TRUE if monitor is found, FALSE if no monitor could be detected.

Definition at line 680 of file xcb.c.

References config, mon, Settings::monitor, monitor_active_from_id(), monitor_active_from_winid(), monitor_dimensions(), monitor_get_dimension(), _xcb_stuff::monitors, _workarea::next, and xcb.

Referenced by __create_window(), and config_sanity_check().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ window_get_text_prop()

char* window_get_text_prop ( xcb_window_t  w,
xcb_atom_t  atom 
)
Parameters
wThe xcb_window_t to read property from.
atomThe property identifier

Get text property defined by atom from window. Support utf8.

Returns
a newly allocated string with the result or NULL

Definition at line 151 of file xcb.c.

References _xcb_stuff::connection, netatoms, rofi_latin_to_utf8_strdup(), and xcb.

Referenced by rofi_view_paste().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ window_set_atom_prop()

void window_set_atom_prop ( xcb_window_t  w,
xcb_atom_t  prop,
xcb_atom_t *  atoms,
int  count 
)
Parameters
wThe xcb_window_t to set property on
propAtom of the property to change
atomsList of atoms to change the property too
countThe length of the atoms list.

Set property on window.

Definition at line 176 of file xcb.c.

References _xcb_stuff::connection, count, and xcb.

Referenced by __create_window().

Here is the caller graph for this function:

◆ x11_disable_decoration()

void x11_disable_decoration ( xcb_window_t  window)
Parameters
windowThe X11 window to modify

Set the right hints to disable the window decoration. (Set MOTIF_WM_HINTS, decoration field)

Definition at line 1350 of file xcb.c.

References _xcb_stuff::connection, flags, netatoms, and xcb.

Referenced by __create_window().

Here is the caller graph for this function:

◆ x11_helper_get_bg_surface()

cairo_surface_t* x11_helper_get_bg_surface ( void  )

Gets a surface containing the background image of the desktop.

Returns
a cairo surface with the background image of the desktop.

Definition at line 139 of file xcb.c.

References _xcb_stuff::connection, get_root_pixmap(), netatoms, root_visual, _xcb_stuff::screen, and xcb.

Referenced by rofi_view_setup_fake_transparency().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ x11_helper_get_screenshot_surface()

cairo_surface_t* x11_helper_get_screenshot_surface ( void  )

Gets a surface for the root window of the desktop.

Can be used to take screenshot.

Returns
a cairo surface for the root window of the desktop.

Holds for each supported modifier the possible modifier mask. Check x11_mod_masks[MODIFIER]&mask != 0 to see if MODIFIER is activated.

Definition at line 104 of file xcb.c.

References _xcb_stuff::connection, root_visual, _xcb_stuff::screen, xcb, and xcb_stuff_get_root_window().

Referenced by rofi_view_setup_fake_transparency().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xcb_stuff_get_root_window()

xcb_window_t xcb_stuff_get_root_window ( void  )

Get the root window.

Returns
the root window.

Definition at line 1310 of file xcb.c.

References _xcb_stuff::screen, and xcb.

Referenced by __create_window(), display_late_setup(), lazy_grab_keyboard(), lazy_grab_pointer(), x11_helper_discover_window_manager(), and x11_helper_get_screenshot_surface().

Here is the caller graph for this function:

Variable Documentation

◆ current_window_manager

WindowManagerQuirk current_window_manager

Indicates the current window manager. This is used for work-arounds.

Definition at line 72 of file xcb.c.

Referenced by x11_helper_discover_window_manager().

◆ depth

◆ map

xcb_colormap_t map

Color map to use for creating window

Definition at line 92 of file xcb.c.

Referenced by __create_window(), rofi_view_cleanup(), and x11_create_visual_and_colormap().

◆ netatom_names

const char* netatom_names[]

atoms as string

Definition at line 98 of file xcb.c.

Referenced by x11_create_frequently_used_atoms().

◆ netatoms

◆ visual

xcb_visualtype_t* visual

Visual to use for creating window

Definition at line 91 of file xcb.c.

Referenced by __create_window(), rofi_view_temp_configure_notify(), rofi_view_window_update_size(), and x11_create_visual_and_colormap().

◆ xcb