Display method and electronic equipment
By responding to user operations in an electronic device and highlighting the most recently displayed window as the foreground window, the problem of the taskbar window being accidentally highlighted or the entire screen being not highlighted is solved, improving the user experience.
Patent Information
- Application Number
- CN202411456826.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-10-17
AI Technical Summary
When the screen includes multiple display windows, when the user minimizes one display window by clicking the taskbar window, the taskbar window may be highlighted or the entire screen is not highlighted, affecting the user's user experience.
By implementing a display method in the electronic device, in response to the user's operation in the taskbar window, the first window is minimized, and the most recently displayed second window saved by the electronic device is used as the foreground window to highlight the second window, thereby avoiding highlighting the taskbar window or not highlighting other windows.
Ensure that other display windows on the screen can be highlighted when the user minimizes the window, improving the user experience, and avoiding the flickering problem caused by the taskbar window being mistaken for the foreground window.
Smart Images

Figure CN119645541A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal devices, and in particular to a display method and an electronic device. Background Art
[0002] An electronic device with focus mode turned on can highlight a foreground window, and can change the highlighted window as the foreground window switches, so that the user can focus on the highlighted window.
[0003] However, when the screen includes multiple display windows and the user minimizes a display window by clicking the taskbar window, it is generally considered that the foreground window is switched to the taskbar window. At this time, there is a probability that the taskbar window will be highlighted or all windows on the screen will not be highlighted, thereby not highlighting other display windows on the screen, affecting the user experience. Summary of the invention
[0004] The embodiment of the present application provides a display method and an electronic device. It is used to solve the problem that when a screen includes multiple display windows and a user minimizes a display window by clicking a taskbar window, other windows are not highlighted. To achieve the above purpose, the embodiment of the present application adopts the following technical solution:
[0005] In a first aspect, a display method is provided, the method comprising: displaying a first window; displaying the first window in a first area on the screen, the brightness of the first area being greater than the brightness outside the first area; minimizing the first window in response to a first operation in a taskbar window; after the first window is minimized, the brightness of a second area on the screen is greater than the brightness outside the second area, the second area is a display area of a second window on the screen, and the second window is the most recent window displayed on the screen saved by the electronic device.
[0006] In this embodiment, when the user minimizes the first window by clicking the taskbar window, the second window that is most recently displayed on the screen and saved by the electronic device is used as the foreground window, and the second window is highlighted, thereby avoiding highlighting the taskbar window or not highlighting it, and improving the user experience.
[0007] In some implementations, the second window is obtained; the second window is a window stored in a window container; the window container is used to store windows displayed on the screen.
[0008] In this implementation, the window displayed on the screen is saved by the window container, and the second window is obtained from the window container, so that the efficiency of determining the second window can be improved.
[0009] In some implementations, the first window in the window container is deleted.
[0010] In this implementation, after the first window is minimized, the first window is deleted from the window container, so that the window container can be updated in real time, thereby improving the accuracy of determining whether there is a display window on the screen.
[0011] In some embodiments, the first mask window is set in a lower layer of the second window, and the display brightness of the first mask window is lower than the display brightness of the second window; the first mask window is used to reduce the brightness outside the second area on the desktop; wherein, the display brightness of the window located in the lower layer of the first mask window and overlapping with the display area corresponding to the first mask window is the same as the display brightness of the first mask window.
[0012] In this embodiment, the window located at the lower layer of the first mask window is shielded by setting the first mask window, so that the display brightness of the window located at the lower layer of the first mask window is lower than the display brightness of the target window located at the upper layer of the first mask window, thereby achieving the effect of highlighting the window.
[0013] In some implementations, the second mask window is set on an upper layer of the taskbar window, and the display brightness of the second mask window is lower than the display brightness of the second window; the second mask is used to reduce the brightness of the taskbar window;
[0014] The display brightness of the window located in the lower layer of the second mask window and overlapping with the display area corresponding to the second mask window is the same as the display brightness of the second mask window.
[0015] In this embodiment, by setting the second mask window on the upper layer of the taskbar window, it is possible to avoid highlighting the taskbar window when the taskbar window is considered as the foreground window. It is also possible to avoid the situation where the taskbar window flickers when the foreground window is switched. The second mask window can ensure that the taskbar window is always displayed at low brightness.
[0016] In some implementations, the window container is accessed periodically; when the number of accesses to the window container exceeds a preset threshold, it is determined whether there is a floating window on the screen based on the most recent access result; the floating window represents a window displayed on the screen.
[0017] In this embodiment, by periodically accessing the window container and when the number of accesses exceeds a preset threshold, it is determined whether there is a floating window in the window container based on the most recent access result, thereby achieving a delay effect, avoiding delays in message resources for window minimization and misjudgment, thereby improving the accuracy of the focus mode setting.
[0018] In some implementations, if it is determined that there are at least two floating windows on the screen, the second window is determined according to the order in which the floating windows are displayed, and the second window is the most recent window displayed on the screen and saved by the electronic device.
[0019] In this implementation, the most recent window displayed on the screen and stored by the electronic device is used as the second window, which can improve the user experience in the focus mode.
[0020] In some implementations, if it is determined that there is no floating window on the screen, the desktop and taskbar windows are highlighted.
[0021] In this implementation, when there is no floating window on the screen, the desktop and the taskbar window are highlighted, and the taskbar window is avoided from being highlighted.
[0022] In some implementations, the first mask window and the second mask window are hidden.
[0023] In this implementation, since the desktop and taskbar windows are considered to be the bottom-layer windows, setting the mask window below the desktop and taskbar windows will result in failure, so hiding the mask window can achieve highlighting of the desktop.
[0024] In some embodiments, the visible window attribute WS_VISIBLE is provided;
[0025] The area overlapping with the desktop is larger than the preset area;
[0026] The number of switches to the top layer within the preset time is less than the preset number;
[0027] Not transparent.
[0028] In this embodiment, selecting a window that meets the above conditions as a target window can highlight the window observed by the user.
[0029] In some implementations, a foreground window message is obtained to determine whether the object of the foreground window message is a desktop or taskbar window; if it is determined that the object of the foreground window message is a desktop or taskbar window, a second window is obtained; otherwise, the object of the foreground window message is saved in a window container.
[0030] In this embodiment, when the object of the foreground window message is the desktop or taskbar window, obtaining the second window can avoid highlighting the taskbar window or the screen being masked and displayed at low brightness, which can improve the user experience in the focus mode.
[0031] In a second aspect, an electronic device is provided, which has the function of implementing the method described in the first aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0032] In a third aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is executed on a computer, the computer can execute any of the methods described in the first aspect.
[0033] According to a fourth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any one of the methods according to the first aspect.
[0034] Among them, the technical effects brought about by any design method in the second to fourth aspects can refer to the technical effects brought about by different design methods in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A schematic diagram of a display window scene applicable to the method provided in an embodiment of the present application;
[0036] Figure 2 A schematic diagram of a focus mode scenario applicable to the method provided in an embodiment of the present application;
[0037] Figure 3 A schematic diagram of the Z-axis sequence of windows applicable to the method provided in an embodiment of the present application;
[0038] Figure 4 A schematic diagram of a focus mode scenario applicable to the method provided in an embodiment of the present application;
[0039] Figure 5 A schematic diagram of an operating system message processing mechanism applicable to the method provided in an embodiment of the present application;
[0040] Figure 6 A schematic diagram of highlighting a taskbar window applicable to the method provided in an embodiment of the present application;
[0041] Figure 7 An example diagram of a window frequently switching to the foreground in the focus mode applicable to the method provided in the embodiment of the present application;
[0042] Figure 8 An example diagram of a window ready time lagging behind the foreground window message processing in the focus mode applicable to an embodiment of the present application;
[0043] Fig. 9 A flow chart of a display method provided in an embodiment of the present application;
[0044] Fig.10 A schematic diagram of a framework flow corresponding to a foreground window message receiving and processing process provided in an embodiment of the present application;
[0045] Fig.11A schematic diagram of a flow chart for determining a valid window provided in an embodiment of the present application;
[0046] Fig.12 A flowchart of a method for determining whether a floating window exists provided in an embodiment of the present application;
[0047] Fig.13 A flow chart of a method for setting a focus mode provided in an embodiment of the present application;
[0048] Fig.14 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0049] Fig.15 A schematic diagram of a software architecture of an electronic device provided in an embodiment of the present application;
[0050] Fig.16 A processing flow chart of an application provided in an embodiment of the present application;
[0051] Fig.17 A processing flow chart of a module in an application provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] In the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and the appended claims of the present application, the singular expressions "a", "said", "above", "the" and "this" are intended to also include such expressions as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one or more (including two). The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are a kind of "or" relationship.
[0053] References to "one embodiment" or "some embodiments" etc. described in this specification mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Thus, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways. The term "connection" includes direct connection and indirect connection, unless otherwise specified. "First" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.
[0054] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0055] Electronic devices can display multiple windows. A window is a user interface used to display the content of an application. Figure 1 As shown, the electronic device 100 displays a chat window (window 11), a video window (window 12), a taskbar window (window 13) and a desktop 14 of the operating system. The taskbar window (window 13) includes application icons 11-1 and 12-1 corresponding to the chat window (window 11) and the video window (window 12), respectively. In addition, the electronic device 100 also includes input devices such as a touch screen, a mouse / touchpad, and a keyboard. The user can use these input devices to interact with the content displayed in these windows, and can also control these windows to open, close, or minimize, etc. For example, the user uses a mouse / touchpad to click the application icon 11-1 in the taskbar window (window 13) to close / open the chat window (window 11).
[0056] When the electronic device 100 displays at least one window, one window can be highlighted to facilitate the user to focus on the highlighted window. This function can be called focus mode. A switch can be set on the electronic device 100 to enter or exit the focus mode. For example, the focus mode switch is set in the device manager application. When the focus mode switch is turned on, the electronic device 100 enters the focus mode; when the focus mode switch is turned off, the electronic device 100 exits the focus mode. In other examples, the focus mode switch can also be set in other applications, or as a separate application.
[0057] After the electronic device 100 enters the focus mode, the foreground window can be highlighted. The foreground window usually refers to the focus window, that is, the window that the user is currently interacting with and can receive input. In contrast, the background window refers to the non-focus window. The background window can remain running, but cannot receive input. It can only receive input when the background window is changed to the foreground window. For example, the user clicks on a window with the mouse to change the window from the background window to the foreground window, so that the window can receive input. See Figure 2 , Figure 2 The figure shows an example of a display interface after the electronic device 100 enters the focus mode. Figure 2 In (a), the electronic device 100 displays a chat window (window 21), a video window (window 22), a taskbar window (window 23), and a desktop 24. The video window is a foreground window displayed on the top layer of the screen, and the chat window is a background window located below the video window. The electronic device 100 highlights the video window, and the chat window, taskbar window, and desktop are displayed at a lower brightness than the video window (non-highlighted). For example, in Figure 2 In (a), the slash indicates the non-highlighted area of the electronic device 100. If the user uses the touchpad to control the cursor to select the chat window, the foreground window switches, the chat window changes to the foreground window, and the video window changes to the background window. The electronic device 100 sets the focus mode according to the user's operation, so that the chat window is highlighted, and the video window and the desktop are not highlighted. For example, Figure 2 As shown in (b), the chat window (window 21) is highlighted, and the video window (window 22) and the taskbar window (window 23) and the desktop 24 are not highlighted. Figure 2 In (b), the non-highlighted area of the electronic device 100 is indicated by oblique lines.
[0058] The screen displayed by the electronic device 100 is composed of windows (the desktop can also be regarded as a special window). Each window involved in the synthesis has window attributes such as display position, Z-order, and transparency. The operating system of the electronic device 100 can synthesize these windows according to the window attributes to obtain a synthesized screen, which is displayed on the screen through the display driver. Among them, the Z-order of the windows determines the display order of the windows in the synthesized screen. For example, Figure 3 As shown, window 31 is located at the top layer of all windows, window 32 is displayed at the bottom layer of window 31 , and desktop 33 is displayed at the bottom layer of window 32 .
[0059] In one embodiment, a focus mode is implemented by adding a mask window below the foreground window. The mask window does not display any content, and the transparency is set to a preset value so that the mask window appears semi-transparent. In this way, the content of the window below the mask window can be displayed through the mask window, but will be affected by the transparency of the mask window, presenting a darkened effect. The foreground window above the mask window will not be affected by the transparency of the mask window. Thus, the effect of highlighting the foreground window is achieved. See Figure 4 , Figure 4 This section introduces an example of how to implement highlighting in the foreground window. Figure 4 In (a), the electronic device 100 displays a screen including a foreground window (window 41), a mask window (window 42), a background window (window 43), and a desktop 44. The desktop 44 may include a taskbar window. The mask window is displayed at the lower layer of the foreground window and at the upper layer of the background window and the desktop. The electronic device 100 synthesizes these windows according to their Z-axis order and other window properties to obtain a synthesized screen, and displays the synthesized screen. Figure 4 As shown in (b), the electronic device 100 displays a composite screen, in which the foreground window (window 41) is highlighted, the background window (window 43) and the desktop 44 are not highlighted, and the display contents of the background window and the desktop can be seen. Figure 4 In (b), the non-highlighted area of the electronic device 100 is indicated by oblique lines.
[0060] A display method provided in an embodiment of the present application is applied to a first application program, and the first application program runs on an operating system of an electronic device 100. The operating system of the electronic device 100 may include, for example: operating system, Operating system, etc. In the embodiment of the present application, the electronic device 100 is deployed The operating system is used as an example for illustration. The following is an example of an operating system, but the basic principles also apply to An electronic device 100 having an operating system such as the above.
[0061] The operating system is a message-driven system, in which the message processing mechanism is The core of the operating system. Messages provide communication between applications and between applications. A means of communication between operating systems. The functions to be implemented by the application are triggered by messages and completed by responding to and processing the messages. The following is an example of The message processing mechanism of the operating system (abbreviated as OS).
[0062] Figure 5 The following is a schematic diagram of the message processing mechanism of the operating system of the electronic device 100. Figure 5 As shown, the operating system is responsible for encapsulating the window events detected by the input device according to a preset message structure (e.g., MSG message structure) to obtain a window message. In addition, some applications can also generate window messages. The operating system saves these window messages in the window message queue of the operating system kernel. The first application obtains the window message of interest (e.g., foreground window message, window destroy / minimize message) from the window message queue and hands it over to the window procedure function for processing.
[0063] Among them, the window event can be generated by the input device (for example, mouse / touchpad, keyboard, etc.) in response to the user's operation, such as the user clicks the mouse to switch windows, or uses the combination key on the keyboard to switch windows, etc. The operating system obtains these window events and encapsulates them in MSG format to obtain window messages. In addition, some applications can also generate window messages. For example, when some social software receives a chat message from the server and prepares to display a chat window, it will generate a window message, or when some applications prepare to display some message pop-ups, they will generate window messages, etc.
[0064] The MSG message structure includes information such as the window handle and the message identifier. The window handle is a special identifier. Generally, the window handle indicates a memory address in which the property information of the window is stored. The window handle can be used to obtain the property information of the window or edit the property information of the window. The message identifier can indicate the window message type, which includes, for example, foreground window message, window creation message, window destruction message, window minimize message, etc.
[0065] The window procedure function is used to process window messages. An application may include multiple window procedure functions, and different window procedure functions can implement different functions. These functions include, for example, changing the window style, window transparency, hiding the window, setting the window Z-axis order, etc. In an embodiment of the present application, the window procedure function included in the first application can set the focus mode according to the foreground window message. The focus mode setting includes, for example, calling the Set Window Pos function interface to set the mask window in the lower layer of the foreground window.
[0066] Next, combined with the above Figure 5 The examples are used to exemplarily introduce the scenarios and methods to which the embodiments of the present application are applicable.
[0067] Currently, in some scenarios, after the electronic device 100 enters the focus mode, if the user clicks the application icon on the taskbar window to minimize the window corresponding to the application icon on the desktop, the taskbar window will be highlighted and other windows on the upper layer of the desktop will be displayed at low brightness, affecting the user's experience.
[0068] like Figure 6 A taskbar window highlighting schematic diagram is shown in Figure 6 In (a), a chat window (window 61), a video window (window 62), a taskbar window (window 63) and a desktop 64 are displayed on the desktop of the electronic device 100. Among them, the taskbar window (window 63) includes an application icon 61-1 for the chat window and an application icon 62-1 for the video window. At this time, the chat window (window 61) is the foreground window, and the electronic device 100 highlights the chat window (window 31); the video window (window 62), the taskbar window (window 63) and the desktop 64 are displayed at low brightness. In response to the user clicking on the application icon 61-1 in the taskbar window (window 63), the electronic device 100 minimizes the chat window. At this time, the electronic device 100 sets the taskbar window (window 63) as the foreground window according to the window message, and the electronic device 100 highlights the taskbar window, and the video window (window 62) and the desktop 64 are displayed at low brightness. Figure 6 As shown in (b), the electronic device 100 highlights the taskbar window (window 63), and the video window 62 and the desktop 64 are displayed at low brightness. Figure 6 In (b), the area displayed at low brightness is indicated by oblique lines.
[0069] In other scenarios, after the electronic device 100 enters the focus mode, if the user clicks on the application icon on the taskbar window to minimize the window corresponding to the application icon on the desktop, the taskbar window will be set as the foreground window, and a mask window will be set at the lower layer of the taskbar window. However, the taskbar window is generally considered to be part of the desktop. Therefore, when setting the mask on the lower layer of the taskbar window, there may be a failure, resulting in the mask window being located on the desktop and the upper layer of the taskbar window. If there are other floating windows at this time, this will cause the desktop, other floating windows on the desktop, and the taskbar window to be displayed at low brightness, affecting the user experience. In some related technologies, the topmost attribute can be used to solve the above problem. That is, the target window is placed at the top of the screen to avoid the situation where the taskbar window is considered to be the foreground window and the taskbar window is not blocked. For example Figure 6 As shown in (c) of FIG. 6 , window 61 uses the topmost attribute. However, as Figure 6 As shown in (d), if the window 61-3 in the application corresponding to the window 61 is clicked, the window 61 is still pinned and highlighted, while the window 61-3 cannot be highlighted.
[0070] Therefore, an embodiment of the present application provides a display method, which can select a floating window located on the upper layer of the desktop for highlighting when the taskbar window is changed to the foreground window. The method includes displaying a first window; the first window is displayed in a first area on the screen, and the brightness of the first area is greater than the brightness outside the first area; in response to a first operation in the taskbar window, the first window is minimized; after the first window is minimized, the brightness of the second area on the screen is greater than the brightness outside the second area, the second area is the display area of the second window on the screen, and the second window is the most recent window displayed on the screen saved by the electronic device. Among them, the first operation can be clicking on the application icon corresponding to the first window on the taskbar window, minimizing the first window, so that the first window is not displayed on the screen, but the application icon corresponding to the first window is still displayed in the taskbar window. Unlike closing the first window, when the first window is closed, the application icon corresponding to the first window is not displayed in the taskbar window. The first window and the second window are floating windows.
[0071] The floating window refers to a window that is visible to the user but not on the desktop or taskbar. The floating window can be dragged to move the display position. For example, the floating window includes some application windows or folder windows.
[0072] Optionally, the window handle of the first window and the window handle of the second window are saved in a window container. The window container is used to store windows displayed on the screen. At the same time, after minimizing the first window in response to the first operation, the first window in the window container is deleted, and specifically, the window handle of the first window in the window container can be deleted. The window container is updated to ensure the accuracy of the floating window on the screen.
[0073] Therefore, in response to minimizing the first window in the first operation of the taskbar window, the foreground window is changed to the taskbar window, and the second window is obtained from the window container. Exemplarily, when there are at least two floating windows in the window container, it can be determined that there are at least two floating windows on the screen, and the second window is determined according to the order in which the floating windows are displayed. The second window is the most recent window displayed on the screen saved by the electronic device. For example, the most recently displayed second window can be determined according to the Z-axis order of the floating windows.
[0074] That is, the floating window being displayed on the screen is saved, and when the taskbar window or the desktop is changed to the foreground window, one of the floating windows is selected from the saved floating windows to be re-determined as the foreground window and is highlighted.
[0075] In some embodiments, multiple mask windows are set, one of which (which may be called a taskbar mask window) is set on an upper layer of the taskbar window. When the taskbar window is changed to a foreground window, if there are other floating windows on the desktop, the taskbar mask window is set on an upper layer of the taskbar window to achieve low-brightness display of the taskbar window and avoid the situation where both the taskbar window and the second window are displayed in highlight.
[0076] The mask window does not display any content, and the transparency is set to a preset value so that the mask window presents a semi-transparent effect. In this way, the content of the window located below the mask window can be displayed through the mask window, but will be affected by the transparency of the mask window, while the foreground window located above the mask window will not be affected by the transparency of the mask window. This achieves the effect of highlighting the foreground window
[0077] For example, the first mask window is set at the lower layer of the target window, the display brightness of the first mask window is lower than the display brightness of the target window, and the first mask window is used to reduce the brightness outside the second area on the desktop. Among them, the display brightness of the window located at the lower layer of the first mask window and overlapping the display area corresponding to the first mask window is the same as the display brightness of the first mask window.
[0078] The second mask window is set on the upper layer of the fixed window, the display brightness of the second mask window is lower than the display brightness of the target window, and the second mask window is used to reduce the brightness of the taskbar window. The display brightness of the window located in the lower layer of the second mask window and overlapping the display area corresponding to the second mask window is the same as the display brightness of the second mask window.
[0079] In addition, when the taskbar window is changed to the foreground window, if there is no floating window on the upper layer of the desktop, the desktop and the taskbar window are highlighted. For example, the first mask window and the second mask window are hidden.
[0080] In this way, when the taskbar window is changed to the foreground window, if there is a floating window on the desktop, one of the floating windows on the top layer will be selected and highlighted to avoid highlighting the taskbar window and causing other floating windows to be displayed at low brightness. If there is no floating window on the desktop, the mask window will be hidden to achieve highlighting of the desktop and taskbar windows.
[0081] In some scenarios, after the electronic device 100 enters the focus mode, if some windows are frequently switched to the foreground in a short period of time, the mask window is constantly placed under the foreground window by the device, which will cause the window on the screen of the electronic device 100 to flicker. For example, some applications will construct a large number of foreground window messages, causing the Z-axis order of the windows on the desktop to switch frequently. If the focus mode is set for each foreground window message, the mask window will change with the switching of the foreground window, which will cause the screen of the electronic device 100 to flicker.
[0082] like Figure 7 As shown, Figure 7 The following is an example of a window frequently switching to the foreground. Figure 7 (a) shows an example of windows 71 and 72 frequently switching to the foreground. In response to window 71 being switched to the foreground (t1), the focus mode is set to set the mask window (window 73) at the lower layer of window 71, and window 72 is located at the lower layer of the mask window. In response to window 72 being switched to the foreground, the focus mode is set to set the mask window at the lower layer of window 72, and window 71 is located at the lower layer of the mask window. (t2) In a short period of time, windows 71 and 72 frequently switch to the foreground, and the mask window changes with windows 71 and 72, causing the screen of the electronic device to flicker. Figure 7 (b)~ Figure 7As shown in (c), in response to window 71 being switched to the foreground for focus mode setting, the electronic device 100 highlights window 71, and then, in response to window 72 being switched to the foreground for focus mode setting, the electronic device 100 highlights window 72. The frequent switching of windows 71 and 72 to the foreground causes the screen of the electronic device to flicker (in Figure 7 (b) and Figure 7 In (c), the non-highlighted area of the electronic device is represented by a slash.)
[0083] In addition, in some scenarios, due to the different complexity of the window itself, the time required to load and release window resources may also be different, which will cause the window to be ready (loading resources completed, or releasing resources completed) to lag behind the processing of the foreground window message, resulting in an error in the focus mode setting. For example, the user clicks the application icon on the taskbar window to minimize the window corresponding to the application icon on the desktop. Before the resources of the window are completely released, if the focus mode is set, the mask window will be set in the lower layer of the window. After the resources of the window are completely released, the window does not exist in the upper layer of the desktop. At this time, the mask window is located at the top layer of the desktop, causing the electronic device 100 to not highlight the window.
[0084] The embodiment of the present application provides a display method, which caches the foreground window message within a preset time. If the number of times the foreground window message is received is less than the preset number within the preset time, the focus mode is set. If the number of times the foreground window message is received is greater than the preset number, the foreground window message is reconstructed. In this way, the window can be prevented from flickering when it is frequently switched to the foreground.
[0085] like Figure 8 As shown, Figure 8 The example diagram shows that the window ready time lags behind the foreground window message processing. In response to the operation of minimizing the window 81, as shown in FIG. Figure 8 In (a), the operating system of the electronic device 100 releases the resources of window 81, and the first application sets the focus mode. Since window 81 has not completely released its resources at this time, the window message still shows that window 81 is still displayed on the desktop. The first application selects window 81 to set the focus mode, such as Figure 8 In (b), window 81 is used as the foreground window, and the mask window (window 83) is set at the lower layer of window 81, that is, the upper layer of desktop 82. The operating system of electronic device 100 releases the resources of window 81, and window 81 exits the desktop display. However, at this time, the mask window is at the uppermost layer of the desktop, covering the windows at the lower layer of the mask window, such as Figure 8 As shown in (c), this results in the electronic device 100 not displaying the highlighted window.
[0086] The embodiment of the present application provides a display method, which performs a foreground window check after the window is switched to the foreground. The foreground window check includes: after a preset time, if the foreground window has not changed, then select the foreground window for focus mode setting, if the foreground window has changed, then select a new foreground window for focus mode setting.
[0087] Exemplarily, a timer check can be set. After selecting the foreground window for setting the focus mode, a timer is started. The timer is destroyed after the timing ends. After the timer is destroyed, it is determined whether there is a new window switched to the foreground. If so, the focus mode is set for the new window switched to the foreground. If not, the focus mode is set for the original foreground window.
[0088] Since a timer check delay is added to process the focus mode setting of the foreground window, it can be avoided that the focus mode setting of a large number of windows switched to the foreground in a short period of time causes the electronic device screen to flicker.
[0089] In addition, the delay processing of setting the focus mode for the foreground window can also wait for the resources of the foreground window to be loaded or released. If the resources of the foreground window are displayed on the screen after loading, the foreground window can be correctly highlighted. If the resources of the foreground window are not displayed on the screen after releasing, a new foreground window can be selected for highlighting. This prevents the electronic device screen from not displaying the highlighted window.
[0090] like Fig. 9 As shown, the process of the display method is exemplarily introduced.
[0091] S901. Get foreground window message.
[0092] In some examples, in response to a user operation, a Get Window Procedure Hook (Set Win EventHook) function may be used to obtain a foreground window message in a window message queue.
[0093] S902: Determine whether the current foreground window message needs to be filtered.
[0094] For example, the window name / window class name is obtained through the window handle included in the foreground window message. If the window name / window class name exists in the preset window filter list, then the foreground window message needs to be filtered.
[0095] Call the Load XmlFile function to parse the XML configuration table, read out all the feature values that need to be filtered by the window name / window class name, and store them in the window filter list. Then get the window name / window class name of the foreground window according to the window handle included in the foreground window message, and finally compare the window name / window class name of the foreground window with the window name / window class name in the window filter list. If the window name / window class name of the foreground window exists in the window filter list, then the foreground window message needs to be filtered.
[0096] If the window obtained through the window handle included in the foreground window message has the WS_EX_NOACTION attribute or the WS_EX_TRANSPARENT attribute, then the foreground window message needs to be filtered.
[0097] Call the Get Window Long (GWL) function to get the window style (eg, GWL_STYLE) and the window extended style (eg, GWL_EXSTYLE). If the window has the WS_EX_NOACTION attribute or the WS_EX_TRANSPARENT attribute, the foreground window message needs to be filtered.
[0098] If the window size obtained through the window handle included in the foreground window message is smaller than the preset size, or the window display area is outside the screen display area, then the foreground window message needs to be filtered.
[0099] The rectangular area (rect) attribute of the window is obtained through the window handle included in the foreground window message, and the window size and window display area are obtained according to the rectangular area attribute of the window. If the window size is smaller than the preset size, or the window display area is outside the screen display area, then the foreground window message needs to be filtered. According to the above example, if it is determined that the foreground window message needs to be filtered, enter S903. Otherwise, if the foreground window message does not need to be filtered, directly enter S904.
[0100] S903: If the foreground window message needs to be filtered, filter the foreground window to determine a valid window.
[0101] In some examples, the valid window satisfies the following judgment conditions:
[0102] Has the WS_VISIBLE attribute.
[0103] Exemplarily, a window with the WS_VISIBLE attribute indicates that the operating system considers the window to be visible. If the window does not have the WS_VISIBLE attribute, it indicates that the operating system considers the window to be invisible and cannot be observed by the user.
[0104] The area where the window intersects with the desktop is larger than the preset area;
[0105] For example, some windows with special sizes are difficult for users to observe with naked eyes. For example, the length of some windows only occupies one pixel, or the width only occupies one pixel. Windows of such window sizes cannot be observed by users.
[0106] Non-transparent window.
[0107] Exemplarily, a transparent window is invisible to a user and cannot be observed by the user.
[0108] Infrequently switch to the top-level windows. If some windows are frequently switched to the top-level windows in a short period of time, the screen will flicker and affect user experience.
[0109] In some examples, until the foreground window message that needs to be filtered has the WS_EX_NOACTION attribute, the window handle of the foreground window is saved and the process proceeds to S904.
[0110] for example, Fig.10 What is shown is the framework flow diagram corresponding to the foreground window message receiving and processing process, such as Fig.10 As shown, the window message in the message queue is obtained (S1001). For example, the Set Win EventHook function is used to obtain the foreground window, window maximization, minimization, window hiding and other messages in the window message queue. Determine whether it is a foreground window message (S1002). For example, Win Event Proc is used to receive the window message in S1001 and perform message judgment. If it is not a foreground window message, the process ends (S1006). If it is EVENT_SYSTEM_FOREGROUND (foreground window message), determine whether filtering is required (S1003). If filtering is not required, enter S904 (S1005). If filtering is required, call Process Foreground Wnd Msg to filter the foreground window message. The specific filtering process can refer to step S903. After completing the filtering of the foreground window message, construct the foreground window message (S1004), and then enter S904 (S1005). For example, the attributes that need to be processed by the attribute judgment filter window are filled in, and the construction of the foreground window message is completed.
[0111] S904: Determine whether it is a desktop or taskbar window.
[0112] In some examples, a window procedure function (e.g., Win Event Proc function) can be used to identify window messages. If there is a window activation / deactivation message WM_OWN_ACTIVE, the foreground window attribute information is parsed from the MSG structure. Specifically, IsDesktopProcess is called to determine whether it is a desktop window. The desktop window includes the taskbar window.
[0113] Fig.11 What is shown is a flowchart of judging the effective window, such as Fig.11 As shown, a foreground window message is received (S1101), wherein, if it is determined in the above steps S902 and S903 that the object of the current foreground window message is a valid window, then directly enter S1102; if the message obtained from the message loop is a constructed WM_OWN_ACTIVE message, it is necessary to parse the foreground window attribute information from the structure. And determine whether it is a desktop or taskbar window (S1102). If the object of the foreground window message is not the desktop or the taskbar, set the focus mode (S1106). Specifically, it can be to set the mask window in the lower layer of the foreground window and save the window in the window container. If the object of the foreground window message is the desktop or the taskbar, create a timer (S1103) and determine whether there is a floating window (S1104). If there is no floating window, set the focus mode (S1106). Specifically, it can be to hide the mask window and highlight the desktop and taskbar. If there is a floating window, determine the second window (S1105). Among them, the second window is the most recent window displayed on the screen saved by the electronic device.
[0114] As can be seen from the above, if it can be determined that the object of the current foreground window message is the desktop or taskbar window, enter S906. Otherwise,
[0115] Enter S905.
[0116] S905: Set the mask window at the lower layer of the foreground window.
[0117] Exemplarily, the above S904 can determine that the valid window is not a desktop or taskbar window, and at this time, the mask window is set at the lower layer of the valid window to achieve a highlight display effect of the window.
[0118] In other examples, after the mask setting is completed, the process then enters S910 and re-enters the message loop to wait, that is, re-enters S901 to continue obtaining foreground window messages.
[0119] S906: Determine whether there is a floating window on the upper layer of the desktop.
[0120] In a possible implementation, when the object of the foreground window message is the desktop or taskbar window, it is determined whether there is a floating window on the upper layer of the desktop; if so, the floating windows on the upper layer of the desktop are determined from top to bottom in the Z-axis order, and the valid window on the top layer is selected, and the mask window is placed on the lower layer of the valid window to achieve the effect of highlighting the valid window. If not, the mask window is hidden to achieve the effect of highlighting the desktop or taskbar window.
[0121] That is, it is determined whether there is a floating window in the window container; if there is a floating window in the window container, the second window is determined; if there is no floating window in the window container, the desktop is highlighted.
[0122] Optionally, a window container may be set, and the window handle of the window judged as a valid window and displayed on the screen may be saved in the window container. The first application may select the most recently opened window or the window at the top layer as the second window in the window container. If the first application fails to obtain the window handle from the window container, it means that there is no valid window suspended on the upper layer of the current desktop. At this time, the mask window is hidden to achieve the effect of highlighting the desktop.
[0123] For example, the window container is accessed periodically; if the number of accesses to the window container exceeds a preset threshold, it is determined whether there is a floating window on the screen based on the most recent access result; a floating window represents a window displayed on the screen. If it is determined that there are at least two floating windows on the screen, the second window is determined based on the order in which the floating windows are displayed, and the second window is the most recent window displayed on the screen saved by the electronic device. If it is determined that there is no floating window on the screen, the desktop and taskbar windows are highlighted.
[0124] In some examples, when a user clicks on a taskbar window, the taskbar window is considered to be a foreground window. At this time, it is necessary to determine whether there is a floating window on the current desktop.
[0125] For example, a timer is created, and the timer is used to determine whether there is a floating window in the first window container, thereby determining whether there is a floating window on the upper layer of the desktop.
[0126] For example, Fig.12 The figure shows a flow chart of determining whether there is a floating window when the foreground window object is the desktop. Fig.12As shown, a timer is created (S1201). The first window container is accessed according to the time indicated by the timer (S1202). Each time the first window container is accessed, the corresponding counter is incremented by 1 (S1203). According to the counter, it is determined whether it exceeds the preset threshold (S1204). Specifically, the first window container is accessed within the preset interval time, and the counter is incremented by 1 each time the first window container is accessed. After the counter reaches the preset number of times, the timer is destroyed, and it is determined whether there is a floating window in the first window container according to the access result of the number of times corresponding to the preset threshold. For example, when the preset threshold is 5 and the time interval indicated by the timer is 100ms, the first window container is accessed once every 100ms, and it is determined that there is no floating window in the first window container during the first access. The first window container is accessed for the second time after an interval of 100ms, and it is determined that there is no floating window in the first window container. After 5 consecutive visits, the access results are all that there is no floating window in the first window container. Then it can be determined that there is no floating window in the first window container. Optionally, when it is determined according to the counter that the number of visits to the first window container exceeds the preset threshold, the timer is destroyed.
[0127] According to the access result corresponding to the number of accesses indicated by the access threshold, determine whether there is a floating window (S1205). If there is a floating window in the first window container, obtain the handle corresponding to the most recent floating window (S1206), and update the pointer corresponding to the foreground window according to the handle corresponding to the most recent floating window (S1207). In other words, make the foreground window point to the most recent floating window in the above-mentioned first window container. Set the mask window in the lower layer of the foreground window (S1208). If it is determined that there is no floating window in the upper layer of the desktop, the foreground window object is the desktop or taskbar window. Hide the mask window (S1209). Realize the highlight display of the desktop window and the taskbar window.
[0128] According to the above judgment process, if it is determined that there is a floating window, the process proceeds to S907. Otherwise, the process proceeds to S908.
[0129] S907. Perform focus mode settings.
[0130] In some examples, the first program traverses the floating windows in the desktop, judges the windows located in the upper layer of the desktop from top to bottom according to the Z-axis order, and selects the valid window located in the uppermost layer as the foreground window.
[0131] In other examples, the handle corresponding to the most recent floating window in the first window container is obtained, and the pointer corresponding to the foreground window is updated, and the mask window is set in the lower layer of the foreground window, so that the most recent floating window in the first window container can achieve a highlighted display effect. Among them, the first window container is used to save the window handle determined to be a valid window. The first application can select the most recently opened window or the window at the top layer in the first window container as the new foreground window. If the first application fails to obtain the window handle from the first window container, it means that there is no valid window in the upper layer of the current desktop.
[0132] After completing the focus mode setting, enter S910 and re-enter the message loop waiting, that is, re-enter S901 to continue to obtain the foreground window message.
[0133] In other examples, in the process of setting the mask window in the lower layer of the foreground window (the most recent floating window in the first window container), there is a certain probability that the taskbar window will be highlighted. An embodiment of the present application provides a display method, in which two mask windows are set. When there is a valid floating window in the upper layer of the desktop, one of the mask windows is set in the upper layer of the taskbar window to block the taskbar window. It can not only enhance the highlighting effect of the effective floating window, but also avoid the flickering of the taskbar window when the floating window is switched. Thereby improving the user experience in focus mode. After completing the mask window setting, the message loop waits, that is, re-enters S901 to continue to obtain foreground messages.
[0134] S908: Determine whether the mask window is hidden.
[0135] If it is determined that there is no floating window on the upper layer of the desktop, the foreground window object is the desktop or taskbar window. It is necessary to realize the highlight display of the desktop window and the taskbar window. The taskbar window is usually considered to be part of the desktop. Therefore, when setting the mask on the lower layer of the desktop and the taskbar window, there is a certain probability of failure, which causes the mask window to be located in the upper layer of the desktop and the taskbar window, so that the desktop and the taskbar window are blocked, presenting a low-brightness display effect. If it is determined that the mask window has been hidden, enter S910, re-enter the message loop to wait, that is, re-enter S901, and continue to obtain the foreground window message. Otherwise, enter S909.
[0136] S909. Hide the mask window.
[0137] An embodiment of the present application provides a display method for hiding a first mask window and a second mask window when a foreground window object is a desktop or a taskbar window.
[0138] If it is detected that the mask window has been hidden, the desktop and taskbar windows can be highlighted. If the mask window is not hidden, the mask window is hidden, thereby highlighting the desktop and taskbar windows.
[0139] Exemplarily, the mask window may be hidden by setting the mask window to a fully transparent color or by setting the window attribute to WS_NOVISIBLE.
[0140] After the mask window is successfully hidden, the process returns to S910 and enters the message loop to wait, that is, re-enters S901 to continue obtaining foreground messages.
[0141] S910, re-enter the message loop and wait.
[0142] After the current foreground window message has gone through the above processing process, the process re-enters S901 to obtain the foreground window message.
[0143] In some examples, if the foreground window does not need to be filtered, the foreground window message can be cached. The time interval indicated by the timer is used to determine whether the object of the current foreground window is the same as the object of the foreground window at the previous moment. If so, the current foreground window message is not processed, that is, the window indicated by the foreground window object is filtered out. If not, the focus mode is set according to the foreground window indicated by the current foreground window message.
[0144] For example, if the current foreground window information is className: QAa NetmonClassslnfo, title, according to the following cached window log:
[0145] During the first time interval:
[0146] This foreground window information: className: QAa NetmonClassslnfo, title,
[0147] The last foreground window information: className: QAa NetmonClasss, title,
[0148] During the second time interval:
[0149] This foreground window information: className: QAa NetmonClasss, title,
[0150] The last foreground window information: className: QAa NetmonClassslnfo, title,
[0151] It can be determined that the current foreground window information is cyclic and repeated in the first time interval and the second time interval, which means that the window corresponding to the window name QAa NetmonClassslnfo and the window corresponding to the window name QAaNetmonClasss are in a state of repeated switching, so it can be determined that the current foreground window information is className: QAa NetmonClassslnfo, and the window corresponding to the title is an inactive window. There is no need to set the focus mode for this window.
[0152] Combined with the above method of accessing the first window container according to the time interval corresponding to the timer, when a large number of foreground window switching messages appear, the cached historical foreground window messages and the first window container are compared according to the time interval indicated by the timer, which can not only filter out rogue software or non-focus windows that frequently switch to the foreground, but also solve the flickering problem of electronic devices in focus mode. It can also avoid the delay when the foreground window resource display is loaded or minimized to recycle resources, which may lead to misjudgment of the foreground window, resulting in failure to set the focus mode and affecting the user experience.
[0153] An embodiment of the present application provides a display method, and for the above-mentioned S907, a focus mode is set, including: when the object of the foreground window message is a desktop or taskbar window, the windows located on the upper layer of the desktop can also be judged from top to bottom according to the Z-axis order, and the valid window located on the top layer is selected, and the mask window is placed in the lower layer of the valid window, so as to achieve the effect of highlighting the valid window located on the top layer.
[0154] like Fig.13 As shown, the method flow is introduced exemplarily.
[0155] S1301. Traverse all windows.
[0156] In some examples, starting from the top window, candidate windows are obtained in sequence according to the Z-axis order to perform the following process:
[0157] S1302: Determine whether the window has the WS_VISIBLE attribute. If yes, execute S1303; if no, execute S1301.
[0158] Optionally, it is possible to determine whether the candidate window has the WS_VISIBLE attribute through the window handle. If the window has the WS_VISIBLE attribute, it means that the window is visible to the operating system, and the subsequent determination process continues. If the window does not have the WS_VISIBLE attribute, it means that the operating system considers that the window is not visible to the user, and the process returns to S1301 to determine the window of the next layer of the window.
[0159] S1303, determine whether the area where the window intersects with the current desktop is smaller than a preset area, if so, execute S1301, if not, execute S1304.
[0160] Optionally, if the area where the window intersects with the desktop is larger than a preset area, it indicates that the window can be observed by the user; if the area where the window intersects with the screen is smaller than a preset area, it indicates that the window cannot be observed by the user, and the process returns to S1301 to judge the next layer of window of the window.
[0161] Exemplarily, the length and width of the window may also be determined. If either of them is smaller than a preset value (eg, one pixel), it indicates that the window cannot be observed by the user.
[0162] S1304, determine whether the number of times the window is switched to the top layer is greater than a preset number, if so, execute S1301, if not, execute S1305.
[0163] In some examples, a window container is set, and the window container is used to save the window handle included in the top-level window message within a preset duration, and the time of obtaining the top-level window message. The window container saves the window handles of all windows switched to the top level within a period of time. The number of times the window is switched to the top level is counted according to the window handles saved by the window container. If the number of times the window is switched to the top level is greater than the preset value, it means that the window is switched to the top level too frequently and is not a valid window, and the process returns to S1301 to judge the next layer window of the window. If the number of times the window is switched to the top level is less than the preset number, the window continues to be judged.
[0164] S1305: Obtain the pixel color (RGB value) of the target pixel for the first time.
[0165] In some examples, desktop pixel information is obtained by calling a method for obtaining screen pixel information (e.g., GetDC(NULL) function), where the pixel information includes a pixel position and an RGB value. According to the desktop pixel information and the display area of the window, a target pixel point located in the display area of the window is selected, and the RGB value of the target pixel point is obtained.
[0166] S1306: Set a test window at the location of the target pixel, change the window color of the window, and set the window at the lower layer of the candidate window.
[0167] In some examples, the size of the test window is, for example, one pixel, and the window color is set to be different from the pixel color of the target pixel obtained for the first time. For example, the RGB value of the window color can be obtained by adding 1 to the RGB value of the target pixel.
[0168] S1307 , obtaining the pixel color (RGB value) of the target pixel for the second time.
[0169] In some examples, similar to the above step S1305, desktop pixel information is obtained by calling the GetDC(NULL) function, and the pixel color of the target pixel is obtained according to the desktop pixel information.
[0170] S1308, determine whether the pixel color of the target pixel has changed, if so, execute S1301, if not, execute S1309.
[0171] In some examples, by comparing the RGB value of the target pixel obtained for the first time with the RGB value of the target pixel obtained for the second time, it can be determined whether there is a difference in the color of the target pixel. If the RGB value of the target pixel obtained for the first time is different from the RGB value of the target pixel obtained for the second time, it means that there is a difference between the pixel color of the target pixel obtained for the first time and the pixel color of the target pixel obtained for the second time.
[0172] S1309: Set the mask window at the lower layer of the candidate window.
[0173] Exemplarily, the implementation methods described in S1301 to S1309 above are also applicable to an embodiment in which the object of the foreground window message is a non-desktop window and the first application selects a new foreground window to set the focus mode.
[0174] In addition, in some scenarios, some applications will create windows (third windows) outside the screen display area. When such windows are set as foreground windows, mask windows will be set at the bottom layer of such windows. Since such windows are outside the screen display area, the electronic device 100 does not display the highlighted window.
[0175] Among them, the window attributes include a rectangular area (rect) attribute, which can indicate the display area of the window. By comparing the window display area with the screen display area, it can be determined whether the window is located outside the display area of the screen. Exemplarily, the display area of the screen is related to the resolution of the screen. For example, taking a screen with a resolution of 1024 times 768 as an example, the display area of the screen is within the numerical range of X=0~1024, Y=0~768. If the display area of the window is outside the numerical range of X=0~1024, Y=0~768, it means that the window is located outside the display area of the screen.
[0176] The embodiment of the present application provides a display method, which is applied to a first application of an electronic device 100. After obtaining a foreground window message, the first application obtains the window properties of the foreground window through the window handle included in the foreground window message. When it is determined that the display area of the foreground window is outside the screen display area according to the window properties of the foreground window, the first application selects a new foreground window according to the window handle saved in the first window container to set the focus mode, and sets the mask window in the lower layer of the new foreground window. The effect of highlighting the new foreground window is achieved.
[0177] The electronic device 100 may include a tablet computer, a laptop computer, a netbook, a personal computer (PC), and other terminal devices, which can display multiple windows. The following embodiments of the present application are illustrative in that the electronic device 100 is a laptop computer, and other terminal devices are also applicable to the embodiments of the present application, and the present application does not impose any limitation on this.
[0178] In one example, the electronic device 100 includes: Fig.14 The structure shown.
[0179] The electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, an input device 180, a display screen 190, etc.
[0180] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0181] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0182] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0183] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0184] In some embodiments, the processor 110 may include one or more interfaces. The interface may include a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0185] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
[0186] The MIPI interface can be used to connect the processor 110 with the display screen 190, keyboard and other peripheral devices. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the display screen 190 communicate via the DSI interface to realize the display function of the electronic device.
[0187] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the display screen 190, the wireless communication module 160, the audio module 170, the input device 180, etc.
[0188] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device, and can also be used to transfer data between the electronic device and a peripheral device. For example, the electronic device connects to a peripheral input device, such as a keyboard, a mouse, etc., through the interface; it can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.
[0189] It is understandable that the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0190] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of an electronic device. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.
[0191] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the external memory, the display screen 190, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0192] The electronic device implements the display function through a GPU, a display screen 190, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 190 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0193] The display screen 190 is used to display images, videos, etc. The display screen 190 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 190, where N is a positive integer greater than 1. In the embodiment of the present application, the display screen 190 is also referred to as a screen.
[0194] Digital signal processors are used to process digital signals. In addition to processing digital image signals, they can also process other digital signals. For example, when an electronic device selects a frequency point, a digital signal processor is used to perform Fourier transform on the frequency point energy.
[0195] Video codecs are used to compress or decompress digital videos. Electronic devices can support one or more video codecs. In this way, electronic devices can play or record videos in multiple coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0196] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.
[0197] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0198] The electronic device can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0199] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0200] The input device 180 may include a keyboard, a mouse, etc. The keyboard is used to input English letters, numbers, punctuation marks, etc. into the electronic device, thereby issuing commands to the electronic device, inputting data, etc. The mouse is an indicator for the vertical and horizontal coordinates of the electronic device display system, and is used to input instructions, etc. to the electronic device. Among them, the input device 180 can be connected to the electronic device through a wired connection, for example, the input device 180 is connected to the electronic device through a GPIO interface, a USB interface, etc. The input device 180 can also be connected to the electronic device wirelessly, for example, the input device 180 is connected to the electronic device through Bluetooth, infrared, etc.
[0201] Laptops are deployed with software systems such as Fig.15 As shown, the software system may include, for example, an application layer and an OS layer.
[0202] The application layer runs applications, including, for example, a device manager application (the first application in the above embodiment).
[0203] In some examples, the device manager application includes: a message acquisition module, a message filtering module, a desktop window processing module, and a timer verification module. Among them:
[0204] The message acquisition module is used to obtain the foreground window message in the window message queue.
[0205] The message filtering module is used to process the foreground window messages, filter out invalid windows, divide the valid windows into desktop, taskbar windows and floating windows, and give the window handle of the floating window to the window container for recording.
[0206] The desktop window processing module is used to select whether to hide the mask window and whether to create a timer check when the object of the foreground window message is the desktop or taskbar window.
[0207] The timer check module is used to check whether the foreground window message has changed. If it has changed, it determines whether the object of the current window message is a valid window and whether filtering is required based on the cached foreground window message. At the same time, when the foreground window message changes, it determines whether there is a floating window in the window container.
[0208] The OS layer runs system services including, for example, message management, windowing, and graphics systems.
[0209] Message management is used to encapsulate window messages and maintain the window message queue.
[0210] The window and graphics system is used to implement user interface (GUI) functions (also commonly referred to as WindowsUSER and GDI functions), such as processing windows, user interface controls, and drawing.
[0211] The display method provided in the embodiment of the present application is exemplarily introduced below in combination with the system architecture of the above-mentioned electronic device.
[0212] The message management module detects window events, encapsulates window events to obtain window messages, and adds window messages to the window message queue. The device manager application obtains the foreground window message and window destruction / minimization message from the window message queue, and sets the focus mode according to the foreground window message and window destruction / minimization message. After the focus mode is set, the window and graphics system are notified to draw. The window and graphics system synthesize and render the window to obtain a synthesized image, and send the synthesized image to the screen for display.
[0213] The following describes how the device manager application handles window messages:
[0214] like Fig.16 As shown, the device manager application includes: a message acquisition module, a message filtering module, a desktop window processing module, and a timer verification module, wherein:
[0215] S1601. The message acquisition module acquires window messages, identifies the window messages, sends the foreground window messages to the message filtering module, and sends the window destroy / minimize messages to the first judgment module.
[0216] S1602, the first judgment module judges whether the foreground window message needs to be filtered, if so, the foreground window message is sent to the message filtering module. If not, the foreground window message is directly sent to the second judgment module to judge whether the foreground window message object is a desktop or taskbar window.
[0217] S1603: The message filtering module filters the foreground window messages.
[0218] Optionally, if the foreground window message to be filtered has the WS_EX_TRANSPARENT attribute, or the window size is smaller than the preset size, or the window display position is outside the screen display area, or the window name / window class name exists in the filter window list, etc., a window message is constructed.
[0219] That is to say, referring to the implementation of S903 in the above example, the foreground window message can be filtered by window name / window class name, window style, window extension style, window size, window display area, etc. to determine the valid window, and send the valid window to the second judgment module.
[0220] S1604: Determine whether the object of the current foreground window message is a desktop window or a taskbar window through the second determination module. If so, send the foreground window message to the desktop window processing module. If not, send the foreground window message to the message processing module.
[0221] In some implementations, the device manager application further includes a message processing module for processing foreground window messages, performing focus mode settings, and hiding mask windows.
[0222] Optionally, the window message may be acquired and identified by referring to the implementation of S901 to S902 in the above example.
[0223] S1605. The desktop window processing module sends the foreground window message to the timer verification module.
[0224] S1606. The timer checking module sends the foreground window message to the third judgment module.
[0225] S1607: The third judgment module judges whether there is a floating window on the upper layer of the desktop according to the time interval indicated by the timer verification module and a preset threshold.
[0226] Optionally, the implementation of S906 in the above example can be referred to, and the first window container is accessed according to the time indicated by the timer. Each time the first window container is accessed, the corresponding counter is incremented by 1. When the counter indicates that it exceeds a preset threshold, it is determined whether there is a floating window in the first window container according to the access result. Thus, it is determined whether there is a floating window on the upper layer of the desktop. If so, it is sent to the message processing module, the focus mode is set, and the execution is terminated.
[0227] For example, the handle corresponding to the most recent floating window in the first window container is obtained, and the pointer corresponding to the foreground window is updated, and the mask window is set under the foreground window, so that the most recent floating window in the first window container can be highlighted.
[0228] If not, the foreground window message is sent to the fourth judgment module.
[0229] S1608, the fourth judgment module judges whether to hide the mask window. If so, the execution ends. If not, the message processing module is sent to hide the mask window.
[0230] Optionally, if it is determined that there is no floating window on the upper layer of the desktop, and the foreground window object is the desktop or taskbar window, the mask window is hidden to achieve highlighting of the desktop window and the taskbar window.
[0231] Exemplarily, the mask window may be hidden by setting the mask window to a fully transparent color or by setting the window attribute to WS_NOVISIBLE.
[0232] In some implementations, the device manager application further includes a message construction module for constructing a window message.
[0233] In some examples, the constructed window message includes a window handle of a new foreground window selected from the first window container, or a window handle of the desktop.
[0234] In some embodiments, the device manager application further includes a cache processing module, which determines the foreground window message that does not need to be filtered. If the number of times the foreground window message is received is greater than the preset number within the preset time, the message construction module is notified to construct the window message. If the number of times the foreground window message is received is less than the preset number, the focus mode is set. In this way, the window can be prevented from flickering when it is frequently switched to the foreground.
[0235] For example, Fig.17 As shown, the cache processing module performs the following steps:
[0236] S1701: Start a first timer check, and the first timer check is destroyed after the timing ends.
[0237] S1702: After the first timer is verified and destroyed, if the statistical number of foreground window switching is less than the preset number, the message processing module is notified to process.
[0238] S1703: After the first timer is checked and destroyed, if the statistical number of foreground window switching is greater than a preset number, the message construction module is notified to construct a window message.
[0239] Optionally, after constructing the window message, the message construction module sends the constructed window message to the message processing module, and the message processing module sets the focus mode according to the constructed window message. The specific processing process will not be described in detail.
[0240] It is understandable that, in order to realize the above functions, the above electronic device includes a hardware structure and / or software module corresponding to each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.
[0241] The embodiment of the present application can divide the functional modules of the above-mentioned electronic device according to the above-mentioned method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0242] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program code is stored. When a processor executes the computer program code, the electronic device executes the method in the above embodiment.
[0243] The embodiments of the present application also provide a computer program product. When the computer program product is run on a computer, the computer executes the method in the above embodiments.
[0244] Among them, the computer-readable storage medium or computer program product provided in the embodiments of the present application is used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0245] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0246] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0247] 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 separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0248] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROMs, magnetic disks, or optical disks.
[0249] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A display method, characterized in that: The method comprises: Display a first window; the first window is displayed in a first area on the screen, and the brightness of the first area is greater than the brightness outside the first area; In response to a first operation in the taskbar window, the first window is minimized; after the first window is minimized, the brightness of a second area on the screen is greater than the brightness outside the second area, the second area is a display area of a second window on the screen, and the second window is the most recent window displayed on the screen saved by the electronic device.
2. The display method according to claim 1, characterized in that: The method further comprises: The second window is obtained; the second window is a window stored in a window container; the window container is used to store the window displayed on the screen.
3. The display method according to claim 1 or 2, characterized in that: The minimizing the first window includes: The first window in the window container is deleted.
4. The display method according to any one of claims 1 to 3, characterized in that: The method further comprises: The first mask window is set at a lower layer of the second window, and the display brightness of the first mask window is lower than the display brightness of the second window; the first mask window is used to reduce the brightness outside the second area on the desktop; Among them, the display brightness of the window located in the lower layer of the first mask window and overlapping with the display area corresponding to the first mask window is the same as the display brightness of the first mask window.
5. The display method according to claim 4, characterized in that: The method further comprises: Setting a second mask window on an upper layer of the taskbar window, wherein the display brightness of the second mask window is lower than the display brightness of the second window; the second mask is used to reduce the brightness of the taskbar window; Among them, the display brightness of the window located in the lower layer of the second mask window and overlapping with the display area corresponding to the second mask window is the same as the display brightness of the second mask window.
6. The display method according to any one of claims 2 to 5, characterized in that: The method further comprises: Periodically accessing the window container; If the number of accesses to the window container exceeds a preset threshold, it is determined whether there is a floating window on the screen according to the most recent access result; the floating window represents a window displayed on the screen.
7. The display method according to claim 6, characterized in that: The method further comprises: If it is determined that there are at least two floating windows on the screen, the second window is determined according to the order in which the floating windows are displayed, and the second window is the most recent window displayed on the screen and stored by the electronic device.
8. The display method according to claim 7, characterized in that: The method further comprises: If it is determined that the floating window does not exist on the screen, the desktop and the taskbar window are highlighted.
9. The display method according to claim 8, characterized in that: The highlighting of the desktop and the taskbar window comprises: The first mask window and the second mask window are hidden.
10. The display method according to any one of claims 1 to 9, characterized in that: The first window and the second window include the following conditions: Has visible window property WS_VISIBLE; The area overlapping with the desktop is larger than a preset area; The number of switches to the top layer within the preset time is less than the preset number; Not transparent.
11. The display method according to any one of claims 1 to 10, characterized in that: The method further comprises: Obtaining a foreground window message, and determining whether the object of the foreground window message is the desktop or the taskbar window; If it is determined that the object of the foreground window message is the desktop or the taskbar window, obtaining the second window; Otherwise, the object of the foreground window message is saved in the window container.
12. An electronic device, characterized in that: The electronic device comprises: a processor and a memory, wherein the processor is coupled to the memory; the memory is used to store computer program code; the computer program code comprises computer instructions, and when the processor executes the above-mentioned computer instructions, the electronic device executes the display method as described in any one of claims 1-11.
13. A computer-readable storage medium, characterized in that: It comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the display method as described in any one of claims 1 to 11.
14. A computer program product, characterized in that When the computer program product is run on an electronic device, the electronic device executes the display method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Application program processing method and device, equipment and medium
CN114461100A
Document display method and device, electronic equipment and storage medium
CN114997104A
Multi-interface display method and electronic equipment
CN115480629A
Display device and floating window display method
CN117406886A
Application window sorting management method and interaction device
CN117631922A