rofi  1.7.0
xcb.h File Reference
#include <cairo.h>
#include <xcb/xcb.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  X11CursorType { CURSOR_DEFAULT = 0 , CURSOR_POINTER , CURSOR_TEXT , NUM_CURSORS }
 
enum  WindowManagerQuirk { WM_EWHM = 0 , WM_DO_NOT_CHANGE_CURRENT_DESKTOP = 1 , WM_PANGO_WORKSPACE_NAMES = 2 , WM_ROOT_WINDOW_OFFSET = 4 }
 

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)
 
void rofi_xcb_set_input_focus (xcb_window_t w)
 
void rofi_xcb_revert_input_focus (void)
 
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)
 
void x11_set_cursor (xcb_window_t window, X11CursorType type)
 
cairo_surface_t * x11_helper_get_screenshot_surface_window (xcb_window_t window, int size)
 
void cairo_image_surface_blur (cairo_surface_t *surface, double radius, double deviation)
 

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 76 of file xcb.h.

◆ ATOM_ENUM

#define ATOM_ENUM (   x)    x

For getting the atoms in an enum

Definition at line 74 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(WM_TAKE_FOCUS), X(ESETROOT_PMAP_ID)

Atoms we want to pre-load

Definition at line 79 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 1 of file xcb.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

enumeration of the atoms.

Enumerator
EWMH_ATOMS 
NUM_NETATOMS 

Definition at line 85 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

WM_ROOT_WINDOW_OFFSET 

Root window offset (for bspwm)

Definition at line 195 of file xcb.h.

◆ X11CursorType

List of cursor types.

Enumerator
CURSOR_DEFAULT 

Default arrow cursor

CURSOR_POINTER 

Cursor denoting a clickable area

CURSOR_TEXT 

Cursor denoting an input field / selectable text

NUM_CURSORS 

Definition at line 174 of file xcb.h.

Function Documentation

◆ cairo_image_surface_blur()

void cairo_image_surface_blur ( cairo_surface_t *  surface,
double  radius,
double  deviation 
)
Parameters
surface
radius
deviationBlur the content of the surface with radius and deviation.

Definition at line 164 of file xcb.c.

References create_kernel(), TICK, and TICK_N.

Referenced by rofi_view_setup_fake_transparency().

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

◆ 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 937 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(), config_sanity_check(), and rofi_theme_parse_process_conditionals().

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

◆ rofi_xcb_revert_input_focus()

void rofi_xcb_revert_input_focus ( void  )

IF set, revert the focus back to the original applications.

Definition at line 1250 of file xcb.c.

References _xcb_stuff::connection, _xcb_stuff::focus_revert, and xcb.

Referenced by rofi_view_cleanup(), and rofi_view_hide().

Here is the caller graph for this function:

◆ rofi_xcb_set_input_focus()

void rofi_xcb_set_input_focus ( xcb_window_t  w)
Parameters
wrofis window

Stores old input focus for reverting and set focus to rofi.

Definition at line 1227 of file xcb.c.

References config, _xcb_stuff::connection, _xcb_stuff::focus_revert, Settings::steal_focus, and xcb.

Referenced by rofi_view_create().

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 374 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 400 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 1669 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 360 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 334 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:

◆ x11_helper_get_screenshot_surface_window()

cairo_surface_t* x11_helper_get_screenshot_surface_window ( xcb_window_t  window,
int  size 
)
Parameters
windowthe window the screenshot
sizeSize of the thumbnail

Creates a thumbnail of the window.

Returns
NULL if window was not found, or unmapped, otherwise returns a cairo_surface.

Definition at line 273 of file xcb.c.

References _xcb_stuff::connection, lookup_visual(), _xcb_stuff::screen, and xcb.

Here is the call graph for this function:

◆ x11_set_cursor()

void x11_set_cursor ( xcb_window_t  window,
X11CursorType  type 
)
Parameters
window
typeChange mouse cursor

Definition at line 1693 of file xcb.c.

References _xcb_stuff::connection, cursors, NUM_CURSORS, and xcb.

Referenced by rofi_view_set_cursor().

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 1634 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
extern

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

Definition at line 77 of file xcb.c.

Referenced by monitor_active_from_id_focused(), and x11_helper_discover_window_manager().

◆ depth

xcb_depth_t* depth
extern

◆ map

xcb_colormap_t map
extern

Color map to use for creating window

Definition at line 95 of file xcb.c.

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

◆ netatom_names

const char* netatom_names[]
extern

atoms as string

Definition at line 101 of file xcb.c.

Referenced by x11_create_frequently_used_atoms().

◆ netatoms

◆ visual

xcb_visualtype_t* visual
extern

Visual to use for creating window

Definition at line 94 of file xcb.c.

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

◆ xcb