Display method, electronic device, and computer readable storage medium
By creating three windows on the OLED screen and setting a focus display function, the brightness is dynamically adjusted to avoid screen burn-in, thus solving the burn-in problem of OLED screens, extending their lifespan, and improving the user experience.
Patent Information
- Application Number
- PCT/CN2025/091853
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-05-21
- Filing Date
- 2025-04-28
- Publication Date
- 2025-11-27
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. Existing technology also tends to cause screen flickering when switching windows, affecting the user experience.
By creating three windows, two of which are visible and one is invisible, the focus display feature is enabled when the visible window is minimized, making the brightness of the second window greater than that of other areas. A mask is set to ensure that the brightness of the second window takes priority, and the focus display window is dynamically monitored and adjusted.
It extends the lifespan of the display screen, prevents screen burn-in, improves the user experience, and ensures the stability and consistency of the display effect.
Smart Images

Figure CN2025091853_27112025_PF_FP_ABST
Abstract
Description
Display method, electronic device and computer readable storage medium
[0001] The present application claims priority to the Chinese patent application No. 202410644943.1, filed on May 21, 2024, and entitled "A display method, electronic device and computer readable storage medium", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0002] The present application relates to the technical field of window display, in particular to a display method, electronic device and computer readable storage medium. BACKGROUND
[0003] 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 susceptible to burn-in. Burn-in refers to the phenomenon that certain 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
[0004] The purpose of the embodiments of the present application is to provide a display method, electronic device and computer readable storage medium to reduce the risk of the display screen being burned out. The specific technical solutions are as follows:
[0005] In the first aspect, in order to achieve the above-mentioned purpose, the embodiments of the present application provide a display method, which comprises:
[0006] displaying a first window of a first application and a second window of a second application;
[0007] 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;
[0008] minimizing the first window;
[0009] In the case that the first window is minimized and the focus display function is turned on, the brightness of the second window is greater than that of other display areas.
[0010] 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 opened, and the remaining visible window can be displayed, so as to achieve the purpose of partial pixel work, so that the pixels on the screen can get sufficient rest, thereby reducing the risk of burning the display screen, avoiding color difference in the final display effect, and achieving the effect of prolonging the service life of the display screen.
[0011] In a possible implementation, the first window is an owner window of the third window.
[0012] In the case that the first window is minimized and the focused display function is opened, the brightness of the second window is greater than the brightness of other display areas, including:
[0013] In the case that the first window is minimized and the focused display function is opened, 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.
[0014] 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.
[0015] In a possible implementation, the first window, the second window and the third window are all top-level windows, and the method further includes:
[0016] In response to opening 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 point is located or the top-level window of the uppermost window on the current screen visible to the user.
[0017] In the embodiments of the present application, the top-level window of the window where the focus point is located or the top-level window of the uppermost window on the current screen visible to the user is selected for focused display, so that the pixels on the entire 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.
[0018] In a possible implementation, the determination of the top-level window satisfying the preset condition includes:
[0019] The top-level window of the window where the focus point is located is obtained as a foreground window;
[0020] 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, user invisibility, 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.
[0021] If the foreground window is not a desktop window, the foreground window is determined to be the top-level window satisfying the preset condition.
[0022] 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.
[0023] In a possible implementation, the method further includes:
[0024] 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.
[0025] 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.
[0026] In a possible implementation, the method further includes:
[0027] In response to the click operation on the desktop window, the brightness of each window on the current screen is unchanged.
[0028] 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 therefore the brightness of each window on the current screen does not change. The display of each window remains normal and no error occurs.
[0029] In a possible implementation, the method further includes:
[0030] minimizing the second window;
[0031] in response to the second window being minimized, displaying a desktop window, wherein the brightness of the desktop window is increased.
[0032] 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 also be ensured.
[0033] In a possible implementation, after the second window is minimized, the method further includes:
[0034] setting a timer;
[0035] updating the first time when the timer is started for one second;
[0036] updating the second time when 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;
[0037] 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 not visible to the user, hiding the mask layer;
[0038] 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.
[0039] 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.
[0040] In a possible implementation, the method further includes:
[0041] 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.
[0042] The method provided by the embodiments 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.
[0043] In a second aspect, the embodiments of the present application further provide a display method, and the method comprises:
[0044] opening the focused display function in response to the operation of the user;
[0045] in a 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;
[0046] The target top-level window is the top-level window of the topmost window on the current screen visible to the user.
[0047] The display method provided by the embodiments 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.
[0048] In a possible implementation, the target top-level window is determined in the following manner:
[0049] obtaining the top-level window of the window where the focus is located to obtain a foreground window;
[0050] If the foreground window is a desktop window, a target foreground window on the current screen is obtained in a vertical direction of the current screen in a top-down order, 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;
[0051] If the foreground window is not the desktop window, the foreground window is determined as the target top-level window.
[0052] The method for determining the target top-level window provided by the embodiment of the present application firstly acquires the top-level window of the window where the focus is located to obtain a foreground window, and in the case that the foreground window is not a desktop window, the foreground window can be directly determined as the target top-level window; in the case that the foreground window is a desktop window, it is further needed to judge whether there is any other window visible to the user on the current screen, if there is, the uppermost window visible to the user on the current screen is determined as the target top-level window, if there is not, it indicates that there is no any other window on the current screen, and there is only one desktop window, and thus the desktop window can be normally displayed. In this way, the window which needs to be focused and displayed can be correctly selected, and the user experience is improved while the display screen is protected.
[0053] In a possible implementation, the method further includes:
[0054] minimizing the target top-level window;
[0055] in response to the minimization of the target top-level window, updating the first time after a second elapses after a preset timer is started;
[0056] updating the second time if it is detected that the target top-level window changes;
[0057] in response to the update of the second time, if the current target top-level window is a desktop window and the last target top-level window is invisible to the user, hiding the mask layer;
[0058] if the current target top-level window is not a desktop window, setting the mask layer under the current target top-level window to make the brightness of the current target top-level window greater than the brightness of other display areas.
[0059] The method provided by the embodiment of the present application can monitor whether the target top-level window is minimized in the case that the focused display function is already opened, and if the target top-level window is minimized, the window which is focused and displayed is adaptively redetermined, and the focused display is always maintained in the long-time use of the display screen, and the loss of the screen is reduced.
[0060] In a possible implementation, the method further includes:
[0061] if the first time is greater than the second time and the last target top-level window is invisible to the user, hiding the mask layer.
[0062] 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 HandleWinHookEvent callback function cannot receive the EVENT_SYSTEM_FOREGROUND event when the last visible window is minimized, and in this case, the special judgment processing is introduced to correctly find the current target top-level window, and the accuracy of the focused display is ensured.
[0063] In a possible implementation, the method further includes:
[0064] If the target top-level window is detected to change, updating a second time;
[0065] In response to the updating of the second time, if the current target top-level window is a desktop window and the last target top-level window is invisible to a user, hiding a mask layer;
[0066] If the current target top-level window is not a desktop window, setting 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.
[0067] The method provided in the embodiments of the present application can monitor whether the target top-level window changes, and re-determine the target top-level window after the target top-level window changes, so as to realize dynamic implementation of the focus display function.
[0068] In a possible implementation, the method further includes:
[0069] Setting a height parameter of the target top-level window as a first height parameter, the first height parameter being greater than a height parameter of a task bar on a current screen;
[0070] Setting a mask layer under the target top-level window, a height parameter of the mask layer being greater than a height parameter of a task bar on a current screen.
[0071] In the embodiments of the present application, the window that needs to be displayed in focus is set as the topmost window above the task bar, so that the mask layer set under the topmost window can cover the task bar, the brightness of the task bar is also reduced, the pixels on the task bar can also be fully rested, and the risk of screen burn-in is reduced.
[0072] In a third aspect, the embodiments of the present application further provide an electronic device, including:
[0073] One or more processors and a memory;
[0074] The memory is coupled with the one or more processors, and the memory is configured to store computer program codes, the computer program codes including computer instructions, and the one or more processors are configured to invoke the computer instructions to enable the electronic device to perform the display method in any of the first aspect.
[0075] In a fourth aspect, the embodiments of the present application further provide a computer readable storage medium, including a computer program, when the computer program runs on an electronic device, enabling the electronic device to perform the display method in any of the first aspect.
[0076] The display method provided by the embodiments of the present application comprises: 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 a current screen and is not in the first window, and the third window is invisible to a user; minimizing the first window; and in a case that the first window is minimized and a focused display function is turned on, the brightness of the second window is greater than the brightness of other display areas. The present application creates three windows in advance, two of which are visible and one of which is invisible, and when one of the two visible windows is minimized, the focused display function is turned on, and the remaining visible window is displayed, so as to achieve the purpose of partial pixel working, so that the pixels on the screen can be fully rested, thereby reducing the risk of burning the display screen, avoiding color difference in the final display effect, and achieving the effect of prolonging the service life of the display screen. BRIEF DESCRIPTION OF DRAWINGS
[0077] The accompanying drawings, which are included to provide a further understanding of the present application, form a part of the present application and illustrate the illustrative embodiments of the present application and together with the description serve to explain the present application. The present application shall not be limited by the accompanying drawings.
[0078] FIG. 1 is a hardware structure diagram of an electronic device according to an embodiment of the present application;
[0079] FIG. 2 is a software structure block diagram of an electronic device according to an embodiment of the present application;
[0080] FIG. 3a is a user interface diagram according to an embodiment of the present application;
[0081] FIG. 3b is another user interface diagram according to an embodiment of the present application;
[0082] FIG. 4 is an interaction diagram between a device manager and an operating system according to an embodiment of the present application;
[0083] FIG. 5 is another interaction diagram between a device manager and an operating system according to an embodiment of the present application;
[0084] FIG. 6 is a diagram of spatial relationships among multiple windows according to an embodiment of the present application;
[0085] FIG. 7 is a diagram of a target top-level window according to an embodiment of the present application;
[0086] FIG. 8a is a diagram of a created window according to an embodiment of the present application;
[0087] FIG. 8b is a diagram of a relationship between an Owner window and an Owned window according to an embodiment of the present application;
[0088] FIG. 9 is a diagram of a result of applying the display method according to an embodiment of the present application;
[0089] FIG. 10 is a first schematic diagram of determining a top-level window satisfying a preset condition according to an embodiment of the present application;
[0090] FIG. 11 is a second schematic diagram of determining a top-level window satisfying a preset condition according to an embodiment of the present application;
[0091] FIG. 12 is a third schematic diagram of determining a top-level window satisfying a preset condition according to an embodiment of the present application;
[0092] FIG. 13 is a fourth schematic diagram of determining a top-level window satisfying a preset condition according to an embodiment of the present application;
[0093] FIG. 14 is a fifth schematic diagram of determining a top-level window satisfying a preset condition according to an embodiment of the present application. DETAILED DESCRIPTION
[0094] To make the objectives, technical solutions, and advantages of the present application clearer, further detailed description will be made to the present application with reference to the accompanying drawings and embodiments. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art belong to the scope of protection of the present application.
[0095] To make the technical solutions of the embodiments of the present application clear, in the embodiments of the present application, the same items or similar items with basically the same functions and effects are distinguished by using “first”, “second”, and the like. For example, the first instruction and the second instruction are used to distinguish different user instructions, and the order is not limited. Those skilled in the art can understand that “first”, “second”, and the like do not limit the number and execution order, and “first”, “second”, and the like do not necessarily mean different.
[0096] It should be noted that in the present application, “exemplarily” or “for example” and the like are used to represent as an example, illustration, or description. Any embodiment or design scheme described as “exemplarily” or “for example” in the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. In fact, “exemplarily” or “for example” and the like are used to present the relevant concept in a specific way.
[0097] OLED (Organic Light-Emitting Diode, organic light-emitting diode) screen has been widely used in electronic devices because of its 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 current passes through, organic materials emit light, thus displaying an image. However, it is this self-luminous characteristic that makes the OLED screen possible to be burned. The so-called burn-in is 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.
[0098] The current common practice is to keep the topmost window on the desktop at the original brightness, and all other display areas except the taskbar are darkened. However, this has drawbacks. If the current topmost window is the first window, when the topmost window is switched to the second window, the second window will appear a flashing screen phenomenon, resulting in poor user experience.
[0099] The display method provided by the present application can be applied to electronic devices such as smart phones, tablet computers, smart watches, etc. The display screen of the electronic device can be an OLED screen or an LCD (Liquid Crystal Display) screen. In order to prolong the service life of the display screen and reduce the risk of screen burn-in, the display method provided by the present application displays a first window of a first application and a second window of a second application; creates 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; minimizes the first window; and in the case that the first window is minimized and the focus display function is turned on, the brightness of the second window is greater than that of other display areas. It can be seen that the display method provided by the present application does not require the entire display screen to emit light, but rather the brightness of a specific display window is greater than that of other display areas. In this way, only part of the screen is in working condition each time, so that the pixels on the screen can get sufficient rest, thereby reducing the risk of screen burn-in.
[0100] The structure of the electronic device to which the above display method is applied will be introduced below.
[0101] Exemplarily, FIG. 1 shows a structural diagram of an electronic device 100. The electronic device 100 can include a processor 110, a display screen 120, a camera 130, an 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 an electric core and a battery protection device, a sensor module 180, a mobile communication module 190, a wireless communication module 200, an antenna 1 and an antenna 2, and the like. The sensor module 180 can include a pressure sensor 180A, a fingerprint sensor 180B, a touch sensor 180C, an ambient light sensor 180D, and the like.
[0102] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than shown, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0103] The processor 110 can include one or more processing units, for example: the processor 110 can include a CPU (Central Processing Unit), an AP (Application Processor), a modem processor, a GPU (graphics processing unit), an ISP (Image Signal Processor), a controller, a video codec, a DSP (Digital Signal Processor), a baseband processor, and / or a NPU (Neural-network Processing Unit), etc. Different processing units can be independent components or integrated in one or more processors. In some embodiments, the electronic device 100 can also include one or more processors 110. Among them, the controller can generate operation control signals according to instruction operation codes and timing signals, complete the control of fetching instructions and executing instructions. In other embodiments, the processor 110 can also be provided with a memory for storing instructions and data. Exemplarily, the memory in the processor 110 can be a cache memory. The memory can save instructions or data that the processor 110 has just used or repeatedly uses. If the processor 110 needs to use the instructions or data again, it can directly call from the memory. In this way, repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the electronic device 100 in processing data or executing instructions is improved.
[0104] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can 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 interface (Mobile Industry Processor Interface), a GPIO (General-Purpose Input / Output) interface, a SIM card interface, and / or a USB interface, etc. Among them, the USB interface 160 is an interface that conforms to the USB standard specification, and can be 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 to transmit data between the electronic device 100 and a peripheral device. The USB interface 160 can also be used to connect a headset to play audio through the headset.
[0105] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is used for illustrative description, and does not constitute a structural limitation of the electronic device 100. In some other embodiments of the present application, the electronic device 100 can also use different interface connection modes or combinations of multiple interface connection modes in the above embodiments.
[0106] The wireless communication function of the electronic device 100 can be realized by the antenna 1, the antenna 2, the mobile communication module 190, the wireless communication module 200, the modem processor, and the baseband processor, etc.
[0107] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, the antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0108] The electronic device 100 realizes the display function through the GPU, the display screen 120, and the application processor, etc. 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. The processor 110 can include one or more GPUs that execute program instructions to generate or change display information.
[0109] The display screen 120 is configured to display a plurality of different user interaction interfaces. The display screen 120 comprises a display panel. The display panel can be an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), an active matrix organic light emitting diode or an AMOLED (Active-Matrix Organic Light Emitting Diode), a FLED (Flex Light-Emitting Diode), a MiniLed, a MicroLed, a Micro-oLed, a QLED (Quantum Dot Light Emitting Diodes), or the like. In some embodiments, the electronic device 100 can comprise one or more display screens 120.
[0110] In some embodiments of the present application, when the display panel is made of OLED, AMOLED, FLED, or the like, the display screen 120 in the above-mentioned FIG. 1 can be bent. Here, the display screen 120 can be bent at any part to any angle and can be kept at the angle, for example, the display screen 120 can be folded left and right from the middle. It can also be folded up and down from the middle.
[0111] The display screen 120 of the electronic device 100 can be a flexible screen. At present, the flexible screen is attracting much attention due to its unique characteristics and great potential. Compared with the traditional screen, the flexible screen has the characteristics of strong flexibility and bendability, and can provide users with a new interaction mode based on the bendable characteristics, and can meet more user needs for electronic devices. For electronic devices equipped with foldable display screens, the foldable display screens on the electronic devices can be switched between the small screen in the folded state and the large screen in the unfolded state at any time. Therefore, users use the split screen function on electronic devices equipped with foldable display screens more and more frequently.
[0112] The electronic device 100 can realize the shooting function through the ISP, the camera 130, the video codec, the GPU, the display screen 120, and the application processor, and the like, wherein the camera 130 comprises a front camera and a rear camera.
[0113] ISP is used to process the data fed back by the camera 130. For example, when taking a photo, the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and conversion into a visible image. The ISP can optimize the noise, brightness and color of the image through algorithm, and the ISP can also optimize the exposure and color temperature of the shooting scene. In some embodiments, the ISP can be arranged in the camera 130.
[0114] The camera 130 is used to take photos or videos. Objects generate optical images through lenses and project them onto photosensitive elements. The photosensitive element can be a CCD (Charge Coupled Cevice) or a CMOS (Complementary Metal-Oxide-Semiconductor) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into a standard RGB (Red Green Blue) image signal, YUV (a color encoding method), etc. In some embodiments, the electronic device 100 can include one or N cameras 130, where N is a positive integer greater than 1.
[0115] The digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.
[0116] The video codec is used to compress or decompress digital video. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as MPEG (Moving Picture Experts Group) 1, MPEG2, MPEG3, and MPEG4.
[0117] The NPU is a neural network computing processor that learns from the structure of biological neural networks, such as the transmission mode between human brain neurons, and can quickly process input information and continuously self-learn. Through the NPU, the electronic device 100 can realize intelligent cognition and other applications, such as image recognition, face recognition, voice recognition, and text understanding.
[0118] The internal memory 140 can be used to store one or more computer programs including instructions. The processor 110 can cause the electronic device 100 to perform the display method provided in some embodiments of the present application, various applications and data processing, etc. by running the above-mentioned instructions stored in the internal memory 140. The internal memory 140 can include a program storage area and a data storage area. The program storage area can store an operating system, and can also store one or more applications (such as a gallery, contacts, etc.). The data storage area can store data created during use of the electronic device 100 (such as photos, contacts, etc.). In addition, the internal memory 140 can include a high-speed random access memory, and can also include a non-volatile memory such as one or more disk storage components, flash memory components, universal flash storage, etc. In some embodiments, the processor 110 can cause the electronic device 100 to perform the display method provided in the embodiments of the present application, and other applications and data processing by running the instructions stored in the internal memory 140 and / or the instructions stored in the memory provided in the processor 110.
[0119] The internal memory 140 can be used to store the related programs of the display method provided in the embodiments of the present application, and 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 the present application.
[0120] The sensor module 180 can include a pressure sensor 180A, a fingerprint sensor 180B, a touch sensor 180C, an ambient light sensor 180D, etc.
[0121] The pressure sensor 180A is configured to sense a pressure signal and convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed on the display screen 120. The pressure sensor 180A can be of various types, such as a resistive pressure sensor, an inductive pressure sensor, or a capacitive pressure sensor. The capacitive pressure sensor can include at least two parallel plates of conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes, and the electronic device 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation is applied to the display screen 120, the electronic device 100 detects the touch operation based on the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch based on the detection signal of the 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 instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, an instruction to view a short message is executed; when a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the short message application icon, an instruction to create a new short message is executed.
[0122] The fingerprint sensor 180B is configured to acquire a fingerprint. The electronic device 100 can use the acquired fingerprint characteristics to implement functions such as unlocking, accessing an application lock, taking a photograph, and answering an incoming call.
[0123] The touch sensor 180C is also referred to as a touch device. The touch sensor 180C can be disposed on the display screen 120, and the touch sensor 180C and the display screen 120 together form a touch screen, which is also referred to as a touch screen. The touch sensor 180C is configured to detect a touch operation applied to or near the touch sensor 180C. The 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 the display screen 120. In other embodiments, the touch sensor 180C can also be disposed on the surface of the electronic device 100 and disposed at a position different from the display screen 120.
[0124] The ambient light sensor 180D is configured to sense the brightness of ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 120 based on the sensed brightness of the ambient light. The ambient light sensor 180D can also be used to automatically adjust the white balance when photographing. The ambient light sensor 180D can also transmit information about the environment in which the device is located to the GPU.
[0125] The ambient light sensor 180D is also configured to obtain the brightness, light ratio, color temperature, and the like of the acquisition environment of the image acquired by the camera 130.
[0126] The software system of the electronic device can employ a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. The layered architecture divides the software system of the electronic device into a plurality of layers, each layer having a clear role and division of labor, and the layers communicate with each other through software interfaces. In some examples, a device manager can be installed on the device. The device manager can perform focus monitoring, layer management, and desktop special judgment. Focus monitoring refers to determining the window in which the focus is located on the current screen. Layer management refers to various operations on a layer, which is a semi-transparent black full-screen window that can be overlaid on other windows, causing the display brightness of other windows to decrease. Desktop special judgment refers to judging whether the owner window of a window is a 0-pixel window that has the WS_EX_TOOLWINDOW extension attribute.
[0127] As an implementation manner, as shown in FIG. 2, the service layer of the device includes a device manager, and the operating system layer of the device includes a management module. The management module can include a message management module, a window management module, and a drawing management module. It can be understood that the division of the above-mentioned functional modules is only an example, and in actual application, the above-mentioned functions can be completed by different functional modules according to needs.
[0128] The message management module is configured to process various messages generated in the window display process. The device manager interacts with the operating system layer multiple times to complete the display method provided in the present application. In this process, the device manager communicates with the operating system layer through various messages, and the message management module can be responsible for processing various messages.
[0129] The window management module is configured to create a new window in the window establishment stage, including clicking an application to create a new window through the application, or creating a next-level window of the current window by clicking the window. The created window can also be managed, such as switching the window in which the focus is located in the case of multiple windows, or closing / minimizing a certain created window.
[0130] The drawing management module is configured to draw a layer and other user interfaces that need to be displayed. After the focus display function is turned on, the layer can be set below the top window of the window in which the focus is located.
[0131] The service layer is mainly responsible for processing the business logic of the system and providing functional support for the application layer, including data verification, data processing, business process control, etc. The service layer provides higher-level abstraction for the application layer by encapsulating the underlying data processing and logic, making it easier for the application layer to use these services. The service layer provides services for the application layer by encapsulating the underlying data processing and logic, providing higher-level abstraction for the application layer. The application layer responds to and meets 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 is mainly concerned with providing services for users and implementing application programs, while the service layer focuses on processing business logic and data processing abstraction. The two work together to achieve the overall functionality of the system.
[0132] The above operating system layer can hide hardware details and only provide abstract interfaces to application developers. The corresponding application has strong compatibility. The operating system layer is usually composed of an embedded kernel, GUI (Graphic user interface), TCP / IP (Transmission Control Protocol / Internet Protocol) network protocol, file system and power management. Among them, the kernel is the foundation and essential, which can only be optimized, and the basic components are: process management, inter-process communication, memory management, etc.; system call is a mechanism for application programs to request operating system services; API (Application Programming Interface) is a collection of complex functions, messages and structures.
[0133] Of course, only the service layer and operating system layer in the device are shown in FIG. 2. It can be understood that the software architecture of the electronic device can include other levels in addition to the service layer and operating system layer, 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 the related technology, which will not be described here.
[0134] The following describes an application scenario of the display method provided by the embodiments of the present application. In this scenario, the electronic device is taken as a computer as an example for explanation and description.
[0135] Figure 3a illustrates a user interface 300 on a computer including a plurality of application programs. The user interface 300 displays a desktop window with application icons, which can include a plurality of application icons (e.g., a mailbox application icon, a text document application icon, a browser application icon, etc.). At the bottom of the desktop window is a taskbar, which can include a "start" button for shutting down / restarting the computer or launching a specific application from the "start" button. Specifically, after clicking the "start" button, a user interface as shown in Figure 3b is displayed. A user can select to click an application on the desktop to launch the application, or select to click the "start" button to select an application from a plurality of displayed applications and launch the selected application. After a window is created by an application, the window appears on the taskbar 302, and the window can be maximized / minimized by clicking the window icon on the taskbar 302. The taskbar also includes a focus display function switch 301, and when the focus display function switch 301 is turned on, the window is displayed according to the display method provided in the present application. In addition to starting the focus display function from a software layer, a corresponding hardware switch can also be provided for the focus display function. For example, a physical switch can be provided on the frame of the display screen, and when the physical switch is turned on, the window is displayed according to the display method provided in the present application. The taskbar can also display the time, and generally displays the date and real-time time at the rightmost side of the taskbar. The above is only one possible implementation, and the embodiments of the present application do not limit the content displayed on the user interface 300.
[0136] The actual implementation process of the display method of the present application is further described below in connection with Figure 4, which illustrates the process of determining the window that truly needs focus display after the focus display function is turned on, which is achieved by the device manager of the service layer interacting with the operating system.
[0137] After detecting that the focus display function is turned on, the device manager requests the operating system to obtain the handle of the foreground window, which is the top-level window of the window where the focus is located. The top-level window refers to the root window, for example, a word document is opened and the text input part is being operated, then the top-level window is not only the text input part, but also the entire word page. For another example, a search engine is clicked and a web page is created, but only the address bar is operated, then the determined top-level window is also the entire web page instead of only the address bar. The top-level window can or can not be possessed, and can be displayed at any position on the screen.
[0138] The device manager can request the operating system to obtain the foreground window handle through the GetForegroundWindow() function, and the operating system returns the foreground window handle in response to the request of the device manager. In order to determine whether the foreground window is the desktop window, because the current foreground window is the desktop window, and there is another window visible to the user on the current screen, the device manager needs to set the mask layer under the uppermost window visible to the user, rather than under the desktop window. Therefore, the device manager needs to request the operating system to obtain the desktop window handle, and the operating system returns the desktop window handle in response to the request of the device manager. The device manager needs to compare the two window handles obtained to determine whether the foreground window is the desktop window.
[0139] After the device manager determines whether the foreground window is the desktop window, if the result is no, it means that the foreground window is a normal top-level window, and therefore the mask layer can be directly set under the foreground window to achieve the focused display of the foreground window. If the result is yes, it is necessary to determine whether there is another window visible to the user on the current screen. Therefore, the device manager can request the operating system to obtain all target foreground window handles through the EnumWindows() function. Specifically, different windows have different height parameters, and the device manager can obtain all target foreground window handles on the current screen in the vertical direction of the current screen in the order from top to bottom. The operating system returns all target foreground window handles in response to the request of the device manager.
[0140] For each target foreground window, the device manager needs to determine whether it meets the preset conditions. In the case of minimizing the target foreground window, it is impossible to focus on the display, and such minimized windows need to be excluded. Similarly, in the case of the target foreground window being invisible to the user, it is impossible to focus on the display, and the window invisible to the user also needs to be excluded. Similarly, in the case of the target foreground window not being on the current screen, it is impossible to focus on the display, and the target foreground window not on the current screen also needs to be excluded. There is also a special case, that is, the owner window of some owned windows (i.e., owned windows) is a 0-pixel window with the WS_EX_TOOLWINDOW extended attribute, which will cause the owned window to return as visible to the user when calling IsWindowVisible() to determine whether the window is visible, but in fact the user cannot see the owned window, so the owner window of the owned window needs to be found by GetWindow(owned, GW_OWNER), and it is determined whether 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 eliminated. For a normal owned window, it needs to be determined whether the window needs to be eliminated through the above-mentioned four judgment conditions, and if the judgment result is no, the owner window of the owned window can be further determined. It can be understood that if the owner window is minimized, the owned window is also minimized, and in this case, the owned window is also eliminated.
[0141] After obtaining the handle of the target foreground window, the device manager determines whether the target foreground window is minimized, and if so, the current target foreground window is eliminated and the next target foreground window is determined. In the case of no, it is determined whether the target foreground window is invisible to the user, and if so, the current target foreground window is eliminated and the next target foreground window is determined. In the case of no, the device manager determines whether the target foreground window is not on the current screen, and if so, the current target foreground window is eliminated and the next target foreground window is determined. In the case of no, the device manager determines whether the target foreground window is a special case, and if so, the current target foreground window is eliminated and the next target foreground window is determined.
[0142] The implementation of the EnumWindows() callback function is as follows:
[0143] if (IsIconic(hWnd))
[0144] {
[0145] return TRUE;
[0146] }
[0147] This code is used to determine whether the window is minimized;
[0148] if(!IsWindowVisible(hwnd))
[0149] {
[0150] return TRUE;
[0151] }
[0152] This code is used to determine whether a window is invisible to the user;
[0153] if (the window is not currently on the desktop)
[0154] {
[0155] return TRUE;
[0156] }
[0157] This code is used to determine whether the window is currently on the screen;
[0158] (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.)
[0159] {
[0160] return TRUE;
[0161] }
[0162] This code is used to determine whether a window meets a special condition;
[0163] Record the handle of the top-level window on the desktop into the variable hPreWnd.
[0164] return FALSE;
[0165] 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.
[0166] Only the foreground window that is not minimized, user visible, on the current screen and not belonging to special cases is the window that needs to be focused display, so the device manager selects the foreground window that does not meet the above judgment, and sets a mask layer under it. The application uses the HWND_TOPMOST parameter of SetWindowPos to set the window to the topmost window higher than the taskbar height parameter, and sets a semi-transparent mask layer under it. Compared with the prior art, the focused display method cannot dim the taskbar. The application embodiment sets the window that needs to be focused display to the topmost window above the taskbar, so that the mask layer set under the topmost window can cover the taskbar, ensuring that the brightness of the taskbar is also smaller, so that the pixels on the taskbar can also get sufficient rest, reducing the risk of screen burn-in.
[0167] Of course, the final result can also be that all the foreground windows are eliminated, which means that there is only one desktop window on the current screen, so there is no need to set a mask layer. The device manager does not set a mask layer if there is no foreground window that does not meet the above judgment.
[0168] After entering the focused display mode, the device manager subscribes to the EVENT_SYSTEM_MINIMIZESTART (window minimization) and EVENT_SYSTEM_FOREGROUND (foreground window change) events of the entire system using SetWinEventHook. The device manager and the operating system will be further described in connection with FIG. 5.
[0169] The device manager subscribes to the window minimization event and the foreground window change event of the system by sending SetWinEventHook() to the operating system. When the device manager learns that the window is minimized, a timer is set. The function of the timer is to trigger the device manager to perform certain specific operations. One second after the timer is started, timestamp 1 is updated.
[0170] When the device manager learns that the foreground window has changed, timestamp 2 is updated. If the current foreground window is the desktop window, hide the mask layer under the last user-invisible foreground window; if the current foreground window is not the desktop window, adjust the mask layer to the lower layer of the current foreground window. Of course, the HWND_TOPMOST parameter of SetWindowPos is still used to set the window to the topmost window higher than the taskbar height parameter, and a semi-transparent mask layer is placed under it, ensuring that the brightness of the taskbar can also be reduced.
[0171] But when the last visible window is minimized, the HandleWinHookEvent callback function cannot receive the EVENT_SYSTEM_FOREGROUND event when the icon in the task bar is clicked to minimize the visible window. It is necessary to check whether the time stamp 1 is greater than the time stamp 2 and the last foreground window is invisible to the user. If yes, the mask is hidden. It can be understood that when the window is minimized by clicking the minimize button normally, the device manager receives the window minimized event and the foreground window changed event. In this case, the time stamp 1 is updated first, and then the time stamp 2 is updated. The time stamp 2 is greater than the time stamp 1. If the current foreground window is the desktop window, the mask is hidden when the last foreground window is invisible to the user. If the current foreground window is not the desktop window, the mask is adjusted to the lower layer of the current foreground window. However, if the current foreground window is the only visible window on the screen, the user minimizes the foreground window by clicking the icon in the task bar. The device manager can only receive the window minimized event, that is, only the time stamp 1 is updated. Since the time stamp 2 is not updated, the time stamp 2 is less than the time stamp 1. If the time stamp 1 is greater than the time stamp 2 and the last foreground window is invisible to the user, the mask is hidden. In this way, the accuracy of the focused display is ensured.
[0172] After the foreground window changes, the foreground window can be determined again according to the method provided in FIG. 4.
[0173] The SetWinEventHook subscribes to the EVENT_SYSTEM_MINIMIZESTART and EVENT_SYSTEM_FOREGROUND events of the entire system. The specific processing code is as follows:
[0174] The UI message thread belongs to the device manager. When the message is read, the mask is adjusted to the lower layer of the new foreground window.
[0175] In an example, the embodiment of the application provides a display method. The method comprises:
[0176] S601, opening the focused display function in response to the operation of the user.
[0177] The opening of the focused display function can be realized by setting a switch on the user interface, or a corresponding hardware switch can be set for the focused display function. For example, an entity switch is arranged at the frame of the display screen. When the entity switch is turned on, the window is displayed according to the display method provided by the application.
[0178] S602, in a case that the focus 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 decreased.
[0179] The target top-level window is a top-level window of an uppermost window visible to a user on the current screen.
[0180] When the display function is opened, the target top-level window is a window determined to be displayed in focus, and thus the target top-level window is normally displayed, and the brightness of an area on the current screen except the target top-level window is decreased, so that the problem of screen burn caused by long-time work of pixels on the screen can be avoided.
[0181] The display method provided in the embodiments of the present application only allows the top-level window of the uppermost window visible to the user on the current screen to be normally displayed, and the brightness of other parts is decreased, and at the same time, the pixels of the entire screen do not need to be in a working state, so that the service life of the screen can be prolonged.
[0182] In one example, the target top-level window is determined in the following manner:
[0183] The top-level window of the window where the focus is located is obtained to obtain a foreground window.
[0184] If the foreground window is a desktop window, a target foreground window on the current screen is obtained in a top-down order in a direction perpendicular to the current screen, it is determined whether the target foreground window satisfies any one of the conditions of minimization, invisibility to the user, absence on the current screen, and a special case, the special case is 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 the target top-level window, otherwise, the desktop window is determined to be the top-level window satisfying the preset condition.
[0185] If the foreground window is not the desktop window, the foreground window is determined to be the target top-level window.
[0186] Referring to FIG. 6, the spatial relationship between multiple windows is shown (the Z axis points from the lower layer to the upper layer), the focus window of the uppermost layer corresponds to the target top-level window, which is the window to be displayed in focus, and the mask layer is arranged below the window to be displayed in focus, and the display area except the focus window is darkened by being overlaid on other windows.
[0187] The method for determining the target top-level window provided in the embodiments of the present application first acquires the top-level window of the window where the focus is located to obtain a foreground window, and in the case that the foreground window is not a desktop window, the foreground window can be directly determined as the target top-level window; in the case that the foreground window is a desktop window, it is further needed to judge whether there is any other window visible to the user on the current screen, if there is, the topmost window visible to the user on the current screen is determined as the target top-level window, if there is not, it indicates that there is no any other window on the current screen, and there is only one desktop window, and thus the desktop window can be normally displayed. In this way, the window which needs to be focused and displayed can be correctly selected, and the user experience is improved while the display screen is protected.
[0188] In one example, the method further includes:
[0189] S701, minimizing 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 the last visible window is minimized, the HandleWinHookEvent callback function cannot receive the EVENT_SYSTEM_FOREGROUND event when the taskbar icon is clicked to minimize the desktop visible window. At this time, some special processing is needed. It can be understood that when the window is minimized by normally clicking the minimize button, the device manager will receive the window minimizing event and the foreground window changing event, and in the embodiments of the present application, the processing flow is for this case.
[0191] S702, in response to the target top-level window being minimized, updating the first time after a second elapses after the preset timer is started.
[0192] The preset timer is used to trigger the occurrence of certain actions, and the first time is updated after a second elapses after the timer is started.
[0193] S703, if it is detected that the target top-level window changes, updating the second time.
[0194] The initial values of the first time and the second time can both 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 last target top-level window is invisible to the user, hiding the mask layer.
[0196] If it is judged that the current target top-level window is a desktop window and the last target top-level window is invisible, it indicates that only one target top-level window is opened, and the target top-level window is correctly focused and displayed. After the target top-level window is minimized, there is only one desktop window on the current screen, and thus the mask layer can be removed to normally display the desktop window.
[0197] S705, if the current target top-level window is not the desktop window, setting a mask layer under the current target top-level window to make the brightness of the current target top-level window 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 have been opened before, and after the target top-level window is minimized, another window becomes the new target top-level window. In this case, the mask layer is set under the new target top-level window, and the current target top-level window can be displayed.
[0199] The method provided by the embodiment of the present application can monitor whether the target top-level window is minimized when the focused display function is enabled, and adaptively determine which window to focus on display if the target top-level window is minimized. In the long-term use of the display screen, the focused display is always maintained, and the screen loss is reduced.
[0200] In one example, the method further includes:
[0201] If the first time is greater than the second time and the last target top-level window is not visible to the user, the mask layer is hidden.
[0202] When the desktop visible window is minimized by clicking the icon in the taskbar, the HandleWinHookEvent callback function cannot receive the EVENT_SYSTEM_FOREGROUND event when the last visible window is minimized. At this time, some special processing is needed. In the embodiment of the present application, it is the processing flow for this case. It is necessary to check whether the timestamp 1 is greater than the timestamp 2 and whether the last target top-level window is not visible to the user. If yes, the mask layer is hidden. When the target top-level window is the last visible window on the current screen, after the target top-level window is minimized by clicking the icon in the taskbar, the device manager can only receive the window minimization event, that is, only the timestamp 1 is updated. Since the timestamp 2 is not updated, the timestamp 2 is definitely less than the timestamp 1. If the timestamp 1 is greater than the timestamp 2 and the last target top-level window is not visible to the user, it means that the target top-level window is the last visible window on the screen and is minimized by clicking the icon in the taskbar. At this time, the mask layer needs to be hidden.
[0203] The method provided by the embodiment of the present application considers that the HandleWinHookEvent callback function cannot receive the EVENT_SYSTEM_FOREGROUND event when the desktop visible window is minimized by clicking the icon in the taskbar, and the last visible window is minimized. In this case, special judgment processing is introduced to correctly find the current target top-level window and ensure the accuracy of the focused display.
[0204] In one example, the method further comprises:
[0205] S801, if it is detected that the target top-level window changes, updating a second time.
[0206] In addition to minimizing / closing the target top-level window, other normal access operations to the windows can also change the target top-level window. For example, clicking any window other than the current target top-level window will make the clicked window the new target top-level window. Referring to FIG. 7, window 901 is a window under the target top-level window, but when window 901 is clicked, window 901 will be brought to the top of the current screen and become the new target top-level window.
[0207] S802, in response to the updating of the second time, if the current target top-level window is a desktop window and the last target top-level window is not visible to the user, hiding the mask.
[0208] S803, if the current target top-level window is not a desktop window, setting a mask under the current target top-level window to make the brightness of the current target top-level window greater than the brightness of other display areas.
[0209] The method provided by the embodiments of the present application can monitor whether the target top-level window changes, and re-determine the target top-level window after the target top-level window changes, to realize dynamic implementation of the focus display function.
[0210] In one example, the method further comprises:
[0211] The height parameter of the target top-level window is set to a first height parameter, and the first height parameter is greater than the height parameter of the taskbar on the current screen;
[0212] A mask is set under 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] As can be seen from FIG. 6, the windows on the screen have different height parameters. By setting the height parameter of the target top-level window to the highest, the mask set under the target top-level window will cover the taskbar, so the taskbar will also become dark. Compared with the focus display method in the prior art, which cannot dim the taskbar, the embodiments of the present application set the window that needs focus display to the topmost window above the taskbar, so that the mask set under the topmost window can cover the taskbar, ensuring that the brightness of the taskbar also becomes smaller, so that the pixels on the taskbar can also get sufficient rest, reducing the risk of screen burn-in.
[0214] On the other hand, the embodiments of the present application also provide a display method, which comprises:
[0215] displaying a first window of a first application and a second window of a second application;
[0216] creating a third window by the first application, wherein the third window is on the current screen and not within the first window, and the third window is invisible to the user;
[0217] minimizing the first window;
[0218] in a case that the first window is minimized and the focus display function is turned on, the brightness of the second window is greater than that of other display areas.
[0219] The display method provided by the embodiment of the present application is described in detail below in combination with Fig. 8a. When the mailbox application is started by clicking the mailbox, a first window is created, and when the text document application is started by clicking the text document, a second window is created. The first window and the second window are both visible to the user. Although the first window and the second window now appear to be in a parallel relationship, the first window can be above or below the second window as the mouse is clicked. A third window invisible to the user can also be created by the mailbox. Specifically, the third window is created by the first window, and the first window is the owner window of the third window. The third window is actually a 0-pixel window with the WS_EX_TOOLWINDOW extension attribute. The third window can also create an owned window as the owner window.
[0220] Referring to Fig. 8b, the owner window and the owned window are exemplarily described. An owner window can be first created by clicking the text document application. When the mouse is placed on the "file" button of the owner window, a frame containing the options of "new", "open", "save", "save as", "print" and "exit" is displayed. After the "open" button is clicked, an owned window is popped up on the current screen to select the file to be opened. The owned window can be completely displayed in the owner window, partially displayed in the owner window, or displayed outside the owner window, which can be determined according to the actual hardware device conditions.
[0221] Referring to Fig. 9, after the first window is minimized, only the second window is visible to the user on the screen. When the focus display function opening switch in the task bar is clicked, the brightness of the second window is normally displayed, and the brightness of other areas except the second window is reduced.
[0222] In the embodiments of the present application, three windows are created in advance, two of which are visible and one of which is invisible. When one of the two visible windows is minimized, the focused display function is opened, and the remaining visible window can be displayed in focus, so that the pixels on the screen can be fully rested, thus reducing the risk of the screen being burned out, avoiding color difference in the final display effect, and achieving the effect of prolonging the service life of the display screen.
[0223] In one example, in the case that the first window is minimized and the focused display function is opened, the brightness of the second window is greater than that of other display areas, including:
[0224] In the case that the first window is minimized and the focused display function is opened, 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 that of the mask layer.
[0225] The mask layer is generally a semi-transparent black full-screen window, which is set to be transparent to the mouse, and the mouse operation on the mask layer is automatically forwarded to the lower layer. When the current screen is left with only one window visible to the user, the focused display function is opened, and the mask layer is arranged under the second window. Because the mask layer is a semi-transparent black full-screen window, the mask layer is overlaid on the other display areas, and part of the screen except the second window can be darkened.
[0226] In the embodiments of the present application, after the second window is determined to be the window that needs to be displayed in focus, the mask layer is arranged under the second window, so that the brightness of the second window is greater than that 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 displayed in focus is brought to the upper layer of the mask layer, so that the screen does not flicker, and the user can have a good 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 opening the focused display function, a top-level window that meets a preset condition is determined, wherein the second window meets 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.
[0229] The top-level window refers to a root window. For example, a word document is opened and a text input part is being operated. The top-level window is not only the text input part but also the whole word page. For another example, a search engine is clicked and a webpage is newly created. The top-level window is the whole webpage but not only the address bar. The top-level window can be owned or not owned and can be displayed at any position on the screen. Since the third window is on the current screen and not in the first window, it is indicated that the third window is created by the first window and is the owned window of the first window but does not belong to the first window and is not included in the first window and is a top-level window.
[0230] In the embodiment of the 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 is displayed in focus, so that the pixels on the whole screen do not need to emit light at the same time, the window being used by the user can be emphasized, and the service life of the display screen can be prolonged.
[0231] In one example, the top-level window satisfying the preset condition is determined by:
[0232] The top-level window of the window where the focus is located is obtained to obtain a foreground window.
[0233] If the foreground window is a desktop window, a target foreground window on the current screen is obtained in a direction perpendicular to the current screen in a top-down order, it is judged whether the target foreground window satisfies any one of the conditions of minimization, invisibility to the user, absence on the current screen and a special condition, the special condition being that an owner window of the target foreground window is a 0-pixel window with a specific extension attribute, if there is a target foreground window not satisfying any one of the conditions, the target foreground window is determined to be the top-level window satisfying the preset condition, otherwise, the desktop window is determined to be the top-level window satisfying the preset condition.
[0234] If the foreground window is not the desktop window, the foreground window is determined to be the top-level window satisfying the preset condition.
[0235] Referring to FIG. 10, the foreground window is the fourth window. Since the fourth window is not the desktop window, the fourth window can be directly determined to be the top-level window satisfying the preset condition.
[0236] But if it is the case of Fig. 11, the determined foreground window is the desktop window, at this time, it is needed to judge whether there is any other user visible window on the desktop, if there is, the topmost user visible window is to be focused and displayed. For this, it is needed to acquire the target foreground window on the current screen in the vertical direction of the current screen (i.e. the direction of Z axis in Fig. 6), in the order from top to bottom, to judge whether the target foreground window meets the preset condition, specifically, the present application provides four judgment conditions, which are any one of the following conditions: minimized, user invisible, not on the current screen, and special case, the special case refers to that the owner window of the target foreground window is a 0-pixel window with specific extension attribute. In this way, when the first window not meeting any of the above judgment conditions is obtained, it can be determined that it is the topmost user visible window on the current screen. For Fig. 11, the determined top-level window meeting the preset condition is the fourth window.
[0237] Referring to Fig. 12, in this case, the foreground window is the desktop window, and the above-mentioned four judgment conditions provided by the present application cannot obtain any user visible window except the desktop window, at this time, the desktop window is the top-level window meeting the preset condition.
[0238] In the present application, the top-level window of the window where the focus is located is acquired to obtain the foreground window, in the case that the foreground window is not the desktop window, the foreground window can be directly determined as the top-level window meeting the preset condition; in the case that the foreground window is the desktop window, it is further needed to judge whether there is any other user visible window on the current screen, if there is, the topmost user visible window on the current screen is to be determined as the top-level window meeting the preset condition, if not, it means that there is no any other window on the current screen, only the desktop window, then the desktop window can be normally displayed. In this way, the window which needs to be focused and displayed can be correctly selected, the display screen is protected, and the user experience is improved.
[0239] In one example, the method further includes:
[0240] In response to a 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.
[0241] Referring to Fig. 13, when the icon of the first window in the taskbar is clicked, the first window is re-displayed on the current screen, at this time, the first window is the top-level window meeting the preset condition, a mask layer is set under the first window to ensure that the first window is focused and displayed, and other parts except the first window are darkened.
[0242] In the embodiment of the present application, after the focused display function is enabled, the actual situation of window switching is considered, and after the top window meeting the preset condition changes, the brightness of the current top window meeting 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.
[0243] In one example, the method further includes:
[0244] In response to the clicking operation on the desktop window, the brightness of each window on the current screen remains unchanged.
[0245] Taking FIG. 13 as an example, the brightness of the first window is currently greater than the brightness of other display areas, and if the clicking operation is performed on the desktop window, this will not affect the first window to remain the top window meeting the preset condition, and therefore the brightness of each window on the current screen remains unchanged. Although this process is easy to understand, for a machine, after the desktop window is clicked, the machine will execute the process of determining the top window meeting the preset condition again, and the result is that the top window meeting the preset condition is still the first window, so the display brightness of each area on the current screen will not change.
[0246] In the embodiment of the present application, after the focused display function is enabled, various events will occur, some of which will affect the current display rule and some of which will not affect the current display rule. After the desktop window is clicked, the current top window meeting the preset condition will not be affected, and therefore the brightness of each window on the current screen remains unchanged. The display of each window remains normal and will not be wrong.
[0247] In one example, the method further includes:
[0248] Minimizing the second window;
[0249] In response to the second window being minimized, displaying a desktop window, wherein the brightness of the desktop window becomes greater.
[0250] Referring to FIG. 14, after the second window is minimized, there is no window visible to a user on the current screen, and at this time, there is no need to set a mask, and the desktop window can be normally displayed. Because the mask has been present above the desktop window before, the normally displayed desktop window will be brighter than before. Minimizing the second window will affect the change of the top window meeting the preset condition, and therefore for a machine, after the minimize button of the second window is clicked, the machine will execute the process of determining the top window meeting the preset condition again, and the result is that the top window meeting the preset condition is the desktop window, so the mask will be hidden and the brightness of the desktop window becomes greater.
[0251] In the embodiments of the present application, in the case that the desktop window is the top window satisfying the preset condition, the brightness of the desktop window is made larger, that is, only 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 give each pixel a maximum rest, and the display effect of the desktop window can be ensured.
[0252] In one example, after the second window is minimized, the method further includes:
[0253] S901, setting a timer.
[0254] S902, updating a first time when a second elapses after the timer is started.
[0255] S903, updating a second time if it is detected that the top window satisfying the preset condition changes, wherein the preset condition is used to select the top window of the window where the focus is located or the top window of the topmost window on the current screen visible to the user.
[0256] S904, in response to the update of the second time, if the current top window satisfying the preset condition is a desktop window and the last top window satisfying the preset condition is invisible to the user, hiding the mask layer.
[0257] If it is judged that the current top window satisfying the preset condition is a desktop window and the last top window satisfying the preset condition is invisible, it is indicated that only one top window satisfying the preset condition is opened, and the top window satisfying the preset condition is displayed correctly. After the top window satisfying the preset condition is minimized, there is only one desktop window on the current screen, and therefore, after the top window satisfying the preset condition is minimized, the mask layer is removed to enable the desktop window to be displayed normally.
[0258] S905, if the current top window satisfying the preset condition is not a desktop window, setting a mask layer under the current top window satisfying the preset condition to make the brightness of the current top window satisfying the preset condition greater than the brightness of other display areas.
[0259] If the current top window satisfying the preset condition is not a desktop window, it is indicated that many windows are opened before, and after the top window satisfying the preset condition is minimized, another window becomes the new top window satisfying the preset condition. Thus, the mask layer is set under the new top window satisfying the preset condition to display the current top window satisfying the preset condition.
[0260] The method provided in the embodiments of the present application can monitor the top window satisfying the preset condition being minimized in the case that the focused display function is already opened, and adaptively determine which window to focus on, so that the focused display is maintained all the time in the long-time use of the display screen, and the screen loss is reduced.
[0261] In one example, the method further comprises:
[0262] If the first time is greater than the second time, and the last top-level window satisfying the preset condition is invisible to the user, hiding the mask.
[0263] When the last visible window is minimized by clicking the icon in the taskbar, the HandleWinHookEvent callback function does not receive the EVENT_SYSTEM_FOREGROUND event. At this time, some special processing is needed. In the embodiment of the present application, it is the processing flow for this case. It is necessary to check whether the timestamp 1 is greater than the timestamp 2 and whether the last top-level window satisfying the preset condition is invisible to the user. If yes, the mask is hidden. When the last top-level window satisfying the preset condition is the last visible window on the current screen, after the window is minimized by clicking the icon in the taskbar, the device manager can only receive the window minimization event, that is, only the timestamp 1 is updated. Since the timestamp 2 is not updated, the timestamp 2 must be less than the timestamp 1. If the timestamp 1 is greater than the timestamp 2 and the last top-level window satisfying the preset condition is invisible to the user, it means that the top-level window satisfying the preset condition is the last visible window on the screen and is minimized by clicking the icon in the taskbar. At this time, the mask needs to be hidden.
[0264] The method provided by the embodiment of the present application takes into account that when the last visible window is minimized by clicking the icon in the taskbar, the HandleWinHookEvent callback function does not receive the EVENT_SYSTEM_FOREGROUND event. In this case, special judgment processing is introduced to correctly find the current top-level window satisfying the preset condition, and the accuracy of focused display is ensured.
[0265] The present application also provides an electronic device, which includes one or more processors and a memory; the memory is coupled to the one or more processors, and the memory is configured to store computer program codes, the computer program codes including computer instructions, and the one or more processors are configured to invoke the computer instructions to enable the electronic device to perform part or all of the steps in the above method embodiments.
[0266] The present application also provides a computer readable storage medium, which includes a computer program, and when the computer program runs on an electronic device, enables the electronic device to perform part or all of the steps in the above method embodiments. The storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), or the like.
[0267] Embodiments of the mechanisms disclosed herein can be implemented in hardware, software, firmware, or any combination thereof. Embodiments of the application can be implemented as computer programs or program code executing on programmable systems comprising 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 perform the functions described herein and generate output information. The output information can be applied to one or more output devices, in known fashion. For purposes of this application, a processing system includes any system that has 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 in a high level procedural or object oriented programming language to communicate with a processing system. The program code can be implemented in assembly or machine language, if desired. In fact, the mechanisms described herein are not limited in scope to any particular programming language. In any case, the language can be a compiled or interpreted language.
[0270] In some cases, the disclosed embodiments can be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments can also be implemented as instructions carried by or stored on a transitory or non-transitory machine-readable (e.g., computer-readable) medium, which can be read and executed by one or more processors. For example, the instructions can be downloaded from a network or by way of another computer readable medium. Thus, a machine-readable medium can include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), including without limitation floppy disks, optical disks, optical disks, Compact Disc Read Only Memories (CD-ROMs), magnetic cased or optical cased cards, read-only memories, random access memories, erasable programmable read-only memories (EPROMs), electrically erasable programmable read-only memories (EEPROMs), magnetic or optical tape, flash memory, or any other suitable medium upon which information can be stored or transmitted. Thus, a machine-readable medium includes any type of medium suitable for storing or transmitting electronic instructions or information in a form readable by a machine (e.g., a computer).
[0271] In the drawings, some of the structural or methodological features can be shown in particular arrangements and / or orders. However, it should be understood that such particular arrangements and / or orders can not be required. Instead, in some embodiments, the features can be arranged differently than shown in the figures of the specification. Also, inclusion of a structural or methodological feature in a particular figure does not imply that the feature is required in all embodiments, and in some embodiments, the feature can not be included or can be combined with other features.
[0272] It should be noted that each unit / module mentioned in the embodiments of the present application is a logical unit / module, in physical, one logical unit / module can be one physical unit / module, or a part of a physical unit / module, or a combination of multiple physical unit / modules, the physical implementation of the logical unit / module itself is not the most important, the combination of the functions implemented by the logical unit / module is the key to solve the technical problems proposed in the present application. In addition, in order to highlight the innovative part of the present application, the above-mentioned each device embodiment of the present application does not introduce the unit / module which is not closely related to solving the technical problems proposed in the present application, which does not mean that the above-mentioned device embodiment does not have other units / modules.
[0273] It has to be noted that the terms "first", "second", and the like in the description and in the claims do not necessarily have to refer to a chronological order, but they are merely placed to distinguish one entity or action from another entity or action, without necessarily implying any actual relationship or order between these entities or actions. Furthermore, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises a", "comprising", or "comprises" does not, without more constraints, preclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0274] The foregoing is considered as illustrative only of the principles of the application. Further, since numerous modifications and changes will readily occur to those skilled in the art, it is not desired to limit the application to the exact construction and practice described. Accordingly, all such variations are intended to be included within the scope of the present application as defined in the following claims.
Claims
1. A display method characterized by comprising: The method comprises: displaying a first window of a first application and a second window of a second application; creating a third window by 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 a user; minimizing the first window; in a case where the first window is minimized and a focused display function is turned on, the brightness of the second window is greater than that of other display areas.
2. The method of claim 1, wherein, The first window is an owner window of the third window; in the case where 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, comprising: in the case where the first window is minimized and the focused display function is turned on, setting a mask layer under the second window, wherein the second window is visible to the user, and the brightness of the second window is greater than that of the mask layer.
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 comprises: in response to turning on the focused display function, determining a top-level window satisfying a preset condition, wherein the second window satisfies the preset condition, and the preset condition is used to select a top-level window of a window where a focus is located or a top-level window of an uppermost window on a current screen which is visible to a user.
4. The method of claim 3, wherein, The determination of the top-level window satisfying the preset condition comprises: obtaining a top-level window of a window where a focus is located to obtain a foreground window; if the foreground window is a desktop window, obtaining a target foreground window on the current screen in a direction perpendicular to the current screen in a top-to-bottom order, judging whether the target foreground window satisfies any one of conditions of being minimized, invisible to a user, not being on the current screen and a special case, the special case being that an owner window of the target foreground window is a 0-pixel window with a specific extension attribute, if there is a target foreground window not satisfying any one of the conditions, determining that the target foreground window is the top-level window satisfying the preset condition, otherwise, determining that the desktop window is the top-level window satisfying the preset condition; if the foreground window is not the desktop window, determining that the foreground window is the top-level window satisfying the preset condition.
5. The method of claim 1, wherein, The method further comprises: in response to a click operation on the first window icon, displaying a first window, wherein the brightness of the first window is greater than that of other display areas, and the brightness of the second window becomes smaller.
6. The method of claim 1, wherein, The method further comprises: in response to a click operation on a desktop window, the brightness of each window on the current screen remains unchanged.
7. The method of claim 1, wherein, The method further comprises: minimizing the second window; in response to the second window being minimized, displaying a desktop window, wherein the brightness of the desktop window becomes greater.
8. The method of claim 7, wherein, After the second window is minimized, the method further comprises: setting a timer; updating a first time when the timer is started for one second; if it is detected that a top-level window satisfying a preset condition changes, updating a second time, wherein the preset condition is used to select a top-level window of a window where a focus is located or a top-level window of an uppermost window on a current screen which is visible to a user. In response to the update of the second time, if a top-level window currently satisfying the preset condition is a desktop window and a last top-level window satisfying the preset condition is invisible to a user, a mask is hidden. If the top-level window currently satisfying the preset condition is not the desktop window, a mask is set under the top-level window currently satisfying the preset condition, so that the brightness of the top-level window currently satisfying the preset condition is greater than the brightness of other display areas.
9. The method of claim 8, wherein, The method further comprises: If the first time is greater than the second time and the last top-level window satisfying the preset condition is invisible to the user, the mask is hidden.
10. A display method characterized by comprising: The method comprises: In response to an operation of the user, a focused display function is opened; In a case where the focused display function is opened and a 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. The target top-level window is the top-level window of an uppermost window on the current screen that is visible to the user.
11. The method of claim 10, wherein, The target top-level window is determined in the following manner: A top-level window of a window where a focus is located is obtained to obtain a foreground window; If the foreground window is the desktop window, a target foreground window on the current screen is obtained in a vertical direction of the current screen in a top-to-bottom order, it is judged whether the target foreground window satisfies any one of conditions of minimization, invisibility to the user, non-existence on the current screen and a special case, the special case is that an owner window of the target foreground window is a 0-pixel window with a specific extension attribute, if there is the 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; If the foreground window is not the desktop window, the foreground window is determined as the target top-level window.
12. The method of claim 10, wherein, The method further comprises: The target top-level window is minimized; In response to the minimization of the target top-level window, a first time is updated after a second elapses after a preset timer is started; If a change of the target top-level window is detected, a second time is updated; In response to the update of the second time, if the target top-level window currently is the desktop window and a last target top-level window is invisible to the user, a mask is hidden; If the target top-level window currently is not the desktop window, a mask is set under the target top-level window currently, so that the brightness of the target top-level window currently is greater than the brightness of other display areas.
13. The method of claim 12, wherein, The method further comprises: If the first time is greater than the second time and the last target top-level window is invisible to the user, the mask is hidden.
14. The method of claim 10, wherein, The method further comprises: If a change of the target top-level window is detected, the second time is updated; In response to the update of the second time, if the target top-level window currently is the desktop window and a last target top-level window is invisible to the user, a mask is hidden; If the target top-level window currently is not the desktop window, a mask is set under the target top-level window currently, so that the brightness of the target top-level window currently is greater than the brightness of other display areas.
15. The method of claim 10, wherein, The method further comprises: A height parameter of the target top-level window is set as a first height parameter, the first height parameter is greater than a height parameter of a taskbar on the current screen; A mask layer is arranged under the target top-level window, and a height parameter of the mask layer is greater than a height parameter of a task bar on a current screen.
16. An electronic device, comprising: Comprising: one or more processors and a memory; The memory is coupled to the one or more processors, and the memory is configured to store computer program codes including computer instructions, and the one or more processors are configured to invoke the computer instructions to cause the electronic device to perform the method according to any one of claims 1-15.
17. A computer-readable storage medium, characterized in that, A computer program, when running on an electronic device, causes the electronic device to perform the method according to any one of claims 1-15.
Citation Information
Patent Citations
Display device and method of controlling the same
CN103853424A
Method and apparatus for controlling screen brightness in electronic device
CN104575445A
Interface display method and electronic equipment
CN115729346A
Method for displaying a plurality of windows
JP2001350619A
Display power saving method and electronic system
US20110304536A1