Hacking¶
The following information is for people who are interested in subtle's internals and/or like to play around and extend subtle. If you have problems with a certain client or discover an odd behaviour, feel free to add to the blamelist.
- Table of contents
- Hacking
- RDoc documentation
- Unit testing
- Loglevel
- EWMH/ICCCM specifications
- Default
- WM State
- Tray
- _XEMBED
- Subtle extension
- SUBTLE_CLIENT_TAGS
- SUBTLE_CLIENT_GRAVITY
- SUBTLE_CLIENT_FLAGS
- SUBTLE_GRAVITY_NEW
- SUBTLE_GRAVITY_LIST
- SUBTLE_GRAVITY_KILL
- SUBTLE_TAG_NEW
- SUBTLE_TAG_LIST
- SUBTLE_TAG_KILL
- SUBTLE_VIEW_NEW
- SUBTLE_VIEW_TAGS
- SUBTLE_VIEW_ICONS
- SUBTLE_VIEW_KILL
- SUBTLE_SUBLET_UPDATE
- SUBTLE_SUBLET_DATA
- SUBTLE_SUBLET_LIST
- SUBTLE_SUBLET_KILL
- SUBTLE_SCREEN_VIEWS
- SUBTLE_VISIBLE_TAGS
- SUBTLE_VISIBLE_VIEWS
- SUBTLE_RELOAD
- SUBTLE_RESTART
- SUBTLE_QUIT
- SUBTLE_COLORS
- SUBTLE_DATA
RDoc documentation¶
The latest rdoc documention can either be found here or be generated from the source tree:
rake rdoc
Unit testing¶
Testing a window manager is a difficult task, currently the unit tests consist of a bunch of riot contexts and a script to run Xvfb.
Requirements:Run tests:
cd test
ruby ./xserver.rb &
ruby ./test.rb
...
68 passes, 0 failures, 0 errors in 18.540124 seconds
Loglevel¶
subtle uses a loglevel system to distinguish between messages and to be able to turn certain messages off. The level can be set with the -l or --level= options, multiple values are comma separated without any whitespace.
subtle -l ruby,subtlext
subtle --level=ruby,subtlext
Default levels:
Name | Messages |
---|---|
warnings | Warning messages |
sublet | Sublet warnings |
error | Error messages |
deprecated | Deprecation warnings |
Debugging levels:
Name | Messages |
---|---|
events | Information about handled events |
ruby | Ruby debugging messages |
xerror | X11 error messages |
subtle | Subsystem messages of subtle |
debug | General debugging messages |
EWMH/ICCCM specifications¶
Here are all EWMH/NetWM properties listed, that are supported by subtle and subtlext.
Default¶
_NET_NUMBER_OF_DESKTOPS¶
Get the number of views.
_NET_DESKTOP_NAMES¶
Get a list of all view names.
_NET_CURRENT_DESKTOP¶
Change or get current desktop
Root property¶
Get current desktop
Client message¶
Set current desktop
data.l[0] = <View id>
data.l[1] = <Timestamp>
data.l[2] = <Screen id>[1]
data.l[3] = 0
data.l[4] = 0
1 subtle extension (Use -1 to for current screen of view)
_NET_ACTIVE_WINDOW¶
Root property¶
Get current1 active window
1 subtle returns the five recent active windows
Client message¶
Set current active window
data.l[0] = <Window id>
data.l[1] = 0
data.l[2] = 0
data.l[3] = 0
data.l[4] = 0
_NET_RESTACK_WINDOW¶
Change stacking of window
data.l[0] = <Ignored>
data.l[1] = <Client id>
data.l[2] = <Detail>
data.l[3] = 0
data.l[4] = 0
Detail: 0 = Above (raise), 1 = Below (lower)
_NET_MOVERESIZE_WINDOW¶
Resize window
data.l[0] = <Ignored>
data.l[1] = <x>
data.l[2] = <y>
data.l[3] = <width>
data.l[4] = <height>
Move/resize a window.
_NET_CLOSE_WINDOW¶
Close client window
data.l[0] = <Timestamp>
data.l[1] = <Ignored>
data.l[2] = 0
data.l[3] = 0
data.l[4] = 0
Ask subtle to close a window.
WM State¶
Normally there are three types of actions: remove (0), add (1) and toggle (2), but we always toggle the states independent of the supplied action. The second property will be ignored.
_NET_WM_STATE_FULLSCREEN¶
Toggle client fullscreen
data.l[0] = <Action>
data.l[1] = _NET_WM_STATE_FULLSCREEN
data.l[2] = <Ignored>
data.l[3] = 0
data.l[4] = 0
Set fullscreen state of a window.
_NET_WM_STATE_ABOVE¶
Toggle client float
data.l[0] = <Action>
data.l[1] = _NET_WM_STATE_ABOVE
data.l[2] = <Ignored>
data.l[3] = 0
data.l[4] = 0
Set floating state of a window.
_NET_WM_STATE_STICKY¶
Toggle client urgent
data.l[0] = <Action>
data.l[1] = _NET_WM_STATE_STICKY
data.l[2] = <Ignored>
data.l[3] = 0
data.l[4] = 0
Set sticky mode of a window.
_NET_WM_STATE_DEMANDS_ATTENTION¶
Toggle client urgent
data.l[0] = <Action>
data.l[1] = _NET_WM_STATE_DEMANDS_ATTENTION
data.l[2] = <Ignored>
data.l[3] = 0
data.l[4] = 0
Set urgency of a window.
Tray¶
MANAGER¶
Inform clients about a new selection manager.
_NET_SYSTEM_TRAY_OPCODE¶
Used for communication between embedder and client.
_NET_SYSTEM_TRAY_MESSAGE_DATA¶
Used for communication between embedder and client.
_NET_SYSTEM_TRAY_S¶
Screen tray selection.
_XEMBED¶
_XEMBED_INFO¶
XEmbed protocol info.
XEMBED_EMBEDDED_NOTIFY¶
Notification to start embedding cycle.
XEMBED_WINDOW_ACTIVATE¶
NormalState for embedded clients.
XEMBED_WINDOW_DEACTIVATE¶
WithdrawnState for embedded clients.
XEMBED_REQUEST_FOCUS¶
Notification of the client for embedder to pass focus.
XEMBED_FOCUS_IN¶
Notification when client can take focus.
XEMBED_FOCUS_OUT¶
Notification when client lost focus.
Subtle extension¶
SUBTLE_CLIENT_TAGS¶
Set the tags of a client.
data.l[0] = <Client id>
data.l[1] = <Tag bitmask>
data.l[2] = 0
data.l[3] = 0
data.l[4] = 0
SUBTLE_CLIENT_GRAVITY¶
Set client gravity
data.l[0] = <Client id>
data.l[1] = <Gravity id>
data.l[2] = 0
data.l[3] = 0
data.l[4] = 0
SUBTLE_CLIENT_FLAGS¶
Set client flags
data.l[0] = <Client id>
data.l[1] = <Flags>
data.l[2] = 0
data.l[3] = 0
data.l[4] = 0
The bits in flags have the following meaning:
Bit | Description |
---|---|
0 | Fullscreen |
1 | Floating |
2 | Sticky |
3 | Resize |
4 | Urgent |
5 | Zaphod |
6 | Fixed |
7 | Center |
8 | Borderless |
SUBTLE_GRAVITY_NEW¶
Create a new gravity mode
data.b[0-20] = <Gravity x>x<Gravity y>+<Gravity width>+<Gravity height>#<Gravity name>
SUBTLE_GRAVITY_LIST¶
Get a gravity mode list
SUBTLE_GRAVITY_KILL¶
Kill a gravity
data.l[0] = <Gravity id>
data.l[1] = 0
data.l[2] = 0
data.l[3] = 0
data.l[4] = 0
SUBTLE_TAG_NEW¶
Create a new tag
data.b[0-20] = <Tag name>
SUBTLE_TAG_LIST¶
Get a tag list
SUBTLE_TAG_KILL¶
Kill a tag
data.l[0] = <Tag id>
data.l[1] = 0
data.l[2] = 0
data.l[3] = 0
data.l[4] = 0
SUBTLE_VIEW_NEW¶
Create a new view
data.b[0-20] = <View name>
SUBTLE_VIEW_TAGS¶
Root property¶
Get a list of all tags.
Client message¶
Set tags of views.
data.l[0] = <View id>
data.l[1] = <Tag mask>
data.l[2] = 0
data.l[3] = 0
data.l[4] = 0
SUBTLE_VIEW_ICONS¶
Get a list of all view icons.
SUBTLE_VIEW_KILL¶
Kill a view
data.l[0] = <View id>
data.l[1] = 0
data.l[2] = 0
data.l[3] = 0
data.l[4] = 0
SUBTLE_SUBLET_UPDATE¶
Force update of a sublet
data.l[0] = <Sublet id>
data.l[1] = 0
data.l[2] = 0
data.l[3] = 0
data.l[4] = 0
SUBTLE_SUBLET_DATA¶
Set data field of sublet
data.l[0] = <Sublet id>
After receiving of this client message, subtle checkes the SUBTLE_DATA property on the root display and copies the data.
SUBTLE_SUBLET_LIST¶
Get sublet list
SUBTLE_SUBLET_KILL¶
Kill a sublet
data.l[0] = <Sublet id>
data.l[1] = 0
data.l[2] = 0
data.l[3] = 0
data.l[4] = 0
SUBTLE_SCREEN_VIEWS¶
List of views in screen order that are visible.
SUBTLE_VISIBLE_TAGS¶
Bitfield of all visible tags on all screens.
SUBTLE_VISIBLE_VIEWS¶
Bitfield of all visible views on all screens.
SUBTLE_RELOAD¶
Force reload of config and sublets.
data.l[0] = 0
data.l[1] = 0
data.l[2] = 0
data.l[3] = 0
data.l[4] = 0
SUBTLE_RESTART¶
Force full restart.
data.l[0] = 0
data.l[1] = 0
data.l[2] = 0
data.l[3] = 0
data.l[4] = 0
SUBTLE_QUIT¶
Force quit.
data.l[0] = 0
data.l[1] = 0
data.l[2] = 0
data.l[3] = 0
data.l[4] = 0
SUBTLE_COLORS¶
Get a color list.
SUBTLE_DATA¶
Property to exchange data.