1 -- {{{ mock notion context
8 function move(ws
, from
, to
)
17 local workspaces1
= {}
18 local workspaces2
= {}
20 geom
= function() return { x
=0, y
=0, w
=1920, h
=1080 } end,
21 name
= function() return "WScreen<1>" end,
22 managed_i
= function(screen
, callback
) iter(workspaces1
, callback
) end,
23 attach
= function(s
, ws
) move(ws
, workspaces2
, workspaces1
); ws
.screen
= firstscreen
end,
24 rqclose
= function() end,
25 mx_count
= function() return #workspaces1
end,
26 id
= function() return 0 end
28 local secondscreen
= {
29 geom
= function() return { x
=0, y
=0, w
=1920, h
=1080 } end,
30 name
= function() return "WScreen" end,
31 managed_i
= function(screen
, callback
) iter(workspaces2
, callback
) end,
32 attach
= function(ws
) move(ws
, workspaces1
, workspaces2
); ws
.screen
= secondscreen
end,
33 rqclose
= function() end,
34 mx_count
= function() return #workspaces2
end,
35 id
= function() return 1 end
38 screen_of
= function() return firstscreen
end,
39 name
= function() return "firstws" end
41 table.insert(workspaces1
, firstws
)
44 screen_of
= function() return secondscreen
end,
45 name
= function() return "secondws" end
47 table.insert(workspaces2
, secondws
)
50 if (o
== firstws
or o
== secondws
) and t
== 'WGroupWS' then return true end
55 get_initial_outputs
= function(ws
)
56 if ws
== firstws
then return { 'VGA1' } end
57 if ws
== secondws
then return { 'VGA1' } end
63 rootwin
= function() end,
64 screens_updated
= function(rootwin
) end,
65 load_module
= function() return 1 end,
66 get_hook
= function() return { add
= function() end; } end,
67 region_i
= function(callback
, type)
68 local next = callback(firstscreen
)
69 if next then callback(secondscreen
) end
71 find_screen_id
= function(screen_id
)
72 if screen_id
== 0 then return firstscreen
74 if screen_id
== 1 then return secondscreen
84 -- all outputs reported by xrander. Notably, the second screen is (now) missing.
85 local all_outputs
= { VGA1
= { x
=0, y
=0, w
=1680, h
=1050, name
='VGA1' } }
87 _G
["mod_xinerama"] = {
88 update_screen
= function() end,
89 query_screens
= function() return { { x
=0, y
=0, w
=1680, h
=1050 } } end
93 get_all_outputs
= function()
101 assert(workspaces2
[1] ~= nil);
104 -- load xrandr module lua code
105 dofile('../mod_xinerama/mod_xinerama.lua')
106 dofile('mod_xrandr.lua')
107 dofile('cfg_xrandr.lua')
109 mod_xrandr
.rearrangeworkspaces(0)
110 assert(nilOrEmpty(workspaces2
));