WO2022218150A1 - Window display method and electronic device - Google Patents
Window display method and electronic device Download PDFInfo
- Publication number
- WO2022218150A1 WO2022218150A1 PCT/CN2022/083912 CN2022083912W WO2022218150A1 WO 2022218150 A1 WO2022218150 A1 WO 2022218150A1 CN 2022083912 W CN2022083912 W CN 2022083912W WO 2022218150 A1 WO2022218150 A1 WO 2022218150A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- window
- electronic device
- desktop
- windows
- target
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 83
- 230000008859 change Effects 0.000 claims abstract description 13
- 230000004044 response Effects 0.000 claims description 12
- 230000015654 memory Effects 0.000 claims description 11
- 238000004590 computer program Methods 0.000 claims description 10
- 230000008569 process Effects 0.000 claims description 10
- 238000004891 communication Methods 0.000 claims description 8
- 238000004364 calculation method Methods 0.000 description 22
- 238000010586 diagram Methods 0.000 description 12
- 230000006870 function Effects 0.000 description 7
- 238000004422 calculation algorithm Methods 0.000 description 6
- 230000009286 beneficial effect Effects 0.000 description 4
- 238000004519 manufacturing process Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000012544 monitoring process Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 230000001419 dependent effect Effects 0.000 description 2
- 230000004438 eyesight Effects 0.000 description 2
- 230000000903 blocking effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008447 perception Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
- 230000016776 visual perception Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0481—Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
- G06F3/0483—Interaction with page-structured environments, e.g. book metaphor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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/448—Execution paradigms, e.g. implementations of programming paradigms
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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/448—Execution paradigms, e.g. implementations of programming paradigms
- G06F9/4488—Object-oriented
- G06F9/449—Object-oriented method invocation or resolution
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/542—Event management; Broadcasting; Multicasting; Notifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Definitions
- the present application relates to the field of electronic technology, and more particularly, to a method and electronic device for window display.
- the present application provides a window display method and electronic device.
- the technical solution can identify and minimize invisible windows displayed on the desktop by the electronic device, thereby reducing system resources occupied by the electronic device and reducing system power consumption.
- a method for displaying a window is provided, the method is applied to an electronic device, and the method includes: the electronic device captures, by the electronic device, a first message of a window change; the first target window; the electronic device divides the display area of the desktop of the electronic device except the task bar into multiple areas according to the vertex coordinates of the window in the desktop; the electronic device uses the window handle to Each area in the multiple areas cannot be marked repeatedly; the electronic device determines the second target window visible to the user in the desktop according to the window handles marked by the multiple areas; the electronic device The device determines a third target window invisible to the user according to the first target window and the second target window; the electronic device minimizes the third target window.
- the electronic device may acquire the first target window opened by the user in the desktop after capturing the message of the window change, and then divide the part of the desktop of the electronic device except the taskbar into two parts according to the vertex coordinates of the window in the desktop. multiple areas, and then use the window handle to mark the multiple areas, so that the second target window visible to the user in the desktop can be determined, and the invisible third target window can be determined in combination with the first target window, and then the third target window can be determined.
- the target window is minimized.
- the technical solution can identify invisible windows in the desktop displayed by the electronic device and minimize them, thereby reducing the system resources occupied by the electronic device and reducing the power consumption of the system.
- acquiring, by the electronic device, a first target window having a stacking order according to the first message includes: acquiring, by the electronic device, a desktop according to the first message The bottommost window except the desktop window in the stacking order of the inner windows; the electronic device searches for all windows from the bottommost window upward according to the stacking sequence of the windows in the desktop, and obtains the first target window, wherein , the first target window is a window that can be displayed in response to a user's operation.
- the electronic device can obtain all the windows that can be displayed in response to the user's operation according to the stacking order of the windows in the desktop, which is beneficial to the subsequent calculation of invisible windows.
- the electronic device divides the desktop display area of the electronic device except for the taskbar into multiple areas according to the vertex coordinates of the windows in the desktop, including: The electronic device divides the length of the display area in the first direction into a plurality of parts according to the coordinates of the vertices of the window in the desktop in the first direction; the electronic device divides the length of the display area in the first direction into a plurality of parts; The coordinates in the second direction divide the length of the display area in the second direction into a plurality of parts.
- the display area of the desktop of the electronic device except the taskbar is divided into multiple parts in the first direction according to the coordinates of the vertices of the windows in the desktop in the first direction, and the desktop of the electronic device except the taskbar is divided into multiple parts.
- the outer display area is divided into multiple parts in the second direction according to the coordinates of the vertices of the windows in the desktop in the second direction, so that the display area can be divided into multiple areas, which is conducive to the subsequent calculation of invisible windows.
- the electronic device uses a window handle to mark the multiple regions respectively, including: the electronic device starts from the most recent window according to the stacking order of the windows in the desktop.
- the top-level window starts, and is marked down sequentially using the window handle.
- the window handles are used to mark the topmost window in sequence according to the stacking sequence of the windows in the desktop, so that the windows visible to the user in the desktop can be determined.
- the method before the electronic device acquires a first target window with a stacking order according to the first message, the method further includes: the electronic device The first message is stored in a first queue, and the first queue retains one message at a time; the electronic device reads the first message from the first queue.
- an interval at which the electronic device reads the first message from the first queue is greater than or equal to a first preset duration.
- the technical solution can avoid excessive message stacking and cause misoperation.
- the third target window includes a first window and a second window, and the first window partially blocks the second window, and the second target
- the window includes a third window, and before the electronic device minimizes the third target window, the method further includes: inserting, by the electronic device, a fourth window after the first window; A fifth window is inserted after the second window; wherein the fourth window and the fifth window are invisible to the user.
- the additional window can be used as the reference position of the minimized window in the window stacking sequence, so as to avoid the stacking sequence disorder after the restoration of the minimized window.
- the position and size of the fourth window on the desktop may be the same as or different from the first window, and the position and size of the fifth window on the desktop may be the same as or different from the first window.
- the fourth and fifth windows hardly occupy system resources.
- the fourth window can also be inserted before the first window, and the fifth window can also be inserted before the second window.
- the method further includes: in response to a user's first operation, the electronic device inserts the first window after the fourth window, and inserts the first window into the fourth window.
- the second window is inserted after the fifth window; the electronic device displays a first interface, the first interface includes the first window and the second window, wherein the first window is partially blocked the second window.
- the minimized first window and the second window are restored, they are inserted into the fourth window and the fifth window respectively in the original order, so that their positions in the window stacking order can be guaranteed to be the same as the smallest window. It is the same as before the minimization, so that the stacking order after the minimization window is restored can be avoided.
- the third target window includes a first window
- the second target window includes a second window and a third window
- the third window partially blocks The second window and the first window partially block the second window
- the method further includes: the electronic device creates a sixth window, The sixth window is located before the first window; wherein, the vertex coordinates of the sixth window are located outside the desktop of the electronic device.
- the vertex coordinates of the sixth window are located outside the desktop of the electronic device, but the position of the sixth window in the window stacking sequence is located before the first window, and the sixth window can be displayed when the third window disappears
- the operation of the system finding the focus window is captured, so that the position of the first window and the second window in the window stacking order will not be affected.
- the method further includes: in response to a second operation of the user, displaying, by the electronic device, a second interface, where the second interface includes the first window and the second window, wherein the first window partially blocks the second window.
- the second operation may be an operation of minimizing or closing the third window, and then the sum of the first window may be restored to its original position.
- the technical solution can avoid the stacking sequence disorder after the minimized window is restored.
- an electronic device comprising one or more processors; one or more memories; the one or more memories store one or more computer programs, the one or more computer programs comprising instructions, When the instructions are executed by one or more processors, the method for causing a window to be displayed as described in the above first aspect and any possible implementation manner thereof is executed.
- a chip in a third aspect, includes a processor and a communication interface, the communication interface is configured to receive a signal and transmit the signal to the processor, and the processor processes the signal such that The method for displaying a window as described in the first aspect and any possible implementation manners thereof is performed.
- a computer-readable storage medium wherein computer instructions are stored in the computer-readable storage medium, and when the computer instructions are executed on a computer, the first aspect and any one of the above-mentioned possibilities are made possible.
- the method of window display described in the implementation mode is executed.
- a computer program product comprising computer instructions, when the computer instructions are executed on an electronic device, the method for displaying a window as described in the above first aspect and any possible implementation manner thereof be executed.
- FIG. 1 is a schematic diagram of a group of GUIs provided by an embodiment of the present application.
- FIG. 2 is a schematic diagram of coordinates after discretization of the window in FIG. 1 .
- FIG. 3 is a schematic diagram of marking a handle to a window according to an embodiment of the present application.
- FIG. 4 is a schematic diagram of another group of GUIs provided by an embodiment of the present application.
- FIG. 5 is a schematic diagram of another group of GUIs provided by an embodiment of the present application.
- FIG. 6 is a schematic timing diagram of a window display provided by an embodiment of the present application.
- FIG. 7 is a schematic flowchart of a method for window display provided by an embodiment of the present application.
- FIG. 8 is a schematic flowchart of calculating invisible windows in FIG. 7 .
- FIG. 9 is a schematic flowchart of a method for displaying a window provided by an embodiment of the present application.
- the window display method in the embodiments of the present application can be applied to electronic devices such as tablet computers, notebook computers, personal computers, ultra-mobile personal computers (UMPC), netbooks, and personal digital assistants (PDAs).
- electronic devices such as tablet computers, notebook computers, personal computers, ultra-mobile personal computers (UMPC), netbooks, and personal digital assistants (PDAs).
- UMPC ultra-mobile personal computers
- PDAs personal digital assistants
- the embodiments of the present application do not impose any restrictions on the specific type of the electronic device.
- embodiments of the present application provide a window display method and electronic device, which can minimize an invisible window, and restore the minimized window to its original position when the minimized window needs to be restored. There is no perception on the top, so that it will not affect the use of users, and at the same time reduce the power consumption of the system.
- FIG. 1 is a schematic diagram of a group of graphical user interfaces (graphical user interface, GUI) provided by an embodiment of the present application. Among them, (a) to (b) in FIG. 1 show the process of discretizing the windows in the display interface of the electronic device.
- GUI graphical user interface
- the GUI may be a display desktop 210 of the electronic device 200
- the display desktop 210 may include a display area 211 and a task bar 215 therein.
- the display area 211 includes a window 212, a window 213 and a window 214, wherein the window stacking order (z-order) of the three windows in the display area 211 is window 213, window 212, and window 214 from top to bottom. That is, the window 213 is on the top layer of the display desktop and is the focus window.
- the electronic device 200 can use the display desktop 210 as the entire canvas to obtain all the windows displayed by all users in the display desktop 210 that can be operated and displayed by keyboard or mouse, and these windows can correspond one-to-one with the windows in the task bar.
- the electronic device 200 can use a system interface, such as the getnextwindow interface, after obtaining the bottommost window in the z-order order of the windows in the display desktop 210, to search up all the windows in the z-order order, so as to obtain the information that the user can use the keyboard or All windows displayed by mouse operation.
- a system interface such as the getnextwindow interface
- the window 213 is a file manager window, a 212-bit Huawei Music window, and the window 213 is a Huawei Computer Manager window
- the windows opened in the taskbar include File Manager, Huawei Music, and Huawei Computer Manager. Then, the electronic device 200 can obtain that the windows that the user can actually operate are the above-mentioned three windows, and the z-order order of the three windows.
- the GUI shows the process of discretizing the display area 211 according to the displayed windows.
- the electronic device 200 has acquired the three windows displayed in the display area 211 and the z-order order of the three windows, then the electronic device 200 can, according to the vertex coordinates of the three windows,
- the display area is divided into a plurality of areas.
- the coordinates of the four vertices of the window 213 are A1, A2, A3, and A4, respectively, the coordinates of the four vertices of the window 212 are B1, B2, B3, and B4, respectively, and the four vertices of the window 213
- the vertex coordinates are C1, C2, C3, and C4, respectively.
- the display area 211 by dividing the abscissas of the three windows, a total of 7 areas can be divided, and in the y-axis direction of the display area 211, by dividing the horizontal coordinates of the three windows
- the coordinates can be divided into 6 areas in total, and the entire display area 211 is divided into 42 small areas in total, and each area belongs to the same window. Therefore, more pixels (eg, 1280*760) in the display area 211 can be corresponded to the coordinates corresponding to the 42 small areas, thereby reducing the complexity of the calculation of the amount of data.
- the lower boundary of the window 214 overlaps with the upper boundary of the taskbar, for example, by one pixel. Therefore, in the y-axis direction of the display area 211, it can be divided into 6 areas in total .
- the lower boundary of the window 214 may not overlap with the upper boundary of the task bar, and at this time, the y-axis direction of the display area 211 may be divided into 7 areas, which are not limited in this embodiment of the present application .
- FIG. 2 is a schematic diagram of coordinates after discretization of the window in FIG. 1 .
- the 42 small areas can be corresponding to the discretized coordinate system, the area from coordinates (0, 0) to coordinates (7, 6) in FIG. 2
- the area from the coordinates a3 (2, 2) to a2 (5, 4) in FIG. 2 corresponds to the window 212 in FIG. 1
- the coordinates b3 (1, 1) to The area of coordinates b2 (4, 5) corresponds to the window 213 in FIG. 1
- the area from coordinates c3 (3, 0) to c2 (6, 3) in FIG. 2 corresponds to the window 214 in FIG. 1 .
- more pixels in the display area 211 can be represented by the discretized coordinates.
- the electronic device 200 calculates the window in the display area 211, it only needs to use the discretized coordinates of 42 It is not necessary to consider the coordinates of each pixel in the original display area 211 to perform the calculation in each area, which effectively reduces the complexity of the calculation of the amount of data.
- FIG. 3 is a schematic diagram of marking a handle to a window according to an embodiment of the present application.
- the window 212 located in the second layer of the z-order sequence assuming that the handle of the window 212 is 2, since the coordinates of the area where the window 212 is located is from (1, 1) to (4, 5), a total of 12 areas, but 4 of them have been marked as 1, and each area cannot be marked repeatedly, so the remaining 8 areas are marked as 2.
- the coordinates of the area where the display area 211 is located ranges from (0, 0) to (7, 6), a total of 42 areas, but 6 of them have been Marked as 1, 8 areas are marked as 2, 6 areas are marked as 3, each area cannot be marked repeatedly, so the remaining 22 areas are marked as 4.
- the electronic device 200 can traverse all the regions and count the number of different marked window handles, so as to know the number of visible windows in the display region 211 .
- the display area is the display area except the desktop window.
- the user can operate all the displayed windows through a keyboard and mouse operation, so as to acquire which windows are invisible.
- the number of invisible windows can be obtained by subtracting the number of visible windows from the number of all windows obtained initially, and by comparing all the windows obtained initially with the visible windows, which windows are invisible can be obtained.
- the handle of the window 213 is 1, the handle of the window 212 is 2, the handle of the window 214 is 3, and the handle of the desktop window is 4 as an example for description.
- the handle of the above window is It may also be represented by other values, which are not limited in this embodiment of the present application.
- the electronic device can temporarily minimize the window by calling the system interface to reduce the system resources occupied by the window.
- the user operates the window to make the original position of the minimized window visible, timely
- the window is restored, the user has no visual perception in this process, so that it will not affect the use of the user, and at the same time, the power consumption of the system is reduced.
- the invisible window can be implemented by sending a message to the window, or it can be implemented by using the native external interface showwindow of the windows system.
- the window will be the focus window, and the restoration of the minimized window in the embodiment of the present application is Restore the window to the state before it was minimized, that is, restore the minimized window according to the z-order order of the original window.
- Window A blocks Window B and minimizes Window B.
- the restored Window B cannot be before Window A. If Window B is restored before Window A, the user will feel uncomfortable. , therefore, window B still needs to be behind window A after restoration, that is, the focus window is still window A.
- the window display method provided by the embodiment of the present application can restore the minimized window according to the z-order order of the original window. -The case where the order is out of order.
- the windows system provides the showwindow interface
- some parameters such as the SW_SHOWNOACTIVATE parameter
- the window can be restored from the minimized state to the most recent window state, including the most recent position and z-order order, but, although the restored window It will not become the focus window, but the z-order order of the windows will be easily disordered, that is, the restored window jumps to the front of all windows, but the window is not the focus window.
- window A blocks window B and minimizes window B.
- window A blocks window B and minimizes window B.
- the restored window B is in front of window A, but the user's input and other operations are still in window A, which will make User feels uncomfortable.
- the embodiment of the present application provides a method for displaying a window, which can avoid the occurrence of the above problem.
- FIG. 4 is a schematic diagram of another group of GUIs provided by an embodiment of the present application. Among them, the process of minimizing the invisible window and restoring the minimized window is shown from (a) to (e) in FIG. 4 .
- the display area 311 of the electronic device includes a window 312 and a window 313, wherein the window 312 is located above the window 313, that is, the focus window is the window 312, and the window 312 partially blocks the window 313.
- the GUI as shown in (b) of FIG. 4 may be displayed.
- the user opens the window 314 , and the window 314 completely blocks the window 312 and the window 313 , that is, the focus window of the display area 311 is 314 .
- a window 312b can be inserted after the window 312, the size and position of the window 312b are the same as those of the window 312, and there is no other window between the window 312 and the window 312b; the window 313b is inserted after the window 313 , the size and position of the window 313b are the same as those of the window 313, and there is no other window between the window 313 and the window 313b.
- Window 312b and window 313b are used to subsequently calculate whether window 312 and window 313 need to be restored.
- window 312b can replace the position of window 312 in the window z-order sequence.
- window 313b The position of window 313 in the window z-order can be substituted.
- the window properties of the windows 312b and 313b can be set to make the windows 312b and 313b invisible to the user, for example, the windows 312b and 313b will not appear in the taskbar or in the preview mode, and the user cannot For example, the user cannot operate the windows 312b and 313b by using the keyboard, mouse, shortcut keys, etc., and the windows 312b and 313b basically do not occupy system resources.
- a minimize operation is performed on the window 312 and the window 313, so as to reduce the system resources occupied by them and save the power consumption of the system.
- the electronic device can display the GUI shown in (e) in 4.
- a window 312 and a window 313 are displayed in the display area 311 of the electronic device, and the window 312 is located above the window 313 .
- the electronic device needs to restore the minimized window 312 and window 313, then when restoring the window 312, insert the window 312 into the window 312b, and when restoring the window 313, insert the window 313
- the position of the window 312 and the window 313 in the z-order order of the window can be guaranteed to be the same as the order before the minimization, so as to avoid the problem of disordered z-order order when the minimized window is restored.
- the electronic device can perform the above functions by invoking the system interface. For example, after calling the showwindow interface, the electronic device calls the setwindowpos interface to execute the above function.
- the window 312 may include multiple dependent windows, then when inserting the window 312b, inserting the window 312b after the window 312 means inserting the window 312b after the window 312 and its dependent windows, so as to avoid Other visual effects issues.
- inserting the window 312b after the window 312 means inserting the window 312b after the window 312 and its dependent windows, so as to avoid Other visual effects issues.
- the same operation is also performed for the window 313 .
- the window A1 can replace the position of the window A in the window z-order sequence.
- Window A is inserted after or before window A1, so that the position of window A in the z-order of windows can be guaranteed to be the same as the order before minimization.
- the system will find the next frontmost window in the window z-order order and set it as the focus window, but This operation is almost synchronized with the operation of minimizing restore, so it may cause the window z-order order to be out of order.
- the windows from top to bottom in the window z-order sequence are window A, window B, and window C, and window B partially blocks window C, window A completely blocks window B, and partially blocks window C, that is, window B is the smallest , then when window A is minimized or closed to make window B visible, when the system looks for the next focus window, since window B is performing the restore operation at this time, the system will most likely find window C as the focus window, and finally The result may be that window C precedes window B, which is uncomfortable for the user.
- the embodiments of the present application provide a method for displaying a window, which can avoid the occurrence of the above problems.
- FIG. 5 is a schematic diagram of another group of GUIs provided by an embodiment of the present application. Among them, the process of minimizing the invisible window and restoring the minimized window is shown from (a) to (d) in FIG. 5 .
- the display area 411 of the electronic device includes a window 412 and a window 413, wherein the window 412 is located above the window 413, that is, the focus window is the window 412, and the window 412 partially blocks the window 413.
- the GUI as shown in (b) of FIG. 5 may be displayed.
- the user opens the window 414, and the window 414 completely blocks the window 412, and partially blocks the window 413, that is, the focus window of the display area 411 is 414, and the window 413 is partially visible.
- a window 415 can be created, and the window 415 can be set to be able to capture the request of the system to find the focus window, then insert the window 415 above the window 412, and then insert the window 415 412 performs minimization processing to save system resources.
- the window 415 by setting the parameters of the window 415, its coordinates can be located outside the display area 411, but the position of the window 415 in the window z-order sequence is above the window 412, so when the window 414 is the smallest
- the focus window found by the system is window 415, not window 412.
- the GUI as shown in (d) of FIG. 5 may be displayed.
- the GUI is a display area 411 of an electronic device, the display area 411 includes a window 412 and a window 413 , and the window 412 partially blocks the window 413 . That is, the position of the window 412 in the z-order of the windows is consistent with the order before the minimization, so that the disorder of the z-order of the windows can be avoided.
- the window 415 when there are multiple fully occluded windows, only the window 415 needs to be inserted into the multiple occluded windows above the topmost window in the z-order sequence of the windows to achieve the above functions.
- the window 415 in this embodiment of the present application is invisible to the user, for example, the window 415 does not appear in the task bar or in the preview mode, and the user cannot operate the window, for example, the user uses the keyboard, mouse,
- the window 415 cannot be operated by shortcut keys and the like, and the window 415 basically does not occupy system resources.
- a window B when window A is completely blocked, a window B can be created, and the window B can be inserted on top of window A, and window A can be minimized.
- the system searches for the focus Window B will be found when the window is opened, and window A can be restored normally, avoiding the disorder of the z-order of the windows.
- FIG. 6 is a schematic timing diagram of a window display provided by an embodiment of the present application, which may include steps 501 to 511 .
- hook For example, use a hook to monitor the message calling the system API.
- the hook can first obtain the message.
- the API call message is sent to the system message monitoring module.
- the system message monitoring module sends the API call message to the window monitoring module.
- the window monitor sends the production event message to the flow control queue according to the API call message.
- the production event could be minimizing the window, moving the window, etc.
- the flow control queue saves the latest received message.
- the flow control queue generates the window change event corresponding to the production event message to the window occlusion calculation module.
- the window occlusion calculation module obtains snapshots of all current windows.
- the window occlusion calculation module filters all windows.
- the window calculation module can filter the windows obtained in step 507 to obtain all windows that the user can operate through the mouse or keyboard, and the windows correspond one-to-one with the windows opened in the task bar.
- the window occlusion calculation module calculates the visible window or the invisible window.
- the window occlusion calculation module can determine all visible windows through the above-mentioned discretization algorithm and handle mark, etc., and determine invisible windows in combination with all windows obtained in step 508 .
- the window occlusion calculation module generates a window.
- the window occlusion calculation module generates a window 312b and a window 313b.
- the window occlusion calculation module generates a window 415 .
- the window occlusion calculation module sends the minimization instruction or the restoration instruction to the minimization scene and strategy module.
- the window occlusion calculation module sends a minimization instruction of the completely occluded window 312 to the minimization scene and strategy module. Or when the window 312 needs to be restored, the restoration instruction of the window 312 is sent to the minimized scene and strategy module.
- the minimization scenario and strategy module performs a minimization operation on the window according to the minimization instruction, or performs a restoration operation on the window according to the restoration instruction.
- the minimization scenario and strategy module performs a minimization operation on the window 312 according to the minimization instruction of the window 312 .
- the restoration operation is performed on the window 312 according to the restoration instruction of the window 312 .
- FIG. 7 is a schematic flowchart of a window display method provided by an embodiment of the present application.
- the method may include steps 601 to 604 .
- the hook monitors the system window change message, and sends the message to the queue.
- the window change message enters the queue.
- the duration for example, the preset duration may be 30 milliseconds (millisecond, ms). This can avoid message stacking caused by processing too many messages at the same time.
- the detailed algorithm steps in this step 630 can refer to the related description in FIG. 8 .
- the execution strategy module can execute corresponding strategies according to the result of the window occlusion algorithm, for example, minimize the invisible window, and perform the restoration operation on the minimized window when the minimized window needs to be restored.
- FIG. 8 is a schematic flowchart of calculating invisible windows in FIG. 7 .
- the method may include steps 701 to 704 .
- all the windows obtained in step 631 can be filtered, so as to obtain a target window that can be displayed by the user through keyboard or mouse operations, and the target window corresponds one-to-one with the windows opened in the task bar.
- invisible windows can be calculated.
- the discretization operation is performed on the window through the above-mentioned discretization algorithm, and the position of the discretized window is marked with a handle to determine all visible windows, and the invisible window is determined in combination with the target window obtained in step 632.
- the result calculated in step 633 is sent to the execution strategy module.
- the execution strategy module may be the minimization scenario and strategy module in step 512 above.
- FIG. 9 is a schematic flowchart of a method for displaying a window provided by an embodiment of the present application.
- the method can be applied to an electronic device, and the method can include steps 710 to 770 .
- the electronic device captures the first message of the window change.
- the first message may be various messages of window change, for example, various system messages triggered by minimizing the window, maximizing the window, closing the window, moving the window, and the like.
- the electronic device acquires, according to the first message, a first target window with a stacking sequence.
- the first target window may be a plurality of windows, the plurality of windows have a certain stacking order, and the first target window may be a window that can be displayed on the desktop in response to a user's operation.
- the first target window may be multiple windows opened by the user, wherein some of the multiple windows are displayed on the desktop, and some of the windows are minimized, or some of the windows are on the desktop but are blocked by other windows, causing the user not visible etc.
- the electronic device divides the display area of the desktop of the electronic device except the taskbar into multiple areas according to the vertex coordinates of the windows in the desktop.
- the electronic device divides the display area 211 into a plurality of areas according to the vertex coordinates of the window 212 , the window 213 and the window 214 in the desktop.
- the electronic device uses the window handle to mark the multiple regions respectively, and each region in the multiple regions cannot be marked repeatedly.
- a window handle corresponds to a window one-to-one, that is, for the same window, its window handle is the same.
- a plurality of regions are respectively marked using a window handle.
- the electronic device determines a second target window visible to the user in the desktop according to the window handles of the multiple area markers.
- window handles correspond to the windows one-to-one, after marking the above-mentioned multiple areas, it is only necessary to traverse all the window handles, and determine how many visible windows there are according to how many different window handles there are. and which window that visible window is.
- a total of 4 different window handles are marked, it can be determined that there are 4 visible windows, one of which is a desktop window, then in addition to the desktop window, there are a total of 3 visible windows in the desktop that are visible to the user. window, that is, the second target window is the three visible windows.
- the electronic device determines, according to the first target window and the second target window, a third target window that is invisible to the user.
- the electronic device can determine which windows are invisible, that is, the third target window, in combination with the first target window.
- the third target window may be one or multiple, which is not limited in this embodiment of the present application.
- the electronic device minimizes the third target window.
- the electronic device After determining the third target window invisible to the user, the electronic device minimizes the third target window to save system resources.
- the electronic device may acquire the first target window opened by the user in the desktop after capturing the message of the window change, and then divide the part of the desktop of the electronic device except the taskbar into two parts according to the vertex coordinates of the window in the desktop. multiple areas, and then use the window handle to mark the multiple areas, so that the second target window visible to the user in the desktop can be determined, and the invisible third target window can be determined in combination with the first target window, and then the third target window can be determined.
- the target window is minimized.
- the technical solution can identify invisible windows in the desktop displayed by the electronic device and minimize them, thereby reducing the system resources occupied by the electronic device and reducing the power consumption of the system.
- obtaining, by the electronic device, a first target window having a stacking order according to the first message comprising: obtaining, by the electronic device, according to the first message, the most windows in the desktop in the stacking sequence of windows except the desktop window. the bottom window; the electronic device searches upwards from the bottommost window for all windows according to the stacking order of the windows in the desktop, and obtains the first target window, wherein the first target window is a response to the user's Operates the windows that can be displayed.
- the window 212 , the window 213 , and the window 214 are in the order of window 213 , window 212 , and window 214 in the order of the window stacking sequence. Then the first target window is window 213 , window 212 , and window 214 .
- the electronic device can obtain all the windows that can be displayed in response to the user's operation according to the stacking order of the windows in the desktop, which is beneficial to the subsequent calculation of invisible windows.
- the electronic device divides the display area of the desktop of the electronic device except for the taskbar into multiple areas according to the apex coordinates of the window in the desktop, including: the electronic device according to the apex of the window in the desktop.
- the coordinates in the first direction divide the length of the display area in the first direction into a plurality of parts; the electronic device divides the display area according to the coordinates of the vertices of the windows in the desktop in the second direction
- the length in the second direction is divided into a plurality of parts.
- the first direction may be parallel to the direction of the rotation axis (or the horizontal axis direction) of the electronic device, and the electronic device is in the first direction according to the window 212 in the desktop,
- the coordinates of the vertices of the window 213 and the window 214 in the first direction divide the display area 211 into seven parts.
- the second direction may be a direction perpendicular to the rotation axis of the electronic device (or the longitudinal axis direction), and the electronic device is in the second direction, according to the vertices of the window 212, the window 213 and the window 214 in the desktop in the second direction If the display area 211 is divided into 6 parts, the entire display area 211 is divided into 42 areas.
- the display area of the desktop of the electronic device except the taskbar is divided into multiple parts in the first direction according to the coordinates of the vertices of the windows in the desktop in the first direction, and the desktop of the electronic device except the taskbar is divided into multiple parts.
- the outer display area is divided into multiple parts in the second direction according to the coordinates of the vertices of the windows in the desktop in the second direction, so that the display area can be divided into multiple areas, which is conducive to the subsequent calculation of invisible windows.
- the electronic device uses the window handle to mark the multiple areas respectively, including: the electronic device starts from the topmost window according to the stacking order of the windows in the desktop, and uses the window handle to go to the topmost window in sequence. mark down.
- the electronic device starts from the topmost window and uses the window handle to mark it downwards. For example, referring to FIG.
- the window handle marks it. For example, if its window handle is 1, the six areas where the window 213 is located are marked as 1. Then, the window 212 and the window 214 located after the window 213 are marked respectively, and each area cannot be marked repeatedly until all areas are marked.
- the window handles are used to mark the topmost window in sequence according to the stacking sequence of the windows in the desktop, so that the windows visible to the user in the desktop can be determined.
- the method further includes: the electronic device saves the first message in a first queue, and the The first queue keeps one message at a time; the electronic device reads the first message from the first queue.
- the first queue may be the flow control queue module in the above embodiment.
- an interval at which the electronic device reads the first message from the first queue is greater than or equal to a first preset duration.
- the first preset duration may be 30ms.
- the technical solution can avoid excessive message stacking and cause misoperation.
- the third target window includes a first window and a second window, and the first window partially blocks the second window, the second target window includes a third window, and the electronic device will Before the third target window is minimized, the method further includes: inserting, by the electronic device, a fourth window after the first window; inserting, by the electronic device, a fifth window after the second window; wherein, The fourth window and the fifth window are invisible to the user.
- the third target window includes a first window and a second window
- the first window may be the window 312
- the second window may be the window 313
- the The third window included in the second target window may be the window 314, the fourth window may be the window 312b, and the fifth window may be the window 313b.
- the position and size of the fourth window on the desktop can be the same as or different from the first window; the position and size of the fifth window on the desktop can be the same as or different from the first window.
- the fourth window and the fifth window can be made invisible to the user, for example, the fourth window and the fifth window will not appear in the task bar or in the preview mode. Window, and the user cannot operate the window, for example, the user cannot operate the fourth window and the fifth window using the keyboard, mouse, shortcut keys, etc., and the fourth window and the fifth window basically do not occupy system resources.
- the additional window can be used as the reference position of the minimized window in the window stacking sequence, so as to avoid the stacking sequence disorder after the restoration of the minimized window.
- the fourth window can also be inserted before the first window, and the fifth window can also be inserted before the second window.
- the method further includes: in response to a user's first operation, after the electronic device inserts the first window into the fourth window, inserting the second window into the fifth window Afterwards; the electronic device displays a first interface, where the first interface includes the first window and the second window, wherein the first window partially blocks the second window.
- the first operation may be an operation of the user to minimize the third window, close the third window or move the third window, so that the first window and the second window are visible to the user, then the electronic device needs to use the first window and the second window Restore from minimization.
- the first interface may be the display interface of the electronic device in (e) of FIG. 4 , after the third window 314 is minimized or closed, the first window 312 is displayed on the desktop of the electronic device. and the second window 313, and the first window 312 partially blocks the second window 313, that is, the restored positions of the first window and the second window are the same as before the minimization.
- the minimized first window and the second window are restored, they are inserted into the fourth window and the fifth window respectively in the original order, so that their positions in the window stacking order can be guaranteed to be the same as the smallest window. It is the same as before the minimization, so that the stacking order after the minimization window is restored can be avoided.
- the third target window includes a first window
- the second target window includes a second window and a third window
- the third window partially blocks the second window and the first window. Blocking the second window, before the electronic device minimizes the third target window, the method further includes: the electronic device creating a sixth window, the sixth window being located before the first window ; wherein, the vertex coordinates of the sixth window are located outside the desktop of the electronic device.
- the first window in the third target window may be the window 412
- the second window in the second target window may be the window 413
- the second window in the second target window may be the window 413. 414.
- the sixth window may be the window 415, and the vertex coordinates of the window 415 are located outside the desktop of the electronic device, that is, the window 415 will not be displayed on the desktop, but the position of the window 415 in the window stacking sequence is located in the first window, that is, the window 415 is not displayed on the desktop. before window 412.
- the vertex coordinates of the sixth window are located outside the desktop of the electronic device, but the position of the sixth window in the window stacking sequence is located before the first window, and the sixth window can be displayed when the third window disappears
- the operation of the system finding the focus window is captured, so that the position of the first window and the second window in the window stacking order will not be affected.
- the method further includes: in response to a second operation of the user, the electronic device displays a second interface, the second interface includes the first window and the second window, wherein the first window A window partially blocks the second window.
- the second operation may be an operation performed by the user to minimize the third window, close the third window, or move the third window, so that the first window is visible to the user.
- the second interface may be the display interface of the electronic device in (d) of FIG. 5 .
- the third window 414 is closed or minimized, the first window 412 and the second window 413 are displayed on the desktop of the electronic device, and the first window 412 partially blocks the second window 413, that is, the position of the first window is the same as before the minimized window. identical.
- the second operation may be an operation of minimizing or closing the third window, and then the sum of the first window may be restored to its original position.
- the technical solution can avoid the stacking sequence disorder after the minimized window is restored.
- Embodiments of the present application further provide an electronic device, including one or more processors; one or more memories; the one or more memories stores one or more computer programs, and the one or more computer programs include instructions, When the instructions are executed by one or more processors, the method of causing a window to be displayed as described in any of the possible implementations above is performed.
- An embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, where the communication interface is configured to receive a signal and transmit the signal to the processor, and the processor processes the signal,
- the method for causing the window to be displayed as described in any of the foregoing possible implementation manners is executed.
- This embodiment also provides a computer-readable storage medium, where computer instructions are stored in the computer-readable storage medium, and when the computer instructions are executed on the electronic device, the electronic device executes the above-mentioned related method steps to realize the above-mentioned embodiments. method of window display.
- This embodiment also provides a computer program product, which, when the computer program product runs on a computer, causes the computer to execute the above-mentioned relevant steps, so as to realize the method for displaying a window in the above-mentioned embodiment.
- the embodiments of the present application also provide an apparatus, which may specifically be a chip, a component or a module, and the apparatus may include a connected processor and a memory; wherein, the memory is used for storing computer execution instructions, and when the apparatus is running, The processor can execute the computer-executed instructions stored in the memory, so that the chip executes the method for displaying a window in the foregoing method embodiments.
- the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, for the beneficial effects that can be achieved, reference may be made to the above-provided method. The beneficial effects in the corresponding method will not be repeated here.
- the disclosed system, apparatus and method may be implemented in other manners.
- the apparatus embodiments described above are only illustrative.
- the division of the units is only a logical function division. In actual implementation, there may be other division methods.
- multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented.
- the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
- the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
- each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
- the functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium.
- the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution.
- the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
- the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes .
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Multimedia (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
Provided in the present application are a window display method and an electronic device. The method comprises: an electronic device capturing a first message of a window change; the electronic device acquiring, according to the first message, a first target window having a superposition order; the electronic device dividing, according to vertex coordinates of a window in a desktop, a display region, apart from a taskbar, of the desktop of the electronic device into a plurality of regions; the electronic device respectively marking the plurality of regions by using window handles, wherein each of the plurality of regions cannot be marked repeatedly; the electronic device determining, according to the window handles which mark the plurality of regions, a second target window, which is visible to a user, in the desktop; the electronic device determining, according to the first target window and the second target window, a third target window that is invisible to the user; and the electronic device minimizing the third target window. By means of the technical solution, system resources occupied by an electronic device can be reduced, thereby reducing power consumption of a system.
Description
本申请要求于2021年04月15日提交中国专利局、申请号为202110406595.0、申请名称为“窗口显示的方法和电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202110406595.0 and the application title "Window Display Method and Electronic Device" filed with the China Patent Office on April 15, 2021, the entire contents of which are incorporated into this application by reference .
本申请涉及电子技术领域,并且更具体地,涉及一种窗口显示的方法和电子设备。The present application relates to the field of electronic technology, and more particularly, to a method and electronic device for window display.
用户在使用电子设备时,如在安装有视窗操作系统(microsoft windows)的电子设备中,经常需要打开多个窗口,每个打开的窗口都会占用相应的系统资源,当一个窗口对用户视觉可见时,系统对其分配的资源相对较多,当一个窗口被最小化时,系统就会减少分配给该最小化窗口的资源,以节省功耗。When a user uses an electronic device, such as an electronic device installed with a Windows operating system (microsoft windows), it is often necessary to open multiple windows, and each opened window will occupy corresponding system resources. When a window is visually visible to the user , the system allocates relatively more resources to it. When a window is minimized, the system reduces the resources allocated to the minimized window to save power consumption.
在一些情况下,当用户打开多个窗口时,会有一些窗口被上层的窗口遮挡,导致其位于电子设备的显示屏幕中,但是对用户视觉不可见,对于这类窗口,仍占用大量的系统资源。In some cases, when a user opens multiple windows, some windows are blocked by upper-layer windows, resulting in them being located on the display screen of the electronic device, but invisible to the user's vision. Such windows still occupy a large amount of system resource.
发明内容SUMMARY OF THE INVENTION
本申请提供一种窗口显示的方法和电子设备,该技术方案可识别电子设备显示桌面中的不可见窗口并将其最小化处理,能够降低电子设备占用的系统资源,降低系统功耗。The present application provides a window display method and electronic device. The technical solution can identify and minimize invisible windows displayed on the desktop by the electronic device, thereby reducing system resources occupied by the electronic device and reducing system power consumption.
第一方面,提供了一种窗口显示的方法,该方法应用于电子设备,该方法包括:所述电子设备捕获窗口变化的第一消息;所述电子设备根据所述第一消息获取具有层叠顺序的第一目标窗口;所述电子设备根据桌面内窗口的顶点坐标将所述电子设备的桌面除任务栏之外的显示区域划分为多个区域;所述电子设备使用窗口句柄分别对所述多个区域进行标记,所述多个区域中的每个区域不能被重复标记;所述电子设备根据所述多个区域标记的窗口句柄确定所述桌面内用户可见的第二目标窗口;所述电子设备根据所述第一目标窗口和所述第二目标窗口确定用户不可见的第三目标窗口;所述电子设备将所述第三目标窗口最小化。In a first aspect, a method for displaying a window is provided, the method is applied to an electronic device, and the method includes: the electronic device captures, by the electronic device, a first message of a window change; the first target window; the electronic device divides the display area of the desktop of the electronic device except the task bar into multiple areas according to the vertex coordinates of the window in the desktop; the electronic device uses the window handle to Each area in the multiple areas cannot be marked repeatedly; the electronic device determines the second target window visible to the user in the desktop according to the window handles marked by the multiple areas; the electronic device The device determines a third target window invisible to the user according to the first target window and the second target window; the electronic device minimizes the third target window.
基于本申请实施例,电子设备可以在捕获窗口变化的消息之后,获取桌面内用户打开的第一目标窗口,然后根据桌面内窗口的顶点坐标将电子设备的桌面除任务栏之外的部分划分为多个区域,再使用窗口句柄对该多个区域进行标记,从而可以确定桌面中对用户可见的第二目标窗口,从而结合第一目标窗口确定不可见的第三目标窗口,然后将该第三目标窗口最小化。该技术方案可识别电子设备显示桌面中的不可见窗口并将其最小化处理,能够降低电子设备占用的系统资源,降低系统功耗。Based on the embodiments of the present application, the electronic device may acquire the first target window opened by the user in the desktop after capturing the message of the window change, and then divide the part of the desktop of the electronic device except the taskbar into two parts according to the vertex coordinates of the window in the desktop. multiple areas, and then use the window handle to mark the multiple areas, so that the second target window visible to the user in the desktop can be determined, and the invisible third target window can be determined in combination with the first target window, and then the third target window can be determined. The target window is minimized. The technical solution can identify invisible windows in the desktop displayed by the electronic device and minimize them, thereby reducing the system resources occupied by the electronic device and reducing the power consumption of the system.
结合第一方面,在第一方面的某些实现方式中,所述电子设备根据所述第一消息获取 具有层叠顺序的第一目标窗口,包括:所述电子设备根据所述第一消息获取桌面内窗口的层叠顺序中除桌面窗口之外最底层的窗口;所述电子设备根据所述桌面内窗口的层叠顺序从所述最底层的窗口向上查找所有窗口,得到所述第一目标窗口,其中,所述第一目标窗口为响应于用户的操作能够显示的窗口。With reference to the first aspect, in some implementations of the first aspect, acquiring, by the electronic device, a first target window having a stacking order according to the first message includes: acquiring, by the electronic device, a desktop according to the first message The bottommost window except the desktop window in the stacking order of the inner windows; the electronic device searches for all windows from the bottommost window upward according to the stacking sequence of the windows in the desktop, and obtains the first target window, wherein , the first target window is a window that can be displayed in response to a user's operation.
基于本申请实施例,电子设备可以根据桌面内窗口的层叠顺序,获得所有响应于用户的操作能够显示的窗口,有利于后续计算不可见窗口。Based on the embodiments of the present application, the electronic device can obtain all the windows that can be displayed in response to the user's operation according to the stacking order of the windows in the desktop, which is beneficial to the subsequent calculation of invisible windows.
结合第一方面,在第一方面的某些实现方式中,所述电子设备根据桌面内窗口的顶点坐标将所述电子设备的桌面除任务栏之外的显示区域划分为多个区域,包括:所述电子设备根据所述桌面内窗口的顶点在第一方向上的坐标将所述显示区域在所述第一方向的长度划分为多个部分;所述电子设备根据所述桌面内窗口的顶点在第二方向上的坐标将所述显示区域在所述第二方向的长度划分为多个部分。With reference to the first aspect, in some implementations of the first aspect, the electronic device divides the desktop display area of the electronic device except for the taskbar into multiple areas according to the vertex coordinates of the windows in the desktop, including: The electronic device divides the length of the display area in the first direction into a plurality of parts according to the coordinates of the vertices of the window in the desktop in the first direction; the electronic device divides the length of the display area in the first direction into a plurality of parts; The coordinates in the second direction divide the length of the display area in the second direction into a plurality of parts.
基于本申请实施例,电子设备的桌面除任务栏之外的显示区域在第一方向上根据桌面内窗口的顶点在第一方向上的坐标划分为多个部分,电子设备的桌面除任务栏之外的显示区域在第二方向上根据桌面内窗口的顶点在第二方向上的坐标划分为多个部分,从而可以将显示区域划分为多个区域,有利于后续计算不可见窗口。Based on the embodiment of the present application, the display area of the desktop of the electronic device except the taskbar is divided into multiple parts in the first direction according to the coordinates of the vertices of the windows in the desktop in the first direction, and the desktop of the electronic device except the taskbar is divided into multiple parts. The outer display area is divided into multiple parts in the second direction according to the coordinates of the vertices of the windows in the desktop in the second direction, so that the display area can be divided into multiple areas, which is conducive to the subsequent calculation of invisible windows.
结合第一方面,在第一方面的某些实现方式中,所述电子设备使用窗口句柄分别对所述多个区域进行标记,包括:所述电子设备根据所述桌面内窗口的层叠顺序从最顶层的窗口开始,使用所述窗口句柄依次向下标记。With reference to the first aspect, in some implementations of the first aspect, the electronic device uses a window handle to mark the multiple regions respectively, including: the electronic device starts from the most recent window according to the stacking order of the windows in the desktop. The top-level window starts, and is marked down sequentially using the window handle.
基于本申请实施例,使用窗口句柄按照桌面内窗口的层叠顺序从最顶层的窗口开始依次进行标记,从而可以确定桌面内用户可见的窗口。Based on the embodiments of the present application, the window handles are used to mark the topmost window in sequence according to the stacking sequence of the windows in the desktop, so that the windows visible to the user in the desktop can be determined.
结合第一方面,在第一方面的某些实现方式中,在所述电子设备根据所述第一消息获取具有层叠顺序的第一目标窗口之前,所述方法还包括:所述电子设备将所述第一消息保存在第一队列中,所述第一队列每次保留一个消息;所述电子设备从所述第一队列中读取所述第一消息。With reference to the first aspect, in some implementations of the first aspect, before the electronic device acquires a first target window with a stacking order according to the first message, the method further includes: the electronic device The first message is stored in a first queue, and the first queue retains one message at a time; the electronic device reads the first message from the first queue.
结合第一方面,在第一方面的某些实现方式中,所述电子设备从所述第一队列中读取所述第一消息的间隔大于或等于第一预设时长。With reference to the first aspect, in some implementations of the first aspect, an interval at which the electronic device reads the first message from the first queue is greater than or equal to a first preset duration.
该技术方案可以避免过多消息堆叠,导致误操作。The technical solution can avoid excessive message stacking and cause misoperation.
结合第一方面,在第一方面的某些实现方式中,所述第三目标窗口包括第一窗口和第二窗口,且所述第一窗口部分遮挡所述第二窗口,所述第二目标窗口包括第三窗口,在所述电子设备将所述第三目标窗口最小化之前,所述方法还包括:所述电子设备在所述第一窗口之后插入第四窗口;所述电子设备在所述第二窗口之后插入第五窗口;其中,所述第四窗口和所述第五窗口对用户不可见。With reference to the first aspect, in some implementations of the first aspect, the third target window includes a first window and a second window, and the first window partially blocks the second window, and the second target The window includes a third window, and before the electronic device minimizes the third target window, the method further includes: inserting, by the electronic device, a fourth window after the first window; A fifth window is inserted after the second window; wherein the fourth window and the fifth window are invisible to the user.
基于本申请实施例,通过在需要最小化的窗口之后插入额外的窗口,可以将该额外的窗口作为最小化窗口在窗口层叠顺序中的参考位置,以避免最小化窗口还原后的层叠顺序错乱。Based on the embodiments of the present application, by inserting an additional window after the window to be minimized, the additional window can be used as the reference position of the minimized window in the window stacking sequence, so as to avoid the stacking sequence disorder after the restoration of the minimized window.
该第四窗口在桌面中的位置和大小可以和第一窗口相同,也可以不同、第五窗口在桌面中的位置和大小可以和第一窗口相同,也可以不同。该第四窗口和第五窗口几乎不占用系统资源。The position and size of the fourth window on the desktop may be the same as or different from the first window, and the position and size of the fifth window on the desktop may be the same as or different from the first window. The fourth and fifth windows hardly occupy system resources.
可选地,该第四窗口也可以插入第一窗口之前,该第五窗口也可以插入第二窗口之前。Optionally, the fourth window can also be inserted before the first window, and the fifth window can also be inserted before the second window.
结合第一方面,在第一方面的某些实现方式中,所述方法还包括:响应于用户的第一操作,所述电子设备将所述第一窗口插入至所述第四窗口之后,将所述第二窗口插入至所述第五窗口之后;所述电子设备显示第一界面,所述第一界面包括所述第一窗口和所述第二窗口,其中,所述第一窗口部分遮挡所述第二窗口。With reference to the first aspect, in some implementations of the first aspect, the method further includes: in response to a user's first operation, the electronic device inserts the first window after the fourth window, and inserts the first window into the fourth window. The second window is inserted after the fifth window; the electronic device displays a first interface, the first interface includes the first window and the second window, wherein the first window is partially blocked the second window.
基于本申请实施例,在最小化的第一窗口和第二窗口还原时,将其按照原来的顺序分别插入至第四窗口和第五窗口之后,可以保证其在窗口层叠顺序中的位置与最小化之前相同,从而可以避免最小化窗口还原后的层叠顺序错乱。Based on the embodiments of the present application, when the minimized first window and the second window are restored, they are inserted into the fourth window and the fifth window respectively in the original order, so that their positions in the window stacking order can be guaranteed to be the same as the smallest window. It is the same as before the minimization, so that the stacking order after the minimization window is restored can be avoided.
结合第一方面,在第一方面的某些实现方式中,所述第三目标窗口包括第一窗口,所述第二目标窗口包括第二窗口和第三窗口,且所述第三窗口部分遮挡所述第二窗口、所述第一窗口部分遮挡所述第二窗口,在所述电子设备将所述第三目标窗口最小化之前,所述方法还包括:所述电子设备创建第六窗口,所述第六窗口位于所述第一窗口之前;其中,所述第六窗口的顶点坐标位于所述电子设备的桌面之外。With reference to the first aspect, in some implementations of the first aspect, the third target window includes a first window, the second target window includes a second window and a third window, and the third window partially blocks The second window and the first window partially block the second window, and before the electronic device minimizes the third target window, the method further includes: the electronic device creates a sixth window, The sixth window is located before the first window; wherein, the vertex coordinates of the sixth window are located outside the desktop of the electronic device.
基于本申请实施例,第六窗口的顶点坐标位于电子设备的桌面之外,但是该第六窗口在窗口层叠顺序中的位置位于该第一窗口之前,该第六窗口可以在第三窗口消失时捕获到系统寻找焦点窗口的操作,从而不会影响第一窗口和第二窗口在窗口层叠顺序中的位置。Based on the embodiment of the present application, the vertex coordinates of the sixth window are located outside the desktop of the electronic device, but the position of the sixth window in the window stacking sequence is located before the first window, and the sixth window can be displayed when the third window disappears The operation of the system finding the focus window is captured, so that the position of the first window and the second window in the window stacking order will not be affected.
结合第一方面,在第一方面的某些实现方式中,所述方法还包括:响应于用户的第二操作,所述电子设备显示第二界面,所述第二界面包括所述第一窗口和所述第二窗口,其中,所述第一窗口部分遮挡所述第二窗口。With reference to the first aspect, in some implementations of the first aspect, the method further includes: in response to a second operation of the user, displaying, by the electronic device, a second interface, where the second interface includes the first window and the second window, wherein the first window partially blocks the second window.
基于本申请实施例,该第二操作可以是最小化或关闭第三窗口的操作,则第一窗口和可以还原至原来的位置。该技术方案可以避免最小化窗口还原后的层叠顺序错乱。Based on the embodiment of the present application, the second operation may be an operation of minimizing or closing the third window, and then the sum of the first window may be restored to its original position. The technical solution can avoid the stacking sequence disorder after the minimized window is restored.
第二方面,提供了一种电子设备,包括一个或多个处理器;一个或多个存储器;该一个或多个存储器存储有一个或多个计算机程序,该一个或多个计算机程序包括指令,当该指令被一个或多个处理器执行时,使得如上述第一方面及其任一种可能的实现方式中所述的窗口显示的方法被执行。In a second aspect, an electronic device is provided, comprising one or more processors; one or more memories; the one or more memories store one or more computer programs, the one or more computer programs comprising instructions, When the instructions are executed by one or more processors, the method for causing a window to be displayed as described in the above first aspect and any possible implementation manner thereof is executed.
第三方面,提供一种芯片,所述芯片包括处理器和通信接口,所述通信接口用于接收信号,并将所述信号传输至所述处理器,所述处理器处理所述信号,使得如上述第一方面及其任一种可能的实现方式中所述的窗口显示的方法被执行。In a third aspect, a chip is provided, the chip includes a processor and a communication interface, the communication interface is configured to receive a signal and transmit the signal to the processor, and the processor processes the signal such that The method for displaying a window as described in the first aspect and any possible implementation manners thereof is performed.
第四方面,提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机指令,当所述计算机指令在计算机上运行时,使得如上述第一方面及其任一种可能的实现方式中所述的窗口显示的方法被执行。In a fourth aspect, a computer-readable storage medium is provided, wherein computer instructions are stored in the computer-readable storage medium, and when the computer instructions are executed on a computer, the first aspect and any one of the above-mentioned possibilities are made possible. The method of window display described in the implementation mode is executed.
第五方面,提供一种计算机程序产品,包括计算机指令,当所述计算机指令在电子设备上运行时,使得如上述第一方面及其任一种可能的实现方式中所述的窗口显示的方法被执行。In a fifth aspect, a computer program product is provided, comprising computer instructions, when the computer instructions are executed on an electronic device, the method for displaying a window as described in the above first aspect and any possible implementation manner thereof be executed.
图1是本申请实施例提供的一组GUI的示意图。FIG. 1 is a schematic diagram of a group of GUIs provided by an embodiment of the present application.
图2是图1中的窗口离散化后的坐标的示意图。FIG. 2 is a schematic diagram of coordinates after discretization of the window in FIG. 1 .
图3是本申请实施例提供的对窗口进行句柄标记的示意图。FIG. 3 is a schematic diagram of marking a handle to a window according to an embodiment of the present application.
图4是本申请实施例提供的另一组GUI的示意图。FIG. 4 is a schematic diagram of another group of GUIs provided by an embodiment of the present application.
图5是本申请实施例提供的另一组GUI的示意图。FIG. 5 is a schematic diagram of another group of GUIs provided by an embodiment of the present application.
图6是本申请实施例提供的一种窗口显示的时序示意图。FIG. 6 is a schematic timing diagram of a window display provided by an embodiment of the present application.
图7是本申请实施例提供的一种窗口显示的方法的示意性流程图。FIG. 7 is a schematic flowchart of a method for window display provided by an embodiment of the present application.
图8是图7中计算不可见窗口的示意性流程图。FIG. 8 is a schematic flowchart of calculating invisible windows in FIG. 7 .
图9是本申请实施例提供的一种窗口显示的方法的示意性流程图。FIG. 9 is a schematic flowchart of a method for displaying a window provided by an embodiment of the present application.
下面将结合附图,对本申请中的技术方案进行描述。The technical solutions in the present application will be described below with reference to the accompanying drawings.
本申请实施例中的窗口显示的方法可以应用于平板电脑、笔记本电脑、个人计算机、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等电子设备中,本申请实施例对电子设备的具体类型不作任何限制。The window display method in the embodiments of the present application can be applied to electronic devices such as tablet computers, notebook computers, personal computers, ultra-mobile personal computers (UMPC), netbooks, and personal digital assistants (PDAs). In the device, the embodiments of the present application do not impose any restrictions on the specific type of the electronic device.
在用户使用电子设备时,经常需要打开多个窗口,每个打开的窗口都会占用相应的系统资源,当一个窗口对用户视觉可见时,系统对其分配的资源相对较多,当一个窗口被最小化时,系统就会减少分配给该最小化窗口的资源,以节省功耗。When users use electronic devices, they often need to open multiple windows, and each opened window will occupy corresponding system resources. When a window is visually visible to the user, the system allocates relatively more resources to it. When a window is minimized When minimized, the system reduces the resources allocated to the minimized window to save power.
在一些情况下,当用户打开多个窗口时,会有一些窗口被上层的窗口遮挡,导致其位于电子设备的显示屏幕中,但是对用户视觉不可见,对于这类窗口,仍占用大量的系统资源。In some cases, when a user opens multiple windows, some windows are blocked by upper-layer windows, resulting in them being located on the display screen of the electronic device, but invisible to the user's vision. Such windows still occupy a large amount of system resource.
有鉴于此,本申请实施例提供一种窗口显示的方法和电子设备,能够将不可见窗口最小化处理,且在最小化窗口需要还原时,将其还原至原来的位置,这个过程中用户视觉上无感知,从而不会对用户的使用造成影响,同时又降低了系统的功耗。In view of this, embodiments of the present application provide a window display method and electronic device, which can minimize an invisible window, and restore the minimized window to its original position when the minimized window needs to be restored. There is no perception on the top, so that it will not affect the use of users, and at the same time reduce the power consumption of the system.
图1是本申请实施例提供的一组图形用户界面(graphical user interface,GUI)的示意图。其中,从图1中的(a)至(b)示出了对电子设备的显示界面中的窗口进行离散化的过程。FIG. 1 is a schematic diagram of a group of graphical user interfaces (graphical user interface, GUI) provided by an embodiment of the present application. Among them, (a) to (b) in FIG. 1 show the process of discretizing the windows in the display interface of the electronic device.
参见图1中的(a),该GUI可以是电子设备200的显示桌面210,该显示桌面210中可以包括显示区域211和任务栏215。该显示区域211中包括窗口212、窗口213和窗口214,其中,该三个窗口在显示区域211中的窗口层叠顺序(z-order)从上到下依次为窗口213、窗口212、窗口214,即窗口213在显示桌面的最上层,为焦点窗口。Referring to (a) of FIG. 1 , the GUI may be a display desktop 210 of the electronic device 200 , and the display desktop 210 may include a display area 211 and a task bar 215 therein. The display area 211 includes a window 212, a window 213 and a window 214, wherein the window stacking order (z-order) of the three windows in the display area 211 is window 213, window 212, and window 214 from top to bottom. That is, the window 213 is on the top layer of the display desktop and is the focus window.
其中,电子设备200可以将显示桌面210作为整个画布,获取显示桌面210内所有用户可以用键盘或鼠标操作显示出的所有窗口,这些窗口可以个任务栏中的窗口一一对应。The electronic device 200 can use the display desktop 210 as the entire canvas to obtain all the windows displayed by all users in the display desktop 210 that can be operated and displayed by keyboard or mouse, and these windows can correspond one-to-one with the windows in the task bar.
具体地,电子设备200可以在获取显示桌面210内窗口z-order顺序最底层的窗口之后,使用系统接口,如getnextwindow接口,按照z-order顺序向上查找所有窗口,从而可以获取用户可以用键盘或鼠标操作显示出的所有窗口。Specifically, the electronic device 200 can use a system interface, such as the getnextwindow interface, after obtaining the bottommost window in the z-order order of the windows in the display desktop 210, to search up all the windows in the z-order order, so as to obtain the information that the user can use the keyboard or All windows displayed by mouse operation.
例如,该窗口213为文件管理器窗口、该窗口212位华为音乐窗口,该窗口213为华为电脑管家窗口,则在任务栏中打开的窗口有文件管理器、华为音乐和华为电脑管家。则电子设备200可以获取到用户可以实际操作的窗口为上述三个窗口,以及该三个窗口的z-order顺序。For example, if the window 213 is a file manager window, a 212-bit Huawei Music window, and the window 213 is a Huawei Computer Manager window, the windows opened in the taskbar include File Manager, Huawei Music, and Huawei Computer Manager. Then, the electronic device 200 can obtain that the windows that the user can actually operate are the above-mentioned three windows, and the z-order order of the three windows.
参见图1中的(b),该GUI示出了将显示区域211根据显示的窗口进行离散化的过程。图1中的(a)中,电子设备200已经获取了显示区域211内显示的三个窗口以及该 三个窗口的z-order顺序,那么电子设备200可以根据该三个窗口的顶点坐标,将该显示区域划分为多个区域。Referring to (b) in FIG. 1 , the GUI shows the process of discretizing the display area 211 according to the displayed windows. In (a) of FIG. 1 , the electronic device 200 has acquired the three windows displayed in the display area 211 and the z-order order of the three windows, then the electronic device 200 can, according to the vertex coordinates of the three windows, The display area is divided into a plurality of areas.
如图1中的(b)所示,窗口213的四个顶点坐标分别为A1、A2、A3、A4,窗口212的四个顶点坐标分别为B1、B2、B3、B4,窗口213的四个顶点坐标分别为C1、C2、C3、C4。那么,在显示区域211的x轴方向上,通过对该三个窗口的横坐标进行划分,共可以划分为7个区域,在显示区域211的y轴方向上,通过对该三个窗口的横坐标进行划分,共可以划分为6个区域,则整个显示区域211共被划分为42个小区域,且每一个区域属于同一个窗口。从而可以将显示区域211内较多的像素点(如,1280*760)对应到该42个小区域对应的坐标内,从而降低了数据量计算的复杂度。As shown in (b) of FIG. 1 , the coordinates of the four vertices of the window 213 are A1, A2, A3, and A4, respectively, the coordinates of the four vertices of the window 212 are B1, B2, B3, and B4, respectively, and the four vertices of the window 213 The vertex coordinates are C1, C2, C3, and C4, respectively. Then, in the x-axis direction of the display area 211, by dividing the abscissas of the three windows, a total of 7 areas can be divided, and in the y-axis direction of the display area 211, by dividing the horizontal coordinates of the three windows The coordinates can be divided into 6 areas in total, and the entire display area 211 is divided into 42 small areas in total, and each area belongs to the same window. Therefore, more pixels (eg, 1280*760) in the display area 211 can be corresponded to the coordinates corresponding to the 42 small areas, thereby reducing the complexity of the calculation of the amount of data.
应理解,图1中的(b)中,窗口214的下边界与任务栏的上边界重叠,例如,重叠一个像素,因此,在显示区域211的y轴方向上,共可以划分为6个区域。It should be understood that in (b) of FIG. 1 , the lower boundary of the window 214 overlaps with the upper boundary of the taskbar, for example, by one pixel. Therefore, in the y-axis direction of the display area 211, it can be divided into 6 areas in total .
在一些示例中,窗口214的下边界也可以不与任务栏的上边界重叠,则此时可以将显示区域211的y轴方向上,划分为7个区域,本申请实施例对此不予限定。In some examples, the lower boundary of the window 214 may not overlap with the upper boundary of the task bar, and at this time, the y-axis direction of the display area 211 may be divided into 7 areas, which are not limited in this embodiment of the present application .
图2是图1中的窗口离散化后的坐标的示意图。FIG. 2 is a schematic diagram of coordinates after discretization of the window in FIG. 1 .
参见图2,将显示区域211划分为42小区域之后,可以将该42小区域对应到离散化后的坐标系中,图2中的坐标(0,0)至坐标(7,6)的区域对应图1中的显示区域211,图2中的坐标a3(2,2)至坐标a2(5,4)的区域对应图1中的窗口212,图2中的坐标b3(1,1)至坐标b2(4,5)的区域对应图1中的窗口213,图2中的坐标c3(3,0)至坐标c2(6,3)的区域对应图1中的窗口214。Referring to FIG. 2 , after dividing the display area 211 into 42 small areas, the 42 small areas can be corresponding to the discretized coordinate system, the area from coordinates (0, 0) to coordinates (7, 6) in FIG. 2 Corresponding to the display area 211 in FIG. 1 , the area from the coordinates a3 (2, 2) to a2 (5, 4) in FIG. 2 corresponds to the window 212 in FIG. 1 , and the coordinates b3 (1, 1) to The area of coordinates b2 (4, 5) corresponds to the window 213 in FIG. 1 , and the area from coordinates c3 (3, 0) to c2 (6, 3) in FIG. 2 corresponds to the window 214 in FIG. 1 .
通过上述设置,可以将显示区域211内较多的像素点用该离散化后的坐标进行表示,电子设备200在计算显示区域211内的窗口时,只需对该离散化后坐标系内的42个区域进行计算,而不用去考虑原显示区域211内的每个像素点的坐标,有效降低了数据量计算的复杂度。Through the above settings, more pixels in the display area 211 can be represented by the discretized coordinates. When the electronic device 200 calculates the window in the display area 211, it only needs to use the discretized coordinates of 42 It is not necessary to consider the coordinates of each pixel in the original display area 211 to perform the calculation in each area, which effectively reduces the complexity of the calculation of the amount of data.
对显示区域211中的窗口的顶点坐标进行离散化之后,可以根据窗口的z-order顺序,从z-order最顶层的窗口(即,焦点窗口)开始,用窗口句柄对该窗口所在的区域进行标记,每个区域不能被重复标记。After discretizing the vertex coordinates of the windows in the display area 211, you can start from the topmost window of the z-order (that is, the focus window) according to the z-order order of the windows, and use the window handle to perform operations on the area where the window is located. Mark, each area cannot be marked repeatedly.
图3是本申请实施例提供的对窗口进行句柄标记的示意图。FIG. 3 is a schematic diagram of marking a handle to a window according to an embodiment of the present application.
参见图3,根据窗口的z-order顺序,从最顶层的窗口213开始标记,假设窗口213的句柄为1,则窗口213所在的区域的坐标从(2,2)至(5,4)之间的6个区域被标记为1。然后对位于z-order顺序第二层的窗口212进行标记,假设窗口212的句柄为2,由于窗口212所在的区域的坐标从(1,1)至(4,5)共12个区域,但其中的4个区域已经被标记为1,每个区域不能被重复标记,所以对余下的8个区域标记为2。然后对位于z-order顺序最底层的窗口214进行标记,假设窗口214的句柄为3,由于窗口214所在的区域的坐标从(3,0)至(6,3)共9个区域,但其中的2个区域已经被标记为1、1个区域被标记为2,每个区域不能被重复标记,所以对余下的6个区域标记为3。Referring to FIG. 3, according to the z-order order of the windows, start marking from the topmost window 213. Assuming that the handle of the window 213 is 1, the coordinates of the area where the window 213 is located are from (2, 2) to (5, 4). The 6 regions in between are marked as 1. Then mark the window 212 located in the second layer of the z-order sequence, assuming that the handle of the window 212 is 2, since the coordinates of the area where the window 212 is located is from (1, 1) to (4, 5), a total of 12 areas, but 4 of them have been marked as 1, and each area cannot be marked repeatedly, so the remaining 8 areas are marked as 2. Then mark the window 214 at the bottom of the z-order sequence, assuming that the handle of the window 214 is 3, since the coordinates of the area where the window 214 is located is from (3, 0) to (6, 3), a total of 9 areas, but among them 2 areas have been marked as 1, 1 area is marked as 2, each area cannot be marked repeatedly, so the remaining 6 areas are marked as 3.
对于桌面窗口即显示区域211,假设该桌面窗口的句柄为4,该显示区域211所在的区域的坐标从(0,0)至(7,6),共42个区域但其中的6个区域已经被标记为1、8个区域被标记为2、6个区域被标记为3,每个区域不能被重复标记,所以对余下的22个区域标记为4。For the desktop window, that is, the display area 211, assuming that the handle of the desktop window is 4, the coordinates of the area where the display area 211 is located ranges from (0, 0) to (7, 6), a total of 42 areas, but 6 of them have been Marked as 1, 8 areas are marked as 2, 6 areas are marked as 3, each area cannot be marked repeatedly, so the remaining 22 areas are marked as 4.
当所有的区域被标记完成后,电子设备200可以遍历所有区域,统计出标记的不同窗口句柄的数量,从而可以知道显示区域211内具有的可见窗口的数量。After all the regions are marked, the electronic device 200 can traverse all the regions and count the number of different marked window handles, so as to know the number of visible windows in the display region 211 .
示例性地,如图3所示,对显示区域211内的42个区域进行标记之后,统计出窗口句柄从1至4,共4种不同的窗口句柄,则可以计算出除了桌面窗口即显示区域211之外,还拥有3个可见窗口。结合电子设备200初始获得的用户可以通过键盘鼠标操作显示的所有窗口,即可获得哪些窗口不可见。不可见窗口的数量可以通过初始获得的所有窗口的数量减去可见窗口的数量得到,且通过对比初始获得的所有窗口和可见窗口,即可获得哪些窗口不可见。Exemplarily, as shown in FIG. 3, after the 42 areas in the display area 211 are marked, and a total of 4 different window handles from 1 to 4 are counted, it can be calculated that the display area is the display area except the desktop window. In addition to 211, there are 3 visible windows. In combination with the initial acquisition of the electronic device 200, the user can operate all the displayed windows through a keyboard and mouse operation, so as to acquire which windows are invisible. The number of invisible windows can be obtained by subtracting the number of visible windows from the number of all windows obtained initially, and by comparing all the windows obtained initially with the visible windows, which windows are invisible can be obtained.
应理解,该实施例中以窗口213的句柄为1、窗口212的句柄为2、窗口214的句柄为3、桌面窗口的句柄为4为例进行说明,在其他的示例中,上述窗口的句柄也可以用其他值进行表示,本申请实施例对此不予限定。It should be understood that in this embodiment, the handle of the window 213 is 1, the handle of the window 212 is 2, the handle of the window 214 is 3, and the handle of the desktop window is 4 as an example for description. In other examples, the handle of the above window is It may also be represented by other values, which are not limited in this embodiment of the present application.
本申请实施例中,对于不可见窗口,电子设备可以通过调用系统接口将其暂时最小化处理,以减少其占用的系统资源,当用户操作窗口使该最小化的窗口原本的位置可见时,及时还原该窗口,这个过程中用户视觉上无感知,从而不会对用户的使用造成影响,同时又降低了系统的功耗。In this embodiment of the present application, for an invisible window, the electronic device can temporarily minimize the window by calling the system interface to reduce the system resources occupied by the window. When the user operates the window to make the original position of the minimized window visible, timely When the window is restored, the user has no visual perception in this process, so that it will not affect the use of the user, and at the same time, the power consumption of the system is reduced.
对于上述将不可见窗口最小化的操作,可以通过给窗口发消息实现,或者可以采用windows系统原生的对外接口showwindow来实现。For the above operation of minimizing the invisible window, it can be implemented by sending a message to the window, or it can be implemented by using the native external interface showwindow of the windows system.
如果一个窗口要从最小化还原,用户可以使用组合快捷键、点击鼠标等操作实现,但是无论采用哪种方式均会使得该窗口为焦点窗口,而本申请实施例中的还原最小化窗口,是使得该窗口还原到最小化之前的状态,即按照原窗口的z-order顺序还原最小化窗口。If a window is to be restored from minimization, the user can use a combination of shortcut keys, mouse clicks, etc. to realize it, but no matter which method is adopted, the window will be the focus window, and the restoration of the minimized window in the embodiment of the present application is Restore the window to the state before it was minimized, that is, restore the minimized window according to the z-order order of the original window.
例如,窗口A遮挡窗口B,使得窗口B最小化,当用户移动窗口A使得窗口B能够露出一部分时,还原的窗口B不能在窗口A之前,如果窗口B还原到窗口A之前,用户会感到不适,因此,窗口B在还原之后仍需要在窗口A之后,即焦点窗口仍是窗口A。For example, Window A blocks Window B and minimizes Window B. When the user moves Window A to expose a part of Window B, the restored Window B cannot be before Window A. If Window B is restored before Window A, the user will feel uncomfortable. , therefore, window B still needs to be behind window A after restoration, that is, the focus window is still window A.
本申请实施例提供的窗口显示的方法,可以实现按照原窗口的z-order顺序还原最小化窗口,但是在一些特殊的情况下,如用户点击窗口的速度较快时,可能会出现窗口的z-order顺序错乱的情形。The window display method provided by the embodiment of the present application can restore the minimized window according to the z-order order of the original window. -The case where the order is out of order.
尽管windows系统在提供showwindow接口时,通过设定一些参数,如SW_SHOWNOACTIVATE参数,可以使得窗口从最小化状态还原到最近的窗口状态,包括最近的位置和z-order顺序,但是,尽管还原后的窗口不会成为焦点窗口,但是窗口的z-order顺序会容易乱,即该还原后的窗口跳到所有窗口的最前面,但是该窗口也不是焦点窗口。Although the windows system provides the showwindow interface, by setting some parameters, such as the SW_SHOWNOACTIVATE parameter, the window can be restored from the minimized state to the most recent window state, including the most recent position and z-order order, but, although the restored window It will not become the focus window, but the z-order order of the windows will be easily disordered, that is, the restored window jumps to the front of all windows, but the window is not the focus window.
例如,窗口A遮挡窗口B,使得窗口B最小化,当用户移动窗口A使得窗口B能够露出一部分时,还原的窗口B在窗口A之前,但是用户的输入等操作仍在窗口A,这会令用户感到不适。For example, window A blocks window B and minimizes window B. When the user moves window A to expose a part of window B, the restored window B is in front of window A, but the user's input and other operations are still in window A, which will make User feels uncomfortable.
对于该窗口z-order顺序错乱的小概率情形,本申请实施例提供一种窗口显示的方法,可以避免上述问题的发生。For the small probability situation that the z-order of the window is disordered, the embodiment of the present application provides a method for displaying a window, which can avoid the occurrence of the above problem.
图4是本申请实施例提供的另一组GUI的示意图。其中,从图4中的(a)至(e)示出了最小化不可见窗口以及还原最小化窗口的过程。FIG. 4 is a schematic diagram of another group of GUIs provided by an embodiment of the present application. Among them, the process of minimizing the invisible window and restoring the minimized window is shown from (a) to (e) in FIG. 4 .
参见图4中的(a),电子设备的显示区域311中包括窗口312和窗口313,其中,窗 口312位于窗口313之上,即焦点窗口为窗口312,且窗口312部分遮挡窗口313。当电子设备检测到用户打开窗口314的操作之后,可以显示如图4中的(b)所示的GUI。Referring to (a) in FIG. 4 , the display area 311 of the electronic device includes a window 312 and a window 313, wherein the window 312 is located above the window 313, that is, the focus window is the window 312, and the window 312 partially blocks the window 313. After the electronic device detects the user's operation of opening the window 314, the GUI as shown in (b) of FIG. 4 may be displayed.
参见图4中的(b),用户打开窗口314,且该窗口314完全遮挡窗口312和窗口313,即显示区域311的焦点窗口为314。Referring to (b) in FIG. 4 , the user opens the window 314 , and the window 314 completely blocks the window 312 and the window 313 , that is, the focus window of the display area 311 is 314 .
参见图4中的(c),此时,可以在窗口312之后插入窗口312b,窗口312b的大小、位置与窗口312相同,窗口312与窗口312b之间无其他窗口;在窗口313之后插入窗口313b,窗口313b的大小、位置与窗口313相同,窗口313与窗口313b之间无其他窗口。窗口312b、窗口313b用于后续计算窗口312和窗口313是否需要还原,在窗口312最小化之后,窗口312b可以替代窗口312在窗口z-order顺序中的位置,在窗口313最小化之后,窗口313b可以替代窗口313在窗口z-order顺序中的位置。Referring to (c) in FIG. 4 , at this time, a window 312b can be inserted after the window 312, the size and position of the window 312b are the same as those of the window 312, and there is no other window between the window 312 and the window 312b; the window 313b is inserted after the window 313 , the size and position of the window 313b are the same as those of the window 313, and there is no other window between the window 313 and the window 313b. Window 312b and window 313b are used to subsequently calculate whether window 312 and window 313 need to be restored. After window 312 is minimized, window 312b can replace the position of window 312 in the window z-order sequence. After window 313 is minimized, window 313b The position of window 313 in the window z-order can be substituted.
此外,可以通过设置窗口312b与窗口313b的窗口属性,使得该窗口312b与窗口313b对用户不可见,例如,任务栏中或预览模式下不会出现该窗口312b、313b,且用户也无法对该窗口进行操作,例如,用户使用键盘、鼠标、快捷键等均不能操作该窗口312b、313b,且窗口312b、窗口313b基本不占用系统资源。In addition, the window properties of the windows 312b and 313b can be set to make the windows 312b and 313b invisible to the user, for example, the windows 312b and 313b will not appear in the taskbar or in the preview mode, and the user cannot For example, the user cannot operate the windows 312b and 313b by using the keyboard, mouse, shortcut keys, etc., and the windows 312b and 313b basically do not occupy system resources.
该窗口312b和窗口313b插入完成之后,对窗口312和窗口313执行最小化操作,以减少其占用的系统资源,节省系统功耗。After the window 312b and the window 313b are inserted, a minimize operation is performed on the window 312 and the window 313, so as to reduce the system resources occupied by them and save the power consumption of the system.
参见图4中的(d),窗口312和窗口313最小化之后,窗口312b和窗口313b还处在原来的位置,那么用户通过对窗口314执行最小化或关闭操作时,电子设备可以显示如图4中的(e)所示的GUI。Referring to (d) in FIG. 4 , after the window 312 and the window 313 are minimized, the window 312b and the window 313b are still in their original positions, so when the user performs the minimize or close operation on the window 314, the electronic device can display the GUI shown in (e) in 4.
参见图4中的(e),电子设备的显示区域311中显示窗口312和窗口313,且窗口312位于窗口313之上。Referring to (e) of FIG. 4 , a window 312 and a window 313 are displayed in the display area 311 of the electronic device, and the window 312 is located above the window 313 .
当窗口314被关闭或最小化之后,电子设备需要对已经最小化的窗口312和窗口313进行还原,那么在还原窗口312时,将窗口312插入窗口312b之后,在还原窗口313时,将窗口313插入窗口313b之后或之前,即可以保证窗口312和窗口313在窗口z-order顺序中的位置与最小化之前的顺序一致,从而可以避免最小化窗口在还原时出现的z-order顺序错乱的问题。After the window 314 is closed or minimized, the electronic device needs to restore the minimized window 312 and window 313, then when restoring the window 312, insert the window 312 into the window 312b, and when restoring the window 313, insert the window 313 After or before the window 313b is inserted, the position of the window 312 and the window 313 in the z-order order of the window can be guaranteed to be the same as the order before the minimization, so as to avoid the problem of disordered z-order order when the minimized window is restored. .
具体地,电子设备可以通过调用系统接口执行上述功能。例如,电子设备在调用showwindow接口之后,再调用setwindowpos接口执行上述功能。Specifically, the electronic device can perform the above functions by invoking the system interface. For example, after calling the showwindow interface, the electronic device calls the setwindowpos interface to execute the above function.
应理解,在实际应用中,窗口312可能包括多个附庸窗口,那么在插入窗口312b时,将窗口312b插入窗口312之后,即意味着将窗口312b插入窗口312及其附庸窗口之后,从而可以避免其他视觉效果问题。对于窗口313来说也是相同的操作。It should be understood that, in practical applications, the window 312 may include multiple dependent windows, then when inserting the window 312b, inserting the window 312b after the window 312 means inserting the window 312b after the window 312 and its dependent windows, so as to avoid Other visual effects issues. The same operation is also performed for the window 313 .
应理解,该示例中以不可见窗口为两个为例进行说明,在其他的示例中,不可见窗口的数量还可以更多,本申请实施例对此不予限定。It should be understood that in this example, two invisible windows are used as an example for description. In other examples, the number of invisible windows may be more, which is not limited in this embodiment of the present application.
基于本申请实施例,通过在不可见窗口A之后插入额外的窗口A1,当窗口A最小化之后,该窗口A1可以代替窗口A在窗口z-order顺序中的位置,当窗口A需要还原时,将窗口A插入窗口A1之后或之前,从而可以保证窗口A在窗口z-order顺序中的位置与最小化之前的顺序一致。Based on the embodiment of the present application, by inserting an additional window A1 after the invisible window A, when the window A is minimized, the window A1 can replace the position of the window A in the window z-order sequence. When the window A needs to be restored, Window A is inserted after or before window A1, so that the position of window A in the z-order of windows can be guaranteed to be the same as the order before minimization.
在一些情况下,当窗口Z-order顺序中最前台的窗口消失之后,如最小化或关闭,系统会按照窗口z-order顺序寻找下一个最前面的窗口,并将其设置为焦点窗口,但是这个 操作和最小化还原的操作几乎是同步进行的,因此有可能会导致窗口z-order顺序错乱。In some cases, when the frontmost window in the window Z-order order disappears, such as minimized or closed, the system will find the next frontmost window in the window z-order order and set it as the focus window, but This operation is almost synchronized with the operation of minimizing restore, so it may cause the window z-order order to be out of order.
例如,窗口z-order顺序中从上至下的窗口依次是窗口A、窗口B和窗口C,且窗口B部分遮挡窗口C,窗口A完全遮挡窗口B,部分遮挡窗口C,即窗口B被最小化,那么当窗口A由于最小化或关闭使得窗口B可见时,系统再寻找下一个焦点窗口时,由于窗口B此时正在执行还原操作,因此,系统大概率会找到窗口C作为焦点窗口,最终出现的结果可能是窗口C在窗口B之前,这会对用户造成不适。For example, the windows from top to bottom in the window z-order sequence are window A, window B, and window C, and window B partially blocks window C, window A completely blocks window B, and partially blocks window C, that is, window B is the smallest , then when window A is minimized or closed to make window B visible, when the system looks for the next focus window, since window B is performing the restore operation at this time, the system will most likely find window C as the focus window, and finally The result may be that window C precedes window B, which is uncomfortable for the user.
有鉴于此,本申请实施例提供一种窗口显示的方法,能够避免上述问题的发生。In view of this, the embodiments of the present application provide a method for displaying a window, which can avoid the occurrence of the above problems.
图5是本申请实施例提供的另一组GUI的示意图。其中,从图5中的(a)至(d)示出了最小化不可见窗口以及还原最小化窗口的过程。FIG. 5 is a schematic diagram of another group of GUIs provided by an embodiment of the present application. Among them, the process of minimizing the invisible window and restoring the minimized window is shown from (a) to (d) in FIG. 5 .
参见图5中的(a),电子设备的显示区域411中包括窗口412和窗口413,其中,窗口412位于窗口413之上,即焦点窗口为窗口412,且窗口412部分遮挡窗口413。当电子设备检测到用户打开窗口414的操作之后,可以显示如图5中的(b)所示的GUI。5 (a), the display area 411 of the electronic device includes a window 412 and a window 413, wherein the window 412 is located above the window 413, that is, the focus window is the window 412, and the window 412 partially blocks the window 413. After the electronic device detects the user's operation of opening the window 414, the GUI as shown in (b) of FIG. 5 may be displayed.
参见图5中的(b),用户打开窗口414,且该窗口414完全遮挡窗口412,且部分遮挡窗口413,即显示区域411的焦点窗口为414,且窗口413部分可见。5 (b), the user opens the window 414, and the window 414 completely blocks the window 412, and partially blocks the window 413, that is, the focus window of the display area 411 is 414, and the window 413 is partially visible.
参见图5中的(c),此时,可以创建一个窗口415,该窗口415可以被设置为能够捕获到系统寻找焦点窗口的请求,然后将该窗口415插入到窗口412的上方,然后将窗口412进行最小化处理,以节省系统资源。Referring to (c) in FIG. 5, at this time, a window 415 can be created, and the window 415 can be set to be able to capture the request of the system to find the focus window, then insert the window 415 above the window 412, and then insert the window 415 412 performs minimization processing to save system resources.
对于该窗口415,通过设置该窗口415的参数,可以使得其坐标位于显示区域411之外,但是该窗口415在窗口z-order顺序中的位置是处于窗口412的上方的,所以当窗口414最小化或关闭之后,系统寻找到的焦点窗口是窗口415,而不是窗口412。当电子设备检测到用户关闭或最小化窗口414的操作之后,可以显示如图5中的(d)所示的GUI。For the window 415, by setting the parameters of the window 415, its coordinates can be located outside the display area 411, but the position of the window 415 in the window z-order sequence is above the window 412, so when the window 414 is the smallest After the system is created or closed, the focus window found by the system is window 415, not window 412. After the electronic device detects the user's operation of closing or minimizing the window 414, the GUI as shown in (d) of FIG. 5 may be displayed.
参见图5中的(d),该GUI为电子设备的显示区域411,该显示区域411内包括窗口412和窗口413,且窗口412部分遮挡窗口413。即窗口412在窗口z-order顺序中的位置与最小化之前的顺序一致,从而可以避免窗口z-order顺序错乱。Referring to (d) in FIG. 5 , the GUI is a display area 411 of an electronic device, the display area 411 includes a window 412 and a window 413 , and the window 412 partially blocks the window 413 . That is, the position of the window 412 in the z-order of the windows is consistent with the order before the minimization, so that the disorder of the z-order of the windows can be avoided.
在一些示例中,当具有多个被完全遮挡的窗口时,只需将该窗口415插入至多个被遮挡的窗口中在窗口z-order顺序最上层的窗口之上,即可实现上述功能。In some examples, when there are multiple fully occluded windows, only the window 415 needs to be inserted into the multiple occluded windows above the topmost window in the z-order sequence of the windows to achieve the above functions.
应理解,本申请实施例中的窗口415对用户不可见,例如,任务栏中或预览模式下不会出现该窗口415,且用户也无法对该窗口进行操作,例如,用户使用键盘、鼠标、快捷键等均不能操作该窗口415,且该窗口415基本不占用系统资源。It should be understood that the window 415 in this embodiment of the present application is invisible to the user, for example, the window 415 does not appear in the task bar or in the preview mode, and the user cannot operate the window, for example, the user uses the keyboard, mouse, The window 415 cannot be operated by shortcut keys and the like, and the window 415 basically does not occupy system resources.
基于本申请实施例,当窗口A被完全遮挡时,可以创建一个窗口B,并将该窗口B插入至窗口A之上,并将窗口A最小化处理,当窗口A需要还原时,系统寻找焦点窗口时会寻找到窗口B,而窗口A可以正常还原,避免了窗口z-order顺序发生错乱。Based on the embodiments of the present application, when window A is completely blocked, a window B can be created, and the window B can be inserted on top of window A, and window A can be minimized. When window A needs to be restored, the system searches for the focus Window B will be found when the window is opened, and window A can be restored normally, avoiding the disorder of the z-order of the windows.
图6是本申请实施例提供的一种窗口显示的时序示意图,可以包括步骤501至步骤511。FIG. 6 is a schematic timing diagram of a window display provided by an embodiment of the present application, which may include steps 501 to 511 .
501,劫持调用系统应用程序接口(application programming interface,API)函数的消息。501, hijacking a message calling a system application programming interface (application programming interface, API) function.
例如,使用钩子(hook)监控调用系统API的消息,当有API被调用时,钩子可以首先获取到该消息。For example, use a hook to monitor the message calling the system API. When an API is called, the hook can first obtain the message.
502,当API被调用时,会将该API调用消息发送至系统消息监控模块。502, when the API is called, the API call message is sent to the system message monitoring module.
503,系统消息监控模块将该API调用消息发送至窗口监控模块。503. The system message monitoring module sends the API call message to the window monitoring module.
504,窗口监控根据该API调用消息将生产事件消息发送至流控队列。504, the window monitor sends the production event message to the flow control queue according to the API call message.
例如,该生产事件可以是最小化窗口,移动窗口等。For example, the production event could be minimizing the window, moving the window, etc.
505,流控队列保存最新一次接收到的消息。505, the flow control queue saves the latest received message.
应理解,该流控队列中只有一个位置,用于保存一个生产事件消息。It should be understood that there is only one location in the flow control queue for saving a production event message.
506,流控队列将该生产事件消息对应的窗口变化事件发生至窗口遮挡计算模块。506. The flow control queue generates the window change event corresponding to the production event message to the window occlusion calculation module.
507,窗口遮挡计算模块获取当前所有窗口的快照。507. The window occlusion calculation module obtains snapshots of all current windows.
例如,获取桌面窗口z-order顺序中的所有窗口。For example, get all windows in the z-order of desktop windows.
508,窗口遮挡计算模块对所有窗口进行过滤。508. The window occlusion calculation module filters all windows.
其中,该窗口计算模块可以对步骤507获取到的窗口进行过滤,以得到用户可以通过鼠标或键盘操作的所有窗口,该窗口与任务栏中打开的窗口一一对应。The window calculation module can filter the windows obtained in step 507 to obtain all windows that the user can operate through the mouse or keyboard, and the windows correspond one-to-one with the windows opened in the task bar.
509,窗口遮挡计算模块计算可见窗口或不可见窗口。509. The window occlusion calculation module calculates the visible window or the invisible window.
其中,窗口遮挡计算模块可以通过上述离散化算法和句柄标记等确定所有可见窗口,并结合步骤508中得到的所有窗口,确定不可见窗口。Wherein, the window occlusion calculation module can determine all visible windows through the above-mentioned discretization algorithm and handle mark, etc., and determine invisible windows in combination with all windows obtained in step 508 .
510,窗口遮挡计算模块生成窗口。510. The window occlusion calculation module generates a window.
示例性地,如图4所示,窗口遮挡计算模块生成窗口312b和窗口313b。Exemplarily, as shown in FIG. 4 , the window occlusion calculation module generates a window 312b and a window 313b.
示例性地,如图5所示,窗口遮挡计算模块生成窗口415。Exemplarily, as shown in FIG. 5 , the window occlusion calculation module generates a window 415 .
511,窗口遮挡计算模块将最小化指令或还原指令发送给最小化场景与策略模块。511, the window occlusion calculation module sends the minimization instruction or the restoration instruction to the minimization scene and strategy module.
示例性地,如图4所示,窗口遮挡计算模块将被完全遮挡的窗口312的最小化指令发送给最小化场景与策略模块。或者在窗口312需要还原时,将窗口312的还原指令发送给最小化场景与策略模块。Exemplarily, as shown in FIG. 4 , the window occlusion calculation module sends a minimization instruction of the completely occluded window 312 to the minimization scene and strategy module. Or when the window 312 needs to be restored, the restoration instruction of the window 312 is sent to the minimized scene and strategy module.
512,最小化场景与策略模块根据最小化指令对窗口执行最小化操作,或根据还原指令对窗口执行还原操作。512 , the minimization scenario and strategy module performs a minimization operation on the window according to the minimization instruction, or performs a restoration operation on the window according to the restoration instruction.
示例性地,如图4所示,最小化场景与策略模块根据窗口312的最小化指令对窗口312执行最小化操作。或者在窗口312需要还原时,根据窗口312的还原指令对窗口312执行还原操作。Exemplarily, as shown in FIG. 4 , the minimization scenario and strategy module performs a minimization operation on the window 312 according to the minimization instruction of the window 312 . Or when the window 312 needs to be restored, the restoration operation is performed on the window 312 according to the restoration instruction of the window 312 .
应理解,本申请实施例对上述步骤501至步骤512的先后执行顺序不予限定,或者其中的几个步骤可以同时执行等,本申请实施例对此不予限定。It should be understood that the embodiment of the present application does not limit the sequential execution order of the foregoing steps 501 to 512 , or several of the steps may be executed simultaneously, etc., which is not limited in the embodiment of the present application.
图7是本申请实施例提供的一种窗口显示方法的示意性流程图。该方法可以包括步骤601至步骤604。FIG. 7 is a schematic flowchart of a window display method provided by an embodiment of the present application. The method may include steps 601 to 604 .
610,hook监控系统窗口变化消息,将消息发送至队列中。610, the hook monitors the system window change message, and sends the message to the queue.
其中,使用hook监控系统本身的窗口变化消息,当hook到窗口变化消息之后,将该消息发送至队列中。Among them, use the hook to monitor the window change message of the system itself, and when the hook arrives at the window change message, the message is sent to the queue.
620,窗口变化消息进入队列。620, the window change message enters the queue.
其中,该队列中只有一个位置,用于保存一个窗口变动消息,在每次计算完成之后继续读取队列中的消息,若队列中存在消息,则继续计算,但两次计算之间需间隔预设时长,例如,该预设时长可以为30毫秒(millisecond,ms)。从而可以避免同时处理过多消息造成消息堆叠。Among them, there is only one position in the queue, which is used to save a window change message. After each calculation is completed, the message in the queue is continued to be read. If there is a message in the queue, the calculation will continue, but the interval between the two calculations needs to be pre-planned. Set the duration, for example, the preset duration may be 30 milliseconds (millisecond, ms). This can avoid message stacking caused by processing too many messages at the same time.
630,根据窗口遮挡算法,计算不可见窗口。630. Calculate the invisible window according to the window occlusion algorithm.
该步骤630中的详细算法步骤可以参见图8中的相关描述。The detailed algorithm steps in this step 630 can refer to the related description in FIG. 8 .
640,执行策略。640, Execute the policy.
执行策略模块根据窗口遮挡算法的结果,可以执行相应的策略,例如,对不可见窗口进行最小化处理,在最小化窗口需要还原时,对最小化窗口执行还原操作等。The execution strategy module can execute corresponding strategies according to the result of the window occlusion algorithm, for example, minimize the invisible window, and perform the restoration operation on the minimized window when the minimized window needs to be restored.
图8是图7中计算不可见窗口的示意性流程图。该方法可以包括步骤701至步骤704。FIG. 8 is a schematic flowchart of calculating invisible windows in FIG. 7 . The method may include steps 701 to 704 .
631,获取所有窗口的快照。631, obtain snapshots of all windows.
例如,通过获取桌面窗口z-order顺序最底层的窗口之后,使用系统接口如getnextwindow按照窗口z-order顺序向上查找所有窗口。For example, after obtaining the bottommost window in the z-order order of the desktop window, use a system interface such as getnextwindow to find all windows up in the z-order order of the window.
632,筛选目标窗口,与任务栏中的窗口相对应。632. Filter the target window, which corresponds to the window in the task bar.
通过设定一下过滤条件,可以对步骤631中得到的所有窗口进行过滤,从而得到用户可以通过键盘或鼠标操作显示出来的目标窗口,该目标窗口与任务栏中打开的窗口一一对应。By setting a filter condition, all the windows obtained in step 631 can be filtered, so as to obtain a target window that can be displayed by the user through keyboard or mouse operations, and the target window corresponds one-to-one with the windows opened in the task bar.
633,根据窗口层叠以及位置关系,计算不可见窗口。633. Calculate the invisible window according to the window stacking and the positional relationship.
根据窗口层叠顺序以及窗口的位置关系,可以计算不可见窗口。例如,通过上述离散化算法对窗口进行离散化操作,并对离散化之后的窗口的位置进行句柄标记等确定所有可见窗口,并结合步骤632中得到的目标窗口,确定不可见窗口。According to the window stacking order and the positional relationship of the windows, invisible windows can be calculated. For example, the discretization operation is performed on the window through the above-mentioned discretization algorithm, and the position of the discretized window is marked with a handle to determine all visible windows, and the invisible window is determined in combination with the target window obtained in step 632.
634,发送最终计算结果。634, sending the final calculation result.
将步骤633中计算得到的结果,发送至执行策略模块。例如,该执行策略模块可以是上述步骤512中的最小化场景与策略模块。The result calculated in step 633 is sent to the execution strategy module. For example, the execution strategy module may be the minimization scenario and strategy module in step 512 above.
图9是本申请实施例提供的一种窗口显示的方法的示意性流程图。该方法可以应用于电子设备中,该方法可以包括步骤710至步骤770。FIG. 9 is a schematic flowchart of a method for displaying a window provided by an embodiment of the present application. The method can be applied to an electronic device, and the method can include steps 710 to 770 .
710,电子设备捕获窗口变化的第一消息。710. The electronic device captures the first message of the window change.
其中,该第一消息可以是窗口变化的各种消息,例如,通过最小化窗口、最大化窗口、关闭窗口、移动窗口等触发的各种系统消息。The first message may be various messages of window change, for example, various system messages triggered by minimizing the window, maximizing the window, closing the window, moving the window, and the like.
720,所述电子设备根据所述第一消息获取具有层叠顺序的第一目标窗口。720. The electronic device acquires, according to the first message, a first target window with a stacking sequence.
该第一目标窗口可以是多个窗口,该多个窗口具有一定的层叠顺序,该第一目标窗口可以是响应于用户的操作可以在桌面内显示的窗口。The first target window may be a plurality of windows, the plurality of windows have a certain stacking order, and the first target window may be a window that can be displayed on the desktop in response to a user's operation.
例如,该第一目标窗口可以为用户打开的多个窗口,其中,该多个窗口有部分窗口显示在桌面中,部分窗口被最小化,或者部分窗口在桌面中但是被其他窗口遮挡导致对用户不可见等等。For example, the first target window may be multiple windows opened by the user, wherein some of the multiple windows are displayed on the desktop, and some of the windows are minimized, or some of the windows are on the desktop but are blocked by other windows, causing the user not visible etc.
730,所述电子设备根据桌面内窗口的顶点坐标将所述电子设备的桌面除任务栏之外的显示区域划分为多个区域。730. The electronic device divides the display area of the desktop of the electronic device except the taskbar into multiple areas according to the vertex coordinates of the windows in the desktop.
示例性地,参见图1中的(b),电子设备根据桌面内的窗口212、窗口213和窗口214的顶点坐标将显示区域211划分为多个区域。Illustratively, referring to (b) in FIG. 1 , the electronic device divides the display area 211 into a plurality of areas according to the vertex coordinates of the window 212 , the window 213 and the window 214 in the desktop.
740,所述电子设备使用窗口句柄分别对所述多个区域进行标记,所述多个区域中的每个区域不能被重复标记。740. The electronic device uses the window handle to mark the multiple regions respectively, and each region in the multiple regions cannot be marked repeatedly.
应理解,窗口句柄与窗口一一对应,即对于同一个窗口来说,其窗口句柄是相同的。It should be understood that a window handle corresponds to a window one-to-one, that is, for the same window, its window handle is the same.
示例性地,参见图3,使用窗口句柄分别对多个区域进行标记。Illustratively, referring to FIG. 3 , a plurality of regions are respectively marked using a window handle.
750,所述电子设备根据所述多个区域标记的窗口句柄确定所述桌面内用户可见的第 二目标窗口。750. The electronic device determines a second target window visible to the user in the desktop according to the window handles of the multiple area markers.
应理解,由于窗口句柄于窗口一一对应,因此在对上述多个区域进行标记之后,只需遍历一遍所有的窗口句柄,根据多少个不同的窗口句柄,即可确定有多少个可见的窗口,以及该可见窗口是哪个窗口。It should be understood that since the window handles correspond to the windows one-to-one, after marking the above-mentioned multiple areas, it is only necessary to traverse all the window handles, and determine how many visible windows there are according to how many different window handles there are. and which window that visible window is.
示例性地,参见图3,共标记了4个不同的窗口句柄,则可以确定具有4个可见窗口,其中,一个是桌面窗口,则除去桌面窗口之外,在桌面内共有3个对用户可见的窗口,即该第二目标窗口为该可见的3个窗口。Exemplarily, referring to FIG. 3 , a total of 4 different window handles are marked, it can be determined that there are 4 visible windows, one of which is a desktop window, then in addition to the desktop window, there are a total of 3 visible windows in the desktop that are visible to the user. window, that is, the second target window is the three visible windows.
760,所述电子设备根据所述第一目标窗口和所述第二目标窗口确定用户不可见的第三目标窗口。760. The electronic device determines, according to the first target window and the second target window, a third target window that is invisible to the user.
其中,电子设备在确定可见的第二目标窗口之后,结合第一目标窗口可以确定哪些窗口时不可见的,即第三目标窗口。该第三目标窗口可以是一个,也可以是多个,本申请实施例对此不予限定。Wherein, after determining the visible second target window, the electronic device can determine which windows are invisible, that is, the third target window, in combination with the first target window. The third target window may be one or multiple, which is not limited in this embodiment of the present application.
770,所述电子设备将所述第三目标窗口最小化。770. The electronic device minimizes the third target window.
在确定用户不可见的第三目标窗口之后,电子设备将该第三目标窗口最小化处理,以节省系统资源。After determining the third target window invisible to the user, the electronic device minimizes the third target window to save system resources.
基于本申请实施例,电子设备可以在捕获窗口变化的消息之后,获取桌面内用户打开的第一目标窗口,然后根据桌面内窗口的顶点坐标将电子设备的桌面除任务栏之外的部分划分为多个区域,再使用窗口句柄对该多个区域进行标记,从而可以确定桌面中对用户可见的第二目标窗口,从而结合第一目标窗口确定不可见的第三目标窗口,然后将该第三目标窗口最小化。该技术方案可识别电子设备显示桌面中的不可见窗口并将其最小化处理,能够降低电子设备占用的系统资源,降低系统功耗。Based on the embodiments of the present application, the electronic device may acquire the first target window opened by the user in the desktop after capturing the message of the window change, and then divide the part of the desktop of the electronic device except the taskbar into two parts according to the vertex coordinates of the window in the desktop. multiple areas, and then use the window handle to mark the multiple areas, so that the second target window visible to the user in the desktop can be determined, and the invisible third target window can be determined in combination with the first target window, and then the third target window can be determined. The target window is minimized. The technical solution can identify invisible windows in the desktop displayed by the electronic device and minimize them, thereby reducing the system resources occupied by the electronic device and reducing the power consumption of the system.
应理解,本申请对上述步骤710至步骤770的先后执行顺序不予限定,或者其中的几个步骤可以同时执行等,本申请实施例对此不予限定。It should be understood that the present application does not limit the sequential execution order of the foregoing steps 710 to 770 , or that several of the steps may be executed simultaneously, etc., which is not limited in this embodiment of the present application.
可选地,所述电子设备根据所述第一消息获取具有层叠顺序的第一目标窗口,包括:所述电子设备根据所述第一消息获取桌面内窗口的层叠顺序中除桌面窗口之外最底层的窗口;所述电子设备根据所述桌面内窗口的层叠顺序从所述最底层的窗口向上查找所有窗口,得到所述第一目标窗口,其中,所述第一目标窗口为响应于用户的操作能够显示的窗口。Optionally, obtaining, by the electronic device, a first target window having a stacking order according to the first message, comprising: obtaining, by the electronic device, according to the first message, the most windows in the desktop in the stacking sequence of windows except the desktop window. the bottom window; the electronic device searches upwards from the bottommost window for all windows according to the stacking order of the windows in the desktop, and obtains the first target window, wherein the first target window is a response to the user's Operates the windows that can be displayed.
示例性地,参见图1中的(a),该窗口212、窗口213、窗口214在窗口的层叠顺序中的顺序依次为窗口213、窗口212、窗口214。则该第一目标窗口为窗口213、窗口212、窗口214。For example, referring to (a) in FIG. 1 , the window 212 , the window 213 , and the window 214 are in the order of window 213 , window 212 , and window 214 in the order of the window stacking sequence. Then the first target window is window 213 , window 212 , and window 214 .
应理解,桌面窗口位于窗口层叠顺序中的位置为最底层。It should be understood that the position of the desktop window in the window stacking order is the bottommost layer.
基于本申请实施例,电子设备可以根据桌面内窗口的层叠顺序,获得所有响应于用户的操作能够显示的窗口,有利于后续计算不可见窗口。Based on the embodiments of the present application, the electronic device can obtain all the windows that can be displayed in response to the user's operation according to the stacking order of the windows in the desktop, which is beneficial to the subsequent calculation of invisible windows.
可选地,所述电子设备根据桌面内窗口的顶点坐标将所述电子设备的桌面除任务栏之外的显示区域划分为多个区域,包括:所述电子设备根据所述桌面内窗口的顶点在第一方向上的坐标将所述显示区域在所述第一方向的长度划分为多个部分;所述电子设备根据所述桌面内窗口的顶点在第二方向上的坐标将所述显示区域在所述第二方向的长度划分为多个部分。Optionally, the electronic device divides the display area of the desktop of the electronic device except for the taskbar into multiple areas according to the apex coordinates of the window in the desktop, including: the electronic device according to the apex of the window in the desktop. The coordinates in the first direction divide the length of the display area in the first direction into a plurality of parts; the electronic device divides the display area according to the coordinates of the vertices of the windows in the desktop in the second direction The length in the second direction is divided into a plurality of parts.
示例性地,参见图1中的(b),该第一方向可以平行于电子设备的转轴的方向(或者说横轴方向),电子设备在该第一方向上,根据桌面内的窗口212、窗口213和窗口214的顶点在第一方向上的坐标,将显示区域211划分为7个部分。该第二方向可以是垂直与电子设备的转轴的方向(或者说纵轴方向),电子设备在该第二方向上,根据桌面内的窗口212、窗口213和窗口214的顶点在第二方向上的坐标,将显示区域211划分为6个部分,则整个显示区域211被划分为42个区域。Exemplarily, referring to (b) in FIG. 1 , the first direction may be parallel to the direction of the rotation axis (or the horizontal axis direction) of the electronic device, and the electronic device is in the first direction according to the window 212 in the desktop, The coordinates of the vertices of the window 213 and the window 214 in the first direction divide the display area 211 into seven parts. The second direction may be a direction perpendicular to the rotation axis of the electronic device (or the longitudinal axis direction), and the electronic device is in the second direction, according to the vertices of the window 212, the window 213 and the window 214 in the desktop in the second direction If the display area 211 is divided into 6 parts, the entire display area 211 is divided into 42 areas.
基于本申请实施例,电子设备的桌面除任务栏之外的显示区域在第一方向上根据桌面内窗口的顶点在第一方向上的坐标划分为多个部分,电子设备的桌面除任务栏之外的显示区域在第二方向上根据桌面内窗口的顶点在第二方向上的坐标划分为多个部分,从而可以将显示区域划分为多个区域,有利于后续计算不可见窗口。Based on the embodiment of the present application, the display area of the desktop of the electronic device except the taskbar is divided into multiple parts in the first direction according to the coordinates of the vertices of the windows in the desktop in the first direction, and the desktop of the electronic device except the taskbar is divided into multiple parts. The outer display area is divided into multiple parts in the second direction according to the coordinates of the vertices of the windows in the desktop in the second direction, so that the display area can be divided into multiple areas, which is conducive to the subsequent calculation of invisible windows.
可选地,所述电子设备使用窗口句柄分别对所述多个区域进行标记,包括:所述电子设备根据所述桌面内窗口的层叠顺序从最顶层的窗口开始,使用所述窗口句柄依次向下标记。Optionally, the electronic device uses the window handle to mark the multiple areas respectively, including: the electronic device starts from the topmost window according to the stacking order of the windows in the desktop, and uses the window handle to go to the topmost window in sequence. mark down.
电子设备根据桌面内窗口的层叠顺序,从最顶层的窗口开始使用窗口句柄依次向下进行标记,示例性地,参见图3,窗口的层叠顺序中,窗口213位于最顶层,则使用窗口213的窗口句柄对其进行标记,例如,其窗口句柄为1,则将窗口213所在的6个区域均标记为1。然后分别对位于窗口213之后的窗口212和窗口214进行标记,每个区域不能够被重复标记,直至将所有区域标记完成。According to the stacking order of the windows in the desktop, the electronic device starts from the topmost window and uses the window handle to mark it downwards. For example, referring to FIG. The window handle marks it. For example, if its window handle is 1, the six areas where the window 213 is located are marked as 1. Then, the window 212 and the window 214 located after the window 213 are marked respectively, and each area cannot be marked repeatedly until all areas are marked.
基于本申请实施例,使用窗口句柄按照桌面内窗口的层叠顺序从最顶层的窗口开始依次进行标记,从而可以确定桌面内用户可见的窗口。Based on the embodiments of the present application, the window handles are used to mark the topmost window in sequence according to the stacking sequence of the windows in the desktop, so that the windows visible to the user in the desktop can be determined.
可选地,在所述电子设备根据所述第一消息获取具有层叠顺序的第一目标窗口之前,所述方法还包括:所述电子设备将所述第一消息保存在第一队列中,所述第一队列每次保留一个消息;所述电子设备从所述第一队列中读取所述第一消息。Optionally, before the electronic device acquires a first target window with a stacking order according to the first message, the method further includes: the electronic device saves the first message in a first queue, and the The first queue keeps one message at a time; the electronic device reads the first message from the first queue.
例如,该第一队列可以是上述实施例中的流控队列模块。For example, the first queue may be the flow control queue module in the above embodiment.
可选地,所述电子设备从所述第一队列中读取所述第一消息的间隔大于或等于第一预设时长。Optionally, an interval at which the electronic device reads the first message from the first queue is greater than or equal to a first preset duration.
例如,该第一预设时长可以是30ms。For example, the first preset duration may be 30ms.
该技术方案可以避免过多消息堆叠,导致误操作。The technical solution can avoid excessive message stacking and cause misoperation.
可选地,所述第三目标窗口包括第一窗口和第二窗口,且所述第一窗口部分遮挡所述第二窗口,所述第二目标窗口包括第三窗口,在所述电子设备将所述第三目标窗口最小化之前,所述方法还包括:所述电子设备在所述第一窗口之后插入第四窗口;所述电子设备在所述第二窗口之后插入第五窗口;其中,所述第四窗口和所述第五窗口对用户不可见。Optionally, the third target window includes a first window and a second window, and the first window partially blocks the second window, the second target window includes a third window, and the electronic device will Before the third target window is minimized, the method further includes: inserting, by the electronic device, a fourth window after the first window; inserting, by the electronic device, a fifth window after the second window; wherein, The fourth window and the fifth window are invisible to the user.
示例性地,参见图4的(a)至(c),该第三目标窗口包括第一窗口和第二窗口,例如该第一窗口可以是窗口312、该第二窗口可以是窗口313,该第二目标窗口包括的第三窗口可以是窗口314,该第四窗口可以是窗口312b,该第五窗口可以是窗口313b。Exemplarily, referring to (a) to (c) of FIG. 4 , the third target window includes a first window and a second window, for example, the first window may be the window 312, the second window may be the window 313, the The third window included in the second target window may be the window 314, the fourth window may be the window 312b, and the fifth window may be the window 313b.
其中,该第四窗口在桌面中的位置和大小可以和第一窗口相同,也可以不同;第五窗口在桌面中的位置和大小可以和第一窗口相同,也可以不同。Wherein, the position and size of the fourth window on the desktop can be the same as or different from the first window; the position and size of the fifth window on the desktop can be the same as or different from the first window.
应理解,可以通过设置第四窗口与第五窗口的窗口属性,使得该第四窗口与第五窗口对用户不可见,例如,任务栏中或预览模式下不会出现该第四窗口与第五窗口,且用户也 无法对该窗口进行操作,例如,用户使用键盘、鼠标、快捷键等均不能操作该第四窗口与第五窗口,且该第四窗口与第五窗口基本不占用系统资源。It should be understood that by setting the window properties of the fourth window and the fifth window, the fourth window and the fifth window can be made invisible to the user, for example, the fourth window and the fifth window will not appear in the task bar or in the preview mode. Window, and the user cannot operate the window, for example, the user cannot operate the fourth window and the fifth window using the keyboard, mouse, shortcut keys, etc., and the fourth window and the fifth window basically do not occupy system resources.
基于本申请实施例,通过在需要最小化的窗口之后插入额外的窗口,可以将该额外的窗口作为最小化窗口在窗口层叠顺序中的参考位置,以避免最小化窗口还原后的层叠顺序错乱。Based on the embodiments of the present application, by inserting an additional window after the window to be minimized, the additional window can be used as the reference position of the minimized window in the window stacking sequence, so as to avoid the stacking sequence disorder after the restoration of the minimized window.
可选地,该第四窗口也可以插入第一窗口之前,该第五窗口也可以插入第二窗口之前。Optionally, the fourth window can also be inserted before the first window, and the fifth window can also be inserted before the second window.
可选地,所述方法还包括:响应于用户的第一操作,所述电子设备将所述第一窗口插入至所述第四窗口之后,将所述第二窗口插入至所述第五窗口之后;所述电子设备显示第一界面,所述第一界面包括所述第一窗口和所述第二窗口,其中,所述第一窗口部分遮挡所述第二窗口。Optionally, the method further includes: in response to a user's first operation, after the electronic device inserts the first window into the fourth window, inserting the second window into the fifth window Afterwards; the electronic device displays a first interface, where the first interface includes the first window and the second window, wherein the first window partially blocks the second window.
该第一操作可以是用户最小化第三窗口、关闭第三窗口或移动第三窗口的操作,使得第一窗口和第二窗口对用户可见,则电子设备需要将该第一窗口和第二窗口从最小化还原。The first operation may be an operation of the user to minimize the third window, close the third window or move the third window, so that the first window and the second window are visible to the user, then the electronic device needs to use the first window and the second window Restore from minimization.
示例性地,参见图4,该第一界面可以是图4中的(e)中的电子设备的显示界面,当第三窗口314最小化或关闭之后,电子设备的桌面中显示第一窗口312和第二窗口313,且第一窗口312部分遮挡第二窗口313,即该第一窗口和第二窗口还原后的位置与最小化之前是相同的。Exemplarily, referring to FIG. 4 , the first interface may be the display interface of the electronic device in (e) of FIG. 4 , after the third window 314 is minimized or closed, the first window 312 is displayed on the desktop of the electronic device. and the second window 313, and the first window 312 partially blocks the second window 313, that is, the restored positions of the first window and the second window are the same as before the minimization.
基于本申请实施例,在最小化的第一窗口和第二窗口还原时,将其按照原来的顺序分别插入至第四窗口和第五窗口之后,可以保证其在窗口层叠顺序中的位置与最小化之前相同,从而可以避免最小化窗口还原后的层叠顺序错乱。Based on the embodiments of the present application, when the minimized first window and the second window are restored, they are inserted into the fourth window and the fifth window respectively in the original order, so that their positions in the window stacking order can be guaranteed to be the same as the smallest window. It is the same as before the minimization, so that the stacking order after the minimization window is restored can be avoided.
可选地,所述第三目标窗口包括第一窗口,所述第二目标窗口包括第二窗口和第三窗口,且所述第三窗口部分遮挡所述第二窗口、所述第一窗口部分遮挡所述第二窗口,在所述电子设备将所述第三目标窗口最小化之前,所述方法还包括:所述电子设备创建第六窗口,所述第六窗口位于所述第一窗口之前;其中,所述第六窗口的顶点坐标位于所述电子设备的桌面之外。Optionally, the third target window includes a first window, the second target window includes a second window and a third window, and the third window partially blocks the second window and the first window. Blocking the second window, before the electronic device minimizes the third target window, the method further includes: the electronic device creating a sixth window, the sixth window being located before the first window ; wherein, the vertex coordinates of the sixth window are located outside the desktop of the electronic device.
示例性地,参见图5,该第三目标窗口中第一窗口可以是窗口412,该第二目标窗口中的第二窗口可以是窗口413,该第二目标窗口中的第二窗口可以是窗口414。该第六窗口可以是窗口415,该窗口415的顶点坐标位于电子设备的桌面之外,即该窗口415不会显示在桌面中,但是该窗口415在窗口层叠顺序中的位置位于第一窗口即窗口412之前。5, the first window in the third target window may be the window 412, the second window in the second target window may be the window 413, and the second window in the second target window may be the window 413. 414. The sixth window may be the window 415, and the vertex coordinates of the window 415 are located outside the desktop of the electronic device, that is, the window 415 will not be displayed on the desktop, but the position of the window 415 in the window stacking sequence is located in the first window, that is, the window 415 is not displayed on the desktop. before window 412.
基于本申请实施例,第六窗口的顶点坐标位于电子设备的桌面之外,但是该第六窗口在窗口层叠顺序中的位置位于该第一窗口之前,该第六窗口可以在第三窗口消失时捕获到系统寻找焦点窗口的操作,从而不会影响第一窗口和第二窗口在窗口层叠顺序中的位置。Based on the embodiment of the present application, the vertex coordinates of the sixth window are located outside the desktop of the electronic device, but the position of the sixth window in the window stacking sequence is located before the first window, and the sixth window can be displayed when the third window disappears The operation of the system finding the focus window is captured, so that the position of the first window and the second window in the window stacking order will not be affected.
可选地,所述方法还包括:响应于用户的第二操作,所述电子设备显示第二界面,所述第二界面包括所述第一窗口和所述第二窗口,其中,所述第一窗口部分遮挡所述第二窗口。Optionally, the method further includes: in response to a second operation of the user, the electronic device displays a second interface, the second interface includes the first window and the second window, wherein the first window A window partially blocks the second window.
该第二操作可以是用户可以是用户最小化第三窗口、关闭第三窗口或移动第三窗口的操作,使得第一窗口对用户可见。The second operation may be an operation performed by the user to minimize the third window, close the third window, or move the third window, so that the first window is visible to the user.
示例性地,参见图5,该第二界面可以是图5中的(d)中的电子设备的显示界面。当第三窗口414关闭或最小化之后,电子设备的桌面中显示第一窗口412和第二窗口413,且第一窗口412部分遮挡第二窗口413,即该第一窗口位置与最小化之前是相同的。For example, referring to FIG. 5 , the second interface may be the display interface of the electronic device in (d) of FIG. 5 . After the third window 414 is closed or minimized, the first window 412 and the second window 413 are displayed on the desktop of the electronic device, and the first window 412 partially blocks the second window 413, that is, the position of the first window is the same as before the minimized window. identical.
基于本申请实施例,该第二操作可以是最小化或关闭第三窗口的操作,则第一窗口和可以还原至原来的位置。该技术方案可以避免最小化窗口还原后的层叠顺序错乱。Based on the embodiment of the present application, the second operation may be an operation of minimizing or closing the third window, and then the sum of the first window may be restored to its original position. The technical solution can avoid the stacking sequence disorder after the minimized window is restored.
本申请实施例还提供一种电子设备,包括一个或多个处理器;一个或多个存储器;该一个或多个存储器存储有一个或多个计算机程序,该一个或多个计算机程序包括指令,当该指令被一个或多个处理器执行时,使得如前文中任一种可能的实现方式中所述的窗口显示的方法被执行。Embodiments of the present application further provide an electronic device, including one or more processors; one or more memories; the one or more memories stores one or more computer programs, and the one or more computer programs include instructions, When the instructions are executed by one or more processors, the method of causing a window to be displayed as described in any of the possible implementations above is performed.
本申请实施例还提供一种芯片,所述芯片包括处理器和通信接口,所述通信接口用于接收信号,并将所述信号传输至所述处理器,所述处理器处理所述信号,使得如前文中任一种可能的实现方式中所述的窗口显示的方法被执行。An embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, where the communication interface is configured to receive a signal and transmit the signal to the processor, and the processor processes the signal, The method for causing the window to be displayed as described in any of the foregoing possible implementation manners is executed.
本实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述相关方法步骤实现上述实施例中的窗口显示的方法。This embodiment also provides a computer-readable storage medium, where computer instructions are stored in the computer-readable storage medium, and when the computer instructions are executed on the electronic device, the electronic device executes the above-mentioned related method steps to realize the above-mentioned embodiments. method of window display.
本实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的窗口显示的方法。This embodiment also provides a computer program product, which, when the computer program product runs on a computer, causes the computer to execute the above-mentioned relevant steps, so as to realize the method for displaying a window in the above-mentioned embodiment.
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中的窗口显示的方法。In addition, the embodiments of the present application also provide an apparatus, which may specifically be a chip, a component or a module, and the apparatus may include a connected processor and a memory; wherein, the memory is used for storing computer execution instructions, and when the apparatus is running, The processor can execute the computer-executed instructions stored in the memory, so that the chip executes the method for displaying a window in the foregoing method embodiments.
其中,本实施例提供的电子设备、计算机可读存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Wherein, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, for the beneficial effects that can be achieved, reference may be made to the above-provided method. The beneficial effects in the corresponding method will not be repeated here.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes .
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this. should be covered within the scope of protection of this application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (13)
- 一种窗口显示的方法,其特征在于,所述方法应用于电子设备,所述方法包括:A method for window display, characterized in that the method is applied to an electronic device, and the method includes:所述电子设备捕获窗口变化的第一消息;the electronic device captures the first message of the window change;所述电子设备根据所述第一消息获取具有层叠顺序的第一目标窗口;The electronic device acquires, according to the first message, a first target window with a stacking order;所述电子设备根据桌面内窗口的顶点坐标将所述电子设备的桌面除任务栏之外的显示区域划分为多个区域;The electronic device divides the display area of the desktop of the electronic device except the taskbar into multiple areas according to the vertex coordinates of the window in the desktop;所述电子设备使用窗口句柄分别对所述多个区域进行标记,所述多个区域中的每个区域不能被重复标记;The electronic device uses the window handle to mark the multiple areas respectively, and each area in the multiple areas cannot be repeatedly marked;所述电子设备根据所述多个区域标记的窗口句柄确定所述桌面内用户可见的第二目标窗口;The electronic device determines a second target window visible to the user in the desktop according to the window handles marked by the multiple regions;所述电子设备根据所述第一目标窗口和所述第二目标窗口确定用户不可见的第三目标窗口;The electronic device determines a third target window invisible to the user according to the first target window and the second target window;所述电子设备将所述第三目标窗口最小化。The electronic device minimizes the third target window.
- 根据权利要求1所述的方法,其特征在于,所述电子设备根据所述第一消息获取具有层叠顺序的第一目标窗口,包括:The method according to claim 1, wherein the electronic device obtains, according to the first message, a first target window with a stacking order, comprising:所述电子设备根据所述第一消息获取桌面内窗口的层叠顺序中除桌面窗口之外最底层的窗口;The electronic device obtains, according to the first message, the bottommost window except the desktop window in the stacking sequence of the windows in the desktop;所述电子设备根据所述桌面内窗口的层叠顺序从所述最底层的窗口向上查找所有窗口,得到所述第一目标窗口,其中,所述第一目标窗口为响应于用户的操作能够显示的窗口。The electronic device searches upwards from the bottommost window for all windows according to the stacking order of the windows in the desktop, and obtains the first target window, wherein the first target window is displayable in response to a user's operation window.
- 根据权利要求1或2所述的方法,其特征在于,所述电子设备根据桌面内窗口的顶点坐标将所述电子设备的桌面除任务栏之外的显示区域划分为多个区域,包括:The method according to claim 1 or 2, wherein the electronic device divides the display area of the desktop of the electronic device except the taskbar into multiple areas according to the vertex coordinates of the windows in the desktop, including:所述电子设备根据所述桌面内窗口的顶点在第一方向上的坐标将所述显示区域在所述第一方向的长度划分为多个部分;The electronic device divides the length of the display area in the first direction into a plurality of parts according to the coordinates of the vertices of the window in the desktop in the first direction;所述电子设备根据所述桌面内窗口的顶点在第二方向上的坐标将所述显示区域在所述第二方向的长度划分为多个部分。The electronic device divides the length of the display area in the second direction into a plurality of parts according to the coordinates of the vertices of the window in the desktop in the second direction.
- 根据权利要求1-3中任一项所述的方法,其特征在于,所述电子设备使用窗口句柄分别对所述多个区域进行标记,包括:The method according to any one of claims 1-3, wherein the electronic device uses a window handle to mark the multiple regions respectively, comprising:所述电子设备根据所述桌面内窗口的层叠顺序从最顶层的窗口开始,使用所述窗口句柄依次向下标记。The electronic device starts from the topmost window according to the stacking order of the windows in the desktop, and uses the window handle to mark down in sequence.
- 根据权利要求1-4中任一项所述的方法,其特征在于,在所述电子设备根据所述第一消息获取具有层叠顺序的第一目标窗口之前,所述方法还包括:The method according to any one of claims 1-4, wherein before the electronic device acquires the first target window with a stacking order according to the first message, the method further comprises:所述电子设备将所述第一消息保存在第一队列中,所述第一队列每次保留一个消息;The electronic device saves the first message in a first queue, and the first queue retains one message at a time;所述电子设备从所述第一队列中读取所述第一消息。The electronic device reads the first message from the first queue.
- 根据权利要求5所述的方法,其特征在于,所述电子设备从所述第一队列中读取所述第一消息的间隔大于或等于第一预设时长。The method according to claim 5, wherein an interval at which the electronic device reads the first message from the first queue is greater than or equal to a first preset duration.
- 根据权利要求1-6中任一项所述的方法,其特征在于,所述第三目标窗口包括第 一窗口和第二窗口,且所述第一窗口部分遮挡所述第二窗口,所述第二目标窗口包括第三窗口,在所述电子设备将所述第三目标窗口最小化之前,所述方法还包括:The method according to any one of claims 1-6, wherein the third target window comprises a first window and a second window, and the first window partially blocks the second window, the The second target window includes a third window, and before the electronic device minimizes the third target window, the method further includes:所述电子设备在所述第一窗口之后插入第四窗口;the electronic device inserts a fourth window after the first window;所述电子设备在所述第二窗口之后插入第五窗口;the electronic device inserts a fifth window after the second window;其中,所述第四窗口和所述第五窗口对用户不可见。Wherein, the fourth window and the fifth window are invisible to the user.
- 根据权利要求7所述的方法,其特征在于,所述方法还包括:The method according to claim 7, wherein the method further comprises:响应于用户的第一操作,所述电子设备将所述第一窗口插入至所述第四窗口之后,将所述第二窗口插入至所述第五窗口之后;In response to the user's first operation, the electronic device inserts the first window after the fourth window, and inserts the second window after the fifth window;所述电子设备显示第一界面,所述第一界面包括所述第一窗口和所述第二窗口,其中,所述第一窗口部分遮挡所述第二窗口。The electronic device displays a first interface, the first interface includes the first window and the second window, wherein the first window partially blocks the second window.
- 根据权利要求1-6中任一项所述的方法,其特征在于,所述第三目标窗口包括第一窗口,所述第二目标窗口包括第二窗口和第三窗口,且所述第三窗口部分遮挡所述第二窗口、所述第一窗口部分遮挡所述第二窗口,在所述电子设备将所述第三目标窗口最小化之前,所述方法还包括:The method according to any one of claims 1-6, wherein the third target window comprises a first window, the second target window comprises a second window and a third window, and the third The window partially blocks the second window, the first window partially blocks the second window, and before the electronic device minimizes the third target window, the method further includes:所述电子设备创建第六窗口,所述第六窗口位于所述第一窗口之前;the electronic device creates a sixth window, the sixth window is located before the first window;其中,所述第六窗口的顶点坐标位于所述电子设备的桌面之外。Wherein, the vertex coordinates of the sixth window are located outside the desktop of the electronic device.
- 根据权利要求9所述的方法,其特征在于,所述方法还包括:The method according to claim 9, wherein the method further comprises:响应于用户的第二操作,所述电子设备显示第二界面,所述第二界面包括所述第一窗口和所述第二窗口,其中,所述第一窗口部分遮挡所述第二窗口。In response to the user's second operation, the electronic device displays a second interface, the second interface includes the first window and the second window, wherein the first window partially blocks the second window.
- 一种电子设备,其特征在于,包括一个或多个处理器;一个或多个存储器;该一个或多个存储器存储有一个或多个计算机程序,该一个或多个计算机程序包括指令,当该指令被一个或多个处理器执行时,使得如权利要求1-10中任一项所述的窗口显示的方法被执行。An electronic device, characterized in that it includes one or more processors; one or more memories; the one or more memories stores one or more computer programs, the one or more computer programs include instructions, when the one or more memories are stored The instructions, when executed by one or more processors, cause the method of window display of any of claims 1-10 to be performed.
- 一种芯片,其特征在于,所述芯片包括处理器和通信接口,所述通信接口用于接收信号,并将所述信号传输至所述处理器,所述处理器处理所述信号,使得如权利要求1-10中任一项所述的窗口显示的方法被执行。A chip, characterized in that the chip includes a processor and a communication interface, the communication interface is used to receive a signal, and transmit the signal to the processor, and the processor processes the signal, such as The method of window display of any one of claims 1-10 is performed.
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机指令,当所述计算机指令在计算机上运行时,使得如权利要求1-10中任一项所述的窗口显示的方法被执行。A computer-readable storage medium, wherein computer instructions are stored in the computer-readable storage medium, and when the computer instructions are executed on a computer, the computer instructions according to any one of claims 1 to 10 are implemented. The window display method is executed.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110406595.0A CN115220826A (en) | 2021-04-15 | 2021-04-15 | Window display method and electronic equipment |
CN202110406595.0 | 2021-04-15 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022218150A1 true WO2022218150A1 (en) | 2022-10-20 |
Family
ID=83605661
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/083912 WO2022218150A1 (en) | 2021-04-15 | 2022-03-30 | Window display method and electronic device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN115220826A (en) |
WO (1) | WO2022218150A1 (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1044718A (en) * | 1989-02-06 | 1990-08-15 | 国际商业机器公司 | Depth buffer clip in the window management |
JPH06124184A (en) * | 1992-10-12 | 1994-05-06 | Sharp Corp | Multiwindow display device |
JPH08320777A (en) * | 1995-05-25 | 1996-12-03 | Canon Inc | Processor and method for information processing |
CN101996072A (en) * | 2009-08-21 | 2011-03-30 | 联想(北京)有限公司 | Window management method and computer of operating system |
-
2021
- 2021-04-15 CN CN202110406595.0A patent/CN115220826A/en active Pending
-
2022
- 2022-03-30 WO PCT/CN2022/083912 patent/WO2022218150A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1044718A (en) * | 1989-02-06 | 1990-08-15 | 国际商业机器公司 | Depth buffer clip in the window management |
JPH06124184A (en) * | 1992-10-12 | 1994-05-06 | Sharp Corp | Multiwindow display device |
JPH08320777A (en) * | 1995-05-25 | 1996-12-03 | Canon Inc | Processor and method for information processing |
CN101996072A (en) * | 2009-08-21 | 2011-03-30 | 联想(北京)有限公司 | Window management method and computer of operating system |
Also Published As
Publication number | Publication date |
---|---|
CN115220826A (en) | 2022-10-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US12056341B2 (en) | Method, apparatus, and terminal for processing notification information | |
US20230244317A1 (en) | Proxy Gesture Recognizer | |
US20210004141A1 (en) | Desktop generation and operation methods for mobile terminal and corresponding devices thereof | |
EP3982242A2 (en) | Event recognition | |
EP3028133B1 (en) | Multi-monitor full screen mode in a windowing environment | |
JP2000330684A (en) | Multi-window display system and window displaying and deleting method | |
WO2011112533A1 (en) | Method for managing non-overlapping windows | |
TW201405363A (en) | Application controlling system and method | |
CN106155768A (en) | Split screen runs the method and device of application | |
US20200089512A1 (en) | Method and Apparatus for Invoking Input Method, Server, and Terminal | |
WO2022218150A1 (en) | Window display method and electronic device | |
US20150103025A1 (en) | Information processing device, method and program | |
JP5918902B2 (en) | Remote display area with input lens that draws each area of the graphical user interface | |
CN110221767A (en) | Control method and device of intelligent interaction equipment | |
TWI607369B (en) | System and method for adjusting image display | |
CN114253648A (en) | Remote application virtualization method and device | |
JP2002341990A (en) | Information processor, control program of information processor, and storage medium in which the control program is stored | |
EP3091815A1 (en) | Operation control method and terminal | |
CN106126107B (en) | Electronic apparatus and control method | |
CN114594922A (en) | Display control method, device, equipment and storage medium | |
CN113360074A (en) | Soft keyboard display method, related device and computer program product | |
JP2011180743A (en) | Window size change program, window size change method and window size change device | |
JPH02272621A (en) | Window control method | |
JPH04332034A (en) | Multi-window priority management system |
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: 22787378 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 22787378 Country of ref document: EP Kind code of ref document: A1 |