3 * By Tomáš Ebenlendr and Arnout Engelen
4 * Based on work by Thomas Themel <themel0r@wannabehacker.com>
5 * Based on the mod_xrandr skeleton
9 This module provides multi-head support to Notion. It uses the Xinerama API,
10 and thus can be used with any X Server that exposes functionality through this
11 API, notably RandR (used by both ATI and nVidia) and TwinView (used by nVidia).
13 (it is based on the module that gave ion3 its Xinerama support back that was
18 1. Edit Makefile to ensure TOPDIR points to your top-level notion source
19 directory with a system.mk that matches the version of notion installed
24 3. Either run (as root)
27 $ mkdir -p ~/.notion/lib
28 $ cp .libs/mod_xinerama.{so,lc} ~/.notion/lib
29 4. Add dopath("mod_xinerama") to ~/.notion/cfg_notion.lua. See below
30 for possible status bar issues.
35 If you don't like current behaviour, you can set up screens differently,
36 by placing following code in cfg_xinerama.lua:
38 local screens = mod_xinerama.query_screens()
41 -- -- now you can edit the 'screens' table in lua,
43 -- local merged_screens = mod_xinerama.merge_contained_screens(screens)
44 -- -- or (current behaviour):
45 -- local merged_screens = mod_xinerama.merge_overlapping_screens(screens)
46 -- -- and finally setup the screens:
47 mod_xinerama.setup_screens(merged_screens)
52 When the screen topology changes, the locations, sizes and mergings of windows
53 may be recalculated. The Xinerama API does not support notifications of
54 topology changes, but these might be received through other means, such as
57 If you're satisfied with the default merge algorithm, you may simply call
58 mod_xinerama.refresh(). If you want to use your own merging algorithm, you
59 may call mod_xinerama.setup_screens(merged_screens) again.
63 For some reason, loading the statusbar module _BEFORE_ the Xinerama module hides
64 the status bar. To work around this, load mod_xinerama before loading the
67 This does not contain the Sun Xinerama support that was in the original ion3
68 because I don't have a machine running Solaris ready. Adding it should be rather
69 trivial with access to the original ion code and a Solaris machine.
71 WRAPPING goto_next_scr/goto_prev_scr
73 Without altering the notion source, it doesn't seem possible to get
74 goto_next_scr/goto_prev_scr to properly wrap around on the last/first screen.
75 This can be worked around in lua, though:
78 scr = ioncore.goto_next_screen()
79 if obj_is(scr, "WRootWin") then
80 ioncore.goto_nth_screen(0)
85 scr = ioncore.goto_prev_screen()
86 if obj_is(scr, "WRootWin") then
87 ioncore.goto_nth_screen(-1)
91 defbindings("WScreen", {
92 bdoc("Go to next/previous screen on multihead setup."),
93 kpress(META.."Shift+comma", "prev_wrap()"),
94 kpress(META.."Shift+period", "next_wrap()"),