Display method, electronic equipment and computer readable storage medium
By creating three windows on the OLED screen and setting the focus display function, the burn-in problem of OLED screens was solved, extending the screen's lifespan and improving the user experience.
Patent Information
- Application Number
- CN202410644943.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2025-11-28
AI Technical Summary
OLED screens are prone to burn-in due to their self-emissive nature, leading to pixel aging and color differences in display quality. In existing technologies, screen flickering is common when switching windows, affecting the user experience.
By creating three windows, two of which are visible and one is invisible, and enabling the focus display feature when the visible window is minimized, the brightness of the second window is made greater than that of other areas. A mask is set to ensure that the brightness of the second window is greater than that of other areas on the lower layer, thus avoiding the entire screen from emitting light at the same time.
It extends the lifespan of the display, prevents screen burn-in, improves the user experience, and ensures flicker-free screen switching when switching windows.
Smart Images

Figure CN121029282A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of window display, in particular to a display method, an electronic device and a computer readable storage medium. BACKGROUND
[0002] OLED (Organic Light-Emitting Diode) screens have been widely used in electronic devices because of their lightness, thinness, power saving and other characteristics. It uses self-luminous display technology, and each pixel can emit light independently without the need for a backlight. When an electric current passes through, the organic material emits light, thereby displaying an image. However, it is this self-luminous characteristic that makes OLED screens have the possibility of burn-in. Burn-in refers to the fact that some pixels on the screen remain unchanged in brightness and color for a long time, causing the organic material of these pixels to age and form an indelible mark. In order to avoid the OLED screen from being burned out and the final display effect from appearing color difference, a display method is urgently needed. SUMMARY
[0003] The purpose of the embodiments of the present application is to provide a display method, an electronic device and a computer readable storage medium to reduce the risk of the display screen being burned out. The specific technical solutions are as follows:
[0004] In the first aspect, in order to achieve the above-mentioned purpose, the embodiments of the present application provide a display method, which comprises:
[0005] displaying a first window of a first application and a second window of a second application;
[0006] creating a third window through the first application, wherein the third window is on the current screen and not in the first window, and the third window is invisible to the user;
[0007] minimizing the first window;
[0008] In the case that the first window is minimized and the focused display function is turned on, the brightness of the second window is greater than that of other display areas.
[0009] In the embodiments of the present application, three windows are created in advance, of which two windows are visible and one window is invisible. When one of the two visible windows is minimized, the focused display function is turned on, and the remaining visible window can be displayed in focus, thereby achieving the purpose of partial pixel operation, so that the pixels on the screen can get sufficient rest, which can reduce the risk of the display screen being burned out, avoid the final display effect from appearing color difference, and achieve the effect of prolonging the service life of the display screen.
[0010] In a possible implementation, the first window is an owner window of the third window.
[0011] In the case that the first window is minimized and the focused display function is turned on, the brightness of the second window is greater than the brightness of other display areas, comprising:
[0012] In the case that the first window is minimized and the focused display function is turned on, a mask layer is arranged under the second window, wherein the second window is visible to the user and the brightness of the second window is greater than the brightness of the mask layer.
[0013] In the embodiments of the present application, after the second window is determined to be the window that needs to be focused, the mask layer is arranged under the second window, so as to ensure that the brightness of the second window is greater than the brightness of other parts. Compared with the prior art, the mask layer is first brought to the uppermost layer, and then the window that needs to be focused is brought to the upper layer of the mask layer, so that the screen flashing problem does not occur, and good user experience can be brought to the user.
[0014] In a possible implementation, the first window, the second window and the third window are all top-level windows, and the method further comprises:
[0015] In response to turning on the focused display function, a top-level window satisfying a preset condition is determined, wherein the second window satisfies the preset condition, and the preset condition is used to select the top-level window of the window where the focus is located or the top-level window of the uppermost window on the current screen visible to the user.
[0016] In the embodiments of the present application, the top-level window of the window where the focus is located or the top-level window of the uppermost window on the current screen visible to the user is selected and focused, so that the pixels on the whole screen do not need to emit light at the same time, which not only emphasizes the window being used by the user, but also prolongs the service life of the display screen.
[0017] In a possible implementation, the determination of the top-level window satisfying the preset condition comprises:
[0018] The top-level window of the window where the focus is located is obtained as a foreground window.
[0019] If the foreground window is a desktop window, a target foreground window on the current screen is acquired in a top-down order in a direction perpendicular to the current screen, and it is determined whether the target foreground window satisfies any one of the following conditions: minimization, invisibility to a user, non-existence on the current screen, and a special condition that an owner window of the target foreground window is a 0-pixel window with a specific extended attribute; if there is a target foreground window that does not satisfy any one of the conditions, the target foreground window is determined to be a top-level window satisfying the preset condition, otherwise, the desktop window is determined to be the top-level window satisfying the preset condition.
[0020] If the foreground window is not a desktop window, the foreground window is determined to be the top-level window satisfying the preset condition.
[0021] In the embodiments of the present application, the top-level window of the window where the focus is located is acquired to obtain the foreground window, and in the case that the foreground window is not a desktop window, the foreground window can be directly determined to be the top-level window satisfying the preset condition; in the case that the foreground window is a desktop window, it is further determined whether there is another window visible to a user on the current screen, if there is, the topmost window visible to the user on the current screen is determined to be the top-level window satisfying the preset condition, if not, it is indicated that there is no other window on the current screen, and only a desktop window exists, and thus the desktop window can be normally displayed. In this way, the window that needs to be focused and displayed can be correctly selected, and the user experience is improved while the display screen is protected.
[0022] In a possible implementation, the method further includes:
[0023] In response to the click operation on the first window icon, a first window is displayed, wherein the brightness of the first window is greater than the brightness of other display areas, and the brightness of the second window is reduced.
[0024] In the embodiments of the present application, after the focused display function is enabled, the actual situation of window switching is considered, and after the top-level window satisfying the preset condition is changed, the brightness of the current top-level window satisfying the preset condition is still greater than the brightness of other display areas, so as to ensure the actual correctness of the focused display function.
[0025] In a possible implementation, the method further includes:
[0026] In response to the click operation on the desktop window, the brightness of each window on the current screen is unchanged.
[0027] In the embodiments of the present application, after the focused display function is turned on, various events may occur, some of which may affect the current display rule and some of which may not affect the current display rule. Clicking the desktop window does not affect the top-level window that currently meets the preset condition, and thus the brightness of each window on the current screen does not change. The display of each window remains normal and no error occurs.
[0028] In a possible implementation, the method further includes:
[0029] minimizing the second window;
[0030] in response to the second window being minimized, displaying a desktop window, wherein the brightness of the desktop window is increased.
[0031] In the embodiments of the present application, in the case that the desktop window is the top-level window that meets the preset condition, the brightness of the desktop window is increased, that is, in the case that there is only one desktop window on the current screen, all the pixels on the screen work at the same time, which can maximize the rest of each pixel, and the display effect of the desktop window can be ensured.
[0032] In a possible implementation, after the second window is minimized, the method further includes:
[0033] setting a timer;
[0034] updating the first time when the timer is started for one second;
[0035] updating the second time if it is detected that the top-level window that meets the preset condition changes, wherein the preset condition is used to select the top-level window of the window where the focus is located or the top-level window of the topmost window on the current screen that is visible to the user;
[0036] in response to the update of the second time, if the top-level window that currently meets the preset condition is the desktop window and the last top-level window that meets the preset condition is invisible to the user, hiding the mask layer;
[0037] if the top-level window that currently meets the preset condition is not the desktop window, setting a mask layer under the top-level window that currently meets the preset condition to make the brightness of the top-level window that currently meets the preset condition greater than the brightness of other display areas.
[0038] The method provided in the embodiments of the present application can monitor the top-level window that meets the preset condition being minimized in the case that the focused display function has been turned on, and adaptively determine which window to focus on display. In the long-term use of the display screen, the focused display is always maintained, and the loss of the screen is reduced.
[0039] In a possible implementation, the method further includes:
[0040] If the first time is greater than the second time, and the last top-level window satisfying the preset condition is invisible, the cover layer is hidden.
[0041] The method provided by the embodiment of the present application considers that when the icon in the task bar is clicked to minimize the desktop visible window, the last visible window is minimized, the HandleWinHookEvent callback function cannot receive the EVENT_SYSTEM_FOREGROUND event, in this case, a special judgment processing is introduced to correctly find the current top-level window satisfying the preset condition, and the accuracy of the focused display is ensured.
[0042] In a second aspect, the embodiment of the present application further provides a display method, and the method comprises:
[0043] opening the focused display function in response to the operation of the user;
[0044] In the case that the focused display function is opened and the target top-level window is not the desktop window, the brightness of the target top-level window is unchanged, and the brightness of other windows on the current screen except the target top-level window is reduced.
[0045] The target top-level window is the top-level window of the topmost window on the current screen visible to the user.
[0046] The display method provided by the embodiment of the present application only allows the top-level window of the topmost window on the current screen visible to the user to be normally displayed, and the display brightness of other parts is reduced, and in the same time, all the pixels of the screen do not need to be in working state, so that the service life of the screen can be prolonged.
[0047] In a possible implementation, the target top-level window is determined in the following manner:
[0048] The top-level window of the window where the focus is located is obtained to obtain a foreground window;
[0049] If the foreground window is a desktop window, a target foreground window on the current screen is obtained in the vertical direction of the current screen in the order from top to bottom, it is judged whether the target foreground window satisfies any one of the conditions of minimization, invisibility to the user, non-existence on the current screen and a special case, the special case refers to that an owner window of the target foreground window is a 0-pixel window with a specific extended attribute, if there is a target foreground window not satisfying any one of the conditions, the target foreground window is determined as the target top-level window, otherwise, the desktop window is determined as the top-level window satisfying the preset condition;
[0050] If the foreground window is not the desktop window, the foreground window is determined as the target top-level window.
[0051] The method for determining the target top-level window provided in this application first obtains the top-level window of the window with focus to get the foreground window. If the foreground window is not a desktop window, it can be directly determined as the target top-level window. If the foreground window is a desktop window, it is also necessary to determine whether there are other user-visible windows on the current screen. If so, the topmost user-visible window on the current screen needs to be determined as the target top-level window. If not, it means that there are no other windows on the current screen, only a desktop window, so the desktop window can be displayed normally. In this way, the window that needs to be focused on can be correctly selected, which protects the display screen and improves the user experience.
[0052] In one possible implementation, the method further includes:
[0053] Minimize the target top-level window;
[0054] In response to the minimization of the target top-level window, the first time is updated one second after the preset timer is started;
[0055] If a change is detected in the target top-level window, update the second time;
[0056] In response to the update at the second time, if the current target top-level window is a desktop window and the previous target top-level window is not visible to the user, hide the overlay;
[0057] If the current target top-level window is not a desktop window, set a mask layer under the current target top-level window so that the brightness of the current target top-level window is greater than the brightness of other display areas.
[0058] The method provided in this application embodiment can monitor whether the target top-level window is minimized when the focus display function is already turned on. If the target top-level window is minimized, it adaptively re-determines which window to focus on display, thus maintaining focus display during long-term use of the display screen and reducing screen wear.
[0059] In one possible implementation, the method further includes:
[0060] If the first time is greater than the second time, and the previous target top-level window is not visible to the user, hide the overlay.
[0061] The method provided in this application takes into account that when the last visible window on the desktop is minimized by clicking the icon in the taskbar, the HandleWinHookEvent callback function may not receive the EVENT_SYSTEM_FOREGROUND event. In this case, special judgment processing is introduced to correctly find the current target top-level window and ensure the accuracy of focused display.
[0062] In one possible implementation, the method further includes:
[0063] If a change is detected in the target top-level window, update the second time;
[0064] In response to the update at the second time, if the current target top-level window is a desktop window and the previous target top-level window is not visible to the user, hide the overlay;
[0065] If the current target top-level window is not a desktop window, set a mask layer under the current target top-level window so that the brightness of the current target top-level window is greater than the brightness of other display areas.
[0066] The method provided in this application embodiment can detect whether the target top-level window has changed, and after the target top-level window changes, the target top-level window is redefined to achieve dynamic implementation of the focus display function.
[0067] In one possible implementation, the method further includes:
[0068] Set the height parameter of the target top-level window to a first height parameter, where the first height parameter is greater than the height parameter of the taskbar on the current screen.
[0069] A mask is set below the target top-level window, and the height parameter of the mask is greater than the height parameter of the taskbar on the current screen.
[0070] In this embodiment, the window that needs to be focused on is set as the topmost window above the taskbar. In this way, the overlay set below the topmost window can cover the taskbar, ensuring that the brightness of the taskbar is also reduced, so that the pixels on the taskbar can also get enough rest, reducing the risk of screen burn-in.
[0071] Thirdly, embodiments of this application also provide an electronic device, including:
[0072] One or more processors and memory;
[0073] The memory is coupled to the one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions, which the one or more processors call to cause the electronic device to perform any of the display methods described in the first aspect above.
[0074] Fourthly, embodiments of this application also provide a computer-readable storage medium including a computer program that, when run on an electronic device, causes the electronic device to perform any of the display methods described in the first aspect.
[0075] The display method provided in this application includes displaying a first window of a first application and a second window of a second application; creating a third window through the first application, wherein the third window is on the current screen but not within the first window, and the third window is invisible to the user; minimizing the first window; and when the first window is minimized and the focus display function is enabled, the brightness of the second window is greater than the brightness of other display areas. This application pre-creates three windows, two of which are visible and one is invisible. When one of the two visible windows is minimized, the focus display function is enabled, allowing the remaining visible window to be displayed. This achieves the purpose of partial pixel work, enabling the pixels on the screen to rest sufficiently. This reduces the risk of screen burn-in, avoids color differences in the final display effect, and extends the lifespan of the screen. Attached Figure Description
[0076] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0077] Figure 1 A hardware structure diagram of an electronic device provided in an embodiment of this application;
[0078] Figure 2 A software structure block diagram of an electronic device provided in an embodiment of this application;
[0079] Figure 3a A user interface diagram provided for an embodiment of this application;
[0080] Figure 3b Another user interface diagram provided for an embodiment of this application;
[0081] Figure 4 This is a schematic diagram illustrating the interaction between a device manager and an operating system provided in an embodiment of this application.
[0082] Figure 5 This is another interactive diagram between the device manager and the operating system provided in an embodiment of this application;
[0083] Figure 6 A schematic diagram illustrating the spatial relationship of multiple windows provided in an embodiment of this application;
[0084] Figure 7 A schematic diagram of a target top-level window provided in an embodiment of this application;
[0085] Figure 8a A schematic diagram of the window created for an embodiment of this application;
[0086] Figure 8b This is a schematic diagram illustrating the relationship between the Owner window and the Owned window provided in an embodiment of this application.
[0087] Figure 9 This is a schematic diagram illustrating a result obtained by applying the display method of this application;
[0088] Figure 10 A first schematic diagram illustrating the determination of a top-level window that meets preset conditions, as provided in an embodiment of this application;
[0089] Figure 11 A second schematic diagram illustrating the determination of a top-level window that meets preset conditions, provided for an embodiment of this application;
[0090] Figure 12 A third schematic diagram illustrating the determination of a top-level window that meets preset conditions, provided for an embodiment of this application;
[0091] Figure 13 A fourth schematic diagram illustrating the determination of a top-level window that meets preset conditions, provided for an embodiment of this application;
[0092] Figure 14 This is a fifth schematic diagram illustrating the determination of a top-level window that meets preset conditions, as provided in an embodiment of this application. Detailed Implementation
[0093] To better understand the technical solution of this application, the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0094] To facilitate a clear description of the technical solutions in the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish identical or similar items with essentially the same function and effect. For example, "first instruction" and "second instruction" are used to distinguish different user instructions and do not limit their order. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.
[0095] It should be noted that, in this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.
[0096] OLED (Organic Light-Emitting Diode) screens are widely used in electronic devices due to their thinness, lightness, and energy efficiency. They employ self-emissive display technology, where each pixel emits light independently, eliminating the need for a backlight. When an electric current passes through, the organic material emits light, thus displaying an image. However, this very self-emissive characteristic makes OLED screens susceptible to burn-in. Burn-in occurs when certain pixels on the screen maintain the same brightness and color for an extended period, causing the organic material of these pixels to age and form an indelible mark. To prevent OLED screens from burning out and resulting in color discrepancies in the final display, a new display method is urgently needed.
[0097] The common practice is to keep the topmost window on the desktop at its original brightness, while dimming all other display areas except the taskbar. However, this has drawbacks. If the topmost window is the first window, when switching to the second window, the second window will flicker, resulting in a poor user experience.
[0098] This application provides a display method applicable to electronic devices such as smartphones, tablets, and smartwatches. The display screen of this electronic device can be an OLED or LCD screen. To extend the lifespan of the display screen and reduce the risk of screen burn-in, the display method provided in this application displays a first window of a first application and a second window of a second application; a third window is created through the first application, wherein the third window is on the current screen but not within the first window, and is invisible to the user; the first window is minimized; and with the first window minimized and the focus display function enabled, the brightness of the second window is greater than the brightness of other display areas. Therefore, the display method provided in this application does not require the entire display screen to be illuminated, but rather makes the brightness of a specific display window greater than the brightness of other display areas. In this way, only a portion of the screen is active at any given time, allowing the pixels on the screen to rest sufficiently, thereby reducing the risk of screen burn-in.
[0099] The structure of the electronic device to which the above display method is applied will be described below.
[0100] For example, Figure 1A structural diagram of electronic device 100 is shown. Electronic device 100 may include a processor 110, a display screen 120, a camera 130, internal memory 140, a SIM (Subscriber Identification Module) card interface 150, a USB (Universal Serial Bus) interface 160, a charging management module 170, a battery management module 171, a battery 172 with battery cells and battery protection devices, a sensor module 180, a mobile communication module 190, a wireless communication module 200, antenna 1, and antenna 2, etc. The sensor module 180 may include a pressure sensor 180A, a fingerprint sensor 180B, a touch sensor 180C, an ambient light sensor 180D, etc.
[0101] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0102] Processor 110 may include one or more processing units, such as a CPU (Central Processing Unit), AP (Application Processor), modem processor, GPU (Graphics Processing Unit), ISP (Image Signal Processor), controller, video codec, DSP (Digital Signal Processor), baseband processor, and / or NPU (Neural-network Processing Unit). Different processing units may be independent components or integrated into one or more processors. In some embodiments, electronic device 100 may also include one or more processors 110. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. In other embodiments, processor 110 may also include a memory for storing instructions and data. For example, the memory in processor 110 may be a cache memory. This memory can store instructions or data that processor 110 has just used or is repeatedly used. If processor 110 needs to reuse the instruction or data, it can directly retrieve it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the electronic device 100 in processing data or executing instructions.
[0103] In some embodiments, the processor 110 may include one or more interfaces. These interfaces may include an I2C (Inter-Integrated Circuit) interface, an I2S (Inter-Integrated Circuit Sound) interface, a PCM (Pulse Code Modulation) interface, a UART (Universal Asynchronous Receiver / Transmitter) interface, a MIPI (Mobile Industry Processor Interface) interface, a GPIO (General-Purpose Input / Output) interface, a SIM card interface, and / or a USB interface. The USB interface 160 is a USB standard-compliant interface, specifically a Mini USB interface, a Micro USB interface, a USB Type-C interface, etc. The USB interface 160 can be used to connect a charger to charge the electronic device 100, and can also be used for data transfer between the electronic device 100 and peripheral devices. The USB interface 160 can also be used to connect headphones for audio playback.
[0104] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are for illustrative purposes only and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also adopt different interface connection methods or a combination of multiple interface connection methods as described in the above embodiments.
[0105] The wireless communication function of electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 190, wireless communication module 200, modem processor and baseband processor, etc.
[0106] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.
[0107] Electronic device 100 implements display functions through a GPU, display screen 120, and application processor. The GPU is a microprocessor for image processing, connected to the display screen 120 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0108] The display screen 120 is used to display multiple different user interfaces. The display screen 120 includes a display panel. The display panel can be an LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), Active Matrix Organic Light-Emitting Diode, AMOLED (Active-Matrix Organic Light-Emitting Diode), FLED (Flexible Light-Emitting Diode), MiniLED, MicroLED, Micro-OLED, QLED (Quantum Dot Light-Emitting Diodes), etc. In some embodiments, the electronic device 100 may include one or more display screens 120.
[0109] In some embodiments of this application, when the display panel uses materials such as OLED, AMOLED, and FLED, the above-mentioned Figure 1 The display screen 120 can be bent. Here, "the display screen 120 can be bent" means that the display screen can be bent to any angle at any part and can maintain that angle. For example, the display screen 120 can be folded from the middle left to right. It can also be folded from the middle up and down.
[0110] The display screen 120 of electronic device 100 can be a flexible screen. Currently, flexible screens are attracting much attention due to their unique characteristics and enormous potential. Compared to traditional screens, flexible screens are highly flexible and bendable, providing users with new interaction methods based on their bendability and meeting more user needs for electronic devices. For electronic devices equipped with foldable displays, the foldable display can switch between a small screen in a folded state and a large screen in an unfolded state at any time. Therefore, users are increasingly using split-screen functionality on electronic devices equipped with foldable displays.
[0111] Electronic device 100 can perform shooting functions through ISP, camera 130, video codec, GPU, display 120 and application processor, wherein camera 130 includes a front camera and a rear camera.
[0112] The ISP is used to process data fed back from the camera 130. For example, during shooting, when the shutter is opened, light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can perform algorithmic optimization of image noise, brightness, and color. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 130.
[0113] Camera 130 is used to capture photos or videos. An object is projected onto a photosensitive element through a lens, generating an optical image. The photosensitive element can be a CCD (Charge Coupled Device) or a CMOS (Complementary Metal-Oxide-Semiconductor) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then transmitted to an ISP (Internet Service Provider) for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP (Digital Signal Processor) for processing. The DSP converts the digital image signal into image signals in standard RGB (Red, Green, Blue) or YUV (a color encoding method) formats. In some embodiments, the electronic device 100 may include one or N cameras 130, where N is a positive integer greater than 1.
[0114] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.
[0115] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record video in various encoding formats, such as MPEG (Moving Picture Experts Group) 1, MPEG2, MPEG3, and MPEG4.
[0116] An NPU (Neural Processing Unit) is a neural network computing processor that, by drawing inspiration from the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, rapidly processes input information and can continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.
[0117] The internal memory 140 can be used to store one or more computer programs, which include instructions. The processor 110 can execute the instructions stored in the internal memory 140, thereby causing the electronic device 100 to perform the display methods, various applications, and data processing provided in some embodiments of this application. The internal memory 140 may include a program storage area and a data storage area. The program storage area may store the operating system; it may also store one or more applications (such as a gallery, contacts, etc.). The data storage area may store data created during the use of the electronic device 100 (such as photos, contacts, etc.). Furthermore, the internal memory 140 may include high-speed random access memory and non-volatile memory, such as one or more disk storage components, flash memory components, general-purpose flash memory, etc. In some embodiments, the processor 110 can execute instructions stored in the internal memory 140 and / or instructions stored in memory disposed in the processor 110 to cause the electronic device 100 to perform the display methods, other applications, and data processing provided in the embodiments of this application.
[0118] The internal memory 140 can be used to store related programs of the display method provided in the embodiments of this application. The processor 110 can be used to call the related programs of the display method stored in the internal memory 140 when displaying information, and execute the display method of the embodiments of this application.
[0119] The sensor module 180 may include a pressure sensor 180A, a fingerprint sensor 180B, a touch sensor 180C, an ambient light sensor 180D, etc.
[0120] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be disposed on display screen 120. Pressure sensor 180A can be of many types, such as resistive pressure sensor, inductive pressure sensor, or capacitive pressure sensor. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes, and electronic device 100 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 120, electronic device 100 detects the touch operation based on pressure sensor 180A. Electronic device 100 can also calculate the touch position based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example, when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS is executed; when a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS is executed.
[0121] The fingerprint sensor 180B is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to perform functions such as unlocking, accessing application locks, taking photos, and answering calls.
[0122] Touch sensor 180C, also known as a touch device, can be disposed on display screen 120. The touch sensor 180C and display screen 120 together form a touchscreen, also known as a touch display. Touch sensor 180C is used to detect touch operations applied to or near it. Touch sensor 180C can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 120. In other embodiments, touch sensor 180C may also be disposed on the surface of electronic device 100 and in a different location from display screen 120.
[0123] The ambient light sensor 180D is used to sense the ambient light intensity. The electronic device 100 can adaptively adjust the brightness of the display screen 120 based on the sensed ambient light intensity. The ambient light sensor 180D can also be used to automatically adjust the white balance during shooting. The ambient light sensor 180D can also transmit environmental information about the device's location to the GPU.
[0124] The ambient light sensor 180D is also used to acquire the brightness, light ratio, color temperature, and other parameters of the environment in which the camera 130 captures images.
[0125] The software system of electronic devices can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. A layered architecture divides the electronic device's software system into several layers, each with a clear role and function, and the layers communicate with each other through software interfaces. In some examples, a device manager can be installed on the device. This device manager can perform focus monitoring, overlay management, and desktop specialization. Focus monitoring refers to determining the window with focus on the current screen; overlay management refers to various operations on overlays, where an overlay is a semi-transparent black full-screen window that can cover other windows, reducing their display brightness; desktop specialization refers to determining whether the owner window is a 0-pixel window with the WS_EX_TOOLWINDOW extended attribute.
[0126] As one implementation method, such as Figure 2 As shown, the device's service layer includes a device manager, and the device's operating system layer includes a management module. This management module may include a message management module, a window management module, and a drawing management module. It is understood that the above division of functional modules is only an example; in actual applications, these functions can be assigned to different functional modules as needed.
[0127] The aforementioned message management module is used to handle various messages generated during window display. The device manager interacts with the operating system layer multiple times to complete the display method provided in this application. During this process, the device manager communicates with the operating system layer through various messages, and the message management module is responsible for processing these messages.
[0128] The aforementioned window management module is used to create a new window during the window creation phase, including creating a new window by clicking an application, or creating a sub-window of the current window by clicking a window. It can also manage existing windows, such as switching the focus window when multiple windows exist, or closing / minimizing a specific created window.
[0129] The drawing management module described above is used to draw masks and other user interfaces that need to be displayed. After the focus display function is enabled, the mask can be set in the lower layer of the top-level window of the window where the focus is located.
[0130] The service layer is primarily responsible for handling the system's business logic, providing functional support to the application layer, including data validation, data processing, and business process control. By encapsulating the underlying data processing and logic, the service layer provides a higher level of abstraction to the application layer, making it easier for the application layer to use these services. The application layer provides services to the application layer by encapsulating the underlying data processing and logic, thus providing a higher level of abstraction. The application layer responds to and fulfills user needs by calling the functions provided by the service layer. The quality of the service layer design directly affects the performance, stability, and maintainability of the application layer. The application layer focuses on providing services to users and implementing the application, while the service layer focuses on handling the abstraction of business logic and data processing. The two layers are interdependent and work together to achieve the overall functionality of the system.
[0131] The aforementioned operating system layer hides hardware details, providing application developers with only abstract interfaces, resulting in highly compatible applications. The operating system layer typically consists of an embedded kernel, GUI, TCP / IP network protocol, file system, and power management. The kernel is fundamental and essential, and can only be optimized. Its basic components include process management, inter-process communication, and memory management. System calls are a mechanism for applications to request operating system services. An API (Application Programming Interface) is a complex collection of functions, messages, and structures.
[0132] certainly, Figure 2 The image only shows the service layer and operating system layer of the device. It's understandable that the software architecture of electronic devices can include other layers besides these, such as the application layer. Each layer has a clear role and division of labor. Layers communicate with each other through software interfaces. For details, please refer to relevant technologies; they will not be elaborated upon here.
[0133] The following describes an application scenario of the display method provided in the embodiments of this application. In this scenario, a computer is used as an example for explanation.
[0134] Figure 3a An exemplary illustration shows a user interface 300 on a computer that includes multiple applications. The user interface 300 displays a desktop window with application icons, which may include multiple application icons (e.g., email application icon, text document application icon, browser application icon, etc.). At the bottom of the desktop window is a taskbar, which may contain a "Start" button for shutting down / restarting or launching a specific application from the "Start" button. Specifically, after clicking the "Start" button, the following is displayed: Figure 3bThe user interface shown is illustrated. Users can choose to launch an application by clicking the application icon on the desktop, or they can click the "Start" button to select and launch an application from the displayed applications. After a window is created using an application, it appears on the taskbar 302. The window can be maximized or minimized by clicking the window icon on the taskbar 302. The taskbar also includes a focus display function switch 301. When the focus display function switch 301 is turned on, the window will be displayed according to the display method provided in this application. Besides activating the focus display function from a software perspective, a corresponding hardware switch can also be set for the focus display function. For example, a physical switch can be placed on the edge of the display screen. When the physical switch is turned on, the window will be displayed according to the display method provided in this application. The taskbar can also display the time, typically the date and current time on the far right side of the taskbar. The above is only one possible implementation method, and the embodiments of this application do not limit the content displayed on the user interface 300.
[0135] The following is combined Figure 4 The actual implementation process of the display method in this application will be further explained. Figure 4 This demonstrates the process of identifying the windows that truly need to be focused on after enabling the focus display feature, which is achieved through interaction between the device manager in the service layer and the operating system.
[0136] After detecting that the Focused View feature is enabled, the device manager requests the handle of the foreground window from the operating system. The foreground window is the top-level window of the window with focus. The top-level window refers to the root window. For example, if you open a Word document and are working on the text input section, the top-level window will not only be the text input section, but the entire Word page. Similarly, if you click on a search engine, create a new webpage, but only interact with the address bar, the top-level window will definitely be the entire webpage, not just the address bar. The top-level window can be owned or not, and can be displayed anywhere on the screen.
[0137] Device Manager can use the `GetForegroundWindow()` function to request the handle of the foreground window from the operating system. The operating system responds to the device manager's request and returns the foreground window handle. To determine if the foreground window is the desktop window (because when the foreground window is the desktop window, and there are other user-visible windows on the screen, the overlay should be placed below the topmost visible window, not the desktop window), Device Manager also needs to request the desktop window handle from the operating system. The operating system responds to the device manager's request and returns the desktop window handle. Device Manager needs to compare the two obtained window handles to determine if the foreground window is the desktop window.
[0138] After the device manager checks whether the foreground window is a desktop window, if the result is no, it means the foreground window is just a regular top-level window. Therefore, a mask can be set directly below the foreground window to ensure its focused display. If the result is yes, it needs to determine whether there are other user-visible windows on the current screen. Therefore, the device manager can use the EnumWindows() function to request handles of all target foreground windows from the operating system. Specifically, different windows have different height parameters. The device manager can retrieve handles of all target foreground windows on the current screen in a top-down order along the vertical direction. The operating system responds to the device manager's request and returns all target foreground window handles.
[0139] For each target foreground window, the device manager needs to determine if it meets preset conditions. If the target foreground window is minimized, it cannot be focused on, and such minimized windows need to be excluded. Similarly, if the target foreground window is invisible to the user, it cannot be focused on, and invisible windows also need to be excluded. Likewise, if the target foreground window is not on the current screen, it cannot be focused on, and target foreground windows not on the current screen also need to be excluded. There is also a special case: some owned windows (i.e., windows that are owned by another user) have an owner window with the WS_EX_TOOLWINDOW extended attribute and are 0 pixels wide. This causes the owned window to return "visible to user" when IsWindowVisible() is called to check window visibility, but the user cannot actually see the owned window. Therefore, GetWindow(owned, GW_OWNER) needs to be used to find the owner window of the owned window and determine if the owner window is a 0-pixel window with the WS_EX_TOOLWINDOW extended attribute. If the owner window is a 0-pixel window with the WS_EX_TOOLWINDOW extended attribute, the owned window is discarded. For a regular owned window, it is necessary to first determine whether the window should be eliminated by using the four judgment conditions mentioned above. If the judgment result is negative, it is possible to further judge the owner window of the owned window. It can be understood that if the owner window is minimized, it means that the owned window is also minimized. In this case, the owned window should also be eliminated.
[0140] After obtaining the handle of the target foreground window, the device manager checks whether the target foreground window is minimized. If so, it discards the current target foreground window and continues to check the next target foreground window. If the result is negative, it checks whether the target foreground window is invisible to the user. If so, it discards the current target foreground window and continues to check the next target foreground window. If the result is negative, it checks whether the target foreground window is not on the current screen. If so, it discards the current target foreground window and continues to check the next target foreground window. If the result is negative, it checks whether the target foreground window is a special case. If so, it discards the current target foreground window and continues to check the next target foreground window.
[0141] The implementation of the EnumWindows() callback function is shown below:
[0142] if(IsIconic(hWnd))
[0143] {
[0144] return TRUE;
[0145] }
[0146] This code is used to determine whether the window is minimized;
[0147] if(!IsWindowVisible(hwnd))
[0148] {
[0149] return TRUE;
[0150] }
[0151] This code is used to determine whether a window is invisible to the user;
[0152] if (the window is not currently on the desktop)
[0153] {
[0154] return TRUE;
[0155] }
[0156] This code is used to determine whether the window is currently on the screen;
[0157] (For special cases, such as a 0-pixel window with the WS_EX_TOOLWINDOW extended attribute, which is the owner of some windows that return True when IsWindowVisible is called but are actually not visible. GetWindow(hwnd, GW_OWNER) needs to be used to find the owner for special handling.)
[0158] {
[0159] return TRUE;
[0160] }
[0161] This code is used to determine whether a window meets a special condition;
[0162] Record the handle of the top-level window on the desktop into the variable hPreWnd.
[0163] return FALSE;
[0164] However, if the foreground window is the desktop window and there are no other visible windows on the screen, then hPreWnd is set to NULL. hPreWnd represents other currently foreground windows besides the desktop window.
[0165] Only foreground windows that are not minimized, are visible to the user, are on the current screen, and do not fall under special circumstances are windows that require focused display. Therefore, the device manager selects foreground windows that do not meet the above criteria and sets a mask layer on top of them. This application uses the HWND_TOPMOST parameter of SetWindowPos to set this window as the topmost window, which is higher than the taskbar height, and places the semi-transparent mask layer below it. Compared to existing methods that cannot dim the taskbar for focused display, this embodiment sets the window requiring focused display as the topmost window above the taskbar. In this way, the mask layer placed below the topmost window can cover the taskbar, ensuring that the brightness of the taskbar is also reduced, allowing the pixels on the taskbar to get sufficient rest and reducing the risk of screen burn-in.
[0166] Of course, the final result may be that all target foreground windows are eliminated, which means that there is only one desktop window on the current screen. In that case, there is no need to set a mask. If there is no target foreground window that does not meet the above judgment, the device manager will not set a mask.
[0167] After entering focused display mode, Device Manager uses SetWinEventHook to subscribe to the entire system's EVENT_SYSTEM_MINIMIZESTART and EVENT_SYSTEM_FOREGROUND events. The following section combines... Figure 5 Further explanation is provided regarding event handling by the device manager and operating system.
[0168] Device Manager subscribes to system window minimize events and foreground window change events by sending SetWinEventHook() to the operating system. When Device Manager detects that a window has been minimized, it sets a timer. The timer's purpose is to trigger Device Manager to perform certain specific operations. One second after the timer starts, the timestamp is updated to 1.
[0169] When the device manager detects a change in the foreground window, it updates timestamp 2. If the current foreground window is the desktop window, the overlay is hidden while the previous foreground window is not visible to the user. If the current foreground window is not the desktop window, the overlay is moved to the layer below the current foreground window. Of course, the HWND_TOPMOST parameter of SetWindowPos is used to set the window to the topmost window, which is higher than the taskbar height parameter, and the semi-transparent overlay is placed below it to ensure that the brightness of the taskbar can also be reduced.
[0170] However, when minimizing visible desktop windows by clicking the icon in the taskbar, the HandleWinHookEvent callback function does not receive the EVENT_SYSTEM_FOREGROUND event when the last visible window is minimized. It's necessary to check if timestamp 1 is greater than timestamp 2 and if the previous foreground window is invisible to the user; if so, hide the overlay. Understandably, when a window is normally minimized by clicking the minimize button, Device Manager will receive both the window minimize event and the foreground window change event. In this case, the normal logic should be followed: update timestamp 1 first, then timestamp 2. Since timestamp 2 is greater than timestamp 1, if the current foreground window is a desktop window and the previous foreground window is invisible to the user, hide the overlay; if the current foreground window is not a desktop window, adjust the overlay to be below the current foreground window. However, if the current foreground window is the only visible window on the screen, and the user minimizes it by clicking the icon in the taskbar, the device manager will only receive the window minimize event, meaning it only updates timestamp 1. Since timestamp 2 is not updated, it will definitely be less than timestamp 1. If timestamp 1 > timestamp 2 and the previous foreground window is not visible to the user, the overlay will be hidden. This ensures the accuracy of the focused display.
[0171] After the foreground window changes, you can follow Figure 4 The provided method redefines the foreground window.
[0172] SetWinEventHook subscribes to the EVENT_SYSTEM_MINIMIZESTART and EVENT_SYSTEM_FOREGROUND events of the entire system. The specific handling code is shown below:
[0173]
[0174] The UI message thread belongs to the device manager. When it reads a message, it adjusts the overlay to be below the new foreground window.
[0175] In one example, this application embodiment provides a display method, the method comprising:
[0176] S601, responds to user actions by activating the focus display function.
[0177] The focus display function can be enabled via a software switch on the user interface, or it can be enabled via a hardware switch. For example, a physical switch can be placed on the bezel of the display screen; when the physical switch is turned on, the window will be displayed according to the display method provided in this application.
[0178] S602. When the focus display function is turned on and the target top-level window is not a desktop window, the brightness of the target top-level window remains unchanged, while the brightness of other windows on the current screen other than the target top-level window decreases.
[0179] The target top-level window is the top-level window of the topmost window currently visible to the user on the screen.
[0180] When the display function is enabled, the target top-level window is the window that needs to be focused on. Therefore, the target top-level window is displayed normally, and the brightness of the area on the current screen other than the target top-level window is reduced. This can prevent the pixels on the screen from working for a long time, thus avoiding the problem of screen burn-in.
[0181] The display method provided in this application embodiment only allows the top-level window of the topmost window visible to the user on the current screen to be displayed normally, while the brightness of other parts is reduced. At the same time, it is not necessary for all pixels of the entire screen to be in working state, thus extending the lifespan of the screen.
[0182] In one example, the target top-level window is determined as follows:
[0183] Get the top-level window of the window with focus to become the foreground window;
[0184] If the foreground window is a desktop window, in the direction perpendicular to the current screen, the target foreground window on the current screen is obtained in a top-down order. It is then determined whether the target foreground window meets any of the following conditions: minimized, invisible to the user, not on the current screen, or a special case. The special case refers to the fact that the owner window of the target foreground window is a 0-pixel window with a specific extended attribute. If there is a target foreground window that does not meet any of the conditions, the target foreground window is determined to be the target top-level window. Otherwise, the desktop window is determined to be a top-level window that meets the preset conditions.
[0185] If the foreground window is not a desktop window, then the foreground window is determined to be the target top-level window.
[0186] See Figure 6 This displays the spatial relationship between multiple windows. The topmost focus window corresponds to the target top-level window, which is the window to be focused on. The mask is set below the window that needs to be focused on, and by overlaying it on other windows, it darkens the display area except for the focus window.
[0187] The method for determining the target top-level window provided in this application first obtains the top-level window of the window with focus to get the foreground window. If the foreground window is not a desktop window, it can be directly determined as the target top-level window. If the foreground window is a desktop window, it is also necessary to determine whether there are other user-visible windows on the current screen. If so, the topmost user-visible window on the current screen needs to be determined as the target top-level window. If not, it means that there are no other windows on the current screen, only a desktop window, so the desktop window can be displayed normally. In this way, the window that needs to be focused on can be correctly selected, which protects the display screen and improves the user experience.
[0188] In one example, the above method also includes:
[0189] S701. Minimize the target top-level window.
[0190] The target top-level window can be minimized by clicking the minimize button or the taskbar window icon. However, when minimizing visible windows on the desktop by clicking the icon in the taskbar, the HandleWinHookEvent callback function does not receive the EVENT_SYSTEM_FOREGROUND event when the last visible window is minimized. Special handling is required in this case. Understandably, when a window is normally minimized by clicking the minimize button, the device manager will receive both the window minimize event and the foreground window change event. This embodiment of the application describes the handling process for this situation.
[0191] S702. In response to the minimization of the target top-level window, after one second has elapsed since the preset timer was started, the first time is updated.
[0192] The purpose of a preset timer is to trigger certain actions. Once the timer is started, an update is made immediately after one second.
[0193] S703. If a change is detected in the target top-level window, update the second time.
[0194] The initial values for both the first and second time points can be 0.
[0195] S704. In response to the update of the second time, if the current target top-level window is a desktop window and the previous target top-level window is not visible to the user, hide the overlay.
[0196] If the current target top-level window is determined to be the desktop window, and the previous target top-level window is not visible, it means that only one target top-level window is open and is being displayed correctly. After minimizing this target top-level window, there is only one desktop window on the screen. Therefore, after minimizing the target top-level window, remove the overlay to allow the desktop window to be displayed normally.
[0197] S705. If the current target top-level window is not a desktop window, set a mask layer under the current target top-level window so that the brightness of the current target top-level window is greater than the brightness of other display areas.
[0198] If the current target top-level window is not the desktop window, it means that many windows were opened before. After minimizing the target top-level window, another window will appear on top and become the new target top-level window. In this case, you can set a mask under the new target top-level window to focus on displaying the current target top-level window.
[0199] The method provided in this application embodiment can monitor whether the target top-level window is minimized when the focus display function is already turned on. If the target top-level window is minimized, it adaptively re-determines which window to focus on display, thus maintaining focus display during long-term use of the display screen and reducing screen wear.
[0200] In one example, the above method also includes:
[0201] If the first time is greater than the second time, and the previous target top-level window is not visible to the user, hide the overlay.
[0202] When a visible window on the desktop is minimized by clicking an icon in the taskbar, the HandleWinHookEvent callback function does not receive the EVENT_SYSTEM_FOREGROUND event when the last visible window is minimized. Special handling is required in this case. This embodiment addresses this situation. It checks if timestamp 1 is greater than timestamp 2 and if the previous foreground window is invisible to the user; if so, the overlay is hidden. When the target top-level window is the last visible window on the screen, after minimizing it by clicking the icon in the taskbar, the device manager only receives the window minimize event, meaning only timestamp 1 is updated. Since timestamp 2 is not updated, it must be less than timestamp 1. If timestamp 1 > timestamp 2 and the previous foreground window is invisible to the user, it indicates that the target top-level window is the last visible window on the screen and was minimized by clicking the taskbar icon. In this case, the overlay needs to be hidden.
[0203] The method provided in this application takes into account that when the last visible window on the desktop is minimized by clicking the icon in the taskbar, the HandleWinHookEvent callback function may not receive the EVENT_SYSTEM_FOREGROUND event. In this case, special judgment processing is introduced to correctly find the current target top-level window and ensure the accuracy of focused display.
[0204] In one example, the above method also includes:
[0205] S801. If a change is detected in the target top-level window, update the second time.
[0206] Besides minimizing / closing the target top-level window, you can also change the target top-level window by performing normal access operations on other windows. For example, clicking any window other than the current target top-level window will make that window the new target top-level window. See also Figure 7 Window 901 is a window under the target top-level window, but when window 901 is clicked, window 901 will be moved to the top of the current screen and become the new target top-level window.
[0207] S802. In response to the update of the second time, if the current target top-level window is a desktop window and the previous target top-level window is not visible to the user, hide the overlay.
[0208] S803. If the current target top-level window is not a desktop window, set a mask layer under the current target top-level window so that the brightness of the current target top-level window is greater than the brightness of other display areas.
[0209] The method provided in this application embodiment can detect whether the target top-level window has changed, and after the target top-level window changes, the target top-level window is redefined to achieve dynamic implementation of the focus display function.
[0210] In one example, the above method also includes:
[0211] Set the height parameter of the target top-level window to a first height parameter, where the first height parameter is greater than the height parameter of the taskbar on the current screen.
[0212] A mask is set below the target top-level window, and the height parameter of the mask is greater than the height parameter of the taskbar on the current screen.
[0213] according to Figure 6 As we know, windows on the screen have different height parameters. By setting the height parameter of the target top-level window to the highest, the overlay placed below the target top-level window will cover the taskbar, thus darkening the taskbar. Compared to existing methods that cannot darken the taskbar for focused display, this embodiment sets the window that needs focused display as the top-level window above the taskbar. In this way, the overlay placed below the top-level window can cover the taskbar, ensuring that the brightness of the taskbar is also reduced, allowing the pixels on the taskbar to get sufficient rest and reducing the risk of screen burn-in.
[0214] On the other hand, embodiments of this application also provide a display method, the method comprising:
[0215] Displays the first window of the first application and the second window of the second application;
[0216] A third window is created through the first application, wherein the third window is on the current screen but not within the first window, and the third window is not visible to the user;
[0217] Minimize the first window;
[0218] When the first window is minimized and the focus display function is enabled, the brightness of the second window is greater than the brightness of other display areas.
[0219] The following is combined Figure 8aThe display method provided in this application embodiment will be described in detail. When clicking on the email to launch the email application, a first window is created; when clicking on the text document to launch the text document application, a second window is created. Both the first and second windows are visible to the user. Although the first and second windows appear to be side-by-side, the first window may be placed on top of or below the second window depending on the mouse click operation. A third window that is not visible to the user can also be created through the email. Specifically, the third window is created from the first window, and the first window is the owner window of the third window. The third window is essentially a 0-pixel window with the WS_EX_TOOLWINDOW extended attribute. The third window can also be used as the owner window to create an owned window.
[0220] See Figure 8b The following provides an example of the Owner and Owned windows. You can first create an Owner window by clicking the text document application. When the mouse hovers over the "File" button in the Owner window, a box will appear displaying options such as "New," "Open," "Save," "Save As," "Print," and "Exit." After clicking the "Open" button, an Owned window will pop up on the current screen for selecting the file to open. The Owned window can be completely displayed within the Owner window, partially displayed within the Owner window, or displayed outside the Owner window, depending on the actual hardware conditions.
[0221] See Figure 9 When the first window is minimized, only the second window is visible to the user on the screen. When the Focus Display feature in the taskbar is turned on, the brightness of the second window will be displayed normally, while the brightness of other areas besides the second window will be reduced.
[0222] In this embodiment, three windows are pre-created, two of which are visible and one is invisible. When one of the two visible windows is minimized, the focus display function is turned on, which can focus on displaying the remaining visible window, thereby achieving the purpose of partial pixel work. This allows the pixels on the screen to get sufficient rest, which can reduce the risk of the display screen being burned out, avoid color difference in the final display effect, and achieve the effect of extending the service life of the display screen.
[0223] In one example, the statement that the brightness of the second window is greater than the brightness of other display areas when the first window is minimized and the focus display function is enabled includes:
[0224] When the first window is minimized and the focus display function is enabled, a mask is set under the second window, wherein the second window is visible to the user and the brightness of the second window is greater than the brightness of the mask.
[0225] A mask is typically a semi-transparent, black, full-screen window. When set to mouse pass-through, mouse actions on the mask are automatically forwarded to the layer below. When only the second window is visible to the user on the current screen, enabling the Focus on Display feature allows you to place a mask below the second window. Because the mask is a semi-transparent, black, full-screen window, placing the mask over other display areas will darken the area outside the second window.
[0226] In this embodiment, after determining that the second window is the one that needs to be focused on, a mask is set below the second window to ensure that the brightness of the second window is greater than the brightness of other parts. Compared with the prior art, which first raises the mask to the top and then raises the window that needs to be focused on above the mask, there is no screen flickering problem, which can provide users with a better user experience.
[0227] In one example, the first window, the second window, and the third window are all top-level windows, and the method further includes:
[0228] In response to enabling the focus display function, a top-level window that meets preset conditions is determined, wherein the second window meets the preset conditions, and the preset conditions are used to select the top-level window of the window where the focus is located or the top-level window of the topmost window visible to the user on the current screen.
[0229] A top-level window refers to the root window. For example, if you open a Word document and are working on the text input section, the top-level window is not just the text input section, but the entire Word page. Similarly, if you click on a search engine and create a new webpage, but only interact with the address bar, the resulting top-level window will definitely be the entire webpage, not just the address bar. A top-level window can be owned or not and can be displayed anywhere on the screen. Since the third window is on the current screen and not within the first window, this indicates that although the third window was created by the first window and is owned by the first window, it does not belong to the first window and is not included within it; therefore, it is a top-level window.
[0230] In this embodiment, the top-level window of the window in focus or the top-level window of the topmost window visible to the user on the current screen is selected for focused display, so that the pixels on the entire screen do not need to emit light at the same time. This not only emphasizes the window that the user is using, but also extends the lifespan of the display screen.
[0231] In one example, determining the top-level window that meets the preset conditions includes:
[0232] Get the top-level window of the window with focus to become the foreground window;
[0233] If the foreground window is a desktop window, in the direction perpendicular to the current screen, the target foreground window on the current screen is obtained in a top-down order. It is then determined whether the target foreground window meets any of the following conditions: minimized, invisible to the user, not on the current screen, or a special case. The special case refers to the target foreground window's owner window being a 0-pixel window with specific extended attributes. If there is a target foreground window that does not meet any of the conditions, it is determined that the target foreground window is a top-level window that meets the preset conditions. Otherwise, the desktop window is determined to be a top-level window that meets the preset conditions.
[0234] If the foreground window is not a desktop window, it is determined that the foreground window is a top-level window that meets preset conditions.
[0235] See Figure 10 The foreground window is the fourth window. Since the fourth window is not a desktop window, it can be directly designated as the top-level window that meets the preset conditions.
[0236] But if Figure 11 In this situation, the foreground window is confirmed to be the desktop window. At this point, it's necessary to determine if there are other user-visible windows on the desktop. If so, the topmost user-visible window should be highlighted. To do this, it's necessary to adjust the vertical direction of the current screen (i.e.,...) Figure 6 (As shown in the Z-axis direction), the target foreground window on the current screen is acquired in a top-down order. It is then determined whether the target foreground window meets preset conditions. Specifically, this application embodiment provides four judgment conditions: minimized, invisible to the user, not on the current screen, and any one of the following special cases. The special case refers to the target foreground window's owner window being a 0-pixel window with specific extended attributes. Thus, when the first window that does not meet any of the above judgment conditions is obtained, it can be determined that it is the topmost visible window on the current screen. For Figure 11 In this case, the top-level window that meets the preset conditions is the fourth window.
[0237] See Figure 12 In this case, the foreground window is the desktop window, and the above four judgment conditions provided in this application fail to obtain any other user-visible windows besides the desktop window. In this case, the desktop window is the top-level window that meets the preset conditions.
[0238] In this embodiment, the top-level window of the window with focus is first obtained to get the foreground window. If the foreground window is not a desktop window, it can be directly determined as the top-level window that meets the preset conditions. If the foreground window is a desktop window, it is also necessary to determine whether there are other user-visible windows on the current screen. If so, the topmost user-visible window on the current screen needs to be determined as the top-level window that meets the preset conditions. If not, it means that there are no other windows on the current screen, only a desktop window, so the desktop window can be displayed normally. In this way, the window that needs to be focused on can be correctly selected, which protects the display screen and improves the user experience.
[0239] In one example, the method further includes:
[0240] In response to a click operation on the first window icon, the first window is displayed, wherein the brightness of the first window is greater than the brightness of other display areas, and the brightness of the second window is reduced.
[0241] See Figure 13 When you click the icon of the first window in the taskbar, the first window will be displayed again on the current screen. At this time, the first window is the top-level window that meets the preset conditions. A mask will be set under the first window to ensure that the first window is displayed in focus, and other parts except the first window will be darkened.
[0242] In this embodiment, after enabling the focus display function, considering actual situations such as window switching, even after the top-level window that meets the preset conditions changes, the brightness of the top-level window that currently meets the preset conditions is still greater than the brightness of other display areas, so as to ensure the actual correctness of the focus display function.
[0243] In one example, the method further includes:
[0244] In response to a click on a desktop window, the brightness of all windows on the current screen remains unchanged.
[0245] by Figure 13 To illustrate, currently the brightness of the first window is greater than the brightness of other display areas. If a desktop window is clicked, this will not affect the fact that the first window remains the top-level window that meets the preset conditions. Therefore, the brightness of each window on the screen remains unchanged. Although this process is easy to understand, for the machine, when a desktop window is clicked, the machine will re-execute the process of determining the top-level window that meets the preset conditions. The result is that the top-level window that meets the preset conditions is still the first window, so the brightness of each area on the screen does not change.
[0246] In this embodiment, after enabling the focused display function, various events occur, some of which affect the current display rules while others have no impact. Clicking on a desktop window does not affect the top-level window that meets the preset conditions; therefore, the brightness of each window on the screen remains unchanged. The display of each window remains normal and error-free.
[0247] In one example, the method further includes:
[0248] Minimize the second window;
[0249] In response to the second window being minimized, a desktop window is displayed, wherein the brightness of the desktop window is increased.
[0250] See Figure 14 After minimizing the second window, there are no visible windows on the screen. At this point, no overlay is needed; the desktop window can be displayed normally. Because an overlay was previously present above the desktop window, the normally displayed desktop window will be brighter than before. Minimizing the second window affects the top-level window that meets the preset conditions. Therefore, when the minimize button of the second window is clicked, the machine will re-execute the process of determining the top-level window that meets the preset conditions. If the top-level window that meets the preset conditions is determined to be the desktop window, the overlay will be hidden, making the desktop window brighter.
[0251] In this embodiment, when the desktop window is a top-level window that meets preset conditions, the brightness of the desktop window is increased. That is, only when there is only one desktop window on the current screen will all pixels on the screen work at the same time, which can give each pixel a rest to the maximum extent and also ensure the display effect of the desktop window.
[0252] In one example, after minimizing the second window, the method further includes:
[0253] S901, Set the timer.
[0254] S902. After the timer is started, the first time is updated after one second.
[0255] S903. If a change is detected in the top-level window that meets the preset conditions, update the second time, wherein the preset conditions are used to select the top-level window of the window where the focus is located or the top-level window of the topmost window visible to the user on the current screen.
[0256] S904. In response to the update of the second time, if the current top-level window that meets the preset conditions is the desktop window, and the previous top-level window that meets the preset conditions is not visible to the user, hide the overlay.
[0257] If the current top-level window that meets the preset criteria is determined to be the desktop window, and the previous top-level window that meets the preset criteria is not visible, it means that only one top-level window that meets the preset criteria is open and is being displayed correctly. After minimizing this top-level window that meets the preset criteria, there is only one desktop window on the screen. Therefore, after minimizing the top-level window that meets the preset criteria, remove the overlay to allow the desktop window to be displayed normally.
[0258] S905. If the top-level window that currently meets the preset conditions is not the desktop window, set a mask layer under the top-level window that currently meets the preset conditions so that the brightness of the top-level window that currently meets the preset conditions is greater than the brightness of other display areas.
[0259] If the current top-level window that meets the preset conditions is not the desktop window, it means that many windows were opened before. After minimizing the top-level window that meets the preset conditions, another window will take the top spot and become the new top-level window that meets the preset conditions. In this case, you can set a mask under the new top-level window that meets the preset conditions to focus on displaying the current top-level window that meets the preset conditions.
[0260] The method provided in this application embodiment can detect when the top-level window that meets preset conditions is minimized when the focus display function is already turned on, and adaptively re-determine which window to focus on display, so as to maintain focus display during long-term use of the display screen and reduce screen wear.
[0261] In one example, the method further includes:
[0262] If the first time is greater than the second time, and the previous top-level window that meets the preset conditions is not visible to the user, hide the overlay.
[0263] When a visible window on the desktop is minimized by clicking an icon in the taskbar, the HandleWinHookEvent callback function does not receive the EVENT_SYSTEM_FOREGROUND event when the last visible window is minimized. Special handling is required in this case. This embodiment addresses this situation. It checks if timestamp 1 is greater than timestamp 2 and if the previous top-level window meeting the preset conditions is invisible to the user. If so, the overlay is hidden. When the previous top-level window meeting the preset conditions is the last visible window on the screen, after minimizing the window by clicking the icon in the taskbar, the device manager only receives the window minimize event, meaning only timestamp 1 is updated. Since timestamp 2 is not updated, it is definitely less than timestamp 1. If timestamp 1 > timestamp 2 and the previous top-level window meeting the preset conditions is invisible to the user, it indicates that the top-level window meeting the preset conditions was the last visible window on the screen and was minimized by clicking the taskbar icon. In this case, the overlay needs to be hidden.
[0264] The method provided in this application takes into account that when the last visible window on the desktop is minimized by clicking the icon in the taskbar, the HandleWinHookEvent callback function may not receive the EVENT_SYSTEM_FOREGROUND event. In this case, special judgment processing is introduced to correctly find the top-level window that meets the preset conditions, ensuring the accuracy of focused display.
[0265] This application also provides an electronic device including one or more processors and a memory; the memory is coupled to one or more processors and is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the electronic device to perform some or all of the steps in the above method embodiments.
[0266] This application also provides a computer-readable storage medium including a computer program that, when run on an electronic device, causes the electronic device to perform some or all of the steps described in the method embodiments. The storage medium may be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0267] The various embodiments of the mechanisms disclosed in this application can be implemented in hardware, software, firmware, or a combination of these implementation methods. Embodiments of this application can be implemented as computer programs or program code executable on a programmable system, the programmable system including at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.
[0268] Program code can be applied to input instructions to execute the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, the processing system includes any system having a processor such as, for example, a Digital Signal Processor (DSP), a microcontroller, an Application Specific Integrated Circuit (ASIC), or a microprocessor.
[0269] The program code can be implemented using a high-level procedural language or an object-oriented programming language to communicate with the processing system. Assembly language or machine language can also be used when needed. In fact, the mechanisms described in this application are not limited to any particular programming language. In either case, the language can be a compiled language or an interpreted language.
[0270] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored thereon on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, the instructions may be distributed via a network or through other computer-readable media. Therefore, machine-readable media may include any mechanism for storing or transmitting information in a machine-readable (e.g., computer-readable) form, including but not limited to floppy disks, optical disks, CD-ROMs, compact disc read-only memory (CD-ROMs), magneto-optical disks, read-only memory, random access memory, erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic cards or optical cards, flash memory, or tangible machine-readable storage for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) using the Internet in the form of electrical, optical, acoustic, or other forms of propagated signals. Therefore, machine-readable media includes any type of machine-readable medium suitable for storing or transmitting electronic instructions or information in a machine-readable (e.g., computer-readable) form.
[0271] In the accompanying drawings, some structural or methodological features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be necessary. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the accompanying drawings. Furthermore, including structural or methodological features in a particular figure does not imply that such features are required in all embodiments, and in some embodiments, these features may be omitted or may be combined with other features.
[0272] It should be noted that all units / modules mentioned in the device embodiments of this application are logical units / modules. Physically, a logical unit / module can be a physical unit / module, a part of a physical unit / module, or a combination of multiple physical units / modules. The physical implementation of these logical units / modules themselves is not the most important factor; the combination of functions implemented by these logical units / modules is the key to solving the technical problems proposed in this application. Furthermore, to highlight the innovative aspects of this application, the above-described device embodiments of this application have not introduced units / modules that are not closely related to solving the technical problems proposed in this application. This does not mean that the above-described device embodiments do not contain other units / modules.
[0273] It should be noted that in the examples and description of this patent, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0274] Although this application has been illustrated and described with reference to certain preferred embodiments thereof, those skilled in the art should understand that various changes in form and detail may be made thereto without departing from the spirit and scope of this application.
Claims
1. A display method, characterized in that, The method includes: Displays the first window of the first application and the second window of the second application; A third window is created through the first application, wherein the third window is on the current screen but not within the first window, and the third window is not visible to the user; Minimize the first window; When the first window is minimized and the focus display function is enabled, the brightness of the second window is greater than the brightness of other display areas.
2. The method according to claim 1, characterized in that, The first window is the owner window of the third window; When the first window is minimized and the focus display function is enabled, the brightness of the second window is greater than the brightness of other display areas, including: When the first window is minimized and the focus display function is enabled, a mask is set under the second window, wherein the second window is visible to the user and the brightness of the second window is greater than the brightness of the mask.
3. The method according to claim 1 or 2, characterized in that, The first window, the second window, and the third window are all top-level windows, and the method further includes: In response to enabling the focus display function, a top-level window that meets preset conditions is determined, wherein the second window meets the preset conditions, and the preset conditions are used to select the top-level window of the window where the focus is located or the top-level window of the topmost window visible to the user on the current screen.
4. The method according to claim 3, characterized in that, The process of determining the top-level window that meets the preset conditions includes: Get the top-level window of the window with focus to become the foreground window; If the foreground window is a desktop window, in the direction perpendicular to the current screen, the target foreground window on the current screen is obtained in a top-down order. It is then determined whether the target foreground window meets any of the following conditions: minimized, invisible to the user, not on the current screen, or a special case. The special case refers to the target foreground window's owner window being a 0-pixel window with specific extended attributes. If there is a target foreground window that does not meet any of the conditions, it is determined that the target foreground window is a top-level window that meets the preset conditions. Otherwise, the desktop window is determined to be a top-level window that meets the preset conditions. If the foreground window is not a desktop window, it is determined that the foreground window is a top-level window that meets preset conditions.
5. The method according to claim 1, characterized in that, The method further includes: In response to a click operation on the first window icon, the first window is displayed, wherein the brightness of the first window is greater than the brightness of other display areas, and the brightness of the second window is reduced.
6. The method according to claim 1, characterized in that, The method further includes: In response to a click on a desktop window, the brightness of all windows on the current screen remains unchanged.
7. The method according to claim 1, characterized in that, The method further includes: Minimize the second window; In response to the second window being minimized, a desktop window is displayed, wherein the brightness of the desktop window is increased.
8. The method according to claim 7, characterized in that, After minimizing the second window, the method further includes: Set a timer; After the timer is started, the first time is updated after one second. If a change is detected in the top-level window that meets the preset conditions, the second time is updated. The preset conditions are used to select the top-level window of the window with focus or the top-level window of the topmost window visible to the user on the current screen. In response to the update of the second time, if the current top-level window that meets the preset conditions is the desktop window, and the previous top-level window that meets the preset conditions is not visible to the user, the overlay is hidden. If the top-level window that currently meets the preset conditions is not a desktop window, set a mask layer under the top-level window that currently meets the preset conditions so that the brightness of the top-level window that currently meets the preset conditions is greater than the brightness of other display areas.
9. The method according to claim 8, characterized in that, The method further includes: If the first time is greater than the second time, and the previous top-level window that meets the preset conditions is not visible to the user, hide the overlay.
10. A display method, characterized in that, The method includes: The focus display function is activated in response to user input. When the focus display function is turned on and the target top-level window is not a desktop window, the brightness of the target top-level window remains unchanged, while the brightness of other windows on the current screen, excluding the target top-level window, decreases. The target top-level window is the top-level window of the topmost window currently visible to the user on the screen.
11. The method according to claim 10, characterized in that, The target top-level window is determined in the following way: Get the top-level window of the window with focus to become the foreground window; If the foreground window is a desktop window, in the direction perpendicular to the current screen, the target foreground window on the current screen is obtained in a top-down order. It is then determined whether the target foreground window meets any of the following conditions: minimized, invisible to the user, not on the current screen, or a special case. The special case refers to the fact that the owner window of the target foreground window is a 0-pixel window with a specific extended attribute. If there is a target foreground window that does not meet any of the conditions, the target foreground window is determined to be the target top-level window. Otherwise, the desktop window is determined to be a top-level window that meets the preset conditions. If the foreground window is not a desktop window, then the foreground window is determined to be the target top-level window.
12. The method according to claim 10, characterized in that, The method further includes: Minimize the target top-level window; In response to the minimization of the target top-level window, the first time is updated one second after the preset timer is started; If a change is detected in the target top-level window, update the second time; In response to the update at the second time, if the current target top-level window is a desktop window and the previous target top-level window is not visible to the user, hide the overlay; If the current target top-level window is not a desktop window, set a mask layer under the current target top-level window so that the brightness of the current target top-level window is greater than the brightness of other display areas.
13. The method according to claim 12, characterized in that, The method further includes: If the first time is greater than the second time, and the previous target top-level window is not visible to the user, hide the overlay.
14. The method according to claim 10, characterized in that, The method further includes: If a change is detected in the target top-level window, update the second time; In response to the update at the second time, if the current target top-level window is a desktop window and the previous target top-level window is not visible to the user, hide the overlay; If the current target top-level window is not a desktop window, set a mask layer under the current target top-level window so that the brightness of the current target top-level window is greater than the brightness of other display areas.
15. The method according to claim 10, characterized in that, The method further includes: Set the height parameter of the target top-level window to a first height parameter, where the first height parameter is greater than the height parameter of the taskbar on the current screen. A mask is set below the target top-level window, and the height parameter of the mask is greater than the height parameter of the taskbar on the current screen.
16. An electronic device, characterized in that, include: One or more processors and memory; The memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the electronic device to perform the method as described in any one of claims 1-15.
17. A computer-readable storage medium, characterized in that, Includes a computer program that, when run on an electronic device, causes the electronic device to perform the method according to any one of claims 1-15.