1# Window Subsystem Changelog 2 3## cl.display.1 Changed the rotation and orientation Attributes of Display Objects 4 5**Access Level** 6 7Public API 8 9**Reason for Change** 10 11There are variations in the alignment of electronic components across different devices such as mobile phones and tablets, and the natural orientation of the sensor does not align with the physical orientation of the screen. As a result, the return values of the **rotation** and **orientation** attributes in the Display object on tablets are different from those on mobile phones. 12 13When both devices are rotated by the same angle, the values obtained from the **rotation** and **orientation** attributes of the Display object are different. Special processing is required based on the device type. 14 15**Change Impact** 16 17This change is a non-compatible change. 18 19After the change, the display orientation on tablets will be changed to be the same as that on mobile phones. 20 21The following show the comparison before and after the change. 22 23| Device Rotation Direction| Tablet Before Change| Tablet After Change| Mobile Phone| 24|---------|---------|---------|---------| 25|  | rotation: 1 <br> orientation: 0 | rotation: 0 <br> orientation: 0 | rotation: 0 <br> orientation: 0 | 26|  | rotation: 2 <br> orientation: 3 | rotation: 1 <br> orientation: 1 |rotation: 1 <br> orientation: 1 | 27|  | rotation: 3 <br> orientation: 2| rotation: 2 <br> orientation: 2 | rotation: 2 <br> orientation: 2 | 28|  | rotation: 0 <br> orientation: 1 | rotation: 3 <br> orientation: 3 | rotation: 3 <br> orientation: 3 | 29 30**Start API Level** 31 327 33 34**Change Since** 35 36OpenHarmony SDK 5.0.2.1 37 38**Key API/Component Changes** 39 40**rotation** and **orientation** attributes of the Display object in the @ohos.display.d.ts file 41 42**Adaptation Guide** 43 44Listen for landscape/portrait mode changes on tablets. 45 46Call **display.on('change')** to listen for display attribute changes and obtain the **rotation** and **orientation** values from the Display object. Determine the landscape or portrait state based on these values for tablets, and pay attention to any changes to these values. 47 48With the charging port facing downward (rotation set at **0**) as the reference point, and rotating the tablet clockwise by 0, 90, 180, and 270 degrees, the correlation between **rotation** and **orientation** values on tablets is detailed in the table below. 49 50|Clockwise Rotation Angle|Value of rotation Before Change | Value of rotation After Change | Value of orientation Before Change | Value of orientation After Change| 51|------- |------- | -------- | --------------- |--------------- | 52|0 |1 | 0 | 0 |0 | 53|90 |2 | 1 | 3 |1 | 54|180 |3 | 2 | 2 |2 | 55|270 |0 | 3 | 1 |3 | 56