diff options
author | Vito Caputo <vcaputo@gnugeneration.com> | 2014-09-14 10:30:13 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@gnugeneration.com> | 2014-09-14 10:30:13 -0700 |
commit | 7bcde781975ddf4a5ce266a9214ba26f563ed063 (patch) | |
tree | 46d39444ab8c0e6137c50e5d4f87bad66ae3863d /vwm.h | |
parent | c9554e3a6a27802aea1206ec492727d616f23a0a (diff) |
Import of vwm3 changes from published source tgz
Major changes from vwm2 include:
- Introduction of integrated X client process and descendants
monitoring in the form of per-window composited overlays.
The rendering is done using the Composite, Damage, and Render
extensions. When the monitors are visible, vwm3 is a compositing
manager. When invisible, vwm3 continues to be an immediate-mode
classic X11 minimalist window manager.
Monitors are toggled via Mod1-;, Mod1-LeftArrow and Mod1-RightArrow
may be used to decrease and increase the sampling frequency,
respectively. Mod1-' clears the monitored tasks history for the
focused window when monitoring is visible.
This feature depends on the CONFIG_CHECKPOINT_RESTORE kernel
configuration option for the discovery of descendant processes.
Without this kernel option enabled, you'll only get a single process
monitored per window; the X client process as indicated by the
_NET_WM_PID atom of the window.
A library called libvmon has been introduced for the abstraction of
lightweight system and process statistics sampling.
Since vwm2 received backported features unrelated to monitoring or
compositing while vwm3 was developed, there isn't really much
difference between the two outside the monitoring context.
This isn't to say there isn't much activity in the code, the addition
of compositing and monitoring requires a substantial amount of code
relative to the scale of vwm[12].
Diffstat (limited to 'vwm.h')
-rw-r--r-- | vwm.h | 64 |
1 files changed, 48 insertions, 16 deletions
@@ -8,21 +8,16 @@ #include "list.h" -#define VWM_ERROR(fmt, args...) fprintf(stderr, "%s:%i\t%s() "fmt"\n", __FILE__, __LINE__, __FUNCTION__, ##args) -#define VWM_PERROR(fmt, args...) fprintf(stderr, "%s:%i\t%s() "fmt"; %s\n", __FILE__, __LINE__, __FUNCTION__, ##args, strerror(errno)) -#define VWM_BUG(fmt, args...) fprintf(stderr, "BUG %s:%i\t%s() "fmt"; %s\n", __FILE__, __LINE__, __FUNCTION__, ##args, strerror(errno)) +#define VWM_ERROR(_fmt, _args...) fprintf(stderr, "%s:%i\t%s() "_fmt"\n", __FILE__, __LINE__, __FUNCTION__, ##_args) +#define VWM_PERROR(_fmt, _args...) fprintf(stderr, "%s:%i\t%s() "_fmt"; %s\n", __FILE__, __LINE__, __FUNCTION__, ##_args, strerror(errno)) +#define VWM_BUG(_fmt, _args...) fprintf(stderr, "BUG %s:%i\t%s() "_fmt"; %s\n", __FILE__, __LINE__, __FUNCTION__, ##_args, strerror(errno)) #ifdef TRACE -#define VWM_TRACE(fmt, args...) fprintf(stderr, "%s:%i\t%s() "fmt"\n", __FILE__, __LINE__, __FUNCTION__, ##args) +#define VWM_TRACE(_fmt, _args...) fprintf(stderr, "%s:%i\t%s() "_fmt"\n", __FILE__, __LINE__, __FUNCTION__, ##_args) #else -#define VWM_TRACE(fmt, args...) do { } while(0) +#define VWM_TRACE(_fmt, _args...) do { } while(0) #endif -typedef struct _vwm_box_t { - int x, y; - unsigned int width, height; -} vwm_box_t; - typedef struct _vwm_desktop_t { list_head_t desktops; /* global list of (virtual) desktops */ list_head_t desktops_mru; /* global list of (virtual) desktops in MRU order */ @@ -30,20 +25,57 @@ typedef struct _vwm_desktop_t { struct _vwm_window_t *focused_window; /* the focused window on this virtual desktop */ } vwm_desktop_t; -typedef struct _vwm_window_t { - list_head_t windows; /* global list of managed client windows */ - vwm_desktop_t *desktop; /* desktop this window belongs to currently */ +/* everything needed by the per-window overlay's context */ +typedef struct _vwm_overlay_t { + Pixmap text_pixmap; /* pixmap for overlayed text (kept around for XDrawText usage) */ + Picture text_picture; /* picture representation of text_pixmap */ + Picture shadow_picture; /* text shadow layer */ + Picture grapha_picture; /* graph A layer */ + Picture graphb_picture; /* graph B layer */ + Picture tmp_picture; /* 1 row worth of temporary picture space */ + Picture picture; /* overlay picture derived from the pixmap, for render compositing */ + int width; /* current width of the overlay */ + int height; /* current height of the overlay */ + int phase; /* current position within the (horizontally scrolling) graphs */ + int heirarchy_end; /* row where the process heirarchy currently ends */ + int snowflakes_cnt; /* count of snowflaked rows (reset to zero to truncate snowflakes display) */ + int gen_last_composed; /* the last composed vmon generation */ +} vwm_overlay_t; + +/* every window gets this, even non-managed ones. For compositing vwm must track everything visible, even popup menus. */ +typedef struct _vwm_xwindow_t { + list_head_t xwindows; /* global list of all windows kept in X stacking order */ + + Window id; /* X Window backing this instance */ + XWindowAttributes attrs; /* X window's current attributes, kept up-to-date in handling of ConfigureNotify events */ + Damage damage; /* X damage object associated with the window (for compositing) */ + Picture picture; /* X picture object representing the window (for compositing) */ + Pixmap pixmap; /* X pixmap object representing the window (for compositing) */ + + vmon_proc_t *monitor; /* vmon process monitor handle, may be NULL if for example the X client doesn't supply a PID */ + vwm_overlay_t overlay; /* monitoring overlay state */ + char *name; /* client name */ + unsigned int mapped:1; /* is the window currently mapped (by client) */ + unsigned int occluded:1; /* is the window occluded entirely by another window? (used and valid only during paint_all()) */ + /* if only Xorg could send VisibilityNotify events when requested for redirected windows :( */ + struct _vwm_window_t *managed; /* is the window "managed"? NULL or this points to the managed context of the window */ +} vwm_xwindow_t; - vwm_box_t client; /* box of the client-configured window relative to the root */ - vwm_box_t config; /* box for the current window configuration maintained in handling of ConfigureNotify events */ +/* the managed window we create for every mapped window we actually manage */ +typedef struct _vwm_window_t { + list_head_t windows_mru; /* global list of managed windows kept in MRU order */ + + vwm_xwindow_t *xwindow; /* window being managed */ + vwm_desktop_t *desktop; /* desktop this window belongs to currently */ - Window window; /* the X window being managed by vwm */ + XWindowAttributes client; /* attrs of the client-configured window */ XSizeHints *hints; /* hints the client supplied */ long hints_supplied; /* bitfield reflecting the hints the client supplied */ unsigned int autoconfigured:3; /* autoconfigured window states (none/quarter/half/full/all) */ + unsigned int mapping:1; /* is the window being mapped? (by vwm) */ unsigned int unmapping:1; /* is the window being unmapped? (by vwm) */ unsigned int configuring:1; /* is the window being configured/placed? (by vwm) */ unsigned int shelved:1; /* is the window shelved? */ |