Window updating method of device, electronic device, and computer-readable storage medium

By acquiring the hierarchical structure and touch hotspots of each window in the device's display interface, and confirming and distributing touch events to the target window, the problem of mis-distribution when multiple windows are displayed in parallel is solved, achieving more efficient user interaction and low-power device operation.

CN123047819APending Publication Date: 2026-11-06SHENZHEN TINNO WIRELESS TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611023663.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-09
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

When multiple windows are displayed in parallel, existing technologies are prone to misdistributing touch events to windows that are at the top level but are not the user's intended operation, resulting in interaction logic that contradicts user expectations.

Method used

By acquiring the hierarchical structure and touch hotspots of each window in the display interface of the device, a hit test is performed in response to touch events to identify the target window, and the event is distributed to the target window, while updating the touch hotspots and hierarchical structure of the window.

Benefits of technology

It reduces the misdistribution of touch events when displaying multiple windows in parallel, lowers input event processing latency and device power consumption, and improves the predictability and smoothness of user interaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123047819A_ABST
    Figure CN123047819A_ABST
Patent Text Reader

Abstract

The application discloses a window updating method of a device, an electronic device and a computer readable storage medium, wherein the window updating method of the device comprises the following steps: acquiring a hierarchical structure of each window in a display interface of the device and a touch hot area of each window; in response to detecting a touch event, performing a hit test on the touch coordinates corresponding to the touch event and the touch hot area of each window, and confirming a target window of the touch event based on the hierarchical structure; distributing the touch event to the target window, and updating the touch hot area and the hierarchical structure of the window. Through the above method, the touch event is routed through the window hierarchical structure and the touch hot area, the probability of false touch and the response delay in a multi-window scenario are effectively reduced, and the interactive experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of touchscreen input technology, and in particular to a window update method for a device, an electronic device, and a computer-readable storage medium. Background Technology

[0002] With the increasing screen size and processing power of mobile terminal devices, multi-window and split-screen display modes have become standard features of mainstream operating systems. Taking Android as an example, the existing input event distribution mechanism mainly relies on the collaboration between the input scheduler and the window management service. After the system obtains a touch event, it performs a hit test based on the window stacking order and, combined with the current input focus status, routes the event to the target window.

[0003] However, the determination of the event target is highly dependent on the stacking order and the global focus state. When multiple windows are displayed in parallel, touch events are easily misdistributed to windows that are at the top level but are not the user's intended operation, resulting in the interaction logic contradicting the user's expectations. Summary of the Invention

[0004] This application provides a window update method for a device, an electronic device, and a computer-readable storage medium, which can reduce the misdistribution of touch events when multiple windows are displayed in parallel, reduce input event processing latency and device power consumption, and improve the predictability and smoothness of user interaction.

[0005] To address the aforementioned technical problems, this application provides a window update method, electronic device, and storage medium for a device, comprising: acquiring the hierarchical structure of each window in the display interface of the device, and the touch hotspot of each window; in response to detecting a touch event, performing a hit test between the touch coordinates corresponding to the touch event and the touch hotspot of each window, and identifying the target window of the touch event based on the hierarchical structure; distributing the touch event to the target window, and updating the touch hotspot and hierarchical structure of the window.

[0006] The steps of responding to a detected touch event by performing a hit test between the touch coordinates corresponding to the touch event and the touch hotspots of each window, and identifying the target window of the touch event based on the hierarchical structure, include: generating a set of hit windows based on the hit test in response to a detected touch event; traversing the hierarchical structure to determine the active window node currently having input focus, and / or determining the scope of the focus subtree currently in an active state; matching each hit window in the set of hit windows with the windows within the active window node and / or focus subtree scope, and determining the successfully matched window as the target window of the touch event.

[0007] The step of matching each hit window in the hit window set with windows within the active window node and / or focus subtree range, and determining the successfully matched window as the target window, includes: in response to the number of target windows being greater than or equal to two, obtaining the focus traversal order of each target window in the hierarchical structure, or obtaining the stacking order of each target window in the display interface; and selecting, based on the focus traversal order or stacking order, the window with the highest traversal order in the focus traversal order or the window with the highest stacking level in the display interface as the target window for the touch event.

[0008] The step of generating a set of hit windows based on a hit test in response to a detected touch event includes: in response to a detected touch event, obtaining the touch coordinates of the touch event; traversing the touch hotspots of each window in the display interface, determining the window corresponding to the touch hotspot where the touch coordinates fall as the hit window, and generating a set of hit windows.

[0009] The step of distributing touch events to a target window and updating the window's touch hotspots and hierarchy includes: updating the window's touch hotspots and hierarchy based on touch events in response to detecting at least one state change in the display interface, such as a window layout change, a hierarchy change, or the window's touch hotspots being marked as invalid.

[0010] The window layout includes at least one of the following: window display size, display coordinates, and stacking order in the display interface.

[0011] The steps of obtaining the hierarchical structure of each window in the display interface of the device, as well as the touch hotspot of each window, include: traversing the view tree of the device and extracting the layout information of each window in the display interface; and dividing the touch response area corresponding to each window as the touch hotspot based on the layout information.

[0012] The steps of obtaining the hierarchical structure of each window in the display interface of the device, as well as the touch hotspots of each window, also include: obtaining the hierarchical structure through the device's window management server.

[0013] To address the aforementioned technical problems, this application provides an electronic device, comprising: a memory and a processor coupled to each other, wherein the processor is configured to execute program instructions stored in the memory to implement the window update method of the device as described above.

[0014] To address the aforementioned technical problems, this application provides a computer-readable storage medium storing program data that can be executed to implement the window update method of the device as described above.

[0015] The beneficial effects of this application are as follows: This application provides a window update method for a device, which obtains the hierarchical structure of each window in the display interface of the device, as well as the touch hotspot of each window; in response to the detection of a touch event, performs a hit test between the touch coordinates corresponding to the touch event and the touch hotspot of each window, and identifies the target window of the touch event based on the hierarchical structure; distributes the touch event to the target window, and updates the touch hotspot and hierarchical structure of the window. By uniformly modeling the hierarchical structure and touch hotspot of the window and using it for routing decisions, the misdistribution of touch events in multiple windows is effectively reduced, the mis-touch and response errors caused by event misjudgment are reduced, and the processing overhead of invalid events is reduced, ensuring that the interface interaction state is always consistent with the user's expectations. Attached Figure Description

[0016] Figure 1 This is a flowchart illustrating one embodiment of the window update method for the device provided in this application; Figure 2 This is a flowchart illustrating another embodiment of the window update method for the device provided in this application; Figure 3 This is a schematic diagram of one embodiment of the electronic device provided in this application; Figure 4 This is a schematic diagram of an embodiment of the computer-readable storage medium provided in this application. Detailed Implementation

[0017] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0018] It should be noted that if the embodiments of this application involve directional indicators (such as up, down, left, right, front, back, etc.), the directional indicators are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicators will also change accordingly.

[0019] Furthermore, if the embodiments of this application involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.

[0020] Please see Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the window update method for the device provided in this application.

[0021] S11: Obtain the hierarchical structure of each window in the display interface of the device, as well as the touch hotspot of each window.

[0022] The device can be an electronic device running the Android system, such as smartphones, tablets, foldable screen devices, in-vehicle central control terminals, smart TVs, smartwatches, and other electronic devices. The device's window management server obtains the layer structure of each window on the device's display interface and retrieves the touch hotspots of each window based on the view tree and layout information of each window. The window management server can be the WindowManagerService component in the Android system, which maintains the focus tree structure, i.e., the hierarchical structure of each window. Touch hotspots are the logical areas within a window that can actually respond to touch events, such as the rectangular click area on a button control to trigger a click event, or the content area in a list item to respond to a swipe operation. Specifically, each window on the device's display interface registers or updates its window attributes with the window management server. The window management server aggregates information from all windows, constructs and continuously maintains a view tree data structure that represents the global state of the current display interface. The device system can send query requests to the window management server, which traverses its internally maintained view tree data structure to extract the hierarchical structure of each window and the relevant attribute information of each window node. The hierarchical structure can include unique identifiers for each window node, hierarchical links representing the parent-child navigation relationships between windows, focus subtree boundary information to limit the scope of input events, and pointers to active nodes currently possessing input focus permissions. Simultaneously, the layout information of each window at the current moment is extracted from the view tree maintained by the window management service, and the touch hotspots of each window are determined based on the layout information and the view tree. The layout information includes at least the window's display size, display coordinates, and stacking order on the display interface. The display coordinates define the starting position of the window's interactive area, and the display size defines the coverage area of ​​the window's interactive area. Specifically, based on the display coordinates and display size, the touch response area corresponding to the window in the display interface can be delineated, and this area can be designated as the window's touch hotspot. For windows with special shapes, the touch hotspot can be further defined as a non-rectangular area matching the actual interactive shape of the window, in conjunction with its area shape description parameters.

[0023] In a specific application scenario, the device display interface comprises three windows: the main application window (displaying the message list), a quick reply pop-up that floats above the interface, and the system status bar window. The device system sends a query request to the window management server to obtain the hierarchical structure and related attributes of the three windows. Specifically, this includes the node identifiers of the main application window, the quick reply pop-up, and the system status bar window; the hierarchical relationship of the quick reply pop-up as a child node of the main application window; the boundary of the currently active focus subtree rooted at the quick reply pop-up; and the pointer to the currently active node pointing to the input box within the quick reply pop-up. Simultaneously, it obtains the touch hotspots of each window, including the rectangular touch hotspot of the message list area in the main application window; the rectangular touch hotspot of the quick reply pop-up panel, the cursor activation hotspot of its internal text input box, and the circular click hotspot of the send button; and the rectangular touch hotspots of each icon button in the system status bar.

[0024] S12: In response to the detection of a touch event, perform a hit test between the touch coordinates corresponding to the touch event and the touch hotspots of each window, and identify the target window of the touch event based on the hierarchical structure.

[0025] After receiving a touch event, the device scheduler obtains the touch coordinates and performs a hit test against the touch hotspots of each window. Simultaneously, based on the hierarchical structure, it filters out target windows that both hit the touch hotspots and belong to the focus-related windows in the hierarchy. Touch events can be triggered upon initial contact with the screen surface, while sliding on the screen surface while maintaining contact, or by long-pressing or double-tapping the screen. Specifically, the device system extracts the touch coordinates of the touch point in the display interface coordinate system from the touch event and obtains the touch hotspots of each window in the current display interface. It can traverse the touch hotspots of each window sequentially from top to bottom, according to the stacking order or visual order of the windows on the display interface. For example, starting from the visually topmost window that obscures other windows, it checks layer by layer downwards, determining whether the obtained touch coordinates of each traversed window fall within its touch hotspot range. If the touch coordinates fall within the touch hotspot of a window, the window is considered hit. The window's identifier can be added to a temporarily constructed set of hit windows; alternatively, the window node can be marked, for example, the system can set the hit status flag within that window node to a valid state. Since windows may overlap in the interface, the same touch point may fall within the touch hotspots of multiple windows simultaneously, therefore the set of hit windows may contain one or more candidate windows. After completing the hit test, the device system traverses the windows or active window nodes within the focus subtree of each window's hierarchical structure to filter out the target window for the touch event. The focus subtree is a tree-like logical branch in the hierarchical structure rooted at the currently active focus scope node, typically corresponding to an interactive unit with an independent input context, such as a modal dialog box or an expanded drop-down menu panel. An active window node is a specific window node marked as currently having input focus, typically a specific input control, such as a text input box waiting for user input or a button awaiting confirmation. Specifically, the system can sequentially read the identifier of each hit window, perform a matching check for each hit window, and determine whether the identifier of the hit window matches the identifier of the currently active window node with input focus, or whether the hit window is located within the currently active focus subtree. If the above judgment conditions are met, it is confirmed as the target window of the touch event. When the number of target windows is greater than or equal to two, the system can select the window with the highest priority as the target window based on the focus traversal order of the target windows in the hierarchical structure or based on the stacking order. The focus traversal order is generated based on the traversal logic of the focus subtree (such as depth-first traversal) and reflects the hierarchical relationship of the windows in the focus subtree; the stacking order refers to the order in which the windows are stacked in the Z-axis direction of the display interface, with the higher the layer of the window, the higher its stacking order.

[0026] S13: Distribute the touch event to the target window and update the window's touch hotspots and hierarchy.

[0027] After the device system distributes touch events to the finally determined target window, the target window will respond to the touch events by performing corresponding operations and updating the touch hotspots and hierarchical structure of the target window. Specifically, the touch hotspots and hierarchical structure can be updated based on preset conditions, such as changes in window layout within the display interface, changes in hierarchical structure, or when a touch hotspot is marked as invalid. Specifically, after the touch event is distributed to the target window, the target window executes corresponding business logic, such as window resizing, position movement, visibility changes, popping up a new window, or closing the current window. When the device triggers preset conditions, the device system updates the touch hotspots; for example, when a layout change is detected, the touch hotspots of the target window are immediately recalculated. The hierarchical structure change signal can be synchronized with the focus tree to ensure that the touch hotspots match the focus tree after the hierarchical structure update. A hotspot invalidation marking mechanism can be set to mark a hotspot as invalid and trigger an update when the hotspot calculation fails. Furthermore, in scenarios with high real-time requirements, the system synchronously triggers updates to the touch hotspots and hierarchical structure the instant the target window responds to a touch event and completes its business logic execution. In performance-sensitive or animation-intensive scenarios, the system suspends the update request and registers it as an idle task after the target window responds to a touch event. The system then executes the update operations on the touch hotspots and hierarchical structure when the device system's message queue enters an idle state or when there is remaining processing time after the current frame is rendered.

[0028] Through the above steps, this embodiment combines window hierarchy and touch hotspot for hit testing, so that touch events are only distributed to the target window that hits the hotspot and is the focus-related window. This reduces event mis-distribution when multiple windows are displayed in parallel. Distributing events only to the window that hits the hotspot and is the focus-related window helps to reduce input event processing latency and device power consumption. Furthermore, the touch hotspot is updated synchronously with the layout and focus state, improving the predictability of user interaction and the smoothness of the experience.

[0029] Please see Figure 2 , Figure 2 This is a flowchart illustrating another embodiment of the window update method for the device provided in this application. S21: Obtain the hierarchical structure of each window in the display interface of the device, as well as the touch hotspot of each window.

[0030] This step is the same as step S11 above. Please refer to the relevant description of step S11 for details, which will not be repeated here.

[0031] S22: In response to the detection of a touch event, generate a set of hit windows based on a hit test.

[0032] The system scheduler detects a touch event, obtains the touch coordinates of the touch event in the display interface coordinate system, and then traverses the touch hotspots of each window in the current display interface, determining whether the touch coordinates fall within the touch hotspot of each window, and adding the matched windows to the set of matched windows. The system can use a rectangle-based collision detection algorithm to quickly match touch coordinates with touch hotspots. Specifically, the system abstracts the touch hotspot of each window as a rectangular region, and completes the hit determination by comparing whether the horizontal and vertical axis values ​​of the touch coordinates fall within the horizontal and vertical axis intervals of the rectangular region, respectively. For windows with non-rectangular hotspots, the system can first perform a quick initial screening using a rectangular bounding box, and then combine the window's region shape description parameters for a precise path inclusion determination.

[0033] Furthermore, to optimize traversal efficiency, a quadtree data structure can be used to handle complex interfaces. The system can also prioritize checking the child windows of active windows with input focus based on window hierarchy relationships to accelerate the matching process. Specifically, the system pre-divides the display interface recursively into four quadrants and inserts the touch hotspots of each window into the corresponding quadtree nodes based on their spatial positions. During hit testing, the system only needs to quickly locate the corresponding node in the quadtree and the subset of hotspots associated with its ancestor nodes based on the spatial position of the touch coordinates, thus avoiding a complete traversal of all windows. Moreover, the system does not strictly traverse all windows in hierarchical order during hit testing; it can first obtain the active window node currently with input focus or windows within the current active focus subtree in the hierarchy structure, prioritizing the hit determination of the touch hotspots of these windows to improve traversal efficiency.

[0034] In a specific application scenario, a user touches the "Voice Call" button in the menu window. The device's touchscreen hardware captures this touch action, encapsulates the raw touch data into a touch event, and extracts the touch coordinates (horizontal and vertical axis values) of the touch point in the display interface coordinate system. The system then retrieves touch hotspot data for each window in the current display interface from the window management service, including the overall content hotspot of the content browsing window, the circular hotspot of the shortcut buttons, the rectangular hotspot of the operation menu panel, and the rectangular hotspots of its three internal option buttons. The system continues to use a quadtree data structure for spatial indexing of these hotspots and employs a rectangle-based collision detection algorithm to compare whether the horizontal and vertical axis values ​​of the touch coordinates fall within the horizontal and vertical axis intervals of each hotspot. After determination, the touch coordinates of the touch point simultaneously fall within the touch hotspots of the following windows: the rectangular hotspot of the operation menu panel and the rectangular hotspot of the "Voice Call" button. The system then adds the identifiers of these two matched windows to a temporarily constructed set of matched windows.

[0035] S23: Traverse the hierarchical structure, determine the active window node that currently has input focus, and / or determine the scope of the focus subtree that is currently active; match each hit window in the hit window set with the windows in the active window node and / or focus subtree scope, and determine the successfully matched window as the target window of the touch event.

[0036] After generating the set of hit windows, the device system traverses the hierarchical structure to identify the active window node currently holding input focus, and / or to identify the currently active focus subtree range. Specifically, it reads the specific node currently marked as the focus window in the hierarchical structure as the currently active window node, and / or the system can use a depth-first traversal of the focus window hierarchy to locate the currently marked active focus scope node in real time, and determine the tree branch formed by this node and all its descendant nodes as the currently active focus subtree range. Furthermore, when the window focus changes, the system can automatically trigger a synchronous update of the focus subtree range to ensure that the permission baseline data always remains consistent with the current interface state. Subsequently, the system matches each window in the hit window set with windows within the active window node or focus subtree range to ensure that the target window simultaneously satisfies both the hit hotspot and focus-related conditions. Specifically, the system determines whether the hit window is the currently active window node itself by comparing whether the window identifier of the hit window is consistent with the window identifier of the currently focused window; and / or the system determines whether the hit window is within the scope of the currently active focus subtree by checking whether the window identifier of the hit window is included in the node list of the focus subtree, or by determining whether the position of the hit window in the focus window hierarchy belongs to the descendant node of the currently active focus scope node; finally, the system determines the successfully matched window as the candidate target window.

[0037] When there is only one candidate target window, that candidate target window becomes the target window. When there are two or more candidate target windows, the window with the highest priority can be selected as the target window based on the focus traversal order or the stacking order. Specifically, the system can use a depth-first traversal of the focus window hierarchy to dynamically generate the focus traversal order of each candidate target window within the currently active focus subtree. After the traversal is complete, the system generates an ordered sequence of window nodes, and the order of each window in this sequence is its focus traversal order. The system selects the window with the highest position in this focus traversal order sequence from multiple candidate target windows as the final target window. Alternatively, the system can obtain the stacking order of each candidate target window in the display interface, for example, by determining the stacking order based on the window's Z-order value. The system reads the Z-order value maintained by each candidate target window in the window management service, which represents the stacking level of the window in the direction perpendicular to the screen in the display interface. A window with a larger Z-order value appears closer to the user and is located on the top layer. The system selects the window with the largest Z-order value from multiple candidate target windows as the final target window. The system can also quickly determine the stacking order based on the window's display coordinates. For example, the stacking relationship can be inferred by comparing the display coordinate ranges of each candidate target window in the display interface. For overlapping windows within the same focus subtree, windows whose display coordinate range includes other windows or whose display coordinate range is visually closer to the front area of ​​the screen are judged to have higher stacking priority. The system selects the window that is judged to be the top layer based on the display coordinates from multiple candidate target windows as the final target window.

[0038] S24: In response to detecting at least one state change in the display interface, such as a window layout change, a hierarchy change, or a window's touch hotspot being marked as invalid, update the window's touch hotspot and hierarchy based on the touch event.

[0039] After confirming the target window, touch events are distributed to the target window and corresponding operations are executed. Simultaneously, changes in the interface state caused by the target window's response to touch events are detected. When preset conditions are detected, the touch hotspot and hierarchy of the target window are updated. If, after the target window responds to a touch event, any window in the displayed interface undergoes a size adjustment, display position shift, visibility change, or stacking order change, the system determines that the window layout change conditions are met, triggering an update operation. The system then retraces the view tree maintained by the window management service, extracts the layout information of the affected window at the current moment, and redefines the touch response area of ​​that window as the updated touch hotspot based on the updated layout information. If the hierarchical structure changes, such as the current active node in the hierarchical structure shifting or the range of the current active focus subtree switching, the system determines that the hierarchical structure conditions are met and triggers a synchronous update operation on the hierarchical structure of the focus window. The system updates the pointers of the active nodes in the hierarchical structure to point to the new focus window, redetermines the range of the current active focus subtree, and changes the relative order of the window nodes in the hierarchical structure. For example, switching the focus subtree range changes the node traversal order, inserting or removing the window node in the hierarchical structure when the window is created or destroyed, and changes in the window stacking order trigger a synchronous adjustment of the node order in the hierarchical structure. At the same time, the system ensures that the updated hierarchical structure matches the current touch hotspot distribution state of the interface. If a window's touch hotspot becomes unusable due to window destruction, control disabling, missing layout information, or calculation errors, the system determines that the touch hotspot failure condition is met, triggering a failure marking and update operation. The system marks the touch hotspot corresponding to the failed window as in a failed state and triggers a recalculation of the touch hotspots within the focus subtree of that window. If the calculation is successful, the failed hotspot replaces the newly generated hotspot; if the calculation still fails, the touch hotspot is removed from the hotspot management list. The window can be the target window or another window within the display interface. In practical applications, after the target window responds to a touch event, it may trigger multiple state changes simultaneously or sequentially. For example, when a user clicks a button to trigger a dialog box pop-up, both the window layout and focus change occur. The system can aggregate these simultaneous changes, initiating an update upon detecting the first trigger condition, or performing a batch update after all changes are completed.

[0040] Through the above steps, this embodiment introduces focus permission verification during touch event routing by unifying the window hierarchy and touch hotspot decisions. This significantly improves the problem of multi-window touch events being incorrectly distributed to windows that are not intended by the user. Touch events are only directed to windows that are both within the hit hotspot and associated with the current focus or focus subtree, avoiding invalid traversal and processing of irrelevant windows by the system. In addition, the touch hotspot can be adjusted synchronously with changes in interface layout and focus state, ensuring that the interactive feedback is highly consistent with the user's operation expectations, thus improving the smoothness and stability of the overall operation experience.

[0041] Based on the same concept, this application also proposes an electronic device capable of executing the window update method of any of the above embodiments. Please refer to [link to relevant documentation]. Figure 3 , Figure 3 This is a schematic diagram of an embodiment of the electronic device provided in this application. The electronic device includes a processor 31 and a memory 32.

[0042] The processor 31 is used to execute the program instructions stored in the memory 32 to implement the window update method steps of any of the above-described devices. In a specific implementation scenario, the electronic device may include, but is not limited to, a microcomputer or a server. In addition, the electronic device may also include mobile devices such as laptops and tablets, which are not limited here.

[0043] Specifically, processor 31 controls itself and memory 32 to implement the steps of any of the above embodiments. Processor 31 may also be referred to as a CPU (Central Processing Unit). Processor 31 may be an integrated circuit chip with signal processing capabilities. Processor 31 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or any conventional processor. Furthermore, processor 31 may be implemented using integrated circuit chips.

[0044] Based on the same concept, this application also proposes a computer-readable storage medium, please refer to... Figure 4 , Figure 4This is a schematic diagram of an embodiment of the computer-readable storage medium provided in this application. The computer-readable storage medium 40 stores at least one program data 41, which is used to implement any of the methods described above. In one embodiment, the computer-readable storage medium 40 includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0045] In the several embodiments provided in this application, it should be understood that the disclosed methods and apparatus can be implemented in other ways. For example, the apparatus implementations described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0046] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0047] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0048] If the integrated unit is implemented as 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 technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium.

[0049] The above are merely embodiments of this application and do not limit the scope of this patent application. Any equivalent structural or procedural changes made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of this application.

Claims

1. A method for updating a device's window, characterized in that, include: Obtain the hierarchical structure of each window in the display interface of the device, as well as the touch hotspot of each window; In response to the detection of a touch event, the touch coordinates corresponding to the touch event are matched with the touch hotspots of each window for a hit test, and the target window of the touch event is identified based on the hierarchical structure. The touch event is distributed to the target window, and the touch hotspot and the hierarchy of the window are updated.

2. The window update method according to claim 1, characterized in that, The step of responding to a detected touch event by performing a hit test between the touch coordinates corresponding to the touch event and the touch hotspots of each of the windows, and identifying the target window of the touch event based on the hierarchical structure, includes: In response to the detection of the touch event, a set of hit windows is generated based on the hit test; Traverse the hierarchical structure to determine the active window node that currently has input focus, and / or determine the range of the currently active focus subtree; Each hit window in the hit window set is matched with the windows in the active window node and / or the focus subtree range, and the successfully matched window is determined as the target window of the touch event.

3. The window update method according to claim 2, characterized in that, The step of matching each hit window in the hit window set with windows within the active window node and / or the focus subtree range, and determining the successfully matched window as the target window, includes: In response to the number of target windows being greater than or equal to two, the focus traversal order of each target window in the hierarchy structure is obtained, or the stacking order of each target window in the display interface is obtained; Based on the focus traversal order or the stacking order, the window that appears first in the focus traversal order or the window that appears first in the stacking order in the display interface is selected as the target window for the touch event.

4. The window update method according to claim 2, characterized in that, The step of generating a set of hit windows based on the hit test in response to detecting the touch event includes: In response to detecting the touch event, the touch coordinates of the touch event are obtained; The touch hotspots of each window in the display interface are traversed, and the window corresponding to the touch hotspot where the touch coordinates fall is determined as the hit window, and the hit window set is generated.

5. The window update method according to claim 1, characterized in that, The step of distributing the touch event to the target window and updating the touch hotspot and the hierarchy of the window includes: In response to detecting at least one state change in the display interface, such as a change in window layout, a change in hierarchy, or a window's touch hotspot being marked as invalid, the touch hotspot and hierarchy of the window are updated based on the touch event.

6. The window update method according to claim 5, characterized in that, The window layout includes at least one of the following: window display size, display coordinates, and stacking order of the display interface.

7. The window update method according to claim 1, characterized in that, The step of obtaining the hierarchical structure of each window in the display interface of the device, and the touch hotspot of each window, includes: Traverse the view tree of the device and extract the layout information of each window in the display interface; The touch response area corresponding to each window is divided based on the layout information and is used as the touch hot zone.

8. The window update method according to claim 1, characterized in that, The step of obtaining the hierarchical structure of each window in the display interface of the device, and the touch hotspot of each window, further includes: The hierarchical structure is obtained through the window management server of the device.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor coupled to each other, the processor being configured to execute program instructions stored in the memory to implement the window update method for the target device as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program data that can be executed to implement the window update method for the target device as described in any one of claims 1 to 8.