howm
howm
xcb_help.c File Reference

The portion of howm that interacts with the X server. Perhaps this could be conditionally included if we decide to use wayland as well. More...

#include <stdlib.h>
#include <string.h>
#include <xcb/randr.h>
#include <xcb/xcb.h>
#include <xcb/xcb_ewmh.h>
#include "client.h"
#include "helper.h"
#include "howm.h"
#include "location.h"
#include "workspace.h"
#include "xcb_help.h"

Functions

void check_other_wm (void)
 Try to detect if another WM exists. More...
 
void move_resize (xcb_window_t win, uint16_t x, uint16_t y, uint16_t w, uint16_t h)
 Change the dimensions and location of a window (win). More...
 
void grab_buttons (client_t *c)
 Make a client listen for button press events. More...
 
void set_border_width (xcb_window_t win, uint16_t w)
 Sets the width of the borders around a window (win). More...
 
void elevate_window (xcb_window_t win)
 Move a window to the front of all the other windows. More...
 
void get_atoms (const char **names, xcb_atom_t *atoms)
 Request all of the atoms that howm supports. More...
 
void focus_window (xcb_window_t win)
 Focus the given window, so long as it isn't already focused. More...
 
void delete_win (xcb_window_t win)
 Ask XCB to delete a window. More...
 
void ewmh_process_wm_state (client_t *c, xcb_atom_t a, int action)
 Handle client messages that are related to WM_STATE. More...
 
void setup_ewmh (void)
 Create the EWMH connection, request all of the atoms and set some sensible defaults for them. More...
 
void setup_ewmh_geom (void)
 
void ewmh_set_current_workspace (void)
 
xcb_randr_output_t * randr_get_outputs (unsigned int *nr_outputs)
 
xcb_rectangle_t output_reply_to_rect (xcb_randr_get_output_info_reply_t *output)
 
xcb_randr_output_t randr_get_primary_output (void)
 
void warp_pointer (int16_t x, int16_t y)
 
void center_pointer (xcb_rectangle_t rect)
 

Detailed Description

The portion of howm that interacts with the X server. Perhaps this could be conditionally included if we decide to use wayland as well.

Author
Harvey Hunt
Date
2015

Function Documentation

void center_pointer ( xcb_rectangle_t  rect)
void check_other_wm ( void  )

Try to detect if another WM exists.

If another WM exists (this can be seen by whether it has registered itself with the X11 server) then howm will exit.

void delete_win ( xcb_window_t  win)

Ask XCB to delete a window.

Parameters
winThe window to be deleted.
void elevate_window ( xcb_window_t  win)

Move a window to the front of all the other windows.

Parameters
winThe window to be moved.
void ewmh_process_wm_state ( client_t c,
xcb_atom_t  a,
int  action 
)

Handle client messages that are related to WM_STATE.

TODO: Add more WM_STATE hints.

Parameters
cThe client that is to have its WM_STATE modified.
aThe atom representing which WM_STATE hint should be modified.
actionWhether to remove, add or toggle the WM_STATE hint.
void ewmh_set_current_workspace ( void  )
void focus_window ( xcb_window_t  win)

Focus the given window, so long as it isn't already focused.

Parameters
winA window that belongs to a client being managed by howm.
void get_atoms ( const char **  names,
xcb_atom_t *  atoms 
)

Request all of the atoms that howm supports.

Parameters
namesThe names of the atoms to be fetched.
atomsWhere the returned atoms will be stored.
void grab_buttons ( client_t c)

Make a client listen for button press events.

Parameters
cThe client that needs to listen for button presses.
void move_resize ( xcb_window_t  win,
uint16_t  x,
uint16_t  y,
uint16_t  w,
uint16_t  h 
)

Change the dimensions and location of a window (win).

Parameters
winThe window upon which the operations should be performed.
xThe new x location of the top left corner.
yThe new y location of the top left corner.
wThe new width of the window.
hThe new height of the window.
xcb_rectangle_t output_reply_to_rect ( xcb_randr_get_output_info_reply_t *  output)
xcb_randr_output_t* randr_get_outputs ( unsigned int *  nr_outputs)
xcb_randr_output_t randr_get_primary_output ( void  )
void set_border_width ( xcb_window_t  win,
uint16_t  w 
)

Sets the width of the borders around a window (win).

Parameters
winThe window that will have its border width changed.
wThe new width of the window's border.
void setup_ewmh ( void  )

Create the EWMH connection, request all of the atoms and set some sensible defaults for them.

void setup_ewmh_geom ( void  )
void warp_pointer ( int16_t  x,
int16_t  y 
)