An agricultural machine, such as a rotary swather, comprises an arm (7A) being pivotally connected to a frame (3). A sliding member (15) is connected to the arm (7A) and is displaceable along the arm (7A) in its longitudinal direction. A hydraulic system comprises a first hydraulic cylinder (17) being configured to adjust the position of the sliding member (15) and a second hydraulic cylinder (19) being configured to pivot the arm (7A) relative to the frame (3). A rake rotor (5A) is carried by the sliding member (15). The rake rotor (5A) is displaceable, using the hydraulic system, between a transport position, wherein the arm (7A) extends substantially vertically, and at least one operational position, wherein the arm (7A) protrudes outwards with respect to the frame (3), in particular substantially horizontally. The first hydraulic cylinder (17) and the second hydraulic cylinder (19) are connected to each other in such a manner that when the second hydraulic cylinder (19) is actuated by means of pressurized hydraulic fluid for pivoting the arm (7A) from the transport position towards the operational position, for example the headland position and/or working position, hydraulic fluid discharged from the second hydraulic cylinder (19) is supplied under pressure to the first hydraulic cylinder (17) for displacing the sliding member (15) outwards along the arm (7A) substantially from the start of the pivoting movement of the arm (7A) from the transport position.