Screen refresh rate setting method and electronic device
By detecting whether there is a risk window in the front desk window and deciding whether to switch the screen refresh rate, the screen stuttering or flickering may occur when switching the screen refresh rate, improving the user experience.
Patent Information
- Application Number
- CN202410323536.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-18
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-03-18
AI Technical Summary
在屏幕切换刷新率时,可能会出现画面卡顿或者闪烁的情况,影响用户体验。
By detecting whether there is a window in the foreground window of the electronic device that does not meet the preset conditions, it is determined whether to perform the switching operation of the screen refresh rate. Specifically, the switching operation is only performed if there is no risk window in the foreground window.
Effectively reduces screen stuttering or flickering caused by switching screen refresh rate, thereby improving user experience.
Smart Images

Figure CN118331524B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic devices, and in particular to a method for setting a screen refresh rate and an electronic device. Background Art
[0002] With the development of Internet technology, various electronic devices that support display functions have emerged, such as personal computers (PCs), tablet computers, mobile phones, etc. with screens. These electronic devices can display images through the screen (such as playing videos, displaying game images, displaying work documents, etc.) to provide corresponding services to users.
[0003] The screen can display images at a certain refresh rate, which refers to the number of times the screen is refreshed per second, or the number of times the screen is updated per second. A high refresh rate can bring smoother animations and faster response times, making the image more stable, but increasing the refresh rate will consume more resources and power.
[0004] Therefore, in order to improve the user experience and save resources as much as possible, the refresh rate can be adaptively switched in different scenarios according to certain rules. However, when the screen switches the refresh rate, the screen may freeze or flicker, thus affecting the user experience. Summary of the invention
[0005] The embodiments of the present application provide a method for setting a screen refresh rate and an electronic device, which can reduce the situation where the screen image is stuck or flickered due to switching the screen refresh rate.
[0006] In the first aspect, a method for setting a screen refresh rate is provided, which can be applied to an electronic device, or some modules in an electronic device. Specifically, the method includes: when a switching condition is met, detecting whether there is a window that does not meet the preset condition in the foreground window of the electronic device, and performing a switching operation when there is no window that does not meet the preset condition; when there is a window that does not meet the preset condition, preventing the switching operation. Among them, the switching condition is used to trigger a switching operation, and the switching operation is an operation of switching the refresh rate of the screen of the electronic device from a first refresh rate to a second refresh rate, and the first refresh rate and the second refresh rate are different. The preset conditions include: the foreground window is at least one of a hidden window, a minimized window, a system window, and a window of an application in a whitelist, and the whitelist is used to record applications whose windows will not freeze or flicker when the screen refresh rate is switched.
[0007] Therefore, in the above scheme, it can be used to decide whether to perform the screen refresh rate switching operation. Specifically, when the switching conditions are met and the refresh rate is about to be switched, it can be detected whether there are windows in the foreground window of the electronic device that do not meet the preset conditions. These windows are not windows recorded in the whitelist that will not freeze or flicker when the refresh rate is switched, nor are they other stable (such as system windows) or invisible windows (such as hidden windows, minimized windows). Therefore, these windows are risk windows, that is, they may freeze or flicker when the refresh rate is switched. Since the freeze or flicker of the screen has a great impact on the user experience, in the scheme provided by this application, when the foreground window includes a risk window, it is better not to switch the screen refresh rate temporarily, but to prevent the occurrence of freeze or flicker of the screen, so as to maximize the user experience.
[0008] Optionally, after the switching operation is blocked, the user may wait for a certain time to switch again. For example, the refresh rate may be switched after the risk window in the foreground window is no longer visible, and this application does not limit this.
[0009] Optionally, in a possible implementation, detecting whether there is a window in the foreground window of an electronic device that does not meet preset conditions includes: obtaining a pre-generated set, in which the information of the windows in the foreground window of the electronic device that do not meet preset conditions is maintained in real time; when the set is empty, determining that there is no window in the foreground window that does not meet the preset conditions; when the set is not empty, determining that there is a window in the foreground window that does not meet the preset conditions.
[0010] Based on the above scheme, when the refresh rate is about to be switched (that is, when the switching conditions are met), there is no need to temporarily traverse the current foreground window and detect whether the foreground window meets the preset conditions, because the traversal process is usually time-consuming. If the foreground window needs to be traversed once before each switch of the screen refresh rate, it will not only increase the time complexity of the algorithm, but may also cause the screen to freeze. Based on the above scheme, by pre-generating and maintaining a collection, when the refresh rate is about to be switched, it is directly determined based on the pre-generated list whether the switching operation can be performed, without waiting for the system to temporarily traverse the foreground windows. At the same time, this implementation method can directly determine whether there is a foreground window that does not meet the preset conditions based on whether the collection is empty. There is no need to care about how many windows are in the collection and which windows there are, thereby improving efficiency and reducing freezes caused by detection delays when switching refresh rates.
[0011] Optionally, in a possible implementation, the method further includes: when the switching function is initialized, traversing the current foreground window and recording the windows in the foreground window that do not meet the preset conditions in a collection; and updating the collection in real time according to changes in the foreground window.
[0012] Based on the above scheme, an initial set can be generated when the switching function is initialized, and then the set can be updated in real time according to the changes in the foreground window. On the one hand, it can avoid the situation where the set has not been generated when the electronic device wants to execute the refresh rate switch. On the other hand, it can avoid the situation where the window maintained in the set does not match the current foreground window.
[0013] Optionally, in one possible implementation, the collection is updated in real time according to changes in the foreground window, including: updating the collection in real time according to monitored window minimization events and / or window switching events; wherein the window minimization event is used to indicate that the foreground window is minimized, or switched from a visible state to an invisible state, and the window switching event is used to indicate changes in the foreground window.
[0014] Based on the above scheme, it is possible to determine whether the foreground window has changed by means of event monitoring. Specifically, the window minimization event and / or window switching event can be subscribed in advance. When an event is triggered, it indicates that the foreground window may have changed, and the collection can be updated in time, thereby reducing the situation where the foreground window has changed but the collection has not been updated in time.
[0015] Optionally, in a possible implementation, the collection is updated in real time based on the monitored window minimization events and / or window switching events, including: when it is determined according to the monitoring results that the first window in the foreground window is minimized or switched to an invisible state, determining whether the first window is recorded in the collection; when the first window is recorded, deleting the first window recorded in the collection; when it is determined according to the monitoring results that a second window is added to the foreground window, determining whether the second window meets a preset condition; if the preset condition is not met, recording the second window in the collection.
[0016] Based on the above scheme, whether to update the collection can be determined based on the specific results of the event trigger. For example, if the changed window does not meet the preset conditions, it may be necessary to update the collection in time (maybe deleting a window in the collection, or adding a new window) to improve the freshness of the collection.
[0017] Optionally, in a possible implementation, the collection is updated in real time according to changes in the foreground window, including: traversing the windows in the collection at a preset time, and deleting invisible windows from the collection.
[0018] When an application is closed, sometimes the event of window destruction cannot be detected, and the method of using the process handle to monitor process exit is too cumbersome. Therefore, in the above scheme, all windows recorded in the collection can be traversed at an appropriate time. For example, for existing windows in the collection, the electronic device traverses the windows in the collection at a preset time (or at a preset frequency), and then deletes the invisible windows from the collection. This can not only enable the collection to be updated in a timely manner, but also avoid the problem of the program being too cumbersome.
[0019] Optionally, in a possible implementation, traversing the windows in the collection at a preset time includes: traversing the windows in the collection when an object destruction event is monitored, the object destruction event being used to indicate that the application object is destroyed.
[0020] In the above scheme, when the electronic device determines that an object destruction event occurs, it traverses all windows recorded in the collection, and then deletes the invisible windows from the collection. The reason for this is that there are usually multiple events for object destruction events. If all events are subscribed, the power consumption will be very high, and the event itself is not very accurate. Therefore, this application does not judge all types of object destruction events, but uses it as a trigger condition, that is, it is used to trigger the operation of traversing all windows in the collection. In other words, when the object destruction event is triggered, the electronic device does not need to care about the specific content of the object destruction event, but directly detects whether there are invisible windows in the collection. If a window becomes invisible, it means that the window may have been closed or has crashed by itself. At this time, the window is deleted from the collection, so that the situation where the application is closed or the application crashes by itself can be properly handled. In this way, it can be more accurately determined which windows have become invisible.
[0021] Optionally, in a possible implementation, detecting whether there is a window in the foreground window of an electronic device that does not meet preset conditions includes: obtaining a pre-generated set, in which information on windows in the foreground window of the electronic device that meet preset conditions is maintained in real time; when the number of foreground windows is the same as the number of windows in the set, determining that there is no window in the foreground window that does not meet the preset conditions; when the number of foreground windows is different from the number of windows in the set, determining that there is a window in the foreground window that does not meet the preset conditions.
[0022] In the above scheme, when the refresh rate is about to be switched (that is, when the switching conditions are met), there is no need to temporarily traverse the current foreground window and detect whether the foreground window meets the preset conditions, thereby improving efficiency and reducing the lag caused by detection delay when switching the refresh rate.
[0023] Optionally, in a possible implementation, the preset condition also includes: the foreground window is not located on the current desktop.
[0024] An electronic device may have multiple screens, and the current desktop here refers to the desktop of the currently detected screen, or the desktop that the user is currently focusing on or using. If it is detected that the foreground window is on a screen that other users are not focusing on, it can be considered that the window does not constitute a risk window, so the refresh rate switching operation can be performed to improve the user experience.
[0025] In a second aspect, an electronic device is provided, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, the electronic device implements the steps of any method described in the first aspect above.
[0026] In a third aspect, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the steps of the method described in any one of the first aspects are implemented.
[0027] According to a fourth aspect, a computer program product is provided. When the computer program product is executed on an electronic device, the electronic device executes any one of the methods according to the first aspect.
[0028] In a fifth aspect, a chip system is provided, which includes a processor coupled to a memory, and the processor executes a computer program stored in the memory to implement the method described in any one of the first aspects above.
[0029] The chip system may be a single chip or a chip module composed of multiple chips.
[0030] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 is a schematic diagram of a graphical user interface of an electronic device provided in an embodiment of the present application;
[0032] Figure 2 A schematic flow chart of a method 200 provided in an embodiment of the present application is shown;
[0033] Figure 3 A user interface diagram of a settings interface provided in an embodiment of the present application is shown;
[0034] Figure 4 is a schematic diagram of another graphical user interface of an electronic device provided in an embodiment of the present application;
[0035] Figure 5is a schematic diagram of another graphical user interface of an electronic device provided in an embodiment of the present application;
[0036] Figure 6 is a schematic diagram of another graphical user interface of an electronic device provided in an embodiment of the present application;
[0037] Figure 7 A schematic diagram of a software architecture of an electronic device provided in an embodiment of the present application is shown;
[0038] Figure 8 A schematic diagram of a hardware architecture of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0039] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0040] With the development of intelligent information technology, various electronic devices with screens or connectable screens have emerged. These electronic devices can provide services to users by displaying various images on the screen. These electronic devices can be, for example, PCs, laptops, ultra-mobile personal computers (UMPCs), netbooks, tablet computers, mobile phones, etc. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices. In specific applications, users can start an application installed on the electronic device, open the window corresponding to the application, and the user can see the image displayed by the application through the window.
[0041] Figure 1 It is a schematic diagram of a graphical user interface of an electronic device (taking a PC as an example) provided in an embodiment of the present application. In this user interface, it is assumed that the default display interface is the desktop 101. It can be understood that the desktop is a system application, and the desktop 101 displayed on the screen can be considered as a display interface of the system browser. The desktop 101 can be used to display application icons (or shortcuts) of some applications installed on the electronic device, such as the icons of "My Computer", "Recycle Bin", "Browser", and "Application A" displayed in the desktop 101. As an example, a user can start application A through the icon 102 of application A, and then application A will open an application window 103, which is used to display the user screen of application A. For example, if application A is a video application, window 103 can display video content or video playlists, etc., and users can watch videos through the window 103; for another example, if application A is a game application, window 103 can display game screens, and users can play electronic games through window 103.
[0042] There are usually multiple controls in the window 103, such as controls 103a to 103c. Among them, the control 103a is used to minimize the window 103. For example, in response to the user clicking the control 103a, the electronic device hides the window 103 (or switches the window 103 from the user visible state to the invisible state), and only retains the icon 105 in the taskbar 104. After the window 103 is minimized, in response to the user's operation of the electronic icon 104, the electronic device redisplays the window 103 (or switches the window 103 from the user invisible state to the visible state), and the position and size of the redisplayed window 103 are the same as the position and size before minimization. The control 103b is used to maximize the window 103. For example, in response to the user clicking the control 103b, the electronic device maximizes the (unmaximized) window 103 (so that the window 103 fills the desktop 101). After the window 103 is maximized, in response to the user clicking the control 103b again, the electronic device restores the window 103 to the state before maximization. Control 103c is used to close window 103. For example, in response to a user clicking on control 103c, the electronic device closes window 103 (it may destroy window 103 or hide window 103, which is not limited in this application).
[0043] It is understandable that after the application is started, the window 103 may be displayed maximized by default or not by default. It is also understandable that the above controls 103a to 103c are only examples, and in actual application scenarios, there may be more or fewer controls on the application window, and the functions of each control may be adjusted as needed, which is not limited in this application.
[0044] In addition, it should be noted that after starting an application, such as starting Figure 1 In the example, if application A is started, the window 103 of application A will be displayed on the top layer. The so-called display on the top layer means that window 103 will block other displayed windows. In other words, after application A is started, if application B is further started, the window of application B may partially or completely block window 103. If the window of application B is not a transparent window, the blocked part of window 103 will not be visible to the user. The user can adjust the window of a certain application to the top layer by clicking the window or clicking the icon of the corresponding application in the taskbar.
[0045] The electronic device displays the above-mentioned window 103 (and other contents) on the screen. The screen here can be a built-in screen of the electronic device, or it can be an external screen of the electronic device, which is not limited in this application. The screen can display the picture at a certain refresh rate. The refresh rate described in the embodiment of the present application refers to the number of times the screen picture is refreshed per second, or the number of times the screen picture is updated per second. Since the picture displayed on the screen is composed of frame images, the higher the refresh rate, the better the picture fluency perceived by the user. Of course, while increasing the refresh rate, it is also necessary to increase the frame rate of the application. The application frame rate refers to the number of frames generated by the application per second. Ideally, the application frame rate should match the screen refresh rate. If the application frame rate is lower than the screen refresh rate, the screen may display the same picture multiple times, which will cause the image to freeze. If the application frame rate is higher than the screen refresh rate, some frames may be ignored, which may cause the picture to be missing.
[0046] Although increasing the screen refresh rate can improve the smoothness and stability of the picture, it will also consume more resources and power. Therefore, we can switch the screen refresh rate to adapt to the needs of different scenarios. For example, in application scenarios with high fluency requirements (such as racing game scenarios), we can increase the screen refresh rate to improve the user experience; in application scenarios with low fluency requirements (such as writing electronic documents), we can reduce the screen refresh rate to reduce power consumption. However, when switching between different refresh rates, the windows of some applications displayed in the foreground may freeze or flicker, affecting the user experience.
[0047] In view of this, an embodiment of the present application provides a method for setting the screen refresh rate, which can detect whether there is a foreground window that does not meet the preset conditions before switching the screen refresh rate. If so, the operation of switching the refresh rate will not be performed. Among them, the foreground window that does not meet the preset conditions refers to an untested window that may cause screen freeze or flicker when switching the screen refresh rate (called a risk window). In this way, the refresh rate can be avoided when the risk window is in the foreground, reducing the situation where the foreground window freezes or flickers due to switching the screen refresh rate. The following is combined with Figure 2 Method 200 in the present application provides a detailed description of the method for setting the screen refresh rate.
[0048] S201, when a switching condition is met, detecting whether there is a window in the foreground window of the electronic device that does not meet a preset condition.
[0049] Exemplarily, after the refresh rate switching function is turned on, the electronic device can detect in real time whether a switching condition is met, wherein the switching condition is used to trigger a switching operation, and the switching operation is an operation of switching the refresh rate of the screen of the electronic device from a first refresh rate to a second refresh rate, and the first refresh rate and the second refresh rate are different. In other words, the screen of the electronic device in the embodiment of the present application supports at least the first refresh rate and the second refresh rate (it can also support more refresh rates, which are not limited in the present application).
[0050] For example, after turning on the "intelligent switching refresh rate" function, the electronic device detects in real time whether the switching condition is met. The "intelligent switching refresh rate" function here refers to the function of the electronic device automatically switching the refresh rate according to the foreground application scenario (and / or the performance, power consumption, etc. of the electronic device). This application does not limit the execution standard of the refresh rate switching of the electronic device after the function is turned on, that is, this application does not limit the specific content of the above switching conditions.
[0051] It is understandable that when the "intelligent switching refresh rate" function is turned on by default, the electronic device starts to detect in real time whether the switching conditions are met after it is turned on. Alternatively, it can also start to detect in real time whether the switching conditions are met after a preset time has passed since the electronic device is turned on, because when the electronic device is just turned on, it usually needs to load many tasks. By waiting for a preset time before executing the above detection process, it can avoid concentrating the system's computing power and improve the overall operation efficiency of the device.
[0052] For electronic devices that support the above-mentioned "intelligent switching refresh rate" function, users can choose whether to enable this function. TM For example, you can add a startup switch for this function in the settings interface. Figure 3 As shown. Figure 3 The user interface shown includes display information (i.e., information of the current screen), as well as controls 301 and 302, wherein control 301 is used to set a fixed refresh rate of the screen, such as 60Hz, 90Hz, 120Hz, etc. (the screen itself needs to support these refresh rates), and the user can set the screen to display at a fixed refresh rate through control 301. Control 202 is used to set the "smart switching refresh rate" function on and off. It is understandable that when the "smart switching refresh rate" function is turned on, the user will no longer be able to set a fixed refresh rate for the screen.
[0053] When the electronic device detects that the switching condition is met, it indicates that the refresh rate can be switched according to the switching standard of the electronic device automatically switching the refresh rate, that is, the electronic device will switch from the current first refresh rate to the second refresh rate, where the second refresh rate may be higher than the first refresh rate, or may be lower than the first refresh rate, depending on the current application scenario, which is not limited in this application. After the electronic device detects that the switching condition is met and before performing the switching operation, it detects whether there is a window in the foreground window that does not meet the preset conditions, or in other words, it detects whether the foreground windows are all windows that meet the preset conditions.
[0054] The foreground window described in the embodiment of the present application refers to the window of the application running in the foreground, which includes windows visible to the user and invisible windows, and also includes system windows and third-party application windows, etc. The foreground window may include one or more windows, which is not limited in the present application.
[0055] In addition, the preset conditions described in the embodiment of the present application include: the foreground window is at least one of a hidden window, a minimized window, a system window, and a window of an application in a whitelist.
[0056] Among them, the hidden window refers to a window that is invisible to the user, specifically, a window that is invisible itself, or a window that is invisible due to being blocked by other windows. It should be noted here that this application does not limit the number of foreground windows. When there are multiple foreground windows, these multiple foreground windows may overlap with each other.
[0057] Figure 4 An example is shown in Figure 4 , window 401 and window 402 partially overlap, and window 402 is located on the upper layer of window 401, so the portion of window 401 that overlaps with window 402 is not visible, but since only a portion of window 401 overlaps with window 402, the other portion is still visible to the user, so at this time window 401 and window 402 are both visible windows.
[0058] Figure 5 Another example is shown in Figure 5 In the above figure, window 501, window 502, and window 503 overlap, and window 502 and window 501 completely overlap, window 503 and window 501 also completely overlap, and window 502 and window 503 partially overlap. However, although window 502 and window 501 completely overlap, window 502 is still visible because window 502 is located on the upper layer of window 501. For the same reason, window 503 is also visible. And window 501 is not completely blocked by window 502 and window 503 because of its large window area, so it is also visible.
[0059] Figure 6 Another example is shown. Figure 6 The user interface shown is similar to Figure 5 The interface shown is similar, that is Figure 6 Window 601, window 602, and window 603 in Figure 5 The windows 501, 502, and 503 in the diagram correspond to each other (i.e., have the same size and position), but the difference is that: Figure 6 Window 601 in the figure is located at the top layer, therefore, window 601 will completely cover window 602 and window 603, so that window 602 and window 603 become invisible windows, that is, hidden windows.
[0060] Understandably, Figure 4-5 The user interface shown is only an example. In actual application scenarios, more or fewer windows may be included, and the size and arrangement of these windows depend on actual conditions. In other words, various other windows may be hidden in actual application scenarios, and this application does not limit this.
[0061] A minimized window refers to a window hidden in the taskbar, for example, a window hidden in the taskbar by a user through a minimize operation, or a window that is not displayed in the foreground but hidden in the taskbar by default.
[0062] System windows refer to windows of certain system applications, such as the system desktop (which is essentially a window created by the system browser process).
[0063] The whitelist is used to record applications whose windows do not freeze or flicker when the screen refresh rate is switched. For example, engineers can test most applications on the market in advance. The test environment is the screen refresh rate switching scenario. When it is determined through testing that when a certain application's window is displayed in the foreground, there will be no freeze, flicker, black screen, etc. due to the screen refresh rate switching, the application is added to the whitelist, for example, the identification information of the application is recorded in the whitelist.
[0064] As can be seen from the above, windows that meet the preset conditions are risk-free windows, that is, windows that will not freeze or flicker when the screen refresh rate switches, or windows that will not be perceived by users even if freezes or flickers occur. Correspondingly, windows that do not meet the preset conditions are risky windows, which mainly include windows of applications that have not passed the above tests or have not undergone the above tests. These windows may freeze or flicker when the screen refresh rate switches, thereby affecting the user experience.
[0065] The following is an exemplary description of a specific implementation method in which the electronic device detects whether there is a window in the foreground that does not meet the preset conditions.
[0066] In a first possible implementation, when the switching condition is met, all foreground windows on the desktop are traversed, and then it is detected whether there is a window that does not meet the preset condition.
[0067] Windows TM Taking the operating system as an example, the "EnumWindows" function can be used to enumerate all foreground windows. This function can enumerate all foreground windows on the screen, or top-level windows, by passing the handle to each window and then to the callback function defined by the application. The operation of enumerating windows will continue until the last foreground window is enumerated or the callback function returns FALSE. Compared with other functions (such as the "GetWindow" function), the "EnumWindows" function is more stable and can improve the implementation efficiency of the entire process.
[0068] After enumerating all the foreground windows, determine whether each foreground window meets the preset conditions in turn. For example, set a detection code, which can detect whether the foreground window is a hidden window (IsIconic(hwnd)), whether it is an invisible window (IsWindowVisible(hwnd)), whether it is a window of an application in the whitelist (isExcluded(hwnd)), and optionally, whether the foreground window is on the current desktop. If none of the above conditions are met, that is, it is not a hidden window or a window of an application in the whitelist, but it is a visible window on the current desktop, then "False" is returned, and it is said that there is a risk window in the foreground window.
[0069] Optionally, some special judgments can be made for some special foreground windows. For example, for a 0-pixel window with the "WS_EX_TOOLWINDOW" extended attribute, it is the owner of some windows. These windows return True when calling "IsWindowVisible", that is, when calling the API to detect whether the window is visible, the result shows visible, but in fact the window is invisible, that is, the detection results for these windows are unreliable. At this time, the owner of the window can be found for special judgment, such as using "GetWindow(hwnd,GW_OWNER)" to find the owner of the window for special judgment, thereby improving the accuracy of detection.
[0070] Through the first possible implementation, when the refresh rate is about to be switched (i.e., when the switching condition is detected to be met), it is possible to accurately detect whether there is a foreground window that does not meet the preset condition in the current foreground window, so as to determine whether to perform the switching operation in the end. At the same time, this method does not require the execution of other pre-actions, and only requires the current foreground window to be traversed once when the switching condition is met. In other words, when the switching condition is not met, there is no need to perform the detection operation, which can minimize the consumption of resources by the detection operation.
[0071] In a second possible implementation, a set is generated in advance, in which information of windows in the foreground window of the electronic device that do not meet the preset condition is maintained in real time. When the switching condition is met, the pre-generated set is obtained. If the set is empty, it is determined that there is no window in the foreground window that does not meet the preset condition; if the set is not empty, it is determined that there is a window in the foreground window that does not meet the preset condition.
[0072] For example, when the switching function is initialized, the current foreground window is traversed and the window in the foreground window that does not meet the preset condition is recorded in the set. The switching function initialization here can refer to when the switching function is turned on, or when the electronic device is turned on (corresponding to the scene where the switching function is turned on by default); the switching function here refers to the function used to switch the screen refresh rate. For example, the switching function here is Figure 3 The "Smart Refresh Rate Switching" function shown.
[0073] Windows TM Taking the operating system as an example, the "EnumWindows" function can be used to enumerate all foreground windows. The specific process can refer to the specific process described in the first possible implementation method mentioned above, which will not be repeated here. Further, the hidden windows, invisible windows, system windows, windows of applications in the whitelist, and the foreground windows that are optionally not on the current desktop (for example, when the electronic device has multiple screens, the foreground window is located on the screen that other users do not pay attention to) are filtered out, and then the remaining windows (i.e., risk windows that do not meet the preset conditions) are recorded in the set, for example, the handles hwnd of the remaining windows are put into the set set. That is to say, when the switching function is initialized, the risk windows in the foreground window are determined by detection and recorded in the set. It should be noted that the embodiment of the present application is explained by taking the set as an example. In this way, the query efficiency can be improved and the implementation complexity will be much lower. However, the present application is not limited to this. The set described in the embodiment of the present application can also be in other forms such as a list and a hash table, which is not limited by the present application.
[0074] After the set is generated when the switching function is initialized, the set is further updated in real time according to the changes in the foreground window. In other words, the present application hopes to maintain a set that is updated in real time, and the set records the risk windows that are updated in real time in the foreground window.
[0075] For example, the electronic device updates the collection in real time based on the window minimization events and / or window switching events monitored; wherein the window minimization event is used to indicate that the foreground window is minimized, or switched from a visible state to an invisible state, and the window switching event is used to indicate changes in the foreground window.
[0076] In a possible implementation, the electronic device monitors the window minimization event and / or the window switching event, or in other words, the electronic device subscribes to messages of the window minimization event and / or the window switching event. After determining that the window minimization event and / or the window switching event occurs, it is determined whether to update the collection according to the occurred event.
[0077] For example, if it is determined according to the monitoring result that the first window in the foreground window is minimized or switched to an invisible state, it is determined whether the first window is recorded in the set; if the first window is recorded, the first window recorded in the set is deleted. For another example, if it is determined according to the monitoring result that a second window is added to the foreground window, it is determined whether the second window meets the preset condition; if it does not meet the preset condition, the second window is recorded in the set.
[0078] That is, the embodiment of the present application provides a method for pre-generating and maintaining a collection in real time, in which a collection is pre-generated when the switching function is initialized, in which the risk windows in the foreground window at that time are recorded. Then, system messages or events are tracked, and windows that are newly placed in the foreground and do not meet the preset conditions are added to the collection, and windows that become invisible in the collection (such as hidden windows or minimized windows) are deleted from the collection.
[0079] In addition, when the application is closed, sometimes the event of window destruction cannot be detected, and the method of using the process handle to monitor the process exit is too troublesome. Therefore, all windows recorded in the set can be traversed at an appropriate time. For example, for the existing windows in the set, the electronic device traverses the windows in the set at a preset time (or at a preset frequency), and then deletes the invisible windows from the set.
[0080] As an example, an electronic device subscribes to an object destruction event, and when it is determined that an object destruction event occurs, it traverses all windows recorded in the collection, and then deletes the invisible windows from the collection. The reason for this is that there are usually multiple events for object destruction events. If all events are subscribed, the power consumption will be very high, and the event itself is not very accurate. Therefore, this application does not judge all types of object destruction events, but uses it as a trigger condition, that is, it is used to trigger the operation of traversing all windows in the collection. In other words, when an object destruction event is triggered, the electronic device does not need to care about the specific content of the object destruction event, but directly detects whether there are invisible windows in the collection. If a window becomes invisible, it means that the window may have been closed or has crashed by itself. At this time, the window is deleted from the collection, so that the situation where the application is closed or the application crashes by itself can be properly handled. In this way, it can be more accurately determined which windows have become invisible.
[0081] The following is Windows TM Taking the operating system as an example, the above-mentioned real-time maintenance collection solution is illustrated.
[0082] On the one hand, the following two events of the entire system are subscribed through the "SetWinEventHook" function: "EVENT_SYSTEM_MINIMIZESTART" and "EVENT_SYSTEM_FOREGROUND". Among them, the "SetWinEventHook" function is used to set event hook functions for a series of events so that some operations can be performed when specific events occur. Specifically, the "SetWinEventHook" function allows an application to register one or more events and call a callback function when these events occur. "EVENT_SYSTEM_MINIMIZESTART" is a Windows event that is triggered when a window is minimized. "EVENT_SYSTEM_FOREGROUND" is also a Windows event that is sent by the system when the foreground window of the system changes. For example, when a user sets a window as the foreground window by clicking, dragging, etc., or switches to another window through the Task Manager, Alt+Tab, etc., the system will trigger the EVENT_SYSTEM_FOREGROUND event.
[0083] When the "EVENT_SYSTEM_MINIMIZESTART" event is detected, if the window corresponding to the event is in the set, the window is deleted from the set.
[0084] When an "EVENT_SYSTEM_FOREGROUND" event is detected, if the window corresponding to the event does not meet the preset conditions, the window is added to the set, such as adding the handle of the window to the set.
[0085] On the other hand, by enumerating the windows in the set at a preset time, the invisible windows are deleted from the set. As an example, the "EVENT_OBJECT_DESTROY" event is subscribed through the "SetWinEventHook" function, where the "EVENT_OBJECT_DESTROY" is a Windows event. When an application object (such as a window or a control) is destroyed, the system triggers this event. After the event is detected, it is not necessary to process the event, but directly trigger the traversal operation of the windows in the set, so as to delete the invisible windows from the set.
[0086] Through the second possible implementation, when the refresh rate is about to be switched (that is, when the switching conditions are met), there is no need to temporarily traverse the current foreground window and detect whether the foreground window meets the preset conditions, because the traversal process is usually time-consuming. If the foreground window needs to be traversed once before each screen refresh rate is switched, it will not only increase the time complexity of the algorithm, but also may cause the screen to freeze. The above second possible implementation method generates and maintains a set in advance, so that when the refresh rate is about to be switched, it is directly determined whether the switching operation can be performed based on the pre-generated list, without waiting for the system to temporarily traverse the foreground window. At the same time, this implementation method can directly determine whether there is a foreground window that does not meet the preset conditions based on whether the set is empty, and there is no need to care about how many windows there are in the set and which windows there are. In other words, based on performance considerations, we do not need to enumerate the windows in the set, and directly look at the number of windows in the set to make a decision, because if the switch cannot be made, it may be tried again after a few minutes. At that time, HandleWinHookEvent has already responded to the event and deleted the exited application from the set. This method can improve efficiency and reduce the freeze caused by detection delay when switching refresh rates.
[0087] In a third possible implementation, a set is generated in advance, in which information of windows that meet the preset conditions in the foreground window of the electronic device is maintained in real time. That is, unlike the second possible implementation in which information of windows that do not meet the preset conditions is maintained in the set, this implementation is to maintain information of windows that meet the preset conditions in the set. The specific implementation is similar to the method described in the second possible implementation, except that this implementation is to add windows that meet the preset conditions to the set, which will not be repeated here.
[0088] In the third possible implementation, when switching is about to take place, it is necessary to determine whether the number of foreground windows is the same as the number of windows in the set. If the number of foreground windows is the same as the number of windows in the set, it is determined that there is no window in the foreground window that does not meet the preset condition; if the number of foreground windows is different from the number of windows in the set, it is determined that there is a window in the foreground window that does not meet the preset condition.
[0089] Through the third possible implementation method, when the refresh rate is about to be switched (that is, when the switching conditions are met), there is no need to temporarily traverse the current foreground window and detect whether the foreground window meets the preset conditions, thereby improving efficiency and reducing the lag caused by detection delay when switching the refresh rate.
[0090] S202: When there is no window that does not meet the preset condition, execute the switching operation.
[0091] S203: If there is a window that does not meet the preset condition, prevent the switching operation.
[0092] Exemplarily, based on the judgment result of S201, when the switching condition is met, it can be determined whether there is a window that does not meet the preset condition. For example, for the first possible implementation method mentioned above, the foreground windows can be temporarily traversed, so that it can be directly determined whether there is a window that does not meet the preset condition; for another example, for the second possible implementation method mentioned above, since the set in this implementation method maintains windows that do not meet the preset condition, it can be directly determined according to the number of applications in the set whether there is a window that does not meet the preset condition, specifically, when the number of windows in the set is 0, it means that there is no window that does not meet the preset condition, and when the number of windows in the set is not 0, it means that there is a window that does not meet the preset condition; for another example, for the third possible implementation method mentioned above, since the set in this implementation method maintains windows that meet the preset condition, it can be determined according to whether there is a window that does not belong to the set in the foreground window, specifically, whether the number of foreground windows is the same as the number of windows in the set. When the number of the foreground windows is the same as the number of windows in the set, it is determined that there is no window that does not meet the preset condition in the foreground window; when the number of the foreground windows is different from the number of windows in the set, it is determined that there is a window that does not meet the preset condition in the foreground window.
[0093] When there is no window that does not meet the preset condition, it means that there is no risk window in the foreground window at this time, that is, there is no window that may cause user-visible jamming or flickering when the switching operation is performed. Therefore, the switching operation can be performed at this time, that is, the screen refresh rate is switched from the first refresh rate to the second refresh rate.
[0094] If there is a window that does not meet the preset condition, it means that there is a risk window in the foreground window, that is, there is a window that may cause user-visible freeze or flickering when the switching operation is performed. Therefore, the switching operation is blocked at this time, that is, the switching operation is not performed.
[0095] Therefore, in the above scheme, it can be used to decide whether to perform the screen refresh rate switching operation. Specifically, after realizing the self-developed seamless intelligent switching of the screen refresh rate, it was found in the test that some applications would briefly freeze or flicker when switching the refresh rate. After careful study, it was found that there may be problems with the processing of certain messages or interfaces when the refresh rate is switched. For example, when determining to switch the screen refresh rate, the system will broadcast the refresh rate change message WM_DISPLAYCHANGE to the application, as well as subsequent WM_PAINT messages, and will also call DirectX and other interfaces to render the application screen. When the application processes the WM_PAINT message or calls the DirectX interface, it may freeze or flicker if it is not optimized.
[0096] One way to deal with this is to use a hook to discard the WM_PAINT message that triggers self-drawing, so that the application cannot receive it, or to prevent the call of the DirectX interface. However, when this method is blocked by the application (or there are other factors), the solution will fail.
[0097] In the above-mentioned scheme provided by the present application, when the switching conditions are met and the refresh rate is about to be switched, it can be detected whether there is a window in the foreground window of the electronic device that does not meet the preset conditions. These windows are not windows recorded in the whitelist that will not freeze or flicker when the refresh rate is switched, nor are they other stable (such as system windows) or invisible windows (such as hidden windows, minimized windows). Therefore, these windows are risk windows, that is, they may freeze or flicker when the refresh rate is switched. Since screen freezes or flickers have a great impact on user experience, in the scheme provided by the present application, when the foreground window includes a risk window, it is better to temporarily not switch the screen refresh rate to prevent the occurrence of screen freezes or flickers, so as to maximize the user experience.
[0098] The electronic device in the embodiment of the present application can be installed with various operating systems, such as Windows system, Android operating system, IOS operating system, etc., which are not limited in the present application. Applications can be installed and run on the operating system. The system architecture of the operating system can be a layered architecture, such as Figure 7 The software architecture 700 shown in FIG. 700 is a layered architecture that divides the software system into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. Figure 7In the example shown, the software architecture of the electronic device includes at least an application layer, a housekeeper layer, and an operating system (OS) layer.
[0099] like Figure 7 As shown, the application layer includes various applications, such as video, live broadcast, conference, learning, etc. These applications can be system applications or third-party applications, which are not limited in this application. It should be noted that the applications shown in the figure are only examples, and the application layer can also include more or fewer applications.
[0100] The housekeeper layer includes a set generation module and a set update module. Among them, the set generation module is used to generate the set described in method 200. For example, the set generation module is used to traverse the current foreground window and record the windows in the foreground window that do not meet the preset conditions in the set when the switching function is initialized. The set update module is used to update the initial set generated by the set generation module. For example, the set update module is used to update the set in real time according to the changes in the foreground window. For example, the set update module is used to update the set in real time according to the monitored window minimization events and / or window switching events, and is also used to traverse the windows in the set at a preset time and delete the invisible windows from the set. The specific implementation process can refer to the description in method 200, which will not be repeated here.
[0101] It is understandable that the set generation module and the set update module can be one module or two different modules. Figure 7 In the description, the set generation module and the set update module are two different modules, but this application is not limited to this.
[0102] It can also be understood that the butler layer in the embodiment of the present application can also be called other names, such as service layer, etc., and the present application does not limit this.
[0103] like Figure 7 As shown, the OS layer includes but is not limited to graphics device interface (graphics device interface, GDI) 32, direct extension (Direct eXtension, DirectX) graphics infrastructure (DirectX Graphics Infrastructure, DXGI), user mode driver (user mode driver, UMD), user32, DirectX graphics kernel (DirectX graphics kernel, Dxgkrnl), user mode driver (kernel mode driver, KMD), etc.
[0104] Among them, GDI32 is an execution function of the dynamic link library, which can be in the form of GDI32.dll. The dynamic link library can provide system call entry and internal function support for the application. GDI32.dll is used to provide functions for implementing GDI, responsible for information exchange between the system and the drawing program, and handles the graphics output of all Windows programs.
[0105] DXGI is part of DirectX technology and is mainly responsible for managing low-level tasks such as enumeration of hardware devices, creation and management of windows, and rendering of images. The main goal of DXGI is to provide a common framework so that future graphics components can be independent of the DirectX graphics runtime. The main function of DXGI is to provide developers with a unified interface so that developers can easily develop high-performance graphics applications without having to worry about the underlying hardware details. At the same time, DXGI can also help developers optimize the performance of applications, for example, by improving the response speed and operating efficiency of applications through parallel processing and asynchronous operations.
[0106] UMD can be used to receive graphics instructions, construct hardware context and command buffer in response to graphics instructions, and pass the command buffer to the KMD of the OS layer for further processing. Specifically, UMD can convert graphics commands issued by the application programming interface runtime (API runtime) into hardware-specific commands (such as commands dedicated to the graphics processing unit (GPU)). During the conversion process, UMD can reserve the appropriate hardware context for the GPU.
[0107] User32 is a dynamic link library in Windows system. It is part of Windows user subsystem and is mainly responsible for handling Windows user interface related functions. User32 contains a large number of API functions, which allow developers to create and operate windows, process messages, draw graphics, create and destroy controls, etc. For example, common functions such as GetWindowText, SendMessage, CreateWindow, etc. are all from User32.
[0108] Dxgkrnl is the kernel-mode driver for the DirectX graphics kernel subsystem in Windows. This driver is mainly responsible for handling kernel-level operations related to graphics, including but not limited to video memory management, GPU scheduling, initialization and configuration of display adapters, etc. Dxgkrnl is the function function that the Windows system supports DirectX implementation. It provides many kernel-mode APIs for display adapter vendors' drivers to use. For example, the display miniport driver can implement the display port driver function through the interface provided by Dxgkrnl.
[0109] KMD can check the instruction stream transmitted by the graphics scheduler to avoid illegal instructions. KMD can also be used to implement physical memory allocation and mapping, set the display mode of the display screen, transmit data and instructions to the GPU, etc. It should be noted that multiple UMDs can exist in an operating system at the same time, but only one KMD can exist.
[0110] In general, the above-listed OS layer modules are mainly used to render and display window images of different applications. The collection generation module and collection update module of the housekeeper layer can generate and update collections based on the foreground windows generated and displayed by the OS layer, and the specific process is not limited here.
[0111] It should be noted that the above architecture is for illustration only. In other implementations, as long as the functions implemented by each functional module are similar to those in the embodiments of the present application, the solution of the present application can also be implemented.
[0112] Corresponding to the methods provided in the above-mentioned method embodiments, the embodiments of the present application also provide corresponding electronic devices. Figure 8 A schematic diagram of the hardware structure of an electronic device 800 provided in an embodiment of the present application is shown. The electronic device 800 includes at least: at least one processor 810, a screen 820, and a memory 830.
[0113] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0114] The processor 810 may include one or more processing units, for example, the processor 810 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors. The GPU may be one or more and may be used to perform operations such as image rendering and video acceleration of the foreground window.
[0115] The processor 810 may also be provided with a memory for storing instructions and data.
[0116] The screen 820 is used to display images, videos, etc. The screen in this application can also be called a display screen, which can include an embedded display port (eDP) signal receiving module, a timing control module, a remote frame buffer (RFB) module, an RFB control module, and a liquid crystal display (LCD) and other modules (not shown in the figure). The electronic device 800 realizes the display function through the GPU, the screen 820, and the application processor.
[0117] In addition, the screen in the embodiment of the present application can support multiple different refresh rates, for example, supporting display at 60Hz refresh rate and 120Hz refresh rate, and can switch between different refresh rates during specific display.
[0118] The memory 830 may be used to store computer executable program codes, which include instructions. The processor 810 executes the instructions stored in the memory 830 to perform various functional applications and data processing of the electronic device described in the embodiment of the present application, such as the specific solution process in the execution method 200.
[0119] It should be noted that the information interaction, execution process, etc. between the above-mentioned modules / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method and system embodiment section and will not be repeated here.
[0120] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0121] An embodiment of the present application provides a computer program product. When the computer program product runs on a device, the device can implement the steps in the above-mentioned method embodiments when the device is executed.
[0122] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / electronic device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0123] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0124] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0125] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
[0126] In addition, it should be noted that the various numerical numbers involved in this application (such as the terms "first", "second", "third", "fourth" and other various terminology labels (if any) in the specification and claims and the above-mentioned drawings) are only distinguished for the convenience of description and are not used to limit the scope of this application. The size of the sequence number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic.
[0127] The terms "including" and "having" and any variations thereof mean "including but not limited to" unless specifically emphasized otherwise. For example, a process, method, system, product or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed but may include other steps or units not explicitly listed or inherent to such process, method, product or apparatus.
[0128] In the embodiments of the present application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.
[0129] In the various embodiments of the present application, if there is no special explanation and logical conflict, the terms and / or descriptions between different embodiments are consistent and can be referenced to each other, and the technical features in different embodiments can be combined to form new embodiments according to their inherent logical relationships. The specific operating methods in the method embodiments of the present application can also be applied to device embodiments or system embodiments.
Claims
1. A method for setting a screen refresh rate, applied to an electronic device, characterized in that: The method comprises: When a switching condition is met, a pre-generated set is used to detect whether there is a window in the foreground window of the electronic device that does not meet the preset condition; wherein the switching condition is used to trigger a switching operation, the switching operation is an operation of switching the refresh rate of the screen of the electronic device from a first refresh rate to a second refresh rate, the first refresh rate and the second refresh rate are different, and the preset condition includes: the foreground window is at least one of a hidden window, a minimized window, a system window, and a window of an application in a whitelist, the whitelist is used to record applications whose windows will not freeze or flicker when the screen refresh rate is switched, and the set maintains in real time information on windows in the foreground window of the electronic device that do not meet the preset conditions or information on windows that meet the preset conditions; In the case where there is no window that does not meet the preset condition, performing the switching operation; If there is a window that does not meet the preset condition, the switching operation is prevented.
2. The method according to claim 1, characterized in that In the case where information of windows in the foreground window of the electronic device that do not meet the preset condition is maintained in real time in the set, the detecting whether there is a window in the foreground window of the electronic device that does not meet the preset condition by using the pre-generated set includes: Obtaining the collection; When the set is empty, determining that there is no window in the foreground window that does not meet the preset condition; When the set is not empty, it is determined that there is a window in the foreground window that does not meet the preset condition.
3. The method according to claim 2, characterized in that The method further comprises: When the switching function is initialized, traverse the current foreground window and record the window in the foreground window that does not meet the preset condition in the set; The collection is updated in real time according to changes in the foreground window.
4. The method according to claim 3, characterized in that: The real-time updating of the set according to the change of the foreground window includes: The collection is updated in real time according to the monitored window minimization events and / or window switching events; wherein the window minimization event is used to indicate that the foreground window is minimized, or switched from a visible state to an invisible state, and the window switching event is used to indicate changes in the foreground window.
5. The method according to claim 4, characterized in that The real-time updating of the set according to the monitored window minimization event and / or window switching event includes: If it is determined according to the monitoring result that the first window in the foreground window is minimized or switched to an invisible state, determining whether the first window is recorded in the set; if the first window is recorded, deleting the first window recorded in the set; When it is determined according to the monitoring result that a second window is added to the foreground window, whether the second window meets the preset condition is determined; if the second window does not meet the preset condition, the second window is recorded in the set.
6. The method according to any one of claims 3 to 5, characterized in that The real-time updating of the set according to the change of the foreground window includes: The windows in the set are traversed at a preset time, and invisible windows are deleted from the set.
7. The method according to claim 6, characterized in that The traversing the windows in the set at a preset time includes: When an object destruction event is monitored, the windows in the collection are traversed, and the object destruction event is used to indicate that the application object is destroyed.
8. The method according to claim 1, characterized in that: In the case where information of windows in the foreground window of the electronic device that meet the preset condition is maintained in real time in the set, the detecting whether there is a window in the foreground window of the electronic device that does not meet the preset condition by using the pre-generated set includes: Acquire the set, wherein the set maintains information of windows in the foreground window of the electronic device that meet the preset conditions in real time; When the number of the foreground windows is the same as the number of windows in the set, determining that there is no window in the foreground window that does not meet the preset condition; When the number of the foreground windows is different from the number of windows in the set, it is determined that there is a window in the foreground window that does not meet the preset condition.
9. The method according to any one of claims 1 to 5, characterized in that The preset condition also includes: the foreground window is not located on the current desktop.
10. An electronic device, characterized in that: The electronic device includes: one or more processors, and a memory; The memory is coupled to the one or more processors, and the memory is used to store computer program codes, wherein the computer program codes include computer instructions, and the one or more processors call the computer instructions to enable the electronic device to perform the method as claimed in any one of claims 1 to 9.
11. A chip system, characterized in that: The chip system is applied to an electronic device, and the chip system includes one or more processors, and the one or more processors are used to call computer instructions so that the electronic device executes the method as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises instructions, which, when executed on an electronic device, enable the electronic device to perform the method as claimed in any one of claims 1 to 9.
Citation Information
Patent Citations
Screen refresh rate switching method and electronic equipment
CN111816139A