WO2023020152A1 - 窗口管理方法、装置、设备和存储介质 - Google Patents
窗口管理方法、装置、设备和存储介质 Download PDFInfo
- Publication number
- WO2023020152A1 WO2023020152A1 PCT/CN2022/104471 CN2022104471W WO2023020152A1 WO 2023020152 A1 WO2023020152 A1 WO 2023020152A1 CN 2022104471 W CN2022104471 W CN 2022104471W WO 2023020152 A1 WO2023020152 A1 WO 2023020152A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- window
- app
- state
- stack
- manager
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
Definitions
- the present invention relates to the field of computer technology, in particular to a window management method, device, equipment, storage medium, computer program product and computer program.
- the application program APP running the Android system can be supported on the Linux system.
- the Linux window manager when a Linux APP is running, the Linux window manager will generate a window corresponding to the Linux APP; when an Android APP is running, the Android window manager will generate a window corresponding to the Android APP.
- the inventors found that: when the state of the window of the Android application needs to be changed, the window manager of the Android cannot obtain the accurate window state, so that the running state of the Android application cannot be accurately adjusted.
- the present invention provides a window management method, device, equipment, storage medium, computer program product and computer program, which are used to solve the defect in the prior art that the window state is inaccurate, so that the running state of the application cannot be accurately adjusted, and realize the window state. Accurately updated.
- the present invention provides a window management method, which is applied to an electronic device, and the electronic device includes: a first operating system and a second operating system deployed in the first operating system in a containerized manner, and the first operating system includes the first operating system A window manager and the first application program APP, the second operating system includes the second window manager and the second APP, and the method includes:
- the first window manager sends the window state of the window of the second APP to the second window manager, and the window state is used for the second window manager to adjust the window of the window of the second APP state.
- the adjusting the position of the window of the second APP in the window stack includes:
- the adjusting the position of the second APP window in the window stack according to the first window state change indication includes:
- the first window state change indication is used to indicate activation of the window of the second APP, adjusting the position of the window of the second APP in the window stack to the top position of the stack;
- the determining the window state of the window of the second APP according to the adjusted position includes:
- the window state of the window of the second APP is an active state.
- the method further includes:
- the adjusting the position of the window of the second APP in the window stack according to the second window state change indication includes:
- the second window state change indication is used to indicate the creation of a window or the activation of a window, adjusting the position of the window of the second APP in the window stack to a non-stack top position;
- the determining the window state of the window of the second APP according to the adjusted position includes:
- the non-stack top position determine that the window state of the window of the second APP is a suspended state.
- a window management method before adjusting the position of the window of the second APP in the window stack to a non-stack top position, further comprising:
- the second window state change indication is used to indicate the creation of a window, then add the window of the first APP to the stack top position of the window stack, and set the window state of the window of the first APP to an active state ;or,
- the second window state change indication is used to indicate the activation window, adjust the position of the window of the first APP in the window stack to the top position of the stack, and change the window state of the window of the first APP adjusted to be active.
- the adjusting the position of the window of the second APP in the window stack according to the second window state change indication includes:
- the second window state change indication is used to instruct to destroy the window, delete the window of the first APP from the window stack, and determine that the adjusted position of the window of the second APP is the top position of the stack ;
- the determining the window state of the window of the second APP according to the adjusted position includes:
- the adjusting the position of the second APP window in the window stack according to the first window state change indication includes:
- first window state change indication is used to indicate to destroy the window, delete the window of the second APP from the window stack;
- the determining the window state of the window of the second APP according to the adjusted position includes:
- the method further includes:
- the present invention also provides a window management device, which is applied to electronic equipment, and the electronic equipment includes: a first operating system and a second operating system deployed in the first operating system in a containerized manner, and the first operating system includes The first window manager and the first application program APP, the second operating system includes the second window manager and the second APP, and the device includes:
- a processing module configured to adjust the position of the window of the second APP in the window stack when the window state of the window of the second APP needs to be changed;
- the processing module is further configured to determine the window state of the window of the second APP according to the adjusted position;
- a sending module configured to send the window state of the window of the second APP to the second window manager, and the window state is used for the second window manager to adjust the window state of the window of the second APP.
- the present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and operable on the processor.
- the processor executes the program, it implements any of the window management methods described above. A step of.
- the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the window management methods described above are implemented.
- An embodiment of the present invention also provides a computer program product, including a computer program, where the computer program is executed by a processor to implement the steps of any one of the window management methods described above.
- An embodiment of the present invention also provides a computer program, which is executed by a processor to implement the steps of any one of the window management methods described above.
- the window management method, device, equipment, storage medium, computer program product, and computer program provided by the present invention adjust the windows of the second APP in the window stack when the window state of the window of the second APP needs to be changed. position; according to the adjusted position, determine the window state of the window of the second APP; the first window manager sends the window state of the window of the second APP to the second window manager, so that the second APP
- the second window manager can know the window state of the window of the second APP in time, and adjust the window state of the window of the second APP in time, so that the window state of the window of the second APP after adjustment is sent to the first window manager.
- the state of the window of the second APP is consistent, ensuring the accuracy of the window state of the window of the second APP.
- Fig. 1 is one of the schematic diagrams of the window stack provided by the embodiment of the present invention.
- Fig. 2 is the second schematic diagram of the window stack provided by the embodiment of the present invention.
- Fig. 3 is a schematic diagram of window state transition provided by an embodiment of the present invention.
- FIG. 4 is a schematic flowchart of a window management method provided by an embodiment of the present invention.
- FIG. 5 is a schematic diagram of a window hierarchy provided by an embodiment of the present invention.
- FIG. 6 is a schematic diagram of window levels provided by an embodiment of the present invention.
- Fig. 7 is one of the interactive flow diagrams of the window management method provided by the embodiment of the present invention.
- Fig. 8 is the second schematic diagram of the interaction process of the window management method provided by the embodiment of the present invention.
- Fig. 9 is the third schematic diagram of the interaction process of the window management method provided by the embodiment of the present invention.
- Fig. 10 is the fourth schematic diagram of the interaction process of the window management method provided by the embodiment of the present invention.
- Fig. 11 is the fifth schematic diagram of the interaction process of the window management method provided by the embodiment of the present invention.
- Fig. 12 is the sixth schematic diagram of the interaction process of the window management method provided by the embodiment of the present invention.
- Fig. 13 is the seventh schematic diagram of the interaction process of the window management method provided by the embodiment of the present invention.
- Fig. 14 is the eighth schematic diagram of the interaction process of the window management method provided by the embodiment of the present invention.
- Fig. 15 is a schematic structural diagram of a window management device provided by an embodiment of the present invention.
- Fig. 16 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.
- the window task of the application displays the application as a container of the application with a specific width and height.
- Each application can create one or more window tasks for displaying different content.
- the window in the embodiment of the present invention refers to the window task.
- the application's window stack is a container for window tasks. Window tasks are arranged linearly in the window stack according to the time sequence of pushing into the stack.
- the second operating system runs on the first operating system in a containerized manner.
- containerization is LXC implemented on the basis of Linux kernel features, which makes full use of cgroups and Namespace features, isolates processes and resources, and enables efficient and lightweight implementation of the second operating system.
- both the first operating system and the second operating system are operating systems based on Linux Kernel, and the two may be the same, for example, the first operating system and the second operating system are both It is a Linux OS distribution (such as Ubuntu) or both are Android; the two can also be different, for example, one of the first operating system and the second operating system is a Linux OS distribution, and the other is Android (Android).
- Linux OS distribution such as Ubuntu
- Android Android
- the communication and notification between the first operating system and the second operating system can be realized through Socket or through system-level broadcast notification Broadcast or through inter-process communication IPC, etc. .
- Android has multiple derivative versions
- Android (Android) referred to in the present invention covers Android OS and AOSP issued by Google and various derivative systems based on AOSP, such as MIUI, EMUI, One UI, etc. .
- the electronic devices in the embodiments of the present invention include, for example, terminal devices such as mobile phones, tablet computers, notebook computers, and computers.
- the implementation process and principle of the embodiment of the present invention will be described below by taking the first operating system as Linux OS and the second operating system as Android as an example, which is only illustrative and does not specifically limit the present invention.
- the window of the APP in the Android OS is at the top of the window stack, and is in the active position of the window. (Active) state.
- window state becomes as shown in Figure 2
- the window of the APP in the Android OS is covered, and its state should change window suspension (Pause) state by Active originally.
- the window manager of the Android OS does not know that the window of the existing Linux APP 2 covers the window of the APP in the Android OS, resulting in the window state recognized by the window manager in the Android OS and the actual window state that should be adjusted. Inconsistency makes it impossible for the Android system to accurately adjust the running status of applications in the Android OS.
- the state change of the window is shown.
- Window states generally include: active state, suspended state and destroyed state.
- the window state of the window of the application is active; if the Home button is clicked or a new application is started (that is, the application is covered by the new application), the state is changed from the active state to the suspended state; When the task manager pulls up the application or re-enters the application, the state is changed from the suspended state to the active state; if the application is destroyed, the state is changed to the destroyed state.
- the window manager of the APP notifies the window state of the window of the APP, so that the window manager corresponding to the APP can accurately adjust the running state of the APP.
- Fig. 4 is a schematic flowchart of an embodiment of a window management method provided by an embodiment of the present invention.
- the method provided in this embodiment is applied to electronic equipment, and the electronic equipment includes: a first operating system and a second operating system deployed in the first operating system in a containerized manner, the first operating system Including a first window manager and a first application program APP, the second operating system includes a second window manager and a second APP, and the method includes:
- Step 101 When the window state of the window of the second APP needs to be changed, adjust the position of the window of the second APP in the window stack.
- the window of the second APP when the window of the second APP is covered by other windows, or when the window of the second APP is covered, the second APP is activated, or the window of the second APP is destroyed, etc., that is, the window of the second APP
- the state of the window needs to be changed, and the first window manager according to the change instruction for the second APP (for example, the user indicates to activate the second APP, or to create a new window for the second APP, or to delete the window for the second APP) or for other
- the indication of the window is to adjust the position of the window of the second APP in the window stack, for example, adjust the position of the window to the top position of the stack, the bottom position of the stack, or the positions other than the top and bottom of the stack.
- the indication will affect the window status of the current second APP window, for example, indicating that the first APP is activated window, the window of the second APP will be covered, so that the window state of the window of the second APP needs to be changed.
- the window manager generally manages application windows by creating a window stack.
- the level of the window in the window stack depends on the level of the window. As shown in Figure 5, the level of the upper window is generally not less than the level of the lower window.
- the window stack in step 101 is the window stack managed by the first window manager.
- Window levels are generally divided into three categories: application-level windows, sub-window levels, and system-level windows. As shown in FIG. 6 , the window levels from high to low are system-level windows, sub-windows, and application-level windows.
- an application-level window such as a desktop window
- Child windows such as a dialog window popped up by an application.
- System-level windows such as status bars showing signal strength or time or system warning windows, are located relatively high in the window stack, and general application-level windows cannot cover such windows.
- the high-level window will cover the low-level window, that is, in the window stack, the high-level window is in the upper layer of the lower level, for example, the child window is displayed in the upper layer of the application-level window.
- the window of application program 1 is displayed first, and then the window of application program 2 is displayed, then the window of application program 2 is in the upper layer of the window of application program 1 .
- Step 102 Determine the window state of the window of the second APP according to the position of the window of the second APP in the window stack.
- different positions in the window stack may correspond to different window states. For example, if a window is at the top of the window stack, the window state of the window is active. If a window is in the window stack The non-stack position in , for example, is covered by other windows, the window state of the window is paused.
- the first window manager determines the window state of the window of the second APP according to the position of the window of the second APP in the window stack. For example, if the position of the window of the second APP in the window stack is the stack top position, then the window state of the window of the second APP is an active state; if the position of the window of the second APP in the window stack is non-stack top position, the window state of the window of the second APP is in the suspended state, and if the window of the second APP is deleted from the window stack, the window state of the window of the second APP is in the destroyed state.
- Step 103 the first window manager sends the window state of the window of the second APP to the second window manager, and the window state is used by the second window manager to adjust the window state of the window of the second APP.
- the first window manager sends the window state of the window of the second APP to the second window manager
- the second window manager adjusts the window of the second APP according to the window state of the window of the second APP, so that the adjusted window of the second APP
- the window state of the window of the second APP is consistent with the window state sent by the first window manager.
- the first window manager is responsible for managing the states of the windows of the application programs in the first operating system and the second operating system, and manages the windows of each application program through the window stack.
- the Android system cannot accurately distinguish the window state of the APP in the Android OS.
- the message interaction between devices, and the management of windows by using the window stack, realize the accuracy of the window status of the APP in the Android OS throughout the life cycle.
- the interactive process of window state adjustment is shown, and in Figure 7, the first window manager is, for example, the window manager of Linux OS, and the second window manager is, for example, the window manager of Android OS , the first APP is the APP in the Linux OS, and the second APP is the APP in the Android OS.
- the method comprises the steps of:
- Step 1a the first window manager receives the first window state change instruction for the second APP sent by the second window manager;
- the first window manager may also receive a first window state change indication for the second APP sent by the task manager of the first operating system; the indication may be generated based on user input;
- Step 2a the first window manager adjusts the window position of the second APP in the window stack to the top position of the stack;
- Step 3a the first window manager adjusts the window state of the window of the second APP to an active state
- Step 4a the first window manager sends the adjusted window state, that is, the active state, to the second window manager;
- Step 5a the second window manager adjusts the status of the window of the second APP to be in the active status according to the active status sent by the first window manager.
- the second APP is notified to activate the window of the second APP.
- the position of the window of the second APP in the window stack is adjusted; according to the adjusted position, the position of the second APP is determined.
- the window state of the window sending the window state of the window of the second APP to the second window manager, so that the second window manager can know the window state of the window of the second APP in time, and adjust the window state of the second APP in time
- the window state of the window of the second APP makes the adjusted window state of the window of the second APP consistent with the window state sent by the first window manager, so as to ensure the accuracy of the window state of the window of the second APP.
- step 102 may be implemented in the following manner:
- obtaining the first window state change indication for the second APP may be implemented in the following ways:
- a first window state change indication sent by the second window manager is received.
- receiving the first window state change instruction sent by the task manager for example, the task manager receives the user's input, and the input is used to indicate to activate the window of the second APP, or to destroy the window of the second APP;
- Receive the first window state change instruction sent by the second window manager for example, instruct to destroy the window of the second APP, and delete the window of the second APP from the window stack.
- the first window status change indication may carry window attribute information, and the window attribute information includes at least one of the following, for example: window position, window size, or window level.
- the first window state change indication determine the position of the window of the second APP in the window stack, for example, if the first window state change indication is used to indicate to activate the window of the second APP, the window of the second APP is The position in the window stack is adjusted to the top position of the stack.
- the position of the window of the second APP in the window stack is adjusted, so that the window state of the window of the second APP can be adjusted in time to ensure that the window of the second APP The accuracy of the window state.
- acquiring a second window state change indication for the first APP for example, receiving a second window state change indication sent by the task manager of the first operating system.
- window state change indications for other APPs or other windows sent by the second window manager it is also possible to receive window state change indications for other APPs or other windows sent by the second window manager.
- receiving the second window state change instruction sent by the task manager for example, the task manager receives the user's input, and the input is used to indicate to activate the window of the first APP, or to create the window of the first APP (at this time, the second The window of the APP will be covered, and the window state of the window of the second APP is also changed), or the window of the first APP is destroyed.
- the second window state change indication may carry window attribute information, and the window attribute information includes at least one of the following, for example: window position, window size, or window level.
- the second window state change indication determine the position of the window of the second APP in the window stack. For example, if the second window state change indication is used to indicate to activate the window of the first APP, it is assumed that the window of the second APP is In the activated state, the position of the window of the second APP in the window stack is adjusted to a non-stack position, that is, the position of the window of the first APP is exchanged with the position of the window of the second APP, so that the window of the first APP At the top position of the stack, the window state of the window of the second APP is adjusted to a suspended state.
- the window state change indication is used to instruct the window of the first APP to be destroyed, it is assumed that the window of the first APP is at the top of the window stack at this time, and the window of the second APP is at the next layer of the top of the stack. , the window of the first APP is deleted from the window stack, thereby adjusting the position of the window of the second APP in the window stack to the top position of the stack, and at this time, the window state of the window of the second APP is adjusted to the active state.
- the position of the window of the second APP in the window stack is adjusted, so that the window state of the window of the second APP can be adjusted in time to ensure that the window of the second APP The accuracy of the window state.
- step 101 specifically includes:
- the first window state change indication is used to indicate activation of the window of the second APP, adjusting the position of the window of the second APP in the window stack to the top position of the stack;
- Step 102 includes: according to the stack top position, determine that the window state of the window of the second APP is an active state.
- the first window state change indication is used to indicate the activation of the window, that is, the window of the second APP needs to be activated, and at this time, the position of the window of the second APP in the window stack is a non-stack position (window state is in the paused state), that is, it is covered by other windows
- the second window manager adjusts the window of the second APP according to the active state, so that the adjusted window state of the window of the second APP is consistent with the window state sent by the first window manager.
- the method includes the following steps:
- Step 1b the first window manager receives the activation instruction sent by the task manager; the activation instruction is generated based on the user clicking on the window of the second APP;
- Step 2b the first window manager determines the position of the window of the second APP in the window stack
- Step 3b the first window manager places the window of the second APP at the top of the stack
- Step 4b the first window manager adjusts the window state of the window of the second APP to an active state, and notifies the second window manager of the active state;
- Step 5b the second window manager activates the window of the second APP.
- the position of the window of the second APP in the window stack is adjusted to the top position of the stack; and the window state of the window of the second APP is determined to be an active state, so that The window state of the window of the second APP can be adjusted in time to ensure the accuracy of the window state of the window of the second APP.
- the window management method also includes
- the window creation indication is used to indicate the creation of a window of a certain second APP, and may also carry window attribute information of the window of the second APP.
- the window creation process of the second APP is shown, and the method includes the following steps:
- Step 1c the second window manager receives the window creation instruction of the second APP, the window creation instruction is generated based on the first input of the user; the first input is used to instruct the creation of the window of the second APP;
- Step 2c the first window manager receives the window creation instruction of the second APP sent by the second window manager;
- Step 3c the first window manager adds the window of the second APP to the top position of the window stack
- Step 4c the first window manager sets the window state of the window of the second APP to an active state
- Step 5c the first window manager sends the active state of the window of the second APP to the second window manager;
- Step 6c the second window manager notifies the second APP to create a window.
- the window of the second APP in the case of instructing to create a window of the second APP, the window of the second APP is added to the stack top position of the window stack; and the window state of the window of the second APP is set to the active state, and then the second The active status of the window of the APP is sent to the second window manager, so that the second window manager can know the window status of the window of the second APP in time, and adjust the window status of the window of the second APP in time to ensure the window status of the second APP.
- the accuracy of the window state of the window in the case of instructing to create a window of the second APP.
- step 101 specifically includes: when the second window state change indication is used to indicate the creation of a window or the activation of a window, adjusting the position of the window of the second APP in the window stack to a non-stack top position;
- Step 102 includes:
- the window state of the window of the second APP is a suspended state.
- the first window state change indication may indicate to activate or create a window of another APP, or may indicate to activate or create a system window. At this time, the window of the current second APP may be covered.
- the position of the window of the second APP in the window stack is adjusted to a non-stack position, and the window of the second APP is adjusted
- the window state of the window is adjusted to the suspended state.
- the window of the first APP is added to the stack top position of the window stack, and the window state of the window of the first APP is set to an active state;
- the window of the second APP is currently active, and its position in the window stack is the top position of the stack;
- the window of the first APP is added to the top position of the window stack, and the window state of the window of the first APP is set to an active state, at this time, the window of the second APP The position is changed to a non-stack top position, so the window state of the window of the second APP is adjusted to a suspended state.
- FIG. 10 it shows the window creation process of the first APP.
- the window of the second APP has been created, and the window of the first APP will cover the window of the second APP.
- the method includes the following steps:
- Step 1d the first window manager receives a window creation instruction of the first APP; the window instruction may be generated based on user input;
- Step 2d the first window manager adds the window of the first APP to the top position of the window stack
- Step 3d the first window manager sets the window state of the window of the first APP to an active state, and adjusts the window state of the window of the second APP to a suspended state;
- Step 4d the first window manager notifies the second window manager of the pause state of the window of the second APP
- Step 5d the second window manager adjusts the window state of the window of the second APP to make it in a suspended state.
- the second window state change indication is used to indicate activation of the window of the first APP
- the position of the window of the first APP in the window stack is adjusted to the top position of the stack, and the window of the first APP is adjusted
- the window state is adjusted to active state.
- the window of the second APP is currently active, and its position in the window stack is the top position of the stack;
- the position of the window of the first APP is adjusted to the top position of the stack, and the window state of the window of the first APP is set to an active state, at this time, the window of the second APP The position is changed to a non-stack top position, so the window state of the window of the second APP is adjusted to a suspended state.
- FIG. 11 it shows the window activation process of the first APP.
- the window of the second APP has been created and is covered by other windows, for example, it is covered by the window of the second APP.
- the window of the second APP In an active state, the method includes the steps of:
- Step 1e the first window manager receives the activation indication of the first APP sent by the task manager;
- the activation indication is, for example, generated based on the user clicking on the window of the first APP;
- Step 2e the first window manager determines the position of the window of the first APP in the window stack
- Step 3e the first window manager places the window of the first APP at the top of the stack
- Step 4e the first window manager adjusts the window state of the window of the first APP to an active state
- Step 5e the first window manager activates the window of the first APP
- Step 6e the first window manager adjusts the window state of the window of the second APP to a suspended state, and notifies the second window manager of the suspended state;
- Step 7e the second window manager adjusts the window state of the window of the second APP to make it in a suspended state.
- the window of the second APP in the case of instructing to create or activate the window of the first APP, the window of the second APP is adjusted to a non-stack position; and the window state of the window of the second APP is set to a pause state, and then The pause state of the window of the second APP is sent to the second window manager, so that the second window manager can know the window state of the window of the second APP in time, and adjust the window state of the window of the second APP in time to ensure that the second APP The accuracy of the window state of the window.
- step 101 may specifically include:
- the window of the first APP is deleted from the window stack, and the adjusted position of the window of the second APP is determined to be the top position of the stack;
- Step 102 includes:
- the window state of the window of the second APP is an active state.
- the window of the second APP is currently in a paused state, and its position in the window stack is the layer below the top of the stack;
- the window of the first APP is deleted from the window stack, and the window state of the window of the first APP is set to the destroyed state, and the window position of the second APP is changed at this time is the top position of the stack, so the window state of the window of the second APP is adjusted to the active state.
- FIG. 12 it shows the window destruction process of the first APP.
- the window of the second APP has been created and covered by the window of the first APP.
- the window of the second APP is in a suspended state.
- the method includes the following steps:
- Step 1f the first window manager receives a destruction instruction of the first APP from the task manager, the destruction instruction is generated based on user input, for example;
- Step 2f the first window manager deletes the window of the first APP from the window stack, and destroys the window;
- Step 3f the first window manager determines that the window position of the second APP is the stack top position
- Step 4f the first window manager adjusts the window state of the window of the second APP to an active state
- Step 5f the first window manager sends the active state of the window of the second APP to the second window manager;
- Step 6f the first window manager activates the window of the second APP.
- step 101 specifically includes:
- Step 102 includes:
- the window state of the window of the second APP is adjusted to a destroyed state.
- the user wants to close the second APP, for example, the user sends a destruction instruction to the first window manager through the task manager of the first operating system, then delete the window of the second APP in the window stack, and delete its window The state is adjusted to the destroyed state.
- the window destruction process of the second APP is shown.
- the window of the second APP has been created, and the window of the second APP is in a suspended state or an active state.
- the method includes the following steps:
- Step 1g the first window manager receives a destruction instruction of the second APP from the task manager, the destruction instruction is generated based on user input, for example;
- Step 2g the first window manager deletes the window of the first APP from the window stack
- Step 3g the first window manager adjusts the window state of the window of the second APP to a destroyed state
- Step 4g the first window manager sends the destruction state of the window of the second APP to the second window manager;
- Step 5g the first window manager destroys the window of the second APP.
- the window of the second APP in the case of instructing to destroy the window of the second APP, the window of the second APP is deleted from the window stack; and the window state of the window of the second APP is set to the destroyed state, and then The destruction status of the window is sent to the second window manager, so that the second window manager can know the window status of the window of the second APP in time, and adjust the window status of the window of the second APP in time to ensure the window status of the window of the second APP. The accuracy of the window state.
- the method also includes:
- the system window is displayed Add the top position of the window stack, set the window state of the system window to the active state, and at this time, the window of the second APP is not at the top of the stack, and adjust the window state of the window of the second APP to the suspended state.
- the Android system pops up a system dialog box.
- the Android APP has an Application No Response (Application No Response, ANR) error, and the Android system will display the ANR system window.
- ANR Application No Response
- the level of the ANR system window is in Linux
- the hierarchical mapping relationship of the terminal is also at the system window level, so the ANR system window will be displayed on the upper layer of all applications.
- the method comprises the steps of:
- Step 1h the second window manager detects that an ANR error occurs in the second APP
- Step 2h the second window manager processes the ANR
- Step 3h the second window manager destroys the window of the second APP
- Step 4h the second window manager sends an instruction to destroy the window of the second APP to the first window manager, and instructs to display the ANR system window;
- Step 5h the first window manager deletes the window of the second APP from the window stack, and adjusts its window state to a destroyed state;
- Step 6h the first window manager puts the ANR system window at the top of the window stack, and sets its window state to active state.
- the system window when the system window is indicated to be displayed, the system window is added to the top position of the window stack, and the state of the system window is set to an active state, and the window of the second APP is adjusted to a non-stack position; And set the window state of the window of the second APP to the suspended state, and then send the suspended state of the window of the second APP to the second window manager, so that the second window manager can know the window of the window of the second APP in time state, and adjust the window state of the window of the second APP in time to ensure the accuracy of the window state of the window of the second APP.
- the window management device provided by the present invention is described below, and the window management device described below and the window management method described above can be referred to in correspondence with each other.
- Fig. 15 is a schematic structural diagram of a window management device provided by the present invention.
- the window management device provided in this embodiment is applied to electronic equipment, and the electronic equipment includes: a first operating system and a second operating system deployed in the first operating system in a containerized manner, and the first operating system includes a first window The manager and the first application APP, the second operating system includes the second window manager and the second APP, as shown in Figure 15, the device includes:
- the processing module 210 is configured to adjust the position of the window of the second APP in the window stack when the window state of the window of the second APP needs to be changed;
- the processing module 210 is further configured to determine the window state of the window of the second APP according to the adjusted position;
- the sending module 220 is configured to send the window state of the window of the second APP to the second window manager, and the window state is used for the second window manager to adjust the window state of the window of the second APP .
- processing module 210 is specifically configured to:
- processing module 210 is specifically configured to:
- the first window state change indication is used to indicate activation of the window of the second APP, adjusting the position of the window of the second APP in the window stack to the top position of the stack;
- the determining the window state of the window of the second APP according to the adjusted position includes:
- the window state of the window of the second APP is an active state.
- the receiving module 220 is also used for:
- the processing module 210 is further configured to: add the window of the second APP to the top position of the window stack;
- processing module 210 is specifically configured to:
- the second window state change indication is used to indicate the creation of a window or the activation of a window, adjusting the position of the window of the second APP in the window stack to a non-stack top position;
- the determining the window state of the window of the second APP according to the adjusted position includes:
- the non-stack top position determine that the window state of the window of the second APP is a suspended state.
- processing module 210 is further configured to:
- the second window state change indication is used to indicate the creation of a window, then add the window of the first APP to the stack top position of the window stack, and set the window state of the window of the first APP to an active state ;or,
- the second window state change indication is used to indicate the activation window, adjust the position of the window of the first APP in the window stack to the top position of the stack, and change the window state of the window of the first APP adjusted to be active.
- processing module 210 is specifically configured to:
- the second window state change indication is used to instruct to destroy the window, delete the window of the first APP from the window stack, and determine that the adjusted position of the window of the second APP is the top position of the stack ;
- the determining the window state of the window of the second APP according to the adjusted position includes:
- processing module 210 is specifically configured to:
- first window state change indication is used to indicate to destroy the window, delete the window of the second APP from the window stack;
- the determining the window state of the window of the second APP according to the adjusted position includes:
- processing module 210 is further configured to:
- the device in the embodiment of the present invention is used to execute the method in any one of the foregoing method embodiments, and its implementation principle and technical effect are similar, and will not be repeated this time.
- FIG. 16 illustrates a schematic diagram of the physical structure of an electronic device.
- the electronic device may include: a processor (processor) 810, a communication interface (Communications Interface) 820, a memory (memory) 830 and a communication bus 840, Wherein, the processor 810 , the communication interface 820 , and the memory 830 communicate with each other through the communication bus 840 .
- processor processor
- Communication interface Communication interface
- memory memory
- FIG. 16 illustrates a schematic diagram of the physical structure of an electronic device.
- the electronic device may include: a processor (processor) 810, a communication interface (Communications Interface) 820, a memory (memory) 830 and a communication bus 840, Wherein, the processor 810 , the communication interface 820 , and the memory 830 communicate with each other through the communication bus 840 .
- memory memory
- the processor 810 can call the logic instructions in the memory 830 to execute the window management method, the method includes: when the window state of the window of the second APP needs to be changed, adjusting the window stack of the window of the second APP according to the adjusted position, determine the window state of the window of the second APP; the first window manager sends the window state of the window of the second APP to the second window manager, and the window The state is used by the second window manager to adjust the window state of the window of the second APP.
- the above logic instructions in the memory 830 may be implemented in the form of software functional units and when sold or used as an independent product, may be stored in a computer-readable storage medium.
- the essence of the technical solution of the present invention or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present invention.
- the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc., which can store program codes. .
- the present invention also provides a computer program product
- the computer program product includes a computer program stored on a non-transitory computer-readable storage medium
- the computer program includes program instructions, and when the program instructions are executed by a computer
- the computer can execute the window management method provided by the above methods, the method includes: when the window state of the window of the second APP needs to be changed, adjusting the window status of the window of the second APP in the window stack position; according to the adjusted position, determine the window state of the window of the second APP; the first window manager sends the window state of the window of the second APP to the second window manager, and the window state is used Adjust the window state of the window of the second APP in the second window manager.
- the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored.
- the window management methods provided above are implemented, and the method includes: When the window state of the window of the second APP needs to be changed, adjust the position of the window of the second APP in the window stack; according to the adjusted position, determine the window state of the window of the second APP; the first window The manager sends the window state of the window of the second APP to the second window manager, and the window state is used for the second window manager to adjust the window state of the window of the second APP.
- the present invention also provides a computer program, which implements the window management methods provided above when the computer program is executed by a processor, the method includes: when the window state of the window of the second APP needs to be changed , adjust the position of the window of the second APP in the window stack; determine the window state of the window of the second APP according to the adjusted position; the first window manager sends the second window manager to the second window manager A window state of the window of the second APP, where the window state is used by the second window manager to adjust the window state of the window of the second APP.
- the device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without any creative efforts.
- each implementation can be implemented by means of software plus a necessary general hardware platform, and of course also by hardware.
- the essence of the above technical solution or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic discs, optical discs, etc., including several instructions to make a computer device (which may be a personal computer, server, or network device, etc.) execute the methods described in various embodiments or some parts of the embodiments.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
本发明提供一种窗口管理方法、装置、设备、存储介质、计算机程序产品及计算机程序,该方法应用于电子设备,电子设备包括:第一操作系统和以容器化方式部署在第一操作系统中的第二操作系统,第一操作系统包括第一窗口管理器和第一APP,第二操作系统包括第二窗口管理器和第二APP,该方法包括:在第二APP的窗口的窗口状态需要变更的情况下,调整第二APP的窗口在窗口栈中的位置;根据调整后的位置,确定第二APP的窗口的窗口状态;第一窗口管理器向第二窗口管理器发送第二APP的窗口的窗口状态,用于第二窗口管理器调整第二APP的窗口,上述方案中,能够使得该第二APP对应的窗口管理器准确调整该APP的运行状态。
Description
相关申请的交叉引用
本公开要求于2021年08月19日提交的申请号为2021109520088、名称为“窗口管理方法、装置、设备和存储介质”的中国专利申请的优先权,此申请的内容通过引用并入本文。
本发明涉及计算机技术领域,尤其涉及一种窗口管理方法、装置、设备、存储介质、计算机程序产品及计算机程序。
随着计算机技术的发展,为了扩展Linux系统下的应用程序(Application,简称APP),丰富应用环境,Linux系统上可支持运行安卓Android系统的应用程序APP。
目前,Linux APP运行时,Linux的窗口管理器会生成对应Linux APP的窗口;安卓APP运行时,安卓的窗口管理器会生成安卓APP对应的窗口。在实现本发明的过程中发明人发现:在安卓应用的窗口的状态需要变更时,安卓的窗口管理器无法获取到准确的窗口状态,从而无法准确调整安卓应用的运行状态。
发明内容
本发明提供一种窗口管理方法、装置、设备、存储介质、计算机程序产品及计算机程序,用以解决现有技术中窗口状态不准确,从而无法准确调整应用的运行状态的缺陷,实现窗口状态的准确更新。
本发明提供一种窗口管理方法,应用于电子设备,所述电子设备包括:第一操作系统和以容器化方式部署在第一操作系统中的第二操作系统,所述第一操作系统包括第一窗口管理器和第一应用程序APP,第二操作系统包括第二窗口管理器和第二APP,所述方法包括:
在所述第二APP的窗口的窗口状态需要变更的情况下,调整所述第二APP的窗口在窗口栈中的位置;
根据调整后的位置,确定所述第二APP的窗口的窗口状态;
所述第一窗口管理器向所述第二窗口管理器发送所述第二APP的窗口的窗口状态,所述窗口状态用于所述第二窗口管理器调整所述第二APP的窗口的窗口状态。
根据本发明提供的一种窗口管理方法,所述调整所述第二APP的窗口在窗口栈中的位置,包括:
获取针对所述第二APP的第一窗口状态变更指示;
根据所述第一窗口状态变更指示,调整所述第二APP的窗口在所述窗口栈中的位置;或,
获取针对所述第一APP的第二窗口状态变更指示;
根据所述第二窗口状态变更指示,调整所述第二APP的窗口在所述窗口栈中的位置。
根据本发明提供的一种窗口管理方法,所述根据所述第一窗口状态变更指示,调整所述第二APP的窗口在窗口栈中的位置,包括:
在所述第一窗口状态变更指示用于指示激活第二APP的窗口的情况下,将所述第二APP的窗口在所述窗口栈中的位置调整为栈顶位置;
所述根据调整后的位置,确定所述第二APP的窗口的窗口状态,包括:
根据所述栈顶位置,确定所述第二APP的窗口的窗口状态为活跃状态。
根据本发明提供的一种窗口管理方法,所述方法还包括:
接收第二窗口管理器发送的第二APP的窗口创建指示,所述第二APP的窗口创建指示携带所述第二APP的窗口属性信息;
将所述第二APP的窗口加入所述窗口栈的栈顶位置;
将所述第二APP的窗口的窗口状态设置为活跃状态,并将所述第二APP的窗口的活跃状态发送给所述第二窗口管理器。
根据本发明提供的一种窗口管理方法,所述根据所述第二窗口状态变更指示,调整所述第二APP的窗口在窗口栈中的位置,包括:
在所述第二窗口状态变更指示用于指示创建窗口或激活窗口的情况下,将所述第二APP的窗口在所述窗口栈中的位置调整为非栈顶位置;
所述根据调整后的位置,确定所述第二APP的窗口的窗口状态,包括:
根据所述非栈顶位置,确定所述第二APP的窗口的窗口状态为暂停状态。
根据本发明提供的一种窗口管理方法,所述将所述第二APP的窗口在所述窗口栈中的位置调整为非栈顶位置之前,还包括:
若所述第二窗口状态变更指示用于指示创建窗口,则将所述第一APP的窗口加入所述窗口栈的栈顶位置,并将所述第一APP的窗口的窗口状态设置为活跃状态;或,
若所述第二窗口状态变更指示用于指示激活窗口,则将所述第一APP的窗口在所述窗口栈中的位置调整为栈顶位置,并将所述第一APP的窗口的窗口状态调整为活跃状态。
根据本发明提供的一种窗口管理方法,所述根据所述第二窗口状态变更指示,调整所述第二APP的窗口在窗口栈中的位置,包括:
在所述第二窗口状态变更指示用于指示销毁窗口的情况下,将所述第一APP的窗口从所述窗口栈中删除,确定所述第二APP的窗口调整后的位置为栈顶位置;
所述根据调整后的位置,确定所述第二APP的窗口的窗口状态,包括:
确定所述第二APP的窗口的窗口状态为激活状态。
根据本发明提供的一种窗口管理方法,所述根据所述第一窗口状态变更指示,调整所述第二APP的窗口在所述窗口栈中的位置,包括:
在所述第一窗口状态变更指示用于指示销毁窗口的情况下,将所述第二APP的窗口从所述窗口栈中删除;
所述根据调整后的位置,确定所述第二APP的窗口的窗口状态,包括:
将所述第二APP的窗口的窗口状态调整为销毁状态。
根据本发明提供的一种窗口管理方法,所述方法还包括:
在接收到显示系统窗口的指示的情况下,将所述系统窗口加入所述窗口栈的栈顶位置,并将所述系统窗口的状态设置为活跃状态。
本发明还提供一种窗口管理装置,应用于电子设备,所述电子设备包括:第一操作系统和以容器化方式部署在第一操作系统中的第二操作系统,所述第一操作系统包括第一窗口管理器和第一应用程序APP,第二操作系统包括第二窗口管理器和第二APP,所述装置包括:
处理模块,用于在所述第二APP的窗口的窗口状态需要变更的情况下,调整所述第二APP的窗口在窗口栈中的位置;
所述处理模块,还用于根据调整后的位置,确定所述第二APP的窗口的窗口状态;
发送模块,用于向所述第二窗口管理器发送所述第二APP的窗口的窗口状态,所述窗口状态用于所述第二窗口管理器调整所述第二APP的窗口的窗口状态。
本发明还提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上述任一种所述窗口管理方法的步骤。
本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述任一种所述窗口管理方法的步骤。
本发明实施例还提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行以实现如上述任一种所述窗口管理方法的步骤。
本发明实施例还提供一种计算机程序,该计算机程序被处理器执行以实现如上述任一种所述窗口管理方法的步骤。
本发明提供的窗口管理方法、装置、设备、存储介质、计算机程序产品及计算机程序,通过在所述第二APP的窗口的窗口状态需要变更的情况下,调整第二APP的窗口在窗口栈中的位置;根据调整后的位置,确定所述第二APP的窗口的窗口状态;所述第一窗口管理器向所述第二窗口管理器发送所述第二APP的窗口的窗口状态,使得第二窗口管理器可以及时获知到第二APP的窗口的窗口状态,并及时调整所述第二APP的窗口的窗口状态,使得调整后的第二APP的窗口的窗口状态与第一窗口管理器发送的窗口状态一致,保证第二APP的窗口的窗口状态的准确性。
为了更清楚地说明本发明或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本发明实施例提供的窗口栈示意图之一;
图2是本发明实施例提供的窗口栈示意图之二;
图3是本发明实施例提供的窗口状态转换示意图;
图4是本发明实施例提供的窗口管理方法的流程示意图;
图5是本发明实施例提供的窗口层级示意图;
图6是本发明实施例提供的窗口级别示意图;
图7是本发明实施例提供的窗口管理方法的交互流程示意图之一;
图8是本发明实施例提供的窗口管理方法的交互流程示意图之二;
图9是本发明实施例提供的窗口管理方法的交互流程示意图之三;
图10是本发明实施例提供的窗口管理方法的交互流程示意图之四;
图11是本发明实施例提供的窗口管理方法的交互流程示意图之五;
图12是本发明实施例提供的窗口管理方法的交互流程示意图之六;
图13是本发明实施例提供的窗口管理方法的交互流程示意图之七;
图14是本发明实施例提供的窗口管理方法的交互流程示意图之八;
图15是本发明实施例提供的窗口管理装置的结构示意图;
图16是本发明实施例提供的电子设备的结构示意图。
为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明中的附图,对本发明中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
首先,对本发明实施例涉及的部分词汇和应用场景进行介绍。
应用程序的窗口任务,即Task,作为一个特定宽度和高度的、应用程序的容器,显示该应用程序。每个应用程序可以创建一个或者多个窗口任务,用于显示不同的内容。本发明实施例中的窗口即指窗口任务。
应用程序的窗口栈,即Stack,是窗口任务的容器。窗口任务以线性排列的方式,按进栈的时间顺序,排列在窗口栈中。
在本发明的实施例中,第二操作系统以容器化的方式运行在第一操作系统中。如本领域技术人员所知,容器化即以Linux内核特性为基础实现的LXC,其充分利用了cgroups和Namespace特性,隔离进程和资源,使得第二操作系统高效、轻量的实现。
在本发明的实施例中,尽管没有明确描述的,第一操作系统和第二操作系统均为基于Linux Kernel的操作系统,二者可以是相同的,例如第一操作系统和第二操作系统均为Linux OS发行版(如Ubuntu)或均为Android;二者也可以是不同的,例如第一操作系统和第二操作系统中一者为Linux OS发行版,一者为Android(安卓)。
在本发明的实施例中,尽管没有明确描述的,第一操作系统与第二操作系统之间的通讯、通知等可以通过Socket实现或通过系统层面的广播通知Broadcast或通过进程间通讯IPC等实现。
如本领域技术人员所知,Android具有多个衍生版,本发明中所称的Android(安卓)涵盖Google发行的Android OS以及AOSP和基于AOSP的各种衍生系统,如MIUI、EMUI、One UI等。
如本领域技术人员所知,还存在多种其它的基于Linux Kernel的操作系统,如Tizen等,同样适用于本发明的技术方案。
本发明实施例中的电子设备例如包括:手机、平板电脑、笔记本电脑、计算机等终端设备。
为了说明的方便,以下以第一操作系统为Linux OS、第二操作系统为Android为例说明本发明实施例的实现过程和原理,这仅是示意性的,并不对本发明构成特别限定。
针对上述场景,如果先启动Linux OS中的APP(应用程序)1,再启动安卓OS中的APP,则如图1所示,安卓OS中的APP的窗口在窗口栈的栈顶,处于窗口活跃(Active)状态。如果再启动一个Linux OS中的APP 2,则窗口状态变为如图2所示,安卓OS中的APP的窗口被覆盖,其状态原本应该由Active转为窗口暂停(Pause)状态。但在安卓OS的窗口管理器并不知道已经存在Linux APP 2的窗口覆盖了安卓OS中的APP的窗口,造成了安卓OS中的窗口管理器所认知的窗口状态与实际应调整的窗口状态不一致,使得安卓系统无法准确调整安卓OS中的应用的运行状态。
在一实施例中,如图3所示,示出了窗口状态变化情况。
窗口状态一般包括:活跃状态、暂停状态和销毁状态。
例如,针对某个应用,启动应用则该应用的窗口的窗口状态为活跃状态;若点击Home键或启动新应用(即该应用被新应用覆盖),则由活跃状态变更为暂停状态;若通过任务管理器拉升 该应用或重入该应用,则由暂停状态变更为活跃状态;若销毁该应用则变更为销毁状态。
本发明实施例的窗口管理方法的技术构思如下:
在APP的窗口的窗口状态需要变更时,确定APP的窗口在窗口栈中的位置,例如需要调整该窗口在窗口栈中的位置,并基于该位置确定APP的窗口的窗口状态;向该APP对应的窗口管理器通知该APP的窗口的窗口状态,使得该APP对应的窗口管理器能够准确调整该APP的运行状态。
下面结合图1-图14以具体的实施例对本发明的技术方案进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例不再赘述。
图4是本发明实施例提供的窗口管理方法一实施例的流程示意图。如图4所示,本实施例提供的方法,应用于电子设备,所述电子设备包括:第一操作系统和以容器化方式部署在第一操作系统中的第二操作系统,第一操作系统包括第一窗口管理器和第一应用程序APP,第二操作系统包括第二窗口管理器和第二APP,所述方法包括:
步骤101、在第二APP的窗口的窗口状态需要变更的情况下,调整第二APP的窗口在窗口栈中的位置。
例如,第二APP的窗口被其他窗口覆盖,或者第二APP的窗口在被覆盖的情况下激活该第二APP,或者销毁该第二APP的窗口等等情况下,即第二APP的窗口的窗口状态需要变更,第一窗口管理器根据针对该第二APP的变更指示(例如用户指示激活该第二APP,或新建该第二APP的窗口,或删除该第二APP的窗口)或者针对其他窗口的指示,调整该第二APP的窗口在窗口栈中的位置,例如是将该窗口的位置调整位于栈顶位置、栈底位置,或,非栈顶和栈底位置等。
可选地,针对其他窗口的指示,例如针对其他第一APP的窗口的指示,或针对系统窗口的指示,该指示会影响当前第二APP的窗口的窗口状态,例如,指示激活第一APP的窗口,则会覆盖该第二APP的窗口,使得第二APP的窗口的窗口状态需要变更。
窗口管理器一般通过创建窗口栈来管理应用的窗口,窗口在窗口栈的层级,决定于该窗口的级别,如图5所示,上层的窗口的级别一般不小于下层的窗口的级别。
其中,步骤101中的窗口栈为第一窗口管理器管理的窗口栈。
窗口级别一般分三类:应用程序级窗口、子窗口级别和系统级窗口。如图6所示,窗口级别从高到低依次为系统级窗口、子窗口、应用程序级窗口。
示例性的,应用程序级窗口,如桌面窗口,一般为层级最低的窗口,处于窗口栈的底端,其他级别窗口都可以覆盖它。
子窗口,如一个应用程序弹出的对话框窗口。
系统级窗口,如显示信号强度或时间的状态条或系统警告窗口,处于窗口栈相对高的位置,一般的应用程序级窗口不可覆盖这类窗口。
高级别窗口会覆盖低级别窗口,即在窗口栈中,高级别窗口处于低级别的上层,例如子窗口显示在应用程序级窗口的上层。
对于同级别窗口,例如先显示应用程序1的窗口,再显示应用程序2的窗口,则应用程序2的窗口处于应用程序1的窗口的上层。
步骤102、根据第二APP的窗口在窗口栈中的位置,确定第二APP的窗口的窗口状态。
具体的,在窗口栈中不同的位置,可能对应不同的窗口状态,例如,如果某个窗口处于窗口栈中的栈顶位置,则该窗口的窗口状态为活跃状态,如果某个窗口处于窗口栈中的非栈顶位置, 例如被其他窗口覆盖,则该窗口的窗口状态为暂停状态。
第一窗口管理器根据该第二APP的窗口在窗口栈中的位置,确定第二APP的窗口的窗口状态。例如,若该第二APP的窗口在窗口栈中的位置为栈顶位置,则该第二APP的窗口的窗口状态为活跃状态,若该第二APP的窗口在窗口栈中的位置为非栈顶位置,则该第二APP的窗口的窗口状态为暂停状态,若该第二APP的窗口从窗口栈中删除,则该第二APP的窗口的窗口状态为销毁状态。
步骤103、第一窗口管理器向第二窗口管理器发送第二APP的窗口的窗口状态,窗口状态用于第二窗口管理器调整第二APP的窗口的窗口状态。
具体的,第一窗口管理器向第二窗口管理器发送第二APP的窗口的窗口状态,第二窗口管理器根据第二APP的窗口的窗口状态调整第二APP的窗口,使得调整后的第二APP的窗口的窗口状态与第一窗口管理器发送的窗口状态一致。
本发明实施例中,第一窗口管理器负责管理第一操作系统和第二操作系统内的应用程序的窗口的状态,通过窗口栈对各个应用程序的窗口进行管理。
在出现Linux OS中的APP和安卓OS中的APP同时运行时,安卓系统无法准确分辨安卓OS中的APP的窗口状态,本发明实施例的方法通过Linux OS的窗口管理器与安卓OS的窗口管理器之间的消息交互,以及利用窗口栈对窗口的管理,实现安卓OS中的APP在整个生命周期内窗口状态的准确性。
示例性的,如图7所示,示出了窗口状态调整的交互流程,图7中第一窗口管理器例如为Linux OS的窗口管理器,第二窗口管理器例如为安卓OS的窗口管理器,第一APP为Linux OS中的APP,第二APP为安卓OS中的APP。
该方法包括如下步骤:
步骤1a、第一窗口管理器接收第二窗口管理器发送的针对第二APP的第一窗口状态变更指示;
在其他实施例中,第一窗口管理也可以接收第一操作系统的任务管理器发送的针对第二APP的第一窗口状态变更指示;该指示可以是基于用户的输入生成的;
步骤2a、第一窗口管理器调整窗口栈中该第二APP的窗口位置为栈顶位置;
步骤3a、第一窗口管理器将该第二APP的窗口的窗口状态调整为活跃状态;
步骤4a、第一窗口管理器向第二窗口管理器发送调整后的窗口状态,即活跃状态;
步骤5a、第二窗口管理器根据第一窗口管理器发送的活跃状态,调整该第二APP的窗口的状态,使其处于活跃状态。
例如,通知第二APP激活该第二APP的窗口。
本实施例的方法,通过在所述第二APP的窗口的窗口状态需要变更的情况下,调整第二APP的窗口在窗口栈中的位置;根据调整后的位置,确定所述第二APP的窗口的窗口状态;向所述第二窗口管理器发送所述第二APP的窗口的窗口状态,使得第二窗口管理器可以及时获知到第二APP的窗口的窗口状态,并及时调整所述第二APP的窗口的窗口状态,使得调整后的第二APP的窗口的窗口状态与第一窗口管理器发送的窗口状态一致,保证第二APP的窗口的窗口状态的准确性。
在一实施例中,步骤102可以通过如下方式实现:
一种实现方式:
获取针对第二APP的窗口的第一窗口状态变更指示;
根据第一窗口状态变更指示,调整第二APP的窗口在窗口栈中的位置。
可选地,获取针对第二APP的第一窗口状态变更指示,可以通过如下几种方式实现:
接收第一操作系统的任务管理器发送的第一窗口状态变更指示;或,
接收第二窗口管理器发送的第一窗口状态变更指示。
其中,接收任务管理器发送的第一窗口状态变更指示,例如任务管理器接收到用户的输入,该输入用于指示激活该第二APP的窗口,或销毁该第二APP的窗口;
接收第二窗口管理器发送的第一窗口状态变更指示,例如,指示销毁该第二APP的窗口,从窗口栈中删除该第二APP的窗口。
第一窗口状态变更指示,可以携带窗口属性信息,窗口属性信息例如包括以下至少一项:窗口位置、窗口大小或窗口层级等。
根据第一窗口状态变更指示,确定该第二APP的窗口在窗口栈中的位置,例如,若第一窗口状态变更指示用于指示激活第二APP的窗口,则将该第二APP的窗口在窗口栈中的位置调整为栈顶位置。
上述实施方式中,根据针对第二APP的窗口的窗口状态变更指示,调整第二APP的窗口在窗口栈中的位置,使得能够及时调整第二APP的窗口的窗口状态,保证第二APP的窗口的窗口状态的准确性。
另一种实现方式:
获取针对所述第一APP的第二窗口状态变更指示;
根据所述第二窗口状态变更指示,调整所述第二APP的窗口在所述窗口栈中的位置。
可选地,获取针对第一APP的第二窗口状态变更指示,例如接收第一操作系统的任务管理器发送的第二窗口状态变更指示。
可选地,在其他实施例中,还可以接收第二窗口管理器发送的这对其他APP或其他窗口的窗口状态变更指示。
其中,接收任务管理器发送的第二窗口状态变更指示,例如任务管理器接收到用户的输入,该输入用于指示激活该第一APP的窗口,或创建第一APP的窗口(此时第二APP的窗口会被覆盖,第二APP的窗口的窗口状态也变更),或销毁该第一APP的窗口。
第二窗口状态变更指示,可以携带窗口属性信息,窗口属性信息例如包括以下至少一项:窗口位置、窗口大小或窗口层级等。
根据第二窗口状态变更指示,确定该第二APP的窗口在窗口栈中的位置,例如,若第二窗口状态变更指示用于指示激活第一APP的窗口,假设此时第二APP的窗口为激活状态,则将该第二APP的窗口在窗口栈中的位置调整为非栈顶位置,即将第一APP的窗口的位置与该第二APP的窗口的位置进行交换,使得第一APP的窗口处于栈顶位置,第二APP的窗口的窗口状态调整为暂停状态。
例如,若第二窗口状态变更指示用于指示销毁第一APP的窗口,假设此时第一APP的窗口位于窗口栈中的栈顶位置,第二APP的窗口位于该栈顶位置的下一层,则将第一APP的窗口从窗口栈中删除,从而将该第二APP的窗口在窗口栈中的位置调整为栈顶位置,此时第二APP的窗口的窗口状态调整为激活状态。
上述实施方式中,根据针对第一APP的窗口的窗口状态变更指示,调整第二APP的窗口在窗口栈中的位置,使得能够及时调整第二APP的窗口的窗口状态,保证第二APP的窗口的窗口状态的准确性。
在一实施例中,步骤101具体包括:
在第一窗口状态变更指示用于指示激活第二APP的窗口的情况下,将所述第二APP的窗口在所述窗口栈中的位置调整为栈顶位置;
步骤102包括:根据所述栈顶位置,确定所述第二APP的窗口的窗口状态为活跃状态。
具体的,在第一窗口状态变更指示用于指示激活窗口的情况下,即需要激活该第二APP的窗口,此时第二APP的窗口在窗口栈中的位置为非栈顶位置(窗口状态为暂停状态),即被其他窗口覆盖,则将第二APP的窗口在窗口栈中的位置调整为栈顶位置,将窗口状态由暂停状态调整为活跃状态,将该活跃状态发送给第二窗口管理器,第二窗口管理器根据该活跃状态调整第二APP的窗口,使得调整后的第二APP的窗口的窗口状态与第一窗口管理器发送的窗口状态一致。
示例性的,如图8所示,该方法包括如下步骤:
步骤1b、第一窗口管理器接收任务管理器发送的激活指示;该激活指示是基于用户点击第二APP的窗口生成的;
步骤2b、第一窗口管理器确定窗口栈中该第二APP的窗口的位置;
步骤3b、第一窗口管理器将该第二APP的窗口的置于栈顶位置;
步骤4b、第一窗口管理器将该第二APP的窗口的窗口状态调整为活跃状态,并向第二窗口管理器通知该活跃状态;
步骤5b、第二窗口管理器激活该第二APP的窗口。
上述实施方式中,在指示激活第二APP的窗口的情况下,将第二APP的窗口在窗口栈中的位置调整为栈顶位置;并确定第二APP的窗口的窗口状态为活跃状态,使得能够及时调整第二APP的窗口的窗口状态,保证第二APP的窗口的窗口状态的准确性。
在一实施例中,该窗口管理方法还包括
接收第二窗口管理器发送的第二APP的窗口创建指示,第二APP的窗口创建指示携带所述第二APP的窗口属性信息;
将第二APP的窗口加入所述窗口栈的栈顶位置;
将第二APP的窗口的窗口状态设置为活跃状态,并将第二APP的窗口的活跃状态发送给第二窗口管理器。
具体的,窗口创建指示,用于指示创建某个第二APP的窗口,还可以携带该第二APP的窗口的窗口属性信息。
将第二APP的窗口加入窗口栈的栈顶位置,对应的窗口状态设置为活跃状态,并将该第二APP的窗口的活跃状态发送给所述第二窗口管理器,使得第二窗口管理器通知第二APP创建对应的窗口。
示例性的,如图9所示,示出了第二APP的窗口创建过程,该方法包括如下步骤:
步骤1c、第二窗口管理器接收第二APP的窗口创建指示,该窗口创建指示是基于用户的第一输入生成的;所述第一输入用于指示创建第二APP的窗口;
步骤2c、第一窗口管理器接收第二窗口管理器发送的第二APP的窗口创建指示;
步骤3c、第一窗口管理器将第二APP的窗口加入窗口栈中栈顶位置;
步骤4c、第一窗口管理器将第二APP的窗口的窗口状态设置为活跃状态;
步骤5c、第一窗口管理器向第二窗口管理器发送该第二APP的窗口的活跃状态;
步骤6c、第二窗口管理器通知该第二APP创建窗口。
上述实施方式中,在指示创建第二APP的窗口的情况下,将第二APP的窗口加入窗口栈的 栈顶位置;并将第二APP的窗口的窗口状态设置为活跃状态,进而将第二APP的窗口的活跃状态发送给第二窗口管理器,使得第二窗口管理器可以及时获知到第二APP的窗口的窗口状态,并及时调整第二APP的窗口的窗口状态,保证第二APP的窗口的窗口状态的准确性。
在一实施例中,步骤101具体包括:在第二窗口状态变更指示用于指示创建窗口或激活窗口的情况下,将第二APP的窗口在窗口栈中的位置调整为非栈顶位置;
步骤102包括:
根据非栈顶位置,确定第二APP的窗口的窗口状态为暂停状态。
具体的,第一窗口状态变更指示可以指示激活或创建其他APP的窗口,还可以指示激活或创建系统窗口。此时可能会覆盖当前第二APP的窗口。
若第二APP的窗口在窗口栈中的当前位置为栈顶位置(对应活跃状态),则将第二APP的窗口在窗口栈中的位置调整为非栈顶位置,并将第二APP的窗口的窗口状态调整为暂停状态。
在一实施例中,步骤“将第二APP的窗口在所述窗口栈中的位置调整为非栈顶位置”之前,还可以执行如下几种方案:
方案一
若第二窗口状态变更指示用于指示创建第一APP的窗口,则将第一APP的窗口加入窗口栈的栈顶位置,并将第一APP的窗口的窗口状态设置为活跃状态;
具体的,假设当前第二APP的窗口为活跃状态,在窗口栈中的位置为栈顶位置;
若接收到创建第一APP的窗口的指示,则将该第一APP的窗口加入窗口栈的栈顶位置,并将第一APP的窗口的窗口状态设置为活跃状态,此时第二APP的窗口位置变更为非栈顶位置,因此将第二APP的窗口的窗口状态调整为暂停状态。
示例性的,如图10所示,示出了第一APP的窗口创建过程,此时第二APP的窗口已创建,第一APP的窗口会覆盖第二APP的窗口,在图9的基础上,该方法包括如下步骤:
步骤1d、第一窗口管理器接收第一APP的窗口创建指示;该窗口窗口指示可以是基于用户的输入生成的;
步骤2d、第一窗口管理器将第一APP的窗口加入窗口栈中栈顶位置;
步骤3d、第一窗口管理器将第一APP的窗口的窗口状态设置为活跃状态,并将第二APP的窗口的窗口状态调整为暂停状态;
步骤4d、第一窗口管理器向第二窗口管理器通知该第二APP的窗口的暂停状态;
步骤5d、第二窗口管理器调整该第二APP的窗口的窗口状态,使其处于暂停状态。
方案二
若第二窗口状态变更指示用于指示激活第一APP的窗口,则将所述第一APP的窗口在所述窗口栈中的位置调整为栈顶位置,并将所述第一APP的窗口的窗口状态调整为活跃状态。
具体的,假设当前第二APP的窗口为活跃状态,在窗口栈中的位置为栈顶位置;
若接收到激活第一APP的窗口的指示,则将该第一APP的窗口的位置调整为栈顶位置,并将第一APP的窗口的窗口状态设置为活跃状态,此时第二APP的窗口位置变更为非栈顶位置,因此将第二APP的窗口的窗口状态调整为暂停状态。
示例性的,如图11所示,示出了第一APP的窗口激活过程,此时第二APP的窗口已创建,被其他窗口覆盖,例如被第二APP的窗口覆盖,第二APP的窗口处于激活状态,该方法包括如下步骤:
步骤1e、第一窗口管理器接收任务管理器发送的第一APP的激活指示;该激活指示例如是 基于用户点击第一APP的窗口生成的;
步骤2e、第一窗口管理器确定窗口栈中该第一APP的窗口的位置;
步骤3e、第一窗口管理器将该第一APP的窗口的置于栈顶位置;
步骤4e、第一窗口管理器将该第一APP的窗口的窗口状态调整为活跃状态;
步骤5e、第一窗口管理器激活该第一APP的窗口;
步骤6e、第一窗口管理器将该第二APP的窗口的窗口状态调整为暂停状态,并向第二窗口管理器通知该暂停状态;
步骤7e、第二窗口管理器调整该第二APP的窗口的窗口状态,使其处于暂停状态。
上述实施方式中,在指示创建或激活第一APP的窗口的情况下,将第二APP的窗口调整为非栈顶位置;并将第二APP的窗口的窗口状态设置为暂停状态,进而将第二APP的窗口的暂停状态发送给第二窗口管理器,使得第二窗口管理器可以及时获知到第二APP的窗口的窗口状态,并及时调整第二APP的窗口的窗口状态,保证第二APP的窗口的窗口状态的准确性。
在一实施例中,步骤101具体可以包括:
在第二窗口状态变更指示用于指示销毁第一APP的窗口的情况下,将第一APP的窗口从窗口栈中删除,确定第二APP的窗口调整后的位置为栈顶位置;
步骤102包括:
确定第二APP的窗口的窗口状态为激活状态。
具体的,假设当前第二APP的窗口为暂停状态,在窗口栈中的位置为栈顶位置的下一层;
若接收到销毁第一APP的窗口的指示,则将该第一APP的窗口从窗口栈中删除,并将第一APP的窗口的窗口状态设置为销毁状态,此时第二APP的窗口位置变更为栈顶位置,因此将第二APP的窗口的窗口状态调整为活跃状态。
示例性的,如图12所示,示出了第一APP的窗口销毁过程,此时第二APP的窗口已创建,被该第一APP的窗口覆盖,第二APP的窗口处于暂停状态,该方法包括如下步骤:
步骤1f、第一窗口管理器接收来自任务管理器的第一APP的销毁指示,该销毁指示例如是基于用户的输入生成的;
步骤2f、第一窗口管理器将该第一APP的窗口从窗口栈中删除,并销毁该窗口;
步骤3f、第一窗口管理器确定该第二APP的窗口位置为栈顶位置;
步骤4f、第一窗口管理器将第二APP的窗口的窗口状态调整为活跃状态;
步骤5f、第一窗口管理器向第二窗口管理器发送该第二APP的窗口的活跃状态;
步骤6f、第一窗口管理器激活该第二APP的窗口。
上述实施方式中,在指示销毁第一APP的窗口的情况下,将第二APP的窗口调整为栈顶位置;并将第二APP的窗口的窗口状态设置为活跃状态,进而将第二APP的窗口的活跃状态发送给第二窗口管理器,使得第二窗口管理器可以及时获知到第二APP的窗口的窗口状态,并及时调整第二APP的窗口的窗口状态,保证第二APP的窗口的窗口状态的准确性。
在一实施例中,步骤101具体包括:
在第一窗口状态变更指示用于指示删除窗口的情况下,将第二APP的窗口从窗口栈中删除;
步骤102包括:
将第二APP的窗口的窗口状态调整为销毁状态。
具体的,若用户想要关闭第二APP,例如用户通过第一操作系统的任务管理器向第一窗口管理器发送销毁指示,则在窗口栈中删除该第二APP的窗口,并将其窗口状态调整为销毁状态。
示例性的,如图13所示,示出了第二APP的窗口销毁过程,此时第二APP的窗口已创建,第二APP的窗口处于暂停状态或活跃状态,该方法包括如下步骤:
步骤1g、第一窗口管理器接收来自任务管理器的第二APP的销毁指示,该销毁指示例如是基于用户的输入生成的;
步骤2g、第一窗口管理器将该第一APP的窗口从窗口栈中删除;
步骤3g、第一窗口管理器将第二APP的窗口的窗口状态调整为销毁状态;
步骤4g、第一窗口管理器向第二窗口管理器发送该第二APP的窗口的销毁状态;
步骤5g、第一窗口管理器销毁该第二APP的窗口。
上述实施方式中,在指示销毁第二APP的窗口的情况下,将第二APP的窗口从窗口栈中删除;并将第二APP的窗口的窗口状态设置为销毁状态,进而将第二APP的窗口的销毁状态发送给第二窗口管理器,使得第二窗口管理器可以及时获知到第二APP的窗口的窗口状态,并及时调整第二APP的窗口的窗口状态,保证第二APP的窗口的窗口状态的准确性。
在一实施例中,该方法还包括:
在接收到显示系统窗口的指示的情况下,将系统窗口加入窗口栈的栈顶位置,并将系统窗口的状态设置为活跃状态。
具体的,假设此时第二APP的窗口为活跃状态,处于窗口栈的栈顶位置,系统窗口的级别高于应用程序APP的窗口,在接收到显示系统窗口的指示的情况下,将系统窗口加入窗口栈的栈顶位置,将系统窗口的窗口状态设置为活跃状态,此时第二APP的窗口位于非栈顶位置,调整第二APP的窗口的窗口状态为暂停状态。
示例性的,如图14所示,安卓系统弹出系统对话框,如,安卓APP发生应用无响应(Application No Response,ANR)错误,安卓系统会显示ANR系统窗口,该ANR系统窗口的层级在Linux端的层级映射关系中也处于系统窗口层级,所以该ANR系统窗口将显示在所有应用的上层。
该方法包括如下步骤:
步骤1h、第二窗口管理器检测到第二APP出现ANR错误;
步骤2h、第二窗口管理器处理ANR;
步骤3h、第二窗口管理器销毁第二APP的窗口;
步骤4h、第二窗口管理器向第一窗口管理器发送第二APP的窗口的销毁指示,并指示显示ANR系统窗口;
步骤5h、第一窗口管理器将该第二APP的窗口从窗口栈中删除,并调整其窗口状态为销毁状态;
步骤6h、第一窗口管理器将该ANR系统窗口置于窗口栈的栈顶位置,并将其窗口状态设置为活跃状态。
上述实施方式中,在指示显示系统窗口的情况下,将系统窗口加入窗口栈的栈顶位置,并将系统窗口的状态设置为活跃状态,并将第二APP的窗口调整为非栈顶位置;并将第二APP的窗口的窗口状态设置为暂停状态,进而将第二APP的窗口的暂停状态发送给第二窗口管理器,使得第二窗口管理器可以及时获知到第二APP的窗口的窗口状态,并及时调整第二APP的窗口的窗口状态,保证第二APP的窗口的窗口状态的准确性。
下面对本发明提供的窗口管理装置进行描述,下文描述的窗口管理装置与上文描述的窗口管理方法可相互对应参照。
图15是本发明提供的窗口管理装置的结构示意图。本实施例提供的窗口管理装置,应用于 电子设备,所述电子设备包括:第一操作系统和以容器化方式部署在第一操作系统中的第二操作系统,第一操作系统包括第一窗口管理器和第一应用程序APP,第二操作系统包括第二窗口管理器和第二APP,如图15所示,所述装置包括:
处理模块210,用于在所述第二APP的窗口的窗口状态需要变更的情况下,调整所述第二APP的窗口在窗口栈中的位置;
所述处理模块210,还用于根据调整后的位置,确定所述第二APP的窗口的窗口状态;
发送模块220,用于向所述第二窗口管理器发送所述第二APP的窗口的窗口状态,所述窗口状态用于所述第二窗口管理器调整所述第二APP的窗口的窗口状态。
可选地,所述处理模块210,具体用于:
获取针对所述第二APP的第一窗口状态变更指示;
根据所述第一窗口状态变更指示,调整所述第二APP的窗口在所述窗口栈中的位置;或,
获取针对所述第一APP的第二窗口状态变更指示;
根据所述第二窗口状态变更指示,调整所述第二APP的窗口在所述窗口栈中的位置。
可选地,所述处理模块210,具体用于:
在所述第一窗口状态变更指示用于指示激活第二APP的窗口的情况下,将所述第二APP的窗口在所述窗口栈中的位置调整为栈顶位置;
所述根据调整后的位置,确定所述第二APP的窗口的窗口状态,包括:
根据所述栈顶位置,确定所述第二APP的窗口的窗口状态为活跃状态。
可选地,所述接收模块220还用于:
接收第二窗口管理器发送的第二APP的窗口创建指示,所述第二APP的窗口创建指示携带所述第二APP的窗口属性信息;
所述处理模块210还用于:将所述第二APP的窗口加入所述窗口栈的栈顶位置;
将所述第二APP的窗口的窗口状态设置为活跃状态,并将所述第二APP的窗口的活跃状态发送给所述第二窗口管理器。
可选地,所述处理模块210具体用于:
在所述第二窗口状态变更指示用于指示创建窗口或激活窗口的情况下,将所述第二APP的窗口在所述窗口栈中的位置调整为非栈顶位置;
所述根据调整后的位置,确定所述第二APP的窗口的窗口状态,包括:
根据所述非栈顶位置,确定所述第二APP的窗口的窗口状态为暂停状态。
可选地,所述处理模块210还用于:
若所述第二窗口状态变更指示用于指示创建窗口,则将所述第一APP的窗口加入所述窗口栈的栈顶位置,并将所述第一APP的窗口的窗口状态设置为活跃状态;或,
若所述第二窗口状态变更指示用于指示激活窗口,则将所述第一APP的窗口在所述窗口栈中的位置调整为栈顶位置,并将所述第一APP的窗口的窗口状态调整为活跃状态。
可选地,所述处理模块210具体用于:
在所述第二窗口状态变更指示用于指示销毁窗口的情况下,将所述第一APP的窗口从所述窗口栈中删除,确定所述第二APP的窗口调整后的位置为栈顶位置;
所述根据调整后的位置,确定所述第二APP的窗口的窗口状态,包括:
确定所述第二APP的窗口的窗口状态为激活状态。
可选地,所述处理模块210具体用于:
在所述第一窗口状态变更指示用于指示销毁窗口的情况下,将所述第二APP的窗口从所述窗口栈中删除;
所述根据调整后的位置,确定所述第二APP的窗口的窗口状态,包括:
将所述第二APP的窗口的窗口状态调整为销毁状态。
可选地,所述处理模块210还用于:
在接收到显示系统窗口的指示的情况下,将所述系统窗口加入所述窗口栈的栈顶位置,并将所述系统窗口的状态设置为活跃状态。
本发明实施例的装置,其用于执行前述任一方法实施例中的方法,其实现原理和技术效果类似,此次不再赘述。
图16示例了一种电子设备的实体结构示意图,如图16所示,该电子设备可以包括:处理器(processor)810、通信接口(Communications Interface)820、存储器(memory)830和通信总线840,其中,处理器810,通信接口820,存储器830通过通信总线840完成相互间的通信。处理器810可以调用存储器830中的逻辑指令,以执行窗口管理方法,该方法包括:在所述第二APP的窗口的窗口状态需要变更的情况下,调整所述第二APP的窗口在窗口栈中的位置;根据调整后的位置,确定所述第二APP的窗口的窗口状态;第一窗口管理器向所述第二窗口管理器发送所述第二APP的窗口的窗口状态,所述窗口状态用于所述第二窗口管理器调整所述第二APP的窗口的窗口状态。
此外,上述的存储器830中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
另一方面,本发明还提供一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,计算机能够执行上述各方法所提供的窗口管理方法,该方法包括:在所述第二APP的窗口的窗口状态需要变更的情况下,调整所述第二APP的窗口在窗口栈中的位置;根据调整后的位置,确定所述第二APP的窗口的窗口状态;第一窗口管理器向所述第二窗口管理器发送所述第二APP的窗口的窗口状态,所述窗口状态用于所述第二窗口管理器调整所述第二APP的窗口的窗口状态。
又一方面,本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现上述各提供的窗口管理方法,该方法包括:在所述第二APP的窗口的窗口状态需要变更的情况下,调整所述第二APP的窗口在窗口栈中的位置;根据调整后的位置,确定所述第二APP的窗口的窗口状态;第一窗口管理器向所述第二窗口管理器发送所述第二APP的窗口的窗口状态,所述窗口状态用于所述第二窗口管理器调整所述第二APP的窗口的窗口状态。
又一方面,本发明还提供一种计算机程序,该计算机程序被处理器执行时实现上述各提供的窗口管理方法,该方法包括:在所述第二APP的窗口的窗口状态需要变更的情况下,调整所述第二APP的窗口在窗口栈中的位置;根据调整后的位置,确定所述第二APP的窗口的窗口状态;第一窗口管理器向所述第二窗口管理器发送所述第二APP的窗口的窗口状态,所述窗口状态用于所述第二窗口管理器调整所述第二APP的窗口的窗口状态。
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也 可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。
Claims (14)
- 一种窗口管理方法,其特征在于,应用于电子设备,所述电子设备包括:第一操作系统和以容器化方式部署在第一操作系统中的第二操作系统,所述第一操作系统包括第一窗口管理器和第一APP,第二操作系统包括第二窗口管理器和第二APP,所述方法包括:在所述第二APP的窗口的窗口状态需要变更的情况下,调整所述第二APP的窗口在窗口栈中的位置;根据调整后的位置,确定所述第二APP的窗口的窗口状态;所述第一窗口管理器向所述第二窗口管理器发送所述第二APP的窗口的窗口状态,所述窗口状态用于所述第二窗口管理器调整所述第二APP的窗口的窗口状态。
- 根据权利要求1所述的方法,其特征在于,所述调整所述第二APP的窗口在窗口栈中的位置,包括:获取针对所述第二APP的第一窗口状态变更指示;根据所述第一窗口状态变更指示,调整所述第二APP的窗口在所述窗口栈中的位置;或,获取针对所述第一APP的第二窗口状态变更指示;根据所述第二窗口状态变更指示,调整所述第二APP的窗口在所述窗口栈中的位置。
- 根据权利要求2所述的方法,其特征在于,所述根据所述第一窗口状态变更指示,调整所述第二APP的窗口在窗口栈中的位置,包括:在所述第一窗口状态变更指示用于指示激活第二APP的窗口的情况下,将所述第二APP的窗口在所述窗口栈中的位置调整为栈顶位置;所述根据调整后的位置,确定所述第二APP的窗口的窗口状态,包括:根据所述栈顶位置,确定所述第二APP的窗口的窗口状态为活跃状态。
- 根据权利要求3所述的方法,其特征在于,所述方法还包括:接收第二窗口管理器发送的第二APP的窗口创建指示,所述第二APP的窗口创建指示携带所述第二APP的窗口属性信息;将所述第二APP的窗口加入所述窗口栈的栈顶位置;将所述第二APP的窗口的窗口状态设置为活跃状态,并将所述第二APP的窗口的活跃状态发送给所述第二窗口管理器。
- 根据权利要求2所述的方法,其特征在于,所述根据所述第二窗口状态变更指示,调整所述第二APP的窗口在窗口栈中的位置,包括:在所述第二窗口状态变更指示用于指示创建窗口或激活窗口的情况下,将所述第二APP的窗口在所述窗口栈中的位置调整为非栈顶位置;所述根据调整后的位置,确定所述第二APP的窗口的窗口状态,包括:根据所述非栈顶位置,确定所述第二APP的窗口的窗口状态为暂停状态。
- 根据权利要求5所述的方法,其特征在于,所述将所述第二APP的窗口在所述窗口栈中的位置调整为非栈顶位置之前,还包括:若所述第二窗口状态变更指示用于指示创建窗口,则将所述第一APP的窗口加入所述窗口栈的栈顶位置,并将所述第一APP的窗口的窗口状态设置为活跃状态;或,若所述第二窗口状态变更指示用于指示激活窗口,则将所述第一APP的窗口在所述窗口栈中的位置调整为栈顶位置,并将所述第一APP的窗口的窗口状态调整为活跃状态。
- 根据权利要求2所述的方法,其特征在于,所述根据所述第二窗口状态变更指示,调整所述第二APP的窗口在窗口栈中的位置,包括:在所述第二窗口状态变更指示用于指示销毁窗口的情况下,将所述第一APP的窗口从所述窗口栈中删除,确定所述第二APP的窗口调整后的位置为栈顶位置;所述根据调整后的位置,确定所述第二APP的窗口的窗口状态,包括:确定所述第二APP的窗口的窗口状态为激活状态。
- 根据权利要求2所述的方法,其特征在于,所述根据所述第一窗口状态变更指示,调整所述第二APP的窗口在所述窗口栈中的位置,包括:在所述第一窗口状态变更指示用于指示销毁窗口的情况下,将所述第二APP的窗口从所述窗口栈中删除;所述根据调整后的位置,确定所述第二APP的窗口的窗口状态,包括:将所述第二APP的窗口的窗口状态调整为销毁状态。
- 根据权利要求1至8中任一项所述的方法,其特征在于,所述方法还包括:在接收到显示系统窗口的指示的情况下,将所述系统窗口加入所述窗口栈的栈顶位置,并将所述系统窗口的状态设置为活跃状态。
- 一种窗口管理装置,其特征在于,应用于电子设备,所述电子设备包括:第一操作系统和以容器化方式部署在第一操作系统中的第二操作系统,所述第一操作系统包括第一窗口管理器和第一应用程序APP,第二操作系统包括第二窗口管理器和第二APP,所述装置包括:处理模块,用于在所述第二APP的窗口的窗口状态需要变更的情况下,调整所述第二APP的窗口在窗口栈中的位置;所述处理模块,还用于根据调整后的位置,确定所述第二APP的窗口的窗口状态;发送模块,用于向所述第二窗口管理器发送所述第二APP的窗口的窗口状态,所述窗口状态用于所述第二窗口管理器调整所述第二APP的窗口的窗口状态。
- 一种电子设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现如权利要求1至9中任一项所述窗口管理方法的步骤。
- 一种非暂态计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至9中任一项所述窗口管理方法的步骤。
- 一种计算机程序产品,其特征在于,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,所述计算机程序被处理器执行以实现如权利要求1至9中任一项所述窗口管理方法的步骤。
- 一种计算机程序,其特征在于,所述计算机程序被处理器执行以实现如权利要求1至9中任一项所述窗口管理方法的步骤。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110952008.8 | 2021-08-19 | ||
| CN202110952008.8A CN113407293B (zh) | 2021-08-19 | 2021-08-19 | 窗口管理方法、装置、设备和存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2023020152A1 true WO2023020152A1 (zh) | 2023-02-23 |
Family
ID=77688799
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2022/104471 Ceased WO2023020152A1 (zh) | 2021-08-19 | 2022-07-07 | 窗口管理方法、装置、设备和存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN113407293B (zh) |
| WO (1) | WO2023020152A1 (zh) |
Families Citing this family (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113407293B (zh) * | 2021-08-19 | 2021-11-09 | 北京鲸鲮信息系统技术有限公司 | 窗口管理方法、装置、设备和存储介质 |
| CN114281491A (zh) * | 2021-11-08 | 2022-04-05 | 北京鲸鲮信息系统技术有限公司 | 应用栈管理方法、装置、电子设备和存储介质 |
| CN114090172B (zh) * | 2021-11-10 | 2024-06-18 | 北京字节跳动网络技术有限公司 | 跨系统的小部件复用方法及装置 |
| CN113986446B (zh) * | 2021-12-23 | 2022-05-20 | 北京麟卓信息科技有限公司 | 一种安卓运行环境内安卓应用窗口的缩放优化方法 |
| CN116107575B (zh) * | 2023-04-13 | 2023-07-04 | 麒麟软件有限公司 | 一种窗口管理器 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102063302A (zh) * | 2010-12-20 | 2011-05-18 | 北京握奇数据系统有限公司 | 窗口管理方法、系统及终端 |
| US20120117495A1 (en) * | 2010-10-01 | 2012-05-10 | Imerj, Llc | Dragging an application to a screen using the application manager |
| CN112269604A (zh) * | 2020-11-11 | 2021-01-26 | 北京技德系统技术有限公司 | 在Linux上兼容运行Android应用的窗口交互方法及装置 |
| CN112363783A (zh) * | 2020-10-26 | 2021-02-12 | 广州视源电子科技股份有限公司 | 窗口切换方法、装置、介质以及交互平板 |
| CN113407293A (zh) * | 2021-08-19 | 2021-09-17 | 北京鲸鲮信息系统技术有限公司 | 窗口管理方法、装置、设备和存储介质 |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2004310655A (ja) * | 2003-04-10 | 2004-11-04 | Matsushita Electric Ind Co Ltd | ウィンドウスタック制御方法 |
| CN107291319A (zh) * | 2016-03-31 | 2017-10-24 | 阿里巴巴集团控股有限公司 | 一种窗口显示方法、信息交互方法及系统 |
| CN107508961A (zh) * | 2017-06-26 | 2017-12-22 | 努比亚技术有限公司 | 一种活动窗口启动方法、终端及计算机可读存储介质 |
| CN107329721A (zh) * | 2017-06-30 | 2017-11-07 | 联想(北京)有限公司 | 显示方法、电子设备以及计算机可读存储介质 |
-
2021
- 2021-08-19 CN CN202110952008.8A patent/CN113407293B/zh active Active
-
2022
- 2022-07-07 WO PCT/CN2022/104471 patent/WO2023020152A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20120117495A1 (en) * | 2010-10-01 | 2012-05-10 | Imerj, Llc | Dragging an application to a screen using the application manager |
| CN102063302A (zh) * | 2010-12-20 | 2011-05-18 | 北京握奇数据系统有限公司 | 窗口管理方法、系统及终端 |
| CN112363783A (zh) * | 2020-10-26 | 2021-02-12 | 广州视源电子科技股份有限公司 | 窗口切换方法、装置、介质以及交互平板 |
| CN112269604A (zh) * | 2020-11-11 | 2021-01-26 | 北京技德系统技术有限公司 | 在Linux上兼容运行Android应用的窗口交互方法及装置 |
| CN113407293A (zh) * | 2021-08-19 | 2021-09-17 | 北京鲸鲮信息系统技术有限公司 | 窗口管理方法、装置、设备和存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN113407293B (zh) | 2021-11-09 |
| CN113407293A (zh) | 2021-09-17 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2023020152A1 (zh) | 窗口管理方法、装置、设备和存储介质 | |
| US11740943B2 (en) | Techniques for managing long-running tasks with a declarative provisioner | |
| CN109976667B (zh) | 一种镜像管理方法、装置及系统 | |
| CN110780930B (zh) | 启动Android系统的方法、装置、电子设备及存储介质 | |
| US10579442B2 (en) | Inversion-of-control component service models for virtual environments | |
| JP7749674B2 (ja) | 非同期分散モジュラ関数呼び出し | |
| CN109729121B (zh) | 一种云存储系统及用于云存储系统中实现自定义数据处理的方法 | |
| US12386636B1 (en) | Portable application based virtualization | |
| US12417149B2 (en) | Service cluster instance backup and recovery methods and related devices | |
| US11477290B1 (en) | Remote session state backup and restoration | |
| WO2018090871A1 (zh) | 应用业务提示方法及应用业务提示装置 | |
| US10223178B2 (en) | Enabling WPD devices to be managed at the capability level | |
| CN115904407A (zh) | 镜像构建方法、系统及计算机可读存储介质 | |
| CN113742716B (zh) | 代码运行方法、装置、电子设备、存储介质和程序产品 | |
| RU2760911C2 (ru) | Сокращение использования ресурсов приложением | |
| CN113821205B (zh) | 小程序页面参数的控制方法及装置、介质及电子设备 | |
| US20250053543A1 (en) | Using drag-and-drop to open local files remotely | |
| CN110109718A (zh) | 一种应用程序接口调用方法及装置 | |
| CN111124613B (zh) | 虚拟化资源的服务化实现方法、装置、设备及存储介质 | |
| US11777818B1 (en) | Drift resolver for enterprise applications | |
| KR20180010442A (ko) | 온라인 저작 서비스가 수행되는 사용자 단말 및 이의 문서 저장 방법 | |
| US11874722B2 (en) | Applying modern standby configurations on a per-application basis | |
| US20250272601A1 (en) | Artificial intelligence training using accesibility data | |
| US12353420B2 (en) | Techniques for providing synchronous and asynchronous data processing | |
| CN106899650B (zh) | 一种更新数据方法与装置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22857465 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 11/06/2024) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 22857465 Country of ref document: EP Kind code of ref document: A1 |