CN113238723A - Dynamic rotation method, device, equipment and medium for display screen - Google Patents

Dynamic rotation method, device, equipment and medium for display screen Download PDF

Info

Publication number
CN113238723A
CN113238723A CN202110360399.4A CN202110360399A CN113238723A CN 113238723 A CN113238723 A CN 113238723A CN 202110360399 A CN202110360399 A CN 202110360399A CN 113238723 A CN113238723 A CN 113238723A
Authority
CN
China
Prior art keywords
screen
display
configuration file
weston
temporary configuration
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110360399.4A
Other languages
Chinese (zh)
Inventor
钟瑞
陈明塑
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fuzhou Zhixiang Information Technology Co ltd
Original Assignee
Fuzhou Zhixiang Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuzhou Zhixiang Information Technology Co ltd filed Critical Fuzhou Zhixiang Information Technology Co ltd
Priority to CN202110360399.4A priority Critical patent/CN113238723A/en
Publication of CN113238723A publication Critical patent/CN113238723A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/1415Digital output to display device ; Cooperation and interconnection of the display device with other functional units with means for detecting differences between the image stored in the host and the images displayed on the displays
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention provides a dynamic rotation method, a device, equipment and a medium of a display screen, wherein the method comprises the following steps: s1, when the system driver detects the screen rotation event, writing the target direction of the screen display into a temporary configuration file; s2, the Weston reads the temporary configuration file at regular time through a timer, whether the target direction written in the temporary configuration file is different from the current screen display direction is judged, if yes, the screen display direction is adjusted to be the target direction in real time, and the Weston window is changed; and S3, the upper-layer application detects that the Weston window is changed, and the position and the direction of the display element are adjusted according to the adjusted screen display direction for displaying. The invention can realize the dynamic rotation of the display screen without restarting the linux system.

Description

Dynamic rotation method, device, equipment and medium for display screen
Technical Field
The invention relates to the technical field of computers, in particular to a dynamic rotation method, a device, equipment and a medium of a display screen.
Background
The next popular Linux display framework is Wayland, which is a set of display servers (Wayland composer) and client communication protocols, and Weston is an open source reference implementation of Wayland, which is responsible for all display-related tasks under the Linux system.
However, when the Linux system detects a screen rotation event, no relevant measures are provided to inform Weston in time, so that Weston cannot know the screen rotation event and respond to the screen rotation event in time, and the Weston cannot know the screen rotation event after the Linux system is restarted, so that the current screen rotation can be effective only by restarting the system. However, in some application scenarios, the direction of the screen display needs to be dynamically switched, and if the screen display needs to be restarted to be effective once for switching, the efficiency is inevitably low, and the user experience is very poor; moreover, the dynamic rotation emphasizes real-time performance, and real dynamic switching cannot be realized if the restart can be effective. Therefore, there is a need for Weston to provide a method that can dynamically switch the display orientation of a screen.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a method, an apparatus, a device and a medium for dynamically rotating a display screen, which can realize the dynamic rotation of the display screen without restarting a linux system.
In a first aspect, the present invention provides a method for dynamically rotating a display screen, comprising the following steps:
s1, when the system driver detects the screen rotation event, writing the target direction of the screen display into a temporary configuration file;
s2, the Weston reads the temporary configuration file at regular time through a timer, whether the target direction written in the temporary configuration file is different from the current screen display direction is judged, if yes, the screen display direction is adjusted to be the target direction in real time, and the Weston window is changed;
and S3, the upper-layer application detects that the Weston window is changed, and the position and the direction of the display element are adjusted according to the adjusted screen display direction for displaying.
In a second aspect, the present invention provides a dynamic rotation device for a display screen, comprising:
the configuration module is used for writing the target direction of the screen display into a temporary configuration file when the system driver detects the screen rotation event;
the read judging module is used for reading the temporary configuration file by the Weston through a timer at regular time, judging whether a target direction written in the temporary configuration file is different from the current screen display direction or not, and if so, sending an adjustment notice;
the screen adjusting module is used for receiving the adjusting notification of the reading judging module and adjusting the screen display direction to be the target direction in real time so as to change the Weston window;
and the element adjusting module is used for displaying after adjusting the position and the direction of the display element according to the adjusted screen display direction when the upper-layer application detects that the Weston window is changed.
In a third aspect, the present invention provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of the first aspect when executing the program.
In a fourth aspect, the invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the method of the first aspect.
One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages: when a system driver detects a screen rotation event of hardware (such as a gyroscope and the like), writing a target direction displayed by a screen into a temporary configuration file; a timer is additionally arranged in Weston, the temporary configuration file is read regularly, so that a screen rotation event can be known timely, the screen display direction can be adjusted according to the latest configuration of the temporary configuration file in real time, specific applications can follow the position and direction of a display element in time, the problem that the screen display direction cannot be dynamically switched under the existing display service is solved, the applications can be dynamically adjusted according to the screen display direction, the display element is better adapted, and great improvement is brought to user experience.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
The invention will be further described with reference to the following examples with reference to the accompanying drawings.
FIG. 1 is a flow chart of a method according to one embodiment of the present invention;
FIG. 2 is a schematic structural diagram of an apparatus according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to a third embodiment of the invention;
fig. 4 is a schematic structural diagram of a medium according to a fourth embodiment of the present invention.
Detailed Description
The embodiment of the application provides a method, a device, equipment and a medium for dynamically rotating a display screen, and the dynamic rotation of the display screen can be realized without restarting a linux system.
The technical scheme in the embodiment of the application has the following general idea: when a system driver detects a screen rotation event of hardware (such as a gyroscope and the like), writing a target direction displayed by a screen into a temporary configuration file; a timer is additionally arranged in Weston, the temporary configuration file is read regularly, so that a screen rotation event can be known timely, the screen display direction can be adjusted according to the latest configuration of the temporary configuration file in real time, specific applications can follow the position and direction of a display element in time, the problem that the screen display direction cannot be dynamically switched under the existing display service is solved, the applications can be dynamically adjusted according to the screen display direction, the display element is better adapted, and great improvement is brought to user experience.
Example one
As shown in fig. 1, the present embodiment provides a dynamic rotation method of a display screen, including the following steps:
s1, when the system driver detects the screen rotation event, writing the target direction of the screen display into a temporary configuration file;
s2, the Weston reads the temporary configuration file at regular time through a timer, whether the target direction written in the temporary configuration file is different from the current screen display direction is judged, if yes, the screen display direction is adjusted to be the target direction in real time, and the Weston window is changed;
and S3, the upper-layer application detects that the Weston window is changed, and the position and the direction of the display element are adjusted according to the adjusted screen display direction for displaying.
The temporary configuration file is/tmp/drm _ weston.
When the upper-layer application is an HTML5 application, the display element is automatically adjusted through the cs configuration. Otherwise, for non-HTML 5 applications, the code of the application program can be modified to allow the application to self-detect whether the Weston window has been changed and to adjust the position and orientation of the display elements for rendering according to the adjusted screen display orientation.
Empirically, it is preferable that the timer has a period of reading the temporary configuration file of 100 ms, so that the Weston burden is not increased due to too high reading frequency, and a part of the screen rotation event is not missed due to too low reading frequency. But it is worth mentioning that: the system usually performs anti-shake processing on the screen rotation event, and if continuous rotation events occur within 100 milliseconds, the processing is performed according to the last state, namely, the target direction of the temporary configuration file at the moment of 100 milliseconds is the last target direction.
Based on the same inventive concept, the application also provides a device corresponding to the method in the first embodiment, which is detailed in the second embodiment.
Example two
As shown in fig. 2, in the present embodiment, there is provided a dynamic rotation device of a display screen, including:
the configuration module is used for writing the target direction of the screen display into a temporary configuration file when the system driver detects the screen rotation event;
the read judging module is used for reading the temporary configuration file by the Weston through a timer at regular time, judging whether a target direction written in the temporary configuration file is different from the current screen display direction or not, and if so, sending an adjustment notice;
the screen adjusting module is used for receiving the adjusting notification of the reading judging module and adjusting the screen display direction to be the target direction in real time so as to change the Weston window;
and the element adjusting module is used for displaying after adjusting the position and the direction of the display element according to the adjusted screen display direction when the upper-layer application detects that the Weston window is changed.
The temporary configuration file is/tmp/drm _ weston.
When the upper-layer application is an HTML5 application, the display element is automatically adjusted through the cs configuration. Otherwise, for non-HTML 5 applications, the code of the application program can be modified to allow the application to self-detect whether the Weston window has been changed and to adjust the position and orientation of the display elements for rendering according to the adjusted screen display orientation.
Empirically, it is preferable that the timer has a period of reading the temporary configuration file of 100 ms, so that the Weston burden is not increased due to too high reading frequency, and a part of the screen rotation event is not missed due to too low reading frequency. But it is worth mentioning that: the system usually performs anti-shake processing on the screen rotation event, and if continuous rotation events occur within 100 milliseconds, the processing is performed according to the last state, namely, the target direction of the temporary configuration file at the moment of 100 milliseconds is the last target direction.
Since the apparatus described in the second embodiment of the present invention is an apparatus used for implementing the method of the first embodiment of the present invention, based on the method described in the first embodiment of the present invention, a person skilled in the art can understand the specific structure and the deformation of the apparatus, and thus the details are not described herein. All the devices adopted in the method of the first embodiment of the present invention belong to the protection scope of the present invention.
Based on the same inventive concept, the application provides an electronic device embodiment corresponding to the first embodiment, which is detailed in the third embodiment.
EXAMPLE III
The embodiment provides an electronic device, as shown in fig. 3, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, any one of the first embodiment modes may be implemented.
Since the electronic device described in this embodiment is a device used for implementing the method in the first embodiment of the present application, based on the method described in the first embodiment of the present application, a specific implementation of the electronic device in this embodiment and various variations thereof can be understood by those skilled in the art, and therefore, how to implement the method in the first embodiment of the present application by the electronic device is not described in detail herein. The equipment used by those skilled in the art to implement the methods in the embodiments of the present application is within the scope of the present application.
Based on the same inventive concept, the application provides a storage medium corresponding to the fourth embodiment, which is described in detail in the fourth embodiment.
Example four
The present embodiment provides a computer-readable storage medium, as shown in fig. 4, on which a computer program is stored, and when the computer program is executed by a processor, any one of the embodiments can be implemented.
The method, the device, the system, the equipment and the medium provided by the embodiment of the application have at least the following technical effects or advantages: when a system driver detects a screen rotation event of hardware (such as a gyroscope and the like), writing a target direction displayed by a screen into a temporary configuration file; a timer is additionally arranged in Weston, the temporary configuration file is read regularly, so that a screen rotation event can be known timely, the screen display direction can be adjusted according to the latest configuration of the temporary configuration file in real time, specific applications can follow the position and direction of a display element in time, the problem that the screen display direction cannot be dynamically switched under the existing display service is solved, the applications can be dynamically adjusted according to the screen display direction, the display element is better adapted, and great improvement is brought to user experience.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus or system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Although specific embodiments of the invention have been described above, it will be understood by those skilled in the art that the specific embodiments described are illustrative only and are not limiting upon the scope of the invention, and that equivalent modifications and variations can be made by those skilled in the art without departing from the spirit of the invention, which is to be limited only by the appended claims.

Claims (10)

1. A dynamic rotation method of a display screen is characterized in that: the method comprises the following steps:
s1, when the system driver detects the screen rotation event, writing the target direction of the screen display into a temporary configuration file;
s2, the Weston reads the temporary configuration file at regular time through a timer, whether the target direction written in the temporary configuration file is different from the current screen display direction is judged, if yes, the screen display direction is adjusted to be the target direction in real time, and the Weston window is changed;
and S3, the upper-layer application detects that the Weston window is changed, and the position and the direction of the display element are adjusted according to the adjusted screen display direction for displaying.
2. The dynamic rotation method of a display screen according to claim 1, wherein: the temporary configuration file is/tmp/drm _ weston.
3. The dynamic rotation method of a display screen according to claim 1, wherein: when the upper-layer application is an HTML5 application, the display element is automatically adjusted through the cs configuration.
4. The dynamic rotation method of a display screen according to claim 1, wherein: the period of the timer for reading the temporary configuration file is 100 milliseconds.
5. The utility model provides a developments rotary device of display screen which characterized in that: the method comprises the following steps:
the configuration module is used for writing the target direction of the screen display into a temporary configuration file when the system driver detects the screen rotation event;
the read judging module is used for reading the temporary configuration file by the Weston through a timer at regular time, judging whether a target direction written in the temporary configuration file is different from the current screen display direction or not, and if so, sending an adjustment notice;
the screen adjusting module is used for receiving the adjusting notification of the reading judging module and adjusting the screen display direction to be the target direction in real time so as to change the Weston window;
and the element adjusting module is used for displaying after adjusting the position and the direction of the display element according to the adjusted screen display direction when the upper-layer application detects that the Weston window is changed.
6. The dynamic rotation device of a display screen of claim 5, wherein: the temporary configuration file is/tmp/drm _ weston.
7. The dynamic rotation device of a display screen of claim 5, wherein: when the upper-layer application is an HTML5 application, the display element is automatically adjusted through the cs configuration.
8. The dynamic rotation device of a display screen of claim 5, wherein: the period of the timer for reading the temporary configuration file is 100 milliseconds.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 4 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 4.
CN202110360399.4A 2021-04-02 2021-04-02 Dynamic rotation method, device, equipment and medium for display screen Pending CN113238723A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110360399.4A CN113238723A (en) 2021-04-02 2021-04-02 Dynamic rotation method, device, equipment and medium for display screen

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110360399.4A CN113238723A (en) 2021-04-02 2021-04-02 Dynamic rotation method, device, equipment and medium for display screen

Publications (1)

Publication Number Publication Date
CN113238723A true CN113238723A (en) 2021-08-10

Family

ID=77130970

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110360399.4A Pending CN113238723A (en) 2021-04-02 2021-04-02 Dynamic rotation method, device, equipment and medium for display screen

Country Status (1)

Country Link
CN (1) CN113238723A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102222129A (en) * 2011-05-11 2011-10-19 烽火通信科技股份有限公司 Method for dynamically reconfiguring simulation environment
CN104199666A (en) * 2014-09-09 2014-12-10 北京京东尚科信息技术有限公司 Dynamic configuration method and device for application program
US20170329483A1 (en) * 2016-05-13 2017-11-16 Sap Se Viewport for multi application user interface
CN110032409A (en) * 2018-12-28 2019-07-19 阿里巴巴集团控股有限公司 A kind of client screen adaptation method, device and electronic equipment
CN110908625A (en) * 2018-09-18 2020-03-24 阿里巴巴集团控股有限公司 Multi-screen display method, device, equipment, system, cabin and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102222129A (en) * 2011-05-11 2011-10-19 烽火通信科技股份有限公司 Method for dynamically reconfiguring simulation environment
CN104199666A (en) * 2014-09-09 2014-12-10 北京京东尚科信息技术有限公司 Dynamic configuration method and device for application program
US20170329483A1 (en) * 2016-05-13 2017-11-16 Sap Se Viewport for multi application user interface
CN110908625A (en) * 2018-09-18 2020-03-24 阿里巴巴集团控股有限公司 Multi-screen display method, device, equipment, system, cabin and storage medium
CN110032409A (en) * 2018-12-28 2019-07-19 阿里巴巴集团控股有限公司 A kind of client screen adaptation method, device and electronic equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
FIREFLY TEAM: ""屏幕方向设置"", 《BUILDROOT 开发手册》 *
ZK00: ""weston的使用"", 《HTTPS://BLOG.CSDN.NET/U012080932/ARTICLE/DETAILS/114373675》 *

Similar Documents

Publication Publication Date Title
CN107704154B (en) Navigation bar transition method and system
WO2016201915A1 (en) Alarm method and apparatus thereof
CN104732486A (en) Picture display method and device
CN109933401B (en) Display method and device of suspended window view
EP3671449A1 (en) Application association for browser
CN113900754A (en) Desktop sharing method and device, computer equipment and storage medium
CN103248749A (en) Method, device and terminal for automatically controlling terminal display scale
CN116091672A (en) Image rendering method, computer device and medium thereof
CN102880391A (en) Display control equipment and method for changing displayed content in browser window
CN113238723A (en) Dynamic rotation method, device, equipment and medium for display screen
EP2608003B1 (en) Method and device for movement of image object
CN103164223B (en) Method of intelligent terminal capable of achieving alarm clock and intelligent terminal under shutdown state
CN112118484B (en) Video bullet screen display method and device, computer equipment and readable storage medium
CA2711874C (en) Aligning animation state update and frame composition
CN105320502A (en) Terminal and multi-window displaying method for terminal
CN107368389B (en) Control method and control device for one-key recovery function of operating system and EMMC
CN105160697A (en) Information processing method and electronic device
CN112241303B (en) Image processing method and system, electronic device and storage medium
CN112118473B (en) Video bullet screen display method and device, computer equipment and readable storage medium
CN112791387A (en) Data processing method, device and medium based on mouse and keyboard
CN105302662B (en) Multi-machine backup method and system
CN106293030B (en) A kind of information processing method and electronic equipment
CN112394893B (en) Visual screen matching method, device and system and computer readable medium
CN114095488B (en) Information processing method, device, client and storage medium
JP3388774B2 (en) Window system and program processing control method therefor

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210810