Expose XWarpPointer to lua as rootwin:warp_pointer, for region_do_warp_alt
[notion.git] / test / integration / xrandr / 01_remove_display.lua
blobf8a556b6a70f6bf48f662b0a4cdbfcb03489b9d8
1 if not notioncore.find_screen_id(0) then
2 return "Initial number of screens should be 2, first screen not found"
3 elseif not notioncore.find_screen_id(1) then
4 return "Initial number of screens should be 2, second screen not found"
5 elseif notioncore.find_screen_id(2) then
6 return "Initial number of screens should be 2, third screen found"
7 end
9 if notioncore.find_screen_id(0):mx_count() ~= 1 then
10 return "Initial screen 0 should have 1 workspace instead of " .. notioncore.find_screen_id(0):mx_count()
11 end
12 print ('Screen 0: ' .. notioncore.find_screen_id(0):mx_nth(0):name() )
13 if notioncore.find_screen_id(1):mx_count() ~= 1 then
14 return "Initial screen 1 should have 1 workspace instead of " .. notioncore.find_screen_id(1):mx_count()
15 end
16 print ('Screen 1: ' .. notioncore.find_screen_id(1):mx_nth(0):name())
18 os.execute("cp xrandr/fakexinerama-2monitors xrandr/.fakexinerama")
20 print('Updating layout when there is 2 screens present')
21 -- Removing screens happens asynchronously, so we just check we start with 2 screens,
22 -- remove one, and then leave checking that one was removed up to the next test.
23 mod_xrandr.screenlayoutupdated()
25 if notioncore.find_screen_id(0):mx_count() ~= 1 then
26 return "After updating screen 0 should have 1 workspaces instead of " ..
27 notioncore.find_screen_id(0):mx_count() .. ": " .. mx_names(notioncore.find_screen_id(0))
28 end
29 if notioncore.find_screen_id(1):mx_count() ~= 1 then
30 return "After updating screen 1 should have 1 workspace instead of " .. notioncore.find_screen_id(1):mx_count()
31 end
33 print('Removing one screen and updating layout')
34 mod_xrandr_mock.set_number_of_screens(1)
35 mod_xrandr.screenlayoutupdated()
37 return "ok"