Display method and electronic equipment
By creating a third or transparent window located outside the screen in an electronic device, and adjusting the display order when these windows are set to the foreground, the problem of electronic devices not showing highlights is solved and the user experience is improved.
Patent Information
- Application Number
- CN202411458880.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-03-18
AI Technical Summary
Prior art In electronic devices, when a window that is not observed by a user is set as a foreground window, the electronic device does not display a highlighted window, affecting the user's user experience.
By creating a third window outside the screen display area, and when the window is set as the foreground window, the first window or the second window is selected as the target window for highlighting, or by creating transparent windows or small-sized windows, and when these windows are set as the foreground, the Z-axis order of the masked windows is adjusted to achieve highlighting.
It effectively solves the problem that electronic devices do not display highlights when the window that will not be observed by the user is set to the foreground, improving the user's user experience.
Smart Images

Figure CN119645542A_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, some current applications or operating systems create windows that are not observed by users. The purpose of such windows is not to interact with users. When such windows are set as foreground windows, the electronic device will not display the highlighted windows, affecting the user experience. Summary of the invention
[0004] The embodiment of the present application provides a display method and an electronic device, which are used to solve the problem that the electronic device does not display a highlighted window when some windows that will not be observed by the user are set as foreground windows.
[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect, a display method is provided, the method comprising:
[0007] Display a first window, the first window is displayed in a first display area of the screen, the brightness of the first display area is greater than the brightness of the second display area, create a second window displayed in a third display area of the screen, the second window is displayed on an upper layer of the first window, the brightness of the first display area is reduced, and the brightness of the third display area is greater than the brightness of the first display area; create a third window located outside the display area of the screen, after the third window is created, the brightness of the third display area is greater than the brightness of the first display area.
[0008] In this embodiment, since the third window is located outside the screen display area and cannot be observed by the user, after creating the third window, choosing to highlight the second window can solve the problem that the electronic device does not display a highlighted window when some windows that cannot be observed by the user are set as foreground windows.
[0009] In some implementations, after the third window is created, a target window is acquired; wherein the brightness of a display area corresponding to the target window is greater than the brightness of the second display area; and the target window includes the first window or the second window.
[0010] In this embodiment, when a third window outside the screen display area is set as the foreground window, the first window or the second window is selected as the target window, and then the target window is highlighted, which can solve the problem that the electronic device does not display the highlighted window.
[0011] In some embodiments, a fourth window is created, the fourth window is on top of the first window and the second window, and the fourth window is a transparent window; the fourth window is switched to the foreground, and based on the transparency of the fourth window, a target window is obtained; wherein the brightness of the display area corresponding to the target window is greater than the brightness of the second display area; the target window includes the first window or the second window.
[0012] In this embodiment, since the fourth window is a transparent window and cannot be observed by the user, when the fourth window is set as the foreground window, the first window or the second window is selected as the target window, and then the target window is highlighted, which can solve the problem that the electronic device does not display the highlighted window.
[0013] In some embodiments, a fifth window is created, the fifth window is on top of the first window and the second window, and the size of the fifth window is smaller than a preset size; the fifth window is switched to the foreground, and based on the size of the fifth window being smaller than the preset size, a target window is acquired; wherein the brightness of the display area corresponding to the target window is greater than the brightness of the second display area; the target window includes the first window or the second window.
[0014] In some scenarios, some applications or operating systems will create some small-sized windows. The information displayed in such small-sized windows is usually not the information that the user is concerned about. Therefore, when the fifth window whose window size is smaller than the preset size is set as the foreground window, the first window or the second window is selected as the target window to avoid highlighting the window that the user is not concerned about, thereby improving the user experience.
[0015] In some embodiments, a sixth window is created, the sixth window is on an upper layer of the first window and the second window, and the sixth window has a non-focus WS_EX_NOACTIVATE attribute; the sixth window is switched to the foreground, and based on the sixth window having the WS_EX_NOACTIVATE attribute, the window handle of the sixth window is saved; the brightness of the display area corresponding to the sixth window is greater than the brightness of the second area; the sixth window is destroyed or minimized, and a target window is obtained, wherein the brightness of the display area corresponding to the target window is greater than the brightness of the second display area; the target window includes the first window or the second window.
[0016] In some scenarios, since the operating system will not generate a foreground window message after the sixth window with the WS_EX_NOACTIVATE attribute is destroyed or minimized, and the foreground window message is used to drive the electronic device to highlight the window, after the sixth window is destroyed or minimized, the first window or the second window is selected as the target window, and then the target window is highlighted, which can solve the problem that the electronic device does not display the highlighted window.
[0017] In some implementations, the window handle of the sixth window is stored in the window container;
[0018] Before the sixth window is destroyed or minimized, a window destroy or minimize message is obtained, wherein the window destroy or minimize message includes a window handle; the window handle included in the window destroy or minimize message is the same as the window handle stored in the window container.
[0019] In this implementation, by comparing the window handle included in the window destruction or minimization message with the window handle stored in the window container, it is possible to determine whether the destroyed or minimized window is the sixth window. When it is determined that the destroyed or minimized window is the sixth window, the first window or the second window is selected as the target window, and then the target window is highlighted, which can solve the problem that the electronic device does not display the highlighted window.
[0020] In some embodiments, after acquiring the target window, the mask window is set at the lower layer of the target window; the brightness of the window located at the lower layer of the mask window and overlapping the display area corresponding to the mask window is less than the brightness of the target window located at the upper layer of the mask window.
[0021] In this embodiment, a mask window is set to shield the window located at the lower layer of the mask window, so that the display brightness of the window located at the lower layer of the mask window is lower than the display brightness of the target window located at the upper layer of the mask window, thereby achieving the effect of highlighting the window.
[0022] In some implementations, when the acquisition of the target window fails, the desktop is highlighted; the failure to acquire the target window indicates that there is no window on the upper layer of the desktop.
[0023] In this implementation, if there is no window on the upper layer of the desktop, it means that the electronic device only displays the desktop, and highlighting the desktop can solve the problem that the electronic device does not display the highlighted window.
[0024] In some implementations, highlighting the desktop includes: hiding a mask window.
[0025] In this implementation, when there is no window on the upper layer of the desktop, hiding the mask window can realize highlighting of the desktop.
[0026] In some embodiments, the target window includes the following conditions:
[0027] It has the visible window property WS_VISIBLE; the area intersecting with the desktop is larger than the preset area; the number of times it switches to the top layer is less than the preset number; and it is non-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 embodiments, whether a window is transparent is determined in the following manner:
[0030] The pixel color of the target pixel is obtained for the first time, and the pixel position of the target pixel is located in the display area of the candidate window; a test window is set at the pixel position of the target pixel in the lower layer of the candidate window, so that the window color of the test window is different from the pixel color of the target pixel; the pixel color of the target pixel is obtained for the second time; if there is no 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, the candidate window is a non-transparent window.
[0031] In this embodiment, if there is no 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, it means that the test window cannot be displayed through the candidate window, and further indicates that the candidate window is a non-transparent window. Therefore, it is possible to effectively identify whether the window is transparent.
[0032] 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.
[0033] 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.
[0034] 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.
[0035] 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
[0036] Figure 1A schematic diagram of a display window scene applicable to the method provided in an embodiment of the present application;
[0037] Figure 2 A schematic diagram of a focus mode scenario applicable to the method provided in an embodiment of the present application;
[0038] Figure 3 A schematic diagram of the Z-axis sequence of windows applicable to the method provided in an embodiment of the present application;
[0039] Figure 4 A schematic diagram of a focus mode scenario applicable to the method provided in an embodiment of the present application;
[0040] Figure 5 A schematic diagram of an operating system message processing mechanism applicable to the method provided in an embodiment of the present application;
[0041] Figure 6 A schematic diagram of the focus mode setting applicable to the method provided in the embodiment of the present application;
[0042] Figure 7 A schematic diagram of a scenario in which a highlighted window is not displayed, to which the method provided in an embodiment of the present application is applicable;
[0043] Figure 8 A flow chart of a method for determining a valid window when the object of a foreground window message is a desktop, provided in an embodiment of the present application;
[0044] Fig. 9 A schematic diagram of a scenario in which a window with a non-focus attribute applicable to the method provided in an embodiment of the present application is destroyed / minimized as a foreground window;
[0045] Fig.10 A schematic diagram of a scenario in which a small-sized window applicable to the method provided in an embodiment of the present application is set as a foreground window;
[0046] Fig.11 A flow chart of a display method provided in an embodiment of the present application;
[0047] Fig.12 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0048] Fig.13 A schematic diagram of a software architecture of an electronic device provided in an embodiment of the present application;
[0049] Fig.14 A processing flow chart of an application provided in an embodiment of the present application;
[0050] Fig.15 A processing flow chart of a module in an application provided in an embodiment of the present application;
[0051] Fig.16 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 1As shown, the electronic device 100 displays a chat window (window 11), a video window (window 12) and an operating system desktop 13. In addition, the electronic device 100 also includes input devices such as a touch screen, a mouse / touchpad, and a keyboard, and 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.
[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, a 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, so that the window changes from the background window to the foreground window, and then 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), and a desktop 23. 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 and the desktop are displayed at a lower brightness than the video window (non-highlighted). 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 desktop (window 23) are not highlighted. Figure 2In (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 method for highlighting the foreground window is to add a mask window under 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 presents a semi-transparent effect. In this way, the content of the window located under 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. 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 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 attributes 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] At present, after the foreground window of the electronic device 100 entering the focus mode is switched, it may not be possible to achieve the effect of only one window being highlighted, resulting in a poor user experience. The embodiment of the present application provides a display method that can enable the electronic device 100 to maintain the effect of only one window being highlighted after the foreground window is switched, thereby improving the user experience.
[0061] 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.
[0062] 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).
[0063] 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.
[0064] 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.
[0065] 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.
[0066] 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.
[0067] The following is combined with the above Figure 5 The message processing mechanism described hereby provides an exemplary introduction to the processing flow of foreground window messages.
[0068] like Figure 6 As shown, a diagram of the window Z-axis sequence changes for setting the focus mode is exemplified.
[0069] Before the first application receives the foreground window message (t1), window 61 is the foreground window, window 62 (mask window) is below window 61, window 63 (background window) is below window 62, and desktop 64 is below window 63. In response to the user's click on window 63, a foreground window event is generated, and the operating system encapsulates the foreground window event into a foreground window message and stores the foreground window message in the window message queue.
[0070] The first application obtains the foreground window message from the window message queue and performs focus mode setting (t2). The Z-axis order of the mask window is set, and the mask window located at the lower layer of window 61 is set to be located at the lower layer of window 63.
[0071] After the focus mode is set (t3), the first application notifies the operating system, and the operating system performs window synthesis to obtain a synthesized image and displays the synthesized image. The focus mode setting result includes: window 62 is located at the lower layer of window 63 and at the upper layer of window 61 and desktop 64.
[0072] The following describes the scenarios and methods to which the embodiments of the present application are applicable.
[0073] In some scenarios, the electronic device 100 that enters the focus mode does not display the highlighted window after the foreground window is switched.
[0074] The reasons for the electronic device 100 not displaying the highlighted window include, for example: a window that is invisible to the user but visible to the operating system is set as a foreground window (also called a transparent window), and after the focus mode is set, the mask window is located at the lower layer of such window. Since such window is invisible to the user, the mask window covers other windows and the desktop, resulting in the electronic device 100 not displaying the highlighted window.
[0075] Exemplarily, such windows that are invisible to the user but visible to the operating system generally have a visible window attribute (WS_VISIBLE). The WS_VISIBLE attribute is a window style attribute. Windows with this window attribute are visible to the operating system. Such windows are processed by the operating system and displayed on the screen. At the same time, such windows may also have a layered attribute (such as WS_EX_LAYERED) or a transparent attribute (such as WS_EX_TRANSPARENT) that causes the window color of the window to be fully transparent. Therefore, even if such windows are processed by the operating system and displayed on the screen, they are invisible to the user. Exemplarily, such windows may also be called fourth windows.
[0076] Among them, a window with the WS_EX_TRANSPARENT attribute can be set to fully transparent or semi-transparent. A window with the WS_EX_LAYERED attribute supports setting transparency, shadows, or other visual effects. By calling the method of setting layered window attributes (for example, the Set Layered Window Attributes function), the window color can be set to fully transparent, making such windows invisible to the user.
[0077] The following describes the application scenarios and processing procedures of the method provided in the embodiments of the present application in combination with scenario one and scenario two.
[0078] Scenario 1: Some applications will create windows with the WS_EX_TRANSPARENT attribute or the WS_EX_LAYERED attribute. When such a window is set as the foreground window, the mask window will be set at the lower layer of the foreground window. Since such a window is invisible to the user, other windows located at the lower layer of the mask window, including the desktop, are blocked by the mask window, causing the electronic device 100 to not display the highlighted window.
[0079] like Figure 7 As shown, Figure 7 The following is a schematic diagram of a scenario in which an electronic device 100 does not display a highlighted window. Figure 7In (a), the sequence on the Z axis includes a transparent window (window 71), a mask window (window 72) and a video window (window 73). If window 71 is set as the foreground window, window 72 will be set at the lower layer of window 71. Since window 71 is a transparent window and is invisible to the user, window 73 is blocked by window 72, causing the electronic device 100 to not display the highlighted window. Figure 7 As shown in (b), the electronic device 100 displays the window 73 at low brightness (in Figure 7 In (b), the non-highlighted area is indicated by slashes).
[0080] An embodiment of the present application provides a display method, the method comprising displaying a first window, wherein the display position of the first window is within a first display area on the screen, and the brightness of the first display area is greater than the brightness of the second display area; creating a second window, wherein the brightness of the first display area is reduced; displaying the second window; the second window is displayed on an upper layer of the first window; the display position of the second window is within a third display area on the screen, and the brightness of the third display area is greater than the brightness of the first display area; creating a third window, wherein the third window is on an upper layer of the first window, and the display position of the third window is outside the display area of the screen; wherein, after the third window is created, the brightness of the third display area is greater than the brightness of the first display area.
[0081] In some examples, the method is applied to a first application of the electronic device 100. After obtaining the foreground window message, the first application obtains the window properties of the foreground window through the window handle of the foreground window message, if the foreground window has the WS_EX_TRANSPARENT attribute, or has the WS_EX_LAYERED attribute. The first application selects a new foreground window (also called a target window) for focus mode setting, and sets the mask window in the lower layer of the new foreground window to achieve the effect of highlighting the new foreground window. This can prevent the electronic device from not displaying the highlighted window and affecting the user's experience.
[0082] If there is no new foreground window, the first application hides the mask window. Since there is no new foreground window, it means that there is no other window on the upper layer of the current desktop, so hiding the mask window achieves the effect of highlighting the desktop. In this way, the desktop can be highlighted when the electronic device only displays the desktop.
[0083] In some examples, the first application selects a new foreground window, for example, including: a recently opened window or a window located at the top layer in the Z-axis order. Selecting a recently opened window or a window located at the top layer as the new foreground window can highlight the foreground window that the user has recently used or paid attention to, which is in line with the user's usage habits.
[0084] In some examples, a first window container may be set, and the window handle of the window determined to be a valid window may be saved in the first window container. The first application may select the most recently opened window or the window at the top layer as the new foreground window in the first window container. If the first application fails to obtain the window handle from the first window container, it means that there is no valid window on the current desktop. At this time, the mask window is hidden to achieve the effect of highlighting the desktop.
[0085] In some examples, the valid window includes a first window and a second window, the first window is displayed in a first display area of the screen, and the second window is displayed in a third display area of the screen, and the second display area represents an area outside the first display area on the screen. Figure 2 As shown, if the first window is window 22, the first display area is the area where window 22 is located, and the second display area is the display area where desktop 23 and window 21 are located. Optionally, desktop 23 may also include a taskbar window. In other words, the taskbar window may be regarded as a part of desktop 23. The taskbar window is used to display application icons of running programs or open windows.
[0086] Exemplarily, the valid window satisfies the following judgment conditions:
[0087] Has the WS_VISIBLE attribute.
[0088] 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.
[0089] The area where the window intersects with the desktop is larger than the preset area;
[0090] 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.
[0091] Non-transparent window.
[0092] Exemplarily, a transparent window is invisible to a user and cannot be observed by the user.
[0093] 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.
[0094] In some examples, a valid window refers to a window that can be observed by a user. The above-mentioned judgment conditions for a valid window are merely exemplary. In actual application scenarios, there may be more or fewer judgment conditions, and the embodiments of the present application will not give examples one by one.
[0095] Scenario 2: When the user modifies the suffix of a file, the operating system of the electronic device 100 may create a window that is invisible to the user. This type of window also has the WS_VISIBLE attribute. This type of window will be set as the foreground window when there are no other windows on the desktop of the electronic device 100. However, since this type of window is invisible to the user, when this type of window is set as the foreground window, the electronic device 100 will not display the highlighted window. The file suffix indicates the file format and purpose. For example, in In the operating system, .txt represents a plain text file, .jpg represents an image file, .mp4 represents a video file, and so on.
[0096] Exemplarily, such windows created by the operating system and invisible to the user have specific window names / window class names (e.g., Windows.UI.Core / CoreWindow, etc.)
[0097] 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 name / window class name of the foreground window according to the window handle of the foreground window. If the window name / window class name of the foreground window exists in the window filter list, the first application hides the mask window.
[0098] In some examples, the window filter list is pre-set. The first application obtains the window name / window class name of the foreground window through the window handle included in the foreground window message, and then compares the window name / window class name of the foreground window with the window name / window class name in the window filter list. If there is an identifier in the window filter list that is the same as the window name / window class name of the foreground window, it is determined that the foreground window is a window created by the operating system that is invisible to the user.
[0099] In some examples, some third-party applications will also create similar windows. The problem of scenario 2 can also be solved by adding the window name / window class name corresponding to the window created by the third-party application that is invisible to the user to the window filter list. The embodiments of this application will not be repeated here.
[0100] The above scenarios 1 and 2 are only exemplary introductions of the problem that after some windows invisible to the user but visible to the operating system are set as foreground windows, the electronic device 100 does not display the highlighted window. The embodiment of the present application also provides a display method, which can effectively identify whether the window corresponding to the foreground window message is a window invisible to the user after obtaining the foreground window message.
[0101] In some embodiments, a fourth window is created, the fourth window is on top of the first window and the second window, and the fourth window is a transparent window. When the fourth window is switched to the foreground window, based on the fourth window being transparent, the target window is acquired, and the brightness of the area outside the display area corresponding to the target window is reduced.
[0102] Exemplarily, the pixel color value (RGB value) of the target pixel point located in the display area of the current foreground window is obtained, and then a test window with a different RGB value from the target pixel point is set at the position of the target pixel point in the lower layer of the foreground window. Then the RGB value of the target pixel point is obtained again. If there is a difference between the RGB value of the target pixel point obtained for the first time and the RGB value of the target pixel point obtained for the second time, it indicates that the foreground window is a window that is not visible to the user. That is, it is determined that the current foreground window is the fourth window. If there is no difference, it indicates that the foreground window is a window that is visible to the user.
[0103] In some scenarios, when there are multiple windows on the desktop and the user clicks on the desktop, since the desktop will not be set on an upper layer than other windows, when the desktop is set as the foreground window in focus mode, the mask window will be set on the lower layer of the desktop, causing the electronic device 100 to highlight all windows on the desktop, rendering the focus mode setting invalid, affecting the user experience.
[0104] The embodiment of the present application provides a display method, when the object of the foreground window message is the desktop, the windows located in the upper layer of the desktop are judged from top to bottom according to the Z-axis order, the valid window located in the uppermost layer is selected, and the mask window is placed in the lower layer of the valid window to achieve the effect of highlighting the valid window located in the uppermost layer. If the valid window is not successfully selected, the mask window is hidden to achieve the effect of highlighting the desktop.
[0105] like Figure 8 As shown, the method flow is introduced exemplarily.
[0106] S801. Traverse all windows.
[0107] 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:
[0108] S802: Determine whether the window has the WS_VISIBLE attribute. If yes, execute S803; if no, execute S801.
[0109] Optionally, the window handle may be used to determine whether the candidate window has the WS_VISIBLE attribute. If the window has the WS_VISIBLE attribute, it indicates 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 indicates that the operating system considers the window invisible to the user, and the process returns to S801 to determine the window at the next layer of the window.
[0110] S803: Determine whether the area where the window intersects with the current desktop is smaller than a preset area. If so, execute S801; if not, execute S804.
[0111] 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 S801 to judge the next layer of window of the window.
[0112] 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.
[0113] S804, determine whether the number of times the window is switched to the top layer is greater than a preset number, if so, execute S801, if not, execute S805.
[0114] 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 time length, 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 S801 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.
[0115] S805: Obtain the pixel color (RGB value) of the target pixel for the first time.
[0116] 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.
[0117] S806: 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.
[0118] 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.
[0119] S807 , obtaining the pixel color (RGB value) of the target pixel for the second time.
[0120] In some examples, similar to the above step S805, 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.
[0121] S808, determine whether the pixel color of the target pixel has changed, if so, execute S801, if not, execute S809.
[0122] 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.
[0123] S809: Set the mask window at the lower layer of the candidate window.
[0124] Exemplarily, the implementation methods described in S801 to S809 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.
[0125] 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.
[0126] 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.
[0127] An 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. In addition, if there is no window handle in the first window container, the first application hides the mask window. Since the absence of a window handle in the first window container indicates that there are no other windows on the upper layer of the current desktop, the mask window is hidden to achieve the effect of highlighting the desktop.
[0128] In some examples, the window display area can be obtained by using a function to obtain a window rectangular area (eg, Get Window Rect).
[0129] In addition, in some scenarios, the operating system of the electronic device 100 does not generate a foreground window message after a type of window is destroyed / minimized. Such windows generally have a non-focus attribute (WS_EX_NOACTIVATE), and such windows can also be referred to as non-focus windows or sixth windows. When the non-focus window is destroyed / minimized as the foreground window, since the operating system does not generate a foreground window message, the mask window is located at the top layer, causing the electronic device 100 to not display the highlighted window, resulting in a poor user experience.
[0130] Exemplarily, the operating system of the electronic device 100 may set non-focus attributes for some windows, such as pop-up windows of hardware devices opened by the operating system, or chat windows of some social software, etc. Fig. 9As shown in (a), the operating system of the electronic device 100 turns on the camera module in response to the user's operation, and displays a pop-up window (window 91) for turning on the camera module, which has the WS_EX_NOACTIVATE attribute. When the pop-up window is turned on, the operating system can generate a foreground window message, and the focus mode setting can highlight the pop-up window according to the foreground window message. However, when the window is destroyed / minimized, since the operating system does not generate a foreground window message, the mask window is at the top layer at this time, causing the electronic device 100 to not display the highlighted window. Fig. 9 As shown in (b), after the non-focus window (window 91) is destroyed / minimized as the foreground window, the mask window is located at the top layer, blocking the window 92 and the desktop 93, causing the electronic device 100 to not display the highlighted window. Fig. 9 In (b), the non-highlighted area of the electronic device 100 is indicated by oblique lines.
[0131] An embodiment of the present application provides a display method, which creates a sixth window, where the sixth window is on an upper layer of a first window and a second window, and has a non-focus WS_EX_NOACTIVATE attribute; when the sixth window is switched to the foreground, based on the fact that the sixth window has the WS_EX_NOACTIVATE attribute, the window handle of the sixth window is saved; the brightness of a display area corresponding to the sixth window is greater than the brightness of the second area; the sixth window is destroyed or minimized, a target window is obtained, and the brightness of an area outside the display area corresponding to the target window is reduced.
[0132] That is to say, the first application obtains the foreground window message. If the window handle included in the foreground window message is used to obtain the window with the WS_EX_NOACTIVATE attribute, the window handle of the foreground window is stored in the second window container, and the mask window is set at the lower layer of the foreground window, so that the electronic device 100 highlights the foreground window. The first application obtains the window destruction / minimization message. If it is determined that the window handle included in the window destruction / minimization message exists in the second window container, 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 at the lower layer of the new foreground window. The effect of highlighting the new foreground window is achieved.
[0133] In addition, if there is no window handle in the first window container, the first application hides the mask window. Since there is no window handle in the first window container, it means that there is no other window on the current desktop. Therefore, hiding the mask window achieves the effect of highlighting the desktop.
[0134] Exemplarily, the second window container stores a window handle with the WS_EX_NOACTIVATE attribute. Since a window with the WS_EX_NOACTIVATE attribute will not generate a foreground window message when it is destroyed or minimized, after such a window is destroyed or minimized, a new foreground window is selected to set the focus mode to avoid the electronic device 100 not displaying the highlighted window.
[0135] In some embodiments, a process of setting a focus mode in which a non-focus window is set as a foreground window and then destroyed / minimized is exemplified:
[0136] The first application obtains the foreground window message from the window message queue, obtains the WS_EX_NOACTIVATE attribute of the foreground window through the window handle included in the foreground window message, stores the window handle of the foreground window in the second window container, sets the focus mode according to the foreground window message, sets the mask window at the lower layer of the foreground window, so that the electronic device 100 highlights the foreground window.
[0137] The first application obtains a window destroy / minimize message from a window message queue. The first application determines whether the window handle is stored in the second window container according to the window handle included in the window destroy / minimize message. If the window handle included in the window destroy / minimize message exists in the second window container, the first application obtains the window handle that is most recently opened or located at the top of the Z-axis order in the first window container to construct a foreground window message. The first application sets the mask window at the lower layer of the new foreground window according to the new foreground window indicated by the constructed window message, so that the electronic device 100 highlights the new foreground window.
[0138] In addition, in some scenarios, when some small-sized windows (for example, the floating ball of an application) are set as the foreground window, the mask window will be set at the lower layer of such small-sized windows, so that the electronic device 100 highlights such small-sized windows. However, in some scenarios, such small-sized windows may not be the windows that the user wants to focus on, so highlighting such small-sized windows will reduce the display brightness of the windows that the user wants to focus on, resulting in a poor user experience. Fig.10 As shown in (a), the electronic device 100 displays multiple windows, including the window (window 101) being edited by the user, the small-sized window (window 102), and the desktop 103. If the small-sized window (window 102) is set as the foreground window, the electronic device 100 will highlight the small-sized window, resulting in a decrease in the brightness of the window (window 101) being edited by the user, affecting the user's experience. Fig.10As shown in (b), the small-sized window (window 102) is set as the foreground window, which causes the brightness of the window (window 101) being edited by the user to decrease. Fig.10 The oblique lines in (b) represent the non-highlight display area of the electronic device 100. In some examples, the small-sized window may also be referred to as a fifth window.
[0139] An embodiment of the present application provides a display method, which creates a fifth window, where the fifth window is on top of the first window and the second window, and the size of the fifth window is smaller than a preset size; when the fifth window is switched to the foreground, based on the size of the fifth window being smaller than the preset size, a target window is acquired, and the brightness of the area outside the display area corresponding to the target window is reduced.
[0140] That is, the first application obtains the foreground window message, determines the window size of the foreground window through the window handle included in the foreground window message, and if the window size of the foreground window is smaller than the preset size, the first application selects a new foreground window to set the focus mode according to the window handle saved by the first window container, and sets the mask window under the new foreground window, so as to achieve the effect of highlighting the new foreground window.
[0141] In addition, if there is no window handle in the first window container, the first application hides the mask window. Since the absence of a window handle in the first window container indicates that there are no other windows on the current desktop, hiding the mask window achieves an effect of highlighting the desktop.
[0142] In this way, when some small-sized windows are set as foreground windows, if there are other windows on the desktop, the topmost or most recently opened window is selected for highlighting, so that the user can focus on the highlighted window. If there are no other windows on the desktop, highlighting the small-sized window can effectively reduce energy consumption compared to highlighting the desktop.
[0143] In some scenarios, after the foreground window of the electronic device 100 in the focus mode is switched, multiple windows are highlighted at the same time, affecting the user experience. The reasons for the electronic device 100 to highlight multiple windows include, for example: the mask window is set at the lower layer of the foreground window and the background window, causing the electronic device 100 to highlight multiple windows located at the upper layer of the mask window.
[0144] The embodiment of the present application provides a display method, which is applied to a first application. After the Z-order of the mask window is set, the Z-order value of the mask window and the foreground window is obtained. If the difference between the Z-order values of the mask window and the foreground window is greater than a preset value, the Z-order of the mask window is reset. The difference between the Z-order value of the mask window and the foreground window and the preset value are compared again until the difference between the Z-order value of the mask window and the foreground window is equal to the preset value. Since the mask window is set at the lower layer of the foreground window, the difference between the Z-order value of the mask window and the foreground window is 1. If it is greater than 1, it means that there are other windows between the mask window and the foreground window. After setting the Z-axis order of the mask window, the embodiment of the present application can determine whether there are other windows between the mask window and the foreground window by comparing the difference in Z-order values between the mask window and the foreground window and a preset value. When it is determined that there are other windows between the mask window and the foreground window, the Z-axis order of the mask window is reset until there are no other windows between the mask window and the foreground window, thereby avoiding the problem of the electronic device 100 highlighting multiple windows and improving the user experience.
[0145] In some examples, the value of the preset value is generally set to 1. When the focus mode is correctly set, there is no other window between the mask window and the foreground window. If the Z-order of the foreground window is 0 and the Z-order of the mask window is 1, then the difference between the Z-order of the mask window and the foreground window is 1, which is equal to the preset value, indicating that the focus mode is correctly set. If the Z-order of the foreground window is 0 and the Z-order of the mask window is 2, then the difference between the mask window and the foreground window is 2, which is greater than the preset value, indicating that there is still a window with Z-order=1 between the mask window and the foreground window, causing the electronic device 100 to highlight two highlighted windows.
[0146] The following is a detailed description of the processing flow of a display method provided in an embodiment of the present application.
[0147] like Fig.11 As shown, an embodiment of the present application provides a display method, which is applied to a first application. When the foreground window is switched, a focus mode can be set, and a mask window can be set at a lower layer of the foreground window to achieve the effect of highlighting the foreground window.
[0148] The method comprises:
[0149] S1101. Get window message.
[0150] In some examples, a Set Win Event Hook function may be used to obtain window messages in a window message queue.
[0151] S1102: Identify the window message.
[0152] In some examples, a window procedure function (e.g., Win Event Proc function) can be used to identify window messages. If the window message is a foreground window message (e.g., ENENT_SYSTEM_FOREGROUND) or a window destruction message (e.g., WM_DESTROY) / window minimize message (e.g., WM_MINIMIZE), it is processed and other window messages (e.g., window creation messages, window move messages, etc.) are ignored.
[0153] S1103: If the window message is a foreground window message, determine whether the foreground window message needs to be filtered.
[0154] In some examples, 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 a preset window filter list, then the foreground window message needs to be filtered.
[0155] Exemplarily, the function of loading an extensible markup language (Extensible Markup Language, Xml) file (Load Xml File) is called to parse the xml configuration table, and all feature values that need to be filtered by the window name / window class name are read out and stored in the window filter list. Then, the window name / window class name of the foreground window is obtained according to the window handle included in the foreground window message, and finally the window name / window class name of the foreground window is compared 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.
[0156] In some examples, 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.
[0157] Exemplarily, the Get Window Long (GWL) function is called to obtain 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.
[0158] In some examples, if the window size obtained through the window handle included in the foreground window message is smaller than a preset size, or the window display area is outside the screen display area, then the foreground window message needs to be filtered.
[0159] Exemplarily, the window handle included in the foreground window message is used to obtain the rectangular area (rect) attribute of the window, and the window size and window display area are obtained based on 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.
[0160] S1104: For a foreground window message that does not need to be filtered, a mask window is set at a lower layer of the window corresponding to the foreground window message.
[0161] In some examples, the foreground window message that does not need to be filtered indicates that the window corresponding to the foreground window message is a valid window. The mask window is set at the lower layer of the foreground window to achieve the effect of highlighting the foreground window.
[0162] S1105. If the foreground window message to be filtered has the WS_EX_NOACTION attribute, save the window handle of the foreground window and set the mask window at the lower layer of the foreground window.
[0163] Optionally, if the foreground window message to be filtered has the WS_EX_NOACTION attribute, the window handle included in the message is saved in the second window container, and then the mask window is set at the lower layer of the foreground window.
[0164] S1106. 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, then a window message is constructed.
[0165] In some examples, the constructed window message includes the window handle of the new foreground window selected from the first window container, or the window handle of the desktop. Exemplarily, when there is no window handle in the first window container, the window handle of the desktop is filled into the constructed window message.
[0166] S1107. If the window destroy / minimize message has the WS_EX_NOACTION attribute, then construct a window message.
[0167] In some examples, the window properties can be obtained through the window handle of the window destroy / minimize message. If the destroyed / minimized window has the WS_EX_NOACTION property, a window message is constructed, and the constructed window message includes the window handle of the new foreground window selected from the first window container, or the window handle of the desktop.
[0168] Exemplarily, when there is no window handle in the first window container, the window handle of the desktop is filled into the constructed window message.
[0169] S1108. If the object of the constructed window message is the desktop, then hide the mask window.
[0170] Exemplarily, if the new foreground window message includes the window handle of the desktop, it is determined whether the window handle exists in the first window container. If the window handle does not exist in the first window container, the mask window is hidden so that the electronic device highlights the desktop.
[0171] If there is a window handle in the first window container, the first application starts a first timer check. The first timer check includes: the first timer is destroyed after the timing ends, and before the first timer is destroyed, if the window handle still exists in the first window container, the first application uses the window corresponding to the window handle as a new foreground window, and sets the mask window at the lower layer of the new foreground window, so that the electronic device highlights the new foreground window.
[0172] S1109: If the object of the constructed window message is a non-desktop window, then set the mask window at the lower layer of the window corresponding to the constructed window message.
[0173] Exemplarily, if the object of the constructed window message is a non-desktop window, the first application determines whether the window handle of the window exists in the first window container, and if the window handle of the window exists in the first window container, the mask window is set in the lower layer of the window. If the window handle of the window does not exist in the first window container, the first application starts a second timer check, and the second timer check includes: the second timer is destroyed after the timing ends, and if the window handle of the window still does not exist in the first window container before the second timer is destroyed, the first application selects a new foreground window according to the window handle saved in the first window container, and sets the mask window in the lower layer of the new foreground window, so that the electronic device highlights the new foreground window.
[0174] 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.
[0175] In one example, the electronic device 100 includes: Fig.12 The structure shown.
[0176] 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.
[0177] 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.
[0178] 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.
[0179] 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.
[0180] 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.
[0181] 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.
[0182] 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.
[0183] 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.
[0184] 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.
[0185] 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.
[0186] 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.
[0187] 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.
[0188] 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.
[0189] 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.
[0190] 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.
[0191] 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.
[0192] 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.
[0193] 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.
[0194] 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.
[0195] 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.
[0196] 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.
[0197] 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.
[0198] Laptops are deployed with software systems such as Fig.13 As shown, the software system may include, for example, an application layer and an OS layer.
[0199] The application layer runs applications, including, for example, a device manager application (the first application in the above embodiment).
[0200] In some examples, the device manager application includes: a message acquisition module, a message filtering module, a message construction module, and a message processing module. Among them:
[0201] The message acquisition module is used to obtain window messages in the window message queue, and select foreground window messages and window destroy / minimize messages for processing.
[0202] The message filtering module is used to filter the foreground window message to determine whether a window message needs to be constructed.
[0203] The message construction module is used to construct window messages.
[0204] The message processing module is used to process constructed window messages and set the focus mode.
[0205] Optionally, if the object of the constructed window message is the desktop, the message processing module hides the mask window. If the object of the constructed window message is a non-desktop window, the message processing module sets the mask window in the lower layer of the window.
[0206] The OS layer runs system services including, for example, message management, windowing, and graphics systems.
[0207] Message management is used to encapsulate window messages and maintain the window message queue.
[0208] 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.
[0209] 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.
[0210] 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.
[0211] The following describes how the device manager application processes window messages:
[0212] like Fig.14 As shown, the device manager application includes: a message acquisition module, a message filtering module, a message construction module, and a message processing module, wherein:
[0213] S1401, the message acquisition module acquires the window message, identifies the window message, sends the foreground window message to the message filtering module, and sends the window destroy / minimize message to the third judgment module.
[0214] Optionally, the window message may be acquired and identified by referring to the implementation of S1101 to S1102 in the above example.
[0215] S1402: The message filtering module filters the foreground window messages.
[0216] Optionally, referring to the implementation of S1103 in the above example, the foreground window message may be filtered by window name / window class name, window style, window extension style, window size, window display area, etc.
[0217] S1403, the first judgment module judges whether the foreground window message needs to be filtered, if so, the foreground window message that needs to be filtered is sent to the second judgment module, if not, the foreground window message that does not need to be filtered is sent to the message processing module.
[0218] Optionally, referring to the implementation of S1104 in the above example, a focus mode may be set for a foreground window message that does not need to be filtered, and a mask window may be set at a lower layer of a window corresponding to the foreground window message.
[0219] S1404, the second judgment module determines whether to construct a window message based on the foreground window message that needs to be filtered. If so, the message construction module is notified to construct the window message. If not, the foreground window message that needs to be filtered is sent to the message processing module.
[0220] Optionally, you can refer to the implementation methods of S1105 to S1106 in the above example. 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., construct a window message.
[0221] If the foreground window message to be filtered has the WS_EX_NOACTION attribute, the window handle included in the message is saved in the second window container, and then the mask window is set at the lower layer of the foreground window.
[0222] S1405. The third judgment module obtains the window handle of the window destroy / minimize message and determines whether the window handle exists in the second window container. If so, the message construction module is notified to construct a window message. If not, the execution ends.
[0223] Optionally, referring to the implementation of S1107 in the above example, if the window destroy / minimize message has the WS_EX_NOACTION attribute, a window message is constructed, and the constructed window message includes the window handle of the new foreground window selected from the first window container, or the window handle of the desktop.
[0224] S1406. The message construction module constructs a window message and sends the constructed foreground window message to the message processing module.
[0225] S1407, the message processing module processes the constructed window message, and if the object of the constructed window message is the desktop, the message processing module hides the mask window. If the object of the constructed window message is a non-desktop window, the message processing module sets the mask window in the lower layer of the window.
[0226] In some embodiments, Fig.15 As shown, the message processing module further includes the following steps when processing the constructed window message:
[0227] S1501. Get the constructed window message.
[0228] S1510. Determine whether the constructed window message is for the desktop. If so, execute S1511; if not, execute S1520.
[0229] S1511. Determine whether there is a window handle in the first window container. If so, execute S1512; if not, execute S1530.
[0230] S1512: Start the first timer check.
[0231] Optionally, reference can be made to the implementation method of S1108 above, where the first timer is destroyed after the timing ends. If the window handle still exists in the first window container before the first timer is destroyed, the first application uses the window corresponding to the window handle as the new foreground window and sets the mask window at the lower layer of the new foreground window, so that the electronic device highlights the new foreground window.
[0232] S1520, determine whether the window is a valid window, if so, execute S1531, if not, execute S1521.
[0233] Optionally, whether the window is a valid window may be determined with reference to the above embodiments of S802 to S808, which will not be described in detail herein.
[0234] S1521, start the second timer check.
[0235] Optionally, referring to the implementation method of S1109 above, the second timer is destroyed after the timing ends. If the window handle of the window still does not exist in the first window container before the second timer is destroyed, the first application selects the most recently opened window as the new foreground window according to the window handle saved in the first window container, and sets the mask window at the lower layer of the new foreground window, so that the electronic device highlights the new foreground window.
[0236] S1530. Hide the mask window.
[0237] 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.
[0238] S1531. Set the mask window at the lower layer of the window corresponding to the constructed window message.
[0239] Optionally, you can refer to the above example and set the Z-axis order of the mask window by calling the Set Window Pos function interface.
[0240] 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.
[0241] For example, Fig.16 As shown, the cache processing module performs the following steps:
[0242] S1601: Start the third timer check, and the third timer check is destroyed after the timing ends.
[0243] S1602: After the third 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.
[0244] S1603: After the third 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.
[0245] Optionally, after constructing the window message, the message construction module can refer to the above step S1406 to send the constructed window message to the message processing module, and the message processing module sets the focus mode according to the constructed window message. If the object of the constructed window message is the desktop, the mask window is hidden, and if the object of the constructed window message is a non-desktop window, the mask window is set in the lower layer of the window.
[0246] Optionally, after constructing the window message, the message construction module may also refer to the above steps S1501 to S1531 to send 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 repeated.
[0247] 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.
[0248] 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.
[0249] 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.
[0250] 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.
[0251] 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.
[0252] 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.
[0253] 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.
[0254] 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.
[0255] 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.
[0256] 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: Displaying a first window, wherein a display position of the first window is within a first display area on the screen, and a brightness of the first display area is greater than a brightness of a second display area; creating a second window, wherein the brightness of the first display area is reduced; Displaying the second window; the second window is displayed on an upper layer of the first window; the display position of the second window is within a third display area on the screen, and the brightness of the third display area is greater than the brightness of the first display area; A third window is created, the third window is on an upper layer of the first window, and a display position of the third window is outside a display area of the screen; wherein after the third window is created, a brightness of the third display area is greater than a brightness of the first display area.
2. The method according to claim 1, characterized in that After creating the third window, the method further includes: A target window is acquired, wherein the brightness of an area outside a display area corresponding to the target window is reduced; the target window includes the first window or the second window.
3. The method according to claim 1, characterized in that The method further comprises: Creating a fourth window, wherein the fourth window is on an upper layer of the first window and the second window, and the fourth window is a transparent window; The fourth window is switched to the foreground, and based on the fourth window being transparent, a target window is acquired, and the brightness of an area other than a display area corresponding to the target window is reduced; The target window includes the first window or the second window.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Creating a fifth window, the fifth window being on an upper layer of the first window and the second window, and the size of the fifth window being smaller than a preset size; The fifth window is switched to the foreground, and based on the fact that the size of the fifth window is smaller than a preset size, a target window is acquired, and the brightness of an area other than a display area corresponding to the target window is reduced; The target window includes the first window or the second window.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Creating a sixth window, the sixth window being on an upper layer of the first window and the second window, the sixth window having a non-focus WS_EX_NOACTIVATE attribute; The sixth window is switched to the foreground, and based on the sixth window having the WS_EX_NOACTIVATE attribute, the window handle of the sixth window is saved; the brightness of the display area corresponding to the sixth window is greater than the brightness of the second area; The sixth window is destroyed or minimized, a target window is acquired, and the brightness of an area outside a display area corresponding to the target window is reduced; The target window includes the first window or the second window.
6. The method according to claim 5, characterized in that The window handle of the sixth window is stored in the window container; Before the sixth window is destroyed or minimized, the method further includes: Obtaining a window destroy or minimize message, wherein the window destroy or minimize message includes a window handle; The window handle included in the window destroy or minimize message is the same as the window handle stored in the window container.
7. The method according to any one of claims 1 to 6, characterized in that: The brightness of the area outside the display area corresponding to the target window is reduced, including: The mask window is set at the lower layer of the target window, the display brightness of the mask window is lower than the display brightness of the target window, the mask window is transparent and is located at the lower layer of the mask window, and the display brightness of the window overlapping the display area corresponding to the mask window is the same as the display brightness of the mask window.
8. The method according to claim 7, characterized in that In the case of failure to obtain the target window, the desktop is highlighted; the failure to obtain the target window indicates that there is no window on the upper layer of the desktop.
9. The method according to claim 8, characterized in that The highlighting of the desktop includes: Hides the mask window.
10. The method according to any one of claims 1 to 9, characterized in that: The target window includes the following conditions: Has visible window property WS_VISIBLE; The area intersecting with the desktop is larger than the preset area; The number of switches to the top layer is less than the preset number; Not transparent.
11. The method according to claim 10, characterized in that Determine whether a window is transparent in the following way: Acquiring a pixel color of a target pixel for the first time, wherein the pixel position of the target pixel is located within the display area of the candidate window; In the lower layer of the candidate window, a test window is set at the pixel position of the target pixel point, so that the window color of the test window is different from the pixel color of the target pixel point; Get the pixel color of the target pixel for the second time; If there is no difference between the pixel color of the target pixel point obtained for the first time and the pixel color of the target pixel point obtained for the second time, the candidate window is a non-transparent window.
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 method as described in any one of claims 1-11.
13. A computer-readable storage medium, characterized in that: The method comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 11.
14. A computer program product, characterized in that When the computer program product is executed on an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Method and device for displaying application program interfaces
CN103455234A
Content based dynamic control methods and systems for display brightness
CN105144021A
Display method, storage medium and electronic equipment
CN117632329A
Method of and apparatus for highlighting region to be highlighted in display device, and record medium storing highlight method
US20030179238A1