Search

US-12619389-B2 - Screen projection display method and system, terminal device, and storage medium

US12619389B2US 12619389 B2US12619389 B2US 12619389B2US-12619389-B2

Abstract

The screen projection display method includes: After receiving screen projection request information sent by a source device, a target device obtains window data of an application enabled by the source device, where the window data includes display content corresponding to at least two windows opened in a same application enabled by the source device; and the target device displays the window data of the enabled application. The target device onto which a screen is to be projected obtains the window data of the application enabled by the source device. The window data not only includes content of a currently visible window on the source device, but also includes content of a window that is enabled by the source device but is invisible. The target device displays the window data on a display interface of the target device.

Inventors

  • Guangjun Chen
  • Bo Wang
  • Pei ZHU
  • Dinggeng Fang
  • Ping Wen
  • Tonggang Wu

Assignees

  • HUAWEI TECHNOLOGIES CO., LTD.

Dates

Publication Date
20260505
Application Date
20210420
Priority Date
20200420

Claims (20)

  1. 1 . A method, applied to a target device, wherein the method comprises: after receiving screen projection request information sent by a source device, obtaining first window data of a first application enabled by the source device, wherein the first window data comprises display content corresponding to two windows opened in the first application enabled by the source device, wherein the two windows comprise a first window and a second window, the first window is a window that has not been displayed on the source device before the first window data is received, the second window is a window that has been displayed on the source device before the first window data is received, the second window is a window displayed on the source device when the first window data is received, and the source device does not display any content of the first window, and wherein in the first window data a window component of the first window is in an active state, a layer of the window component of the first window is in a visible state, a window component of the second window is in the active state, and a layer of the window component of the second window is in the visible state; displaying, on the target device, a third window and a fourth window simultaneously, wherein the third window is used to display window content corresponding to the first window in a first area of a display interface of the target device and the fourth window is used to display window content corresponding to the second window in a second area of the display interface of the target device, and wherein the third window and the fourth window are user-operable windows; and in response to an operation performed on the third window, refreshing, by the target device, the displayed window content of the third window, wherein the refreshing of the displayed window content of the third window does not affect any currently displayed content of the source device; and when a fifth window opened from the third window is detected, adding the fifth window to the second area in the display interface of the target device for display, and closing the fourth window displayed in the display interface; and when a sixth window opened from the fourth window is detected, adding, for display, the sixth window to the second area in the display interface of the target device to cover the fourth window displayed in the display interface.
  2. 2 . The method according to claim 1 , wherein the first window data further comprises application information, window component information and window attribute information, and displaying, on the target device, the third window and the fourth window simultaneously comprises: determining a quantity of to-be-displayed windows, and a size, a display location and a display manner of each to-be-displayed window of the to-be-displayed windows based on the application information, the window component information and the window attribute information that are comprised in the first window data; and displaying, on the target device, the third window and the fourth window simultaneously based on the quantity of to-be-displayed windows, and the size, the display location and the display manner of each to-be-displayed window.
  3. 3 . The method according to claim 2 , wherein after displaying, on the target device, the third window and the fourth window simultaneously, the method further comprises: when a first instruction is detected for performing an operation on a window of the quantity of to-be-displayed windows that have been displayed, obtaining target application information and target window component information that are comprised in window data of the window; and sending the first instruction, the target application information and the target window component information to the source device, to instruct the source device to determine both a to-be-operated target application and a to-be-operated target window based on the target application information and the target window component information, and to perform an operation on the to-be-operated target window in the to-be-operated target application according to the first instruction.
  4. 4 . The method according to claim 1 , wherein after displaying, on the target device, the third window and the fourth window simultaneously, the method further comprises: when detecting that a current display interface of the source device changes, keeping displaying content of the third window and the fourth window on the target device; and after detecting a second instruction for performing an operation on a created and displayed window, sending the second instruction to the source device, to instruct the source device to keep the current display interface unchanged and to perform, according to the second instruction, an operation on a corresponding window running in a background of the source device.
  5. 5 . The method according to claim 1 , wherein all display content of the third window and the fourth window is obtained from the first window data.
  6. 6 . The method according to claim 5 , wherein the first window data is automatically sent by the source device to the target device in response to the source device receiving, from the target device, an acknowledgment of the screen projection request information.
  7. 7 . The method according to claim 5 , wherein the source device processes the first window data to set a layer of a window component of each window in the first window data to be in a visible state.
  8. 8 . A terminal device, comprising a non-transitory memory, at least one processor, and a computer program that is stored in the memory and that is executable by the at least one processor, wherein when executing the computer program, the at least one processor is configured to perform: after receiving screen projection request information sent by a source device, obtaining first window data of a first application enabled by the source device, wherein the first window data comprises display content corresponding to two windows opened in the first application enabled by the source device, the two windows comprise a first window and a second window, the first window is a window that has not been displayed on the source device before the first window data is obtained, the second window is a window that has been displayed on the source device before the first window data is received, the second window is a window displayed on the source device when the first window data is received, and the source device does not display any content of the first window when the first window data is received, and wherein in the first window data a window component of the first window is in an active state, a layer of the window component of the first window is in a visible state, a window component of the second window is in the active state, and a layer of the window component of the second window is in the visible state; displaying a third window and a fourth window simultaneously, wherein the third window is used to display window content corresponding to the first window in a first area of a display interface of a target device and the fourth window is used to display window content corresponding to the second window in a second area of the display interface of the target device, and wherein the third window and the fourth window are user-operable windows; and in response to an operation performed on the third window, refreshing the displayed window content of the third window, wherein the refreshing of the displayed window content of the third window does not affect any currently displayed content of the source device; and when a fifth window opened from the third window is detected, adding the fifth window to the second area in the display interface of the target device for display, and closing the fourth window displayed in the display interface; and when a sixth window opened from the fourth window is detected, adding, for display, the sixth window to the second area in the display interface of the target device to cover the fourth window displayed in the display interface.
  9. 9 . The terminal device according to claim 8 , wherein the first window data further comprises application information, window component information and window attribute information, and displaying the third window and the fourth window simultaneously comprises: determining a quantity of to-be-displayed windows, and a size, a display location and a display manner of each to-be-displayed window of the to-be-displayed windows based on the application information, the window component information and the window attribute information that are comprised in the first window data; and displaying the third window and the fourth window simultaneously based on the quantity of to-be-displayed windows, and the size, the display location and the display manner of each to-be-displayed window.
  10. 10 . The terminal device according to claim 8 , wherein when executing the computer program, the at least one processor is configured to perform: after displaying the third window and the fourth window simultaneously, when a first instruction is detected for performing an operation on a window of the quantity of to-be-displayed windows that have been displayed, obtaining target application information and target window component information that are comprised in window data of the window; and sending the first instruction, the target application information and the target window component information to the source device, to instruct the source device to determine both a to-be-operated target application and a to-be-operated target window based on the target application information and the target window component information, and to perform an operation on the to-be-operated target window in the to-be-operated target application according to the first instruction.
  11. 11 . The terminal device according to claim 8 , wherein when executing the computer program, the at least one processor is configured to perform: after displaying the third window and the fourth window simultaneously, when detecting that a current display interface of the source device changes, keeping displaying content of the third window and the fourth window on the target device; and after detecting a second instruction for performing an operation on a created and displayed window, sending the second instruction to the source device, to instruct the source device to keep the current display interface unchanged and to perform, according to the second instruction, an operation on a corresponding window running in a background of the source device.
  12. 12 . The terminal device according to claim 8 , wherein all display content of the third window and the fourth window is obtained from the first window data.
  13. 13 . The terminal device according to claim 12 , wherein the first window data is automatically sent by the source device to the target device in response to the source device receiving, from the target device, an acknowledgment of the screen projection request information.
  14. 14 . The terminal device according to claim 12 , wherein the source device processes the first window data to set a layer of a window component of each window in the first window data to be in a visible state.
  15. 15 . A method, applied to a system comprising a source device and a target device, the method comprising: sending, by the source device, first window data of a first application enabled by the source device, wherein the first window data comprises display content corresponding to two windows opened in the first application enabled by the source device, the two windows comprise a first window and a second window, the first window is a window that has not been displayed on the source device before the first window data is sent, and the second window is a window that has been displayed on the source device before the first window data is sent, the second window is a window displayed on the source device when the first window data is received, and the source device does not display any content of the first window when the first window data is received, wherein in the first window data a window component of the first window is in an active state, a layer of the window component of the first window is in a visible state, a window component of the second window is in the active state, and a layer of the window component of the second window is in the visible state; and receiving, by the target device, the first window data, and displaying a third window and a fourth window simultaneously, wherein the third window is used to display window content corresponding to the first window in a first area of a display interface of the target device and the fourth window is used to display window content corresponding to the second window in a second area of the display interface of the target device, and wherein the third window and the fourth window are user-operable windows; and in response to an operation performed on the third window, refreshing, by the target device, the displayed window content of the third window, wherein the refreshing of the displayed window content of the third window does not affect any currently displayed content of the source device; and when a fifth window opened from the third window is detected, adding, by the target device, the fifth window to the second area in the display interface of the target device for display, and closing the fourth window displayed in the display interface; and when a sixth window opened from the fourth window is detected, adding, for display by the target device, the sixth window to the second area in the display interface of the target device to cover the fourth window displayed in the display interface.
  16. 16 . The method according to claim 15 , wherein the first window data further comprises application information, window component information and window attribute information, and displaying the third window and the fourth window simultaneously comprises: determining a quantity of to-be-displayed windows, and a size, a display location and a display manner of each to-be-displayed window of the to-be-displayed windows based on the application information, the window component information and the window attribute information that are comprised in the first window data; and displaying the third window and the fourth window simultaneously based on the quantity of to-be-displayed windows, and the size, the display location and the display manner of each to-be-displayed window.
  17. 17 . The method according to claim 15 , further comprising: after displaying the third window and the fourth window simultaneously, when a first instruction is detected for performing an operation on a window of the quantity of to-be-displayed windows that have been displayed, obtaining, by the target device, target application information and target window component information that are comprised in window data of the window; and sending the first instruction, the target application information and the target window component information to the source device, to instruct the source device to determine both a to-be-operated target application and a to-be-operated target window based on the target application information and the target window component information, and to perform an operation on the to-be-operated target window in the to-be-operated target application according to the first instruction.
  18. 18 . The method according to claim 15 , further comprising: after displaying the third window and the fourth window simultaneously, when detecting that a current display interface of the source device changes, keeping displaying content of the third window and the fourth window on the target device; and after detecting a second instruction for performing an operation on a created and displayed window, sending, by the target device, the second instruction to the source device, to instruct the source device to keep the current display interface unchanged and to perform, according to the second instruction, an operation on a corresponding window running in a background of the source device.
  19. 19 . The method according to claim 15 , wherein all display content of the third window and the fourth window is obtained from the first window data.
  20. 20 . The method according to claim 15 , wherein the first window data is automatically sent by the source device to the target device in response to the source device receiving, from the target device, an acknowledgment of screen projection request information.

Description

CROSS-REFERENCE TO RELATED APPLICATIONS This application is a national stage of International Application No. PCT/CN2021/088371, filed on Apr. 20, 2021, which claims priority to Chinese Patent Application No. 202010312360.0, filed on Apr. 20, 2020. Both of the aforementioned applications are hereby incorporated by reference in their entireties. TECHNICAL FIELD This application belongs to the field of terminal control technologies, and in particular, to a screen projection display method and system, a terminal device, and a storage medium. BACKGROUND Screen projection display refers to a method for projecting content on a screen of a source device onto a screen of a target device for display. For example, a user may project an application window on a screen of a mobile phone onto a large-screen television for display, to obtain a clearer and more exquisite picture display effect. Currently, screen projection software such as AirPlay and A powerMirror is usually used to implement screen projection display. However, all the screen projection software is used for screen projection based on content of a window that is on a source device and that is currently visible to a user, and cannot be used for projecting, onto a target device, content of a window that is enabled on the source device but is invisible. SUMMARY In view of this, embodiments of this application provide a screen projection display method and system, a terminal device, and a storage medium, to project content of an invisible window on a source device onto a target device for display. According to a first aspect, an embodiment of this application provides a screen projection display method, applied to a target device onto which a screen is to be projected. The method includes: after screen projection request information sent by a source device is received, obtaining window data of an application enabled by the source device, where the window data includes display content corresponding to at least two windows opened in the same application enabled by the source device; anddisplaying the window data of the enabled application. In this embodiment of this application, the target device onto which a screen is to be projected obtains the window data of the application enabled by the source device. The window data not only includes content of a currently visible window on the source device, but also includes content of a window that is enabled by the source device but is invisible. The target device displays the window data on a display interface of the target device, to implement projection of the content of the invisible window on the source device onto the target device for display. Further, the obtaining window data of an application enabled by the source device may include: obtaining window data of each window opened in the application enabled by the source device, where a window component of each window is in an active state, a layer of each window component is in a visible state, and the window data of each window includes a corresponding window identifier; andthe displaying the window data of the enabled application may include:creating and displaying each window based on the window data of each window and the window identifier included in the window data. Before screen projection display is performed, window components of windows that are in the application of the source device and that have run are preset to be in an active state, and layers of these window components are preset to be in a visible state. Then, the source device sends, to the target device, window data of these windows that have run (which may include a currently visible window on the source device and an invisible window running in a background). The target device can distinguish between window data of different windows based on the window identifiers included in all the window data, to create different windows. In addition, because the window components of these windows are activated and the layers thereof are visible, content of these windows can be displayed on the display interface of the target device, in other words, content of the invisible window on the source device is projected onto the target device for display. Further, the windows include a first window and a second window, the first window is a window that is not currently displayed on the source device, the second window is a window currently displayed on the source device, and the displaying each window may include: determining a first area and a second area from a display interface; andadding the first window to the first area for display, and adding the second window to the second area for display. For example, windows to be displayed on the target device include a window A and a window B. The window A is a window that has run on the source device but is not currently displayed, and the window B is a window that is currently displayed on the source device. In this case, two areas, namely, a left area and a rig