Window processing method and device, equipment and storage medium
By creating drag-and-drop contexts for window tabs and performing polling tracking, the problem of interrupted window tab drag-and-drop operations was solved, achieving continuity in tab separation and merging.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-07
AI Technical Summary
In existing technologies, window tabs cannot be continuously separated and merged during drag-and-drop operations, causing the operation process to be interrupted.
By creating a drag-and-drop context for the dragged tab, recording the entire process status information of the drag-and-drop operation, and establishing a polling mechanism for continuous tracking, the drag-and-drop context is seamlessly updated when migrating across windows.
This allows users to continuously separate and merge tabs with a single drag-and-drop operation, improving the smoothness of operation and avoiding interruptions in the operation process found in related technologies.
Smart Images

Figure CN121807208A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a window processing method and device, equipment and storage medium. BACKGROUND
[0002] Tab Drag technology is an important interaction mode in modern graphical user interface, and is widely used in web browsers, code editors, terminal emulators and other application programs. The core functions of the Tab Drag technology include tab separation (i.e. dragging a tab from a current window to create a new independent window corresponding to the dragged tab) and tab merging (i.e. dragging a tab of an independent window to the tab bar of another target window to merge the dragged tab into the target window).
[0003] Currently, the related technology mainly realizes the movement of tabs between different windows based on the native drag-and-drop mechanism provided by the operating system. However, in the above related technology, after the tab is separated from the source window, the original system drag-and-drop session will automatically end. At this time, the newly created window for the dragged tab cannot be continuously dragged and moved by the user. The user needs to re-select the above newly created window as a drag object to continue the next operation (such as dragging the above newly created window to another window for tab merging), which causes the interruption of the drag operation process and makes the above related technology unable to support the user to continuously realize tab separation and tab merging and other tab drag functions through one drag operation. SUMMARY
[0004] Therefore, the present application provides a window processing method, device, equipment and storage medium, which creates a drag context for the dragged tab that can record the full-process state information of the current drag operation, and establishes a polling mechanism to continuously track the operation state of the current drag operation, so as to ensure that the dragged tab can seamlessly update the drag context when migrating across windows (i.e. performing tab separation and tab merging), thereby enabling the user to continuously realize tab separation and tab merging and other tab drag functions through one drag operation.
[0005] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the following preferred embodiments are described in detail below, and the accompanying drawings are described as follows.
[0006] In a first aspect, the embodiments of the present application provide a window processing method applied to a remote control client, the remote control client providing a source window displaying a video stream of a controlled terminal device, the source window containing at least one tab, the tab being associated with the video stream; the window processing method comprising: In response to a drag operation on a target tab in the source window, a drag context corresponding to the target tab is created, and an operation state of the drag operation is polled at a preset frequency to obtain a polling result; the drag context includes at least one of the target tab, a window controller corresponding to the target tab, and operation state information of the drag operation; According to the polling result, the operation state information of the drag operation recorded in the drag context is updated to determine current operation state information of the drag operation; According to the current operation state information, a target window processing instruction matching the current operation state information is determined from a plurality of window processing instructions; the plurality of window processing instructions at least include a tab separation instruction and a tab combination instruction; According to an execution result of the target window processing instruction, the window controller recorded in the drag context is updated to determine an updated drag context; In response to an end of the drag operation, the polling is stopped and the drag context is eliminated.
[0007] In a second aspect, an embodiment of the present application provides a window processing apparatus applied to a remote control client, the remote control client providing a source window displaying a video stream of a controlled terminal device, the source window containing at least one tab, the tab being associated with the video stream; the window processing apparatus comprises: A first response module is configured to, in response to a drag operation on a target tab in the source window, create a drag context corresponding to the target tab, and poll an operation state of the drag operation at a preset frequency to obtain a polling result; the drag context includes at least one of the target tab, a window controller corresponding to the target tab, and operation state information of the drag operation; A first update module is configured to, according to the polling result, update the operation state information of the drag operation recorded in the drag context to determine current operation state information of the drag operation; An instruction determination module is configured to, according to the current operation state information, determine a target window processing instruction matching the current operation state information from a plurality of window processing instructions; the plurality of window processing instructions at least include a tab separation instruction and a tab combination instruction; A second update module is configured to, according to an execution result of the target window processing instruction, update the window controller recorded in the drag context to determine an updated drag context; A second response module is configured to, in response to an end of the drag operation, stop the polling and eliminate the drag context.
[0008] In a third aspect, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the window processing method when executing the computer program.
[0009] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program, and the computer program, when executed by a processor, implements the steps of the window processing method.
[0010] The technical solutions provided by the embodiments of the present application can include the following beneficial effects: The window processing method, device, electronic device, and storage medium provided by the embodiments of the present application can ensure that the dragged tab can seamlessly update the drag context when performing cross-window migration (i.e., tab separation and tab combination), so that the user can continuously realize tab separation and tab combination and other tab dragging functions through one drag operation. BRIEF DESCRIPTION OF DRAWINGS
[0011] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be considered as limiting the scope. For those skilled in the art, other related drawings can also be obtained without creative labor.
[0012] Figure 1 A flowchart of a window processing method provided by an embodiment of the present application is shown; Figure 2 A flowchart of a method for implementing tab combination function provided by an embodiment of the present application is shown; Figure 3 A flowchart of a method for implementing tab separation function provided by an embodiment of the present application is shown; Figure 4 A flowchart of a window self-adaptive adjustment method provided by an embodiment of the present application is shown; Figure 5 A structural diagram of a window processing device provided by an embodiment of the present application is shown; Figure 6 A structural diagram of an electronic device 600 provided by an embodiment of the present application is shown. DETAILED DESCRIPTION
[0013] In order to make the purposes, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. It should be understood that the drawings in the present application serve only the purpose of illustration and description, and do not serve to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in the present application show the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowcharts can not be implemented in sequence, and the steps without logical context relationship can be reversed in sequence or implemented simultaneously. In addition, one or more other operations can be added to the flowcharts or one or more operations can be removed from the flowcharts under the guidance of the content of the present application.
[0014] In addition, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0015] It should be noted that the term "comprise" will be used in the embodiments of the present application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.
[0016] In one window processing method in one of the embodiments of the present application, the method can run in a target control terminal, and one or more windows are displayed in a graphical user interface of the target control terminal; as an optional embodiment, different windows can be from different application programs (for example, multiple windows can be from multiple different web browsers, code editors, terminal emulators, and other application programs), and at least one tab can be included in a window (the tab is displayed in a tab bar of the window), and different tabs in the same window are respectively associated with different tab contents in the application program to which the window belongs (for example, multiple tabs are displayed in a window a corresponding to a browser A, and each tab is associated with a web page or a document in the browser A).
[0017] In one window processing method in one of the embodiments of the present application, the method can also run in a remote control client, and the remote control client runs in a remote control platform, and the remote control client provides one or more windows in the remote control platform (that is, one or more windows are displayed in a graphical user interface provided by the remote control client).
[0018] Here, when the remote control platform remotely controls multiple terminal devices, each window provided by the remote control client can correspond to a controlled terminal device (i.e., the terminal device remotely controlled by the aforementioned remote control platform). In the remote control client, each window can contain at least one tab (the tab is displayed in the tab bar of the window). The tab is associated with the video stream of the controlled terminal device to which the window belongs (unlike the tab content in browsers and other applications, which is a static webpage or document, in the remote control scenario, the tab content in the remote control window corresponding to the controlled terminal device is a continuously decoded and rendered video stream).
[0019] Here, when a remote control platform remotely controls a terminal device, each window provided by the remote control client can correspond to a display device in the controlled device (i.e., the terminal device remotely controlled by the remote control platform). For example, if there are multiple monitors in the controlled device, each window provided by the remote control client corresponds to one monitor in the controlled device. In the remote control client, each window can contain at least one tab (the tab is displayed in the tab bar of the window), and the tab is associated with the video stream of the display device to which the window belongs (for example, window A corresponds to monitor a in the controlled device, and the tab in window A is associated with the video stream of monitor a).
[0020] To facilitate understanding of the embodiments of this application, a window processing method, apparatus, device, and storage medium provided in the embodiments of this application will be described in detail below.
[0021] Reference Figure 1 As shown, Figure 1 The diagram illustrates a flowchart of a window processing method provided in an embodiment of this application. The window processing method is applied to a remote control client, which provides a source window displaying a video stream from a controlled device. The source window includes at least one tab associated with the video stream. The window processing method includes steps S101-S105; specifically: S101, in response to a drag operation on a target tab in the source window, a drag context corresponding to the target tab is created, and the operation status of the drag operation is polled at a preset frequency to obtain a polling result.
[0022] Here, the source window is a window (i.e., the source window contains at least one tab) displayed on a graphical user interface of the target control terminal, and when the remote control client is running on the target control terminal, the source window can be a window provided by the remote control client to display a video stream of a controlled terminal device, and the tab contained in the source window is associated with the video stream. At this time, the source window can correspond to a controlled terminal device, or to a display device in the controlled terminal device. The embodiments of the present application do not make any limitation in this regard.
[0023] Here, the target tab indicates a tab in the source window that is dragged by the user. On different types of target control terminals, the user can trigger the dragging operation on the target tab in different ways. The embodiments of the present application do not make any limitation on the specific triggering manner of the dragging operation.
[0024] For example, when the target control terminal is a personal computer, the user can trigger the dragging operation on the target tab by using a mouse. The target control terminal can create a drag context corresponding to the target tab in response to a mouse click operation on the target tab (i.e., the dragging operation at this time can be a mouse click operation), and poll the state of the mouse (such as the state of the mouse keys, the coordinates of the mouse on the graphical user interface, etc.) at a preset frequency.
[0025] For example, when the target control terminal is a target electronic device (such as a tablet computer or a mobile phone) with a touch screen, the user can trigger the dragging operation on the target tab by touching the target tab with a finger. The target control terminal can create a drag context corresponding to the target tab in response to a touch operation on the target tab (i.e., the dragging operation at this time can be a touch operation), and poll the state of the touch (such as the contact state of the finger with the graphical user interface, the touch position of the finger on the graphical user interface, etc.) at a preset frequency.
[0026] Here, the drag context is a data structure that records the complete state information of the dragging operation, and is also the core data structure throughout the life cycle of the dragging operation. The drag context includes at least one of the following information: the target tab (i.e., the dragged tab object), the window controller corresponding to the target tab (i.e., a controller reference pointing to the window where the target tab is located, used to access the title bar, tab bar, connection manager, etc. of the window where the target tab is located), and the operation state information of the dragging operation.
[0027] It should be noted that the operation state information can include, but is not limited to, the starting operation state information related to the starting trigger position of the dragging operation and the dynamic operation state information related to the real-time dragging state of the dragging operation in the continuous dragging process.
[0028] Specifically, the initial operation state information can include but is not limited to: a drag starting point (i.e., a starting drag position indicated by the drag operation on the graphical user interface, for example, when the drag operation is a mouse click operation, the drag starting point can be the screen coordinates corresponding to the mouse click), and a drag internal offset (used to determine the relative position relationship between the drag position and the target tab being dragged during the drag operation, for example, when the drag operation is a mouse click operation, the drag internal offset can be the local position coordinates of the mouse click position within the target tab).
[0029] Specifically, the dynamic operation state information can include but is not limited to: a current drag position indicated by the drag operation on the graphical user interface (for example, when the drag operation is a mouse click operation, the current drag position can be the current mouse position indicated by the mouse on the graphical user interface), and a tab drag position rectangle (i.e., the actual position and size rectangle of the target tab when being dragged, used for collision detection and visual feedback when executing the tab merging instruction or the tab separation instruction).
[0030] Here, when step S101 is executed, the target control terminal can start a timer, so that the started timer can poll the operation state of the drag operation at a preset frequency (for example, 60 times per second) (for example, the timer continuously polls the current mouse position and mouse button state indicated by the mouse on the graphical user interface at a frequency of 60 times per second), wherein the specific value of the preset frequency can be flexibly adjusted according to actual needs.
[0031] It should be noted that, by using the above polling detection mechanism provided by the embodiments of the present application, the limitation of the related technology (i.e., the native drag-and-drop mechanism provided by the operating system) on cross-window event listening can be bypassed, so that the operation state (such as the mouse state) of the drag operation can be globally and real-time perceived; in addition, the polling frequency (i.e., the preset frequency) needs to be matched with the drag event processing frequency, too low will cause drag response delay, too high will occupy too much CPU resources affecting video stream rendering; at the same time, the timer needs to be stopped immediately when the drag operation is over, in order to avoid resource leakage.
[0032] In the embodiment of the present application, at the starting moment of the user dragging the target tab, the target control terminal creates a drag context for recording the complete state information of the current drag operation in response to the drag operation on the target tab. Before the end of the drag operation (e.g., before the user releases the mouse button), the target control terminal continuously updates the operation state information of the drag operation recorded in the drag context based on the polling result (mainly updates the dynamic operation state information). The target control terminal also updates the window controller recorded in the drag context in real time according to the current window where the dragged tab object (i.e., the target tab) is located, so as to ensure that the dragged tab (i.e., the target tab) can be seamlessly updated when performing cross-window migration (i.e., tab separation and tab merging).
[0033] S102, updating the operation state information of the drag operation recorded in the drag context according to the polling result, to determine the current operation state information of the drag operation.
[0034] Specifically, as can be known from the related description in step S101, in the embodiment of the present application, based on the existence of the polling mechanism, the target control terminal can continuously update the operation state information of the drag operation recorded in the drag context based on the polling result (mainly update the dynamic operation state information), so as to obtain the current operation state information of the drag operation (i.e., the current drag position indicated by the drag operation on the graphical user interface, the current position of the target tab on the graphical user interface, and the size rectangle, etc.).
[0035] S103, determining a target window processing instruction matching the current operation state information from a plurality of window processing instructions according to the current operation state information.
[0036] Here, the plurality of window processing instructions at least include a tab separation instruction (i.e., an instruction for indicating to separate the target tab from the source window to form a new independent window) and a tab merging instruction (i.e., an instruction for indicating to merge the target tab into the tab bar of another window).
[0037] Specifically, according to the current operation state information, the target control terminal can determine the current drag position (e.g., the current mouse position) indicated by the drag operation on the graphical user interface, and can also determine the current position of the target tab on the graphical user interface. Based on this, the target control terminal can determine whether the target tab is dragged into the merging trigger area of a window (i.e., determine whether the tab merging instruction needs to be executed for the target tab) from all the windows displayed on the graphical user interface according to the current drag position or the current position of the target tab.
[0038] Specifically, according to the current operation state information, the target control terminal can further determine the moving direction and distance of the drag operation between the current time and the starting time (i.e. the triggering time of the drag operation) by comparing the difference between the current operation state information and the starting operation state information. Based on this, the target control terminal can determine whether the moving direction and distance of the drag operation satisfy the tab separation condition (i.e. the triggering condition of the tab separation instruction) of the target tab, and further execute the tab separation instruction on the target tab (i.e. separate the target tab from the source window and create a new window as the new window where the separated target tab is located) when the tab separation condition is satisfied.
[0039] It should be noted that when the source window only contains the target tab (i.e. when the source window belongs to a single-tab window), the window processing instruction that the target control terminal can execute on the target tab is the tab merging instruction and the window moving instruction, and does not include the tab separation instruction (equivalent to the plurality of window processing instructions can also include the window moving instruction); that is, when the source window belongs to a single-tab window, if the target control terminal determines that the target tab is not dragged into the merging triggering area of a window, the target control terminal can execute the window moving instruction for the source window (i.e. control the source window to move on the graphical user interface following the drag operation).
[0040] S104, updating the window controller recorded in the drag context according to the execution result of the target window processing instruction, and determining the updated drag context.
[0041] Here, according to the content of the foregoing step S101, the window controller corresponding to the target tab refers to the controller reference to the window where the target tab is located, which is used to access the title bar, tab bar, connection manager and other modules of the window where the target tab is located.
[0042] Specifically, when the target tab executes the window moving instruction (i.e. the source window belongs to a single-tab window, and the target window processing instruction belongs to the window moving instruction), based on the fact that the window where the target tab is located is still the source window at this time, the target control terminal can keep the window controller recorded in the drag context unchanged (equivalent to when the drag context is created, based on the fact that the target tab is located in the source window at the creation time, the window controller corresponding to the target tab recorded in the created drag context is the source window controller).
[0043] Specifically, when the target tab is executed with the above-mentioned tab separation instruction, if the window where the separated target tab is recorded as a newly created window, based on the fact that the window where the target tab is located at this time is the newly created window, the target control terminal can update the window controller recorded in the drag context to the newly created window controller corresponding to the newly created window.
[0044] Specifically, when the target tab is executed with the above-mentioned tab separation instruction, if the window where the separated target tab is recorded as a newly created window, based on the fact that the window where the target tab is located at this time is the newly created window, the target control terminal can update the window controller recorded in the drag context to the newly created window controller corresponding to the newly created window.
[0045] It should be noted that based on the fact that the window controller is a core window control module for accessing the title bar, tab bar, connection manager and other modules of the window where the tab is located, therefore, ensuring that the window controller recorded in the drag context always matches the current window where the target tab is located is also a prerequisite and cornerstone for ensuring the correctness of various operations (such as coordinate calculation operations of tab position, mouse position, and state access operations of tab bar, title bar size and position) that need to be performed with the help of the window controller in the subsequent dragging process.
[0046] Based on this, regardless of the specific type of target window processing instruction executed, in the embodiments of the present application, by executing step S104, the window controller recorded in the drag context can always be consistent with the window controller corresponding to the current window where the target tab is located (for example, after the target tab is merged into the target window, the window controller recorded in the drag context will be updated to the target window controller corresponding to the target window, instead of the source window controller corresponding at the initial moment) in the case that the current dragging operation has not ended, thereby ensuring the accuracy of various operations that need to be performed with the help of the window controller in the subsequent dragging process.
[0047] S105, in response to the end of the drag operation, stop performing the polling and eliminate the drag context.
[0048] Here, in response to the end of the above-mentioned drag operation (for example, detecting that the mouse button is released), the target control terminal can stop the timer for performing the polling, and perform a drag restoration animation, visually restore the target tab being dragged and the source title bar view of the source window (the title bar view reference obtained through the source window controller, used to handle layout updates for horizontal dragging), eliminate the above-mentioned drag context corresponding to the current drag operation, and release related resources.
[0049] It should be noted that, before the drag-and-drop operation ends, in this embodiment, based on the aforementioned polling detection mechanism and the created drag-and-drop context, the target control terminal can continuously update the operation state of the drag-and-drop operation and the window controller corresponding to the target tab recorded in the drag-and-drop context according to the polling results. This allows bypassing the limitations of related technologies (i.e., based on the native drag-and-drop mechanism provided by the operating system) on cross-window event listening (i.e., the system drag-and-drop protocol cannot continuously track the mouse position and key state, making it impossible for related technologies to perceive changes in the operation state of the drag-and-drop operation in real time). This enables global real-time perception of the operation state of the drag-and-drop operation (such as the mouse state), thereby ensuring that the dragged tab can seamlessly update the aforementioned drag-and-drop context when it is migrated across windows (i.e., tab separation and tab merging). (This is equivalent to using the real-time updated drag-and-drop context as a continuous throughout the entire drag-and-drop process.) The core data of the operation lifecycle, when tabs migrate across windows, can maintain the consistency and continuity of the drag session based on the real-time updated drag context, and can correctly execute various window processing instructions triggered by the user based on continuous drag operations. This allows users to continuously achieve tab separation and tab merging functions through a single drag operation (equivalent to the user being able to control the separation of the target tab from the source window and the merging of the separated target tab with the target window based on continuous drag operations without ending the drag operation). This overcomes the technical defects existing in related technologies, and simplifies the operation steps of realizing tab separation and tab merging from "releasing the mouse after separation → re-grabbing the tab → drag merging" in related technologies to "continuously realizing tab separation and tab merging in a single drag operation" in the embodiment of this application, which is conducive to improving the smoothness of user operation.
[0050] Here, we will discuss the specific implementation of step S103 above. Figure 2 This document illustrates a flowchart of a method for implementing a tab merging function according to an embodiment of this application. Figure 2 As shown, when performing step S103, the method includes steps S201-S202, specifically: S201, based on the current operation status information, determine whether the target tab at the current moment has been dragged to the merge trigger area of the target window.
[0051] It should be noted that regardless of whether the source window is a single-tab window (i.e., the source window contains only one target tab) or a multi-tab window (i.e., the source window contains multiple tabs), the specific method for determining whether to execute the tab merge instruction is the same. Therefore, when executing steps S201-S202, it is not necessary to consider the number of tabs contained in the source window.
[0052] Here, based on the aforementioned current operation status information, the target control terminal can determine the current drag position indicated by the drag operation on the graphical user interface (e.g., the current mouse position), and can also determine the current position of the target tab on the graphical user interface. Based on this, the target control terminal can determine from all windows displayed on the graphical user interface whether the target tab has been dragged to the merge trigger area of a window (i.e., the target window) based on the aforementioned current drag position or the current position of the target tab.
[0053] It should be noted that the above-mentioned merge trigger area can be a specific display area in the target window that supports tab merging. For example, the above-mentioned merge trigger area can be the tab bar area in the target window, or it can be a blank area in the target window excluding functional controls, etc.
[0054] Here, considering that in related technologies, when a user opens multiple windows from different sources (such as multiple different applications or multiple different remote control devices) on the target control terminal at the same time, there may be a screen error caused by the user mistakenly dragging and merging the tabs from source A into the window of source B (e.g., dragging and merging the tabs from device A into the window of device B), resulting in a mismatch between the tab data and the actual data source.
[0055] Therefore, to solve the above problems, when executing step S201, the target control terminal can also obtain the window identifier of the source window (i.e., the tab data of the dragged target tab comes from the application or remote control device corresponding to the source window) through the system window management interface, and traverse the other windows in the graphical user interface other than the source window to obtain the window identifier of each other window and the window identifier of the target window (i.e., determine the application or remote control device corresponding to the other windows). By verifying the window identifier, other windows whose window identifiers match the window identifiers of the source window are determined as candidate windows of the target window (i.e., the window identifiers of the target window match the window identifiers of the source window). This ensures that when the tab merging instruction is executed on the target tab in the future, the target tab will only be merged into the target window with the same data source, avoiding the screen distortion problem existing in the above-mentioned related technologies.
[0056] S202, if it is determined that the target tab at the current moment has been dragged into the merge trigger area, then it is determined to execute a tab merge instruction to merge the target tab with the target window.
[0057] Here, the target control terminal can determine to execute the tab merge command when it determines that the current drag position (or the current position of the target tab) is located within the merge trigger area.
[0058] Specifically, when executing the tab merge command, the target control terminal can determine the insertion position of the target tab in the target window's tab bar based on the current drag position (or the current position of the target tab) in the target window's tab bar. Based on this insertion position, the target tab's tab data is migrated to the target window's screen list, and the relevant records for the target tab in the source window are closed (i.e., the window controller recorded in the drag context is updated from the source window controller to the target window controller). Here, when the source window is a single-tab window, after executing the above step S201, if it is determined that the target tab at the current moment has not been dragged into the merge trigger area, the target control terminal can determine to execute a window movement command to control the source window to move following the drag operation.
[0059] Specifically, the target control terminal can first determine the positional offset (including but not limited to horizontal and vertical offsets) of the current drag position (or the current position of the target tab) relative to the drag start point (i.e., the starting drag position indicated on the graphical user interface when the drag operation is a mouse click operation, for example, the drag start point can be the screen coordinates corresponding to the mouse click). Then, the above positional offset is added to the starting window position of the source window (i.e., the window position before dragging the target tab) to obtain the real-time window position of the dragged source window at the current moment. At this time, the target control terminal can update the window position of the source window in real time through the window position setting interface, thereby achieving the effect of a single tab window moving with the drag operation.
[0060] Here, when the source window is a multi-tab window, Figure 3 This document illustrates a flowchart of a method for implementing tab separation functionality according to an embodiment of this application. Figure 3 As shown, after performing step S201 above, the method includes steps S301-S304, specifically: S301, Based on the current operation status information, determine the target vertical distance and the dragging distance respectively.
[0061] Here, the target vertical distance refers to the vertical distance between the target tab and the tab bar boundary of the source window at the current moment; taking drag operation as a mouse click operation as an example, the target control terminal can obtain the current mouse position on the graphical user interface (i.e. the current drag position) from the current operation state information, and then determine the target vertical distance by the relative positional relationship between the current mouse position and the tab bar of the source window.
[0062] Specifically, if the current mouse position is above the tab bar of the source window, then the above target vertical distance = the Y coordinate (i.e., the vertical coordinate) of the current mouse position - the Y coordinate (i.e., the vertical coordinate) of the top boundary of the tab bar of the source window.
[0063] Specifically, if the current mouse position is below the tab bar of the source window, then the above target vertical distance = the Y coordinate (i.e., the vertical coordinate) of the bottom boundary of the tab bar of the source window - the Y coordinate (i.e., the vertical coordinate) of the current mouse position.
[0064] Specifically, if the current mouse position is within the tab bar of the source window, the vertical distance to the target is zero.
[0065] Here, the drag distance refers to the distance the target tab moves as it follows the drag operation; taking the drag operation as a mouse click operation as an example, the target control terminal can obtain the current mouse position on the graphical user interface (i.e., the current drag position) from the current operation state information, and then obtain the drag distance by calculating the distance difference between the current mouse position and the drag starting point.
[0066] S302, determine whether the vertical distance to the target and the drag-and-drop distance meet the triggering conditions of the tab separation instruction.
[0067] Here, as an optional embodiment, the triggering condition for the tab separation instruction can be: the target vertical distance is greater than or equal to a preset separation threshold (e.g., it can be 50% of the height of the tab bar of the source window) and the dragging distance is greater than or equal to a preset movement threshold (e.g., it can be 10 pixels); wherein, the specific values of the preset separation threshold and the preset movement threshold can be flexibly adjusted according to actual configuration requirements.
[0068] S303, if the target vertical distance and the drag-and-drop distance meet the triggering conditions of the tab separation instruction, then it is determined to execute the tab separation instruction to separate the target tab from the source window.
[0069] Here, if the target vertical distance and the drag distance meet the triggering conditions of the tab separation instruction, it can be determined that the drag operation is a vertical drag on the target tab in the vertical direction of the tab bar of the source window, rather than a horizontal drag on the target tab in the horizontal direction of the tab bar. Since horizontal drag is a drag operation used to adjust the order of different tabs in the tab bar, when it is determined that the drag operation belongs to the vertical drag, the target control terminal can determine to execute the tab separation instruction on the target tab.
[0070] Specifically, as an optional embodiment, the target control terminal can execute a tab separation instruction on the target tab according to the method shown in steps a1-a4 below: Step a1: Determine the horizontal position of the new window from the graphical user interface based on the preset window offset and the window position of the source window.
[0071] Here, the preset window offset can be determined based on the title bar height of the source window; for example, the preset window offset can be 50% of the title bar height, or 40% of the title bar height, etc., and this embodiment of the application does not impose any limitation on this.
[0072] Specifically, the horizontal position of the newly created window (i.e., the horizontal coordinate of the newly created window) can be: the X coordinate (i.e., the horizontal coordinate) of the source window's window position + the preset window offset (e.g., 50% of the title bar height).
[0073] Step a2: Based on the preset window offset and the position of the target tab at the current moment, determine the vertical position of the newly created window from the graphical user interface.
[0074] Specifically, in actual calculations, considering that the dragged tab has a certain area, the current drag position (such as the current mouse position) can be used to represent the position of the target tab at the current moment. In this case, as an optional embodiment, the vertical position corresponding to the new window (that is, the vertical coordinate of the new window) can be: the Y coordinate (vertical coordinate) of the current drag position (such as the current mouse position) + the preset window offset (such as 50% of the title bar height) - the window height of the source window.
[0075] Step a3: Determine the position of the new window on the graphical user interface based on the horizontal and vertical positions.
[0076] Here, based on the aforementioned horizontal and vertical positions, the window position of the newly created window (i.e., the newly created window position) can be determined in a two-dimensional graphical user interface.
[0077] Step a4: Display the new window at the new window location, and migrate and display the tab data of the target tab within the new window.
[0078] Specifically, when displaying the target tab's tab data in a new window, the target control terminal can update the window controller of the target tab recorded in the dragged and dropped files from the source window controller to the new window controller (i.e., the window controller corresponding to the new window). However, since the source of the target tab's tab data has not changed, the window identifier of the new window is consistent with (i.e., matches) the window identifier of the source window. For example, if the source window corresponds to remote control device A, then the window identifiers of the source window and the new window can be the identifier 'a' corresponding to remote control device A.
[0079] Specifically, since the target tab in the source window can be separated to form a new independent window (i.e., the newly created window mentioned above), as an optional embodiment, in addition to the window identifier mentioned above, a data identifier can also be configured for the tab data of the target tab. Thus, when the tab data of the target tab is migrated to the newly created window for display, the target control terminal can ensure that the tab data of each tab can be assigned to the correct window for display by verifying the window identifier + data identifier through a dual verification method.
[0080] It should be noted that the aforementioned tab data may include, but is not limited to, text data, image data, video stream data, etc., and this application embodiment does not impose any limitations on this.
[0081] S304, if the target vertical distance and the drag-and-drop distance do not meet the triggering conditions of the tab separation instruction, then it is determined to execute an order adjustment instruction for reordering the target tabs in the tab bar of the source window.
[0082] Here, if the target vertical distance and the drag distance do not meet the triggering conditions of the tab separation instruction, it can be determined that the drag operation is a horizontal drag of the target tab in the horizontal direction of the tab bar of the source window. Since horizontal drag is a drag operation used to adjust the order of different tabs in the tab bar, when it is determined that the drag operation belongs to the above-mentioned horizontal drag, the target control terminal can determine to execute the order adjustment instruction on the target tab.
[0083] Specifically, the target control terminal can calculate the latest insertion position of the reordered target tab in the tab bar of the source window in real time based on the current drag position (such as the current mouse position). By smoothly moving other tabs (i.e., other tabs in the tab bar of the source window besides the target tab), the target tab can be moved to the latest insertion position. At this time, the target control terminal does not need to update the window controller of the target tab recorded in the drag context.
[0084] It should be noted that, based on the polling mechanism in the aforementioned steps and the horizontal dragging and tab reordering in step S304, the embodiments of this application can optimize the processing of tab dragging events, so that the UI update frequency during dragging can match the preset frequency in the polling mechanism. This helps to avoid interference to video decoding and rendering caused by high-frequency event processing when the transmitted tab data is video stream data, which helps to improve the smoothness of video stream rendering and reduce the frequency of video stuttering perceived by the user.
[0085] Here, when displaying the newly created window mentioned above, Figure 4 The following is a flowchart illustrating a window adaptive adjustment method provided in an embodiment of this application, as shown in the figure. Figure 4 As shown, after performing step a3 above (that is, after determining the position of the new window on the graphical user interface), the window adaptive adjustment method includes steps S401-S403, specifically: S401, determine the new window size corresponding to the new window based on the window size of the source window.
[0086] Here, as an optional embodiment, the size of the newly created window can be configured to be the size of the source window by default; for example, the width of the newly created window = the width of the source window, and the height of the newly created window = the height of the source window.
[0087] Here, as another optional embodiment, the size of the newly created window can be configured by default as the product of the size of the source window and a preset scaling factor; for example, taking the preset scaling factor as 80%, the width of the newly created window = the width of the source window × 80%, and the height of the newly created window = the height of the source window × 80%.
[0088] S402, under the assumption that a new window with the same size as the new window is displayed at the new window location, determine whether the new window exceeds the display boundary of the graphical user interface.
[0089] Here, the target control terminal can obtain the visible area of the current graphical user interface, and thus determine the display boundary of the graphical user interface based on the area boundary of the visible area.
[0090] Specifically, assuming a new window of the specified size is displayed at the aforementioned new window location, the target control terminal can determine whether the new window exceeds the boundary of the aforementioned visible area (i.e., the display boundary of the graphical user interface) under the condition that this assumption is true.
[0091] S403, if it is determined that the newly created window exceeds the display boundary of the graphical user interface, then the position of the newly created window is adjusted according to the display boundary of the graphical user interface to obtain the actual window position corresponding to the newly created window.
[0092] Specifically, if it is determined that the new window exceeds the right display boundary of the graphical user interface (that is, the right boundary of the new window exceeds the visible area of the current graphical user interface), the X coordinate (horizontal coordinate) of the new window's position can be adjusted to the right display boundary of the graphical user interface minus the window width of the new window.
[0093] Specifically, if it is determined that the new window exceeds the left display boundary of the graphical user interface (that is, the left boundary of the new window exceeds the visible area of the current graphical user interface), the X coordinate (horizontal coordinate) of the new window's position can be adjusted to the left display boundary of the graphical user interface.
[0094] Specifically, if it is determined that the new window exceeds the upper display boundary of the graphical user interface (that is, the upper boundary of the new window exceeds the visible area of the current graphical user interface), the Y coordinate (vertical coordinate) of the new window position can be adjusted to the upper display boundary of the graphical user interface minus the window height of the new window.
[0095] Specifically, if it is determined that the newly created window exceeds the lower display boundary of the graphical user interface (that is, the lower boundary of the newly created window exceeds the visible area of the current graphical user interface), the Y coordinate (vertical coordinate) of the newly created window's position can be adjusted to the lower display boundary of the graphical user interface.
[0096] It should be noted that, through the window adaptive adjustment method shown in S401-S403 above, the embodiments of this application can dynamically calculate the window position of the new window based on the current drag position of the drag operation and the window size of the source window, while detecting the boundary of the visible area of the screen to ensure that the title bar and content area of the new window are fully visible. This helps to reduce the probability of the new window exceeding the screen boundary in a multi-screen or high-resolution display environment, thereby effectively reducing the frequency of users manually adjusting the position of the new window.
[0097] Based on the window processing method provided in the embodiments of this application, a drag context is created for the dragged tab that can completely record the full process status information of the drag operation, and a polling mechanism is established to continuously track the operation status of the drag operation. This ensures that the dragged tab can seamlessly update the drag context when it is migrated across windows (i.e., tab separation and tab merging), so that the user can continuously realize tab separation and tab merging and other tab drag functions through a single drag operation.
[0098] Based on the same inventive concept, this application also provides a window processing device corresponding to the above-mentioned window processing method. Since the principle of solving the problem by the window processing device in the embodiments of this application is similar to that of the above-mentioned window processing method in the embodiments of this application, the implementation of the window processing device can refer to the implementation of the above-mentioned window processing method, and the repeated parts will not be described again.
[0099] Reference Figure 5 As shown, Figure 5 This illustration shows a schematic diagram of a window processing device provided in an embodiment of this application, wherein it is applied to a remote control client. The remote control client provides a source window for displaying a video stream of a controlled device. The source window includes at least one tab, and the tab is associated with the video stream. The window processing device includes: The first response module 501 is used to respond to a drag operation on a target tab in the source window, create a drag context corresponding to the target tab, and poll the operation status of the drag operation at a preset frequency to obtain a polling result; wherein, the drag context includes at least one of the following information: the target tab, the window controller corresponding to the target tab, and the operation status information of the drag operation; The first update module 502 is used to update the operation status information of the drag operation recorded in the drag context according to the polling result, and determine the current operation status information of the drag operation. The instruction determination module 503 is used to determine, based on the current operation status information, a target window processing instruction that matches the current operation status information from multiple window processing instructions; wherein, the multiple window processing instructions include at least: tab separation instructions and tab merging instructions; The second update module 504 is used to update the window controller recorded in the drag context according to the execution result of the target window processing instruction, and determine the updated drag context. The second response module 505 is used to stop the polling and eliminate the drag context in response to the end of the drag operation.
[0100] In an optional implementation, when determining, based on the current operation state information, from multiple window processing instructions to execute a target window processing instruction that matches the current operation state information, the instruction determination module 503 is configured to: Based on the current operation status information, determine whether the target tab has been dragged into the merge trigger area of the target window at the current moment; If it is determined that the target tab at the current moment is dragged into the merge trigger area, then it is determined to execute a tab merge instruction to merge the target tab with the target window.
[0101] In one alternative implementation, the window identifier of the target window is matched with the window identifier of the source window.
[0102] In an optional implementation, when the source window is a single-tab window, after determining whether the target tab at the current moment has been dragged into the merge trigger area of the target window, the instruction determination module 503 is further configured to: If it is determined that the target tab at the current moment has not been dragged into the merge trigger area, then a window movement instruction for controlling the source window to move following the drag operation is executed.
[0103] In an optional implementation, when the source window is a multi-tab window, after determining whether the target tab at the current moment has been dragged into the merge trigger area of the target window, the instruction determination module 503 is further configured to: Based on the current operation status information, the target vertical distance and the drag distance are determined respectively; wherein, the target vertical distance represents the vertical distance between the target tab and the tab bar boundary of the source window at the current moment, and the drag distance represents the distance moved by the target tab due to the drag operation; Determine whether the vertical distance to the target and the drag distance meet the triggering conditions of the tab separation instruction; If the target vertical distance and the drag distance meet the triggering conditions of the tab separation instruction, then it is determined that a tab separation instruction for separating the target tab from the source window will be executed. If the target vertical distance and the drag distance do not meet the triggering conditions of the tab separation instruction, then it is determined to execute an order adjustment instruction for reordering the target tabs in the tab bar of the source window.
[0104] In an optional implementation, when executing the tab separation instruction for separating the target tab from the source window, the instruction determination module 503 is configured to: Based on a preset window offset and the window position of the source window, the horizontal position of the newly created window is determined from the graphical user interface; wherein, the preset window offset is determined based on the title bar height of the source window; Based on the preset window offset and the position of the target tab at the current moment, the vertical position of the newly created window is determined from the graphical user interface. Based on the horizontal and vertical positions, determine the position of the new window on the graphical user interface. The new window is displayed at the specified location, and the tab data of the target tab is migrated and displayed within the new window.
[0105] In an optional implementation, after determining the location of the new window on the graphical user interface, the instruction determination module 503 is further configured to: Based on the window size of the source window, determine the size of the new window corresponding to the new window; Under the assumption that a new window with the same size as the new window is displayed at the new window location, determine whether the new window exceeds the display boundary of the graphical user interface; If it is determined that the newly created window exceeds the display boundary of the graphical user interface, the position of the newly created window is adjusted according to the display boundary of the graphical user interface to obtain the actual window position corresponding to the newly created window.
[0106] Based on the window processing device provided in the embodiments of this application, a drag context is created for the dragged tab that can completely record the full process status information of the drag operation, and a polling mechanism is established to continuously track the operation status of the drag operation. This ensures that the dragged tab can seamlessly update the drag context when it is migrated across windows (i.e., tab separation and tab merging), so that the user can continuously realize tab separation and tab merging and other tab drag functions through a single drag operation.
[0107] Based on the same inventive concept, this application also provides an electronic device corresponding to the above-described window processing method. Since the principle of solving the problem by the electronic device in the embodiments of this application is similar to that of the above-described window processing method in the embodiments of this application, the implementation of the electronic device can refer to the implementation of the above-described window processing method, and the repeated parts will not be described again.
[0108] Figure 6 A schematic diagram of the structure of an electronic device 600 provided in this application embodiment includes: a processor 601, a memory 602, and a bus 603. The memory 602 stores machine-readable instructions executable by the processor 601. When the electronic device runs a window processing method as described in the embodiment, the processor 601 communicates with the memory 602 via the bus 603. The processor 601 executes the machine-readable instructions, which are applied to a remote control client. The remote control client provides a source window that displays a video stream of the controlled device. The source window includes at least one tab, and the tab is associated with the video stream. When the processor 601 executes the machine-readable instructions, it implements the following steps: In response to a drag operation on a target tab in the source window, a drag context corresponding to the target tab is created, and the operation status of the drag operation is polled at a preset frequency to obtain a polling result; wherein, the drag context includes at least one of the following information: the target tab, the window controller corresponding to the target tab, and the operation status information of the drag operation; Based on the polling results, the operation status information of the drag operation recorded in the drag context is updated to determine the current operation status information of the drag operation. Based on the current operation status information, a target window processing instruction matching the current operation status information is determined from multiple window processing instructions; wherein, the multiple window processing instructions include at least: tab separation instruction and tab merging instruction; Based on the execution result of the target window processing instruction, the window controller recorded in the drag context is updated to determine the updated drag context; In response to the end of the drag operation, the polling is stopped and the drag context is cleared.
[0109] In an optional implementation, when determining, based on the current operation state information, from a plurality of window processing instructions, a target window processing instruction matching the current operation state information is to be executed, the processor 601 is configured to: Based on the current operation status information, determine whether the target tab has been dragged into the merge trigger area of the target window at the current moment; If it is determined that the target tab at the current moment is dragged into the merge trigger area, then it is determined to execute a tab merge instruction to merge the target tab with the target window.
[0110] In one alternative implementation, the window identifier of the target window is matched with the window identifier of the source window.
[0111] In an optional implementation, when the source window is a single-tab window, after determining whether the target tab has been dragged into the merge trigger area of the target window at the current moment, the processor 601 is further configured to: If it is determined that the target tab at the current moment has not been dragged into the merge trigger area, then a window movement instruction for controlling the source window to move following the drag operation is executed.
[0112] In an optional implementation, when the source window is a multi-tab window, after determining whether the target tab at the current moment has been dragged into the merge trigger area of the target window, the processor 601 is further configured to: Based on the current operation status information, the target vertical distance and the drag distance are determined respectively; wherein, the target vertical distance represents the vertical distance between the target tab and the tab bar boundary of the source window at the current moment, and the drag distance represents the distance moved by the target tab due to the drag operation; Determine whether the vertical distance to the target and the drag distance meet the triggering conditions of the tab separation instruction; If the target vertical distance and the drag distance meet the triggering conditions of the tab separation instruction, then it is determined that a tab separation instruction for separating the target tab from the source window will be executed. If the target vertical distance and the drag distance do not meet the triggering conditions of the tab separation instruction, then it is determined to execute an order adjustment instruction for reordering the target tabs in the tab bar of the source window.
[0113] In an optional implementation, when executing the tab separation instruction for separating the target tab from the source window, the processor 601 is configured to: Based on a preset window offset and the window position of the source window, the horizontal position of the newly created window is determined from the graphical user interface; wherein, the preset window offset is determined based on the title bar height of the source window; Based on the preset window offset and the position of the target tab at the current moment, the vertical position of the newly created window is determined from the graphical user interface. Based on the horizontal and vertical positions, determine the position of the new window on the graphical user interface. The new window is displayed at the specified location, and the tab data of the target tab is migrated and displayed within the new window.
[0114] In an optional implementation, after determining the location of the new window corresponding to the new window on the graphical user interface, the processor 601 is further configured to: Based on the window size of the source window, determine the size of the new window corresponding to the new window; Under the assumption that a new window with the same size as the new window is displayed at the new window location, determine whether the new window exceeds the display boundary of the graphical user interface; If it is determined that the newly created window exceeds the display boundary of the graphical user interface, the position of the newly created window is adjusted according to the display boundary of the graphical user interface to obtain the actual window position corresponding to the newly created window.
[0115] The electronic device provided in this application creates a drag context for the dragged tab that can fully record the entire process status information of the drag operation, and establishes a polling mechanism to continuously track the operation status of the drag operation. This ensures that the dragged tab can seamlessly update the drag context when it is migrated across windows (i.e., tab separation and tab merging), so that the user can continuously realize tab separation and tab merging functions through a single drag operation.
[0116] Based on the same inventive concept, embodiments of this application also provide a computer-readable storage medium storing a computer program applied to a remote control client. The remote control client provides a source window displaying a video stream from a controlled device. The source window includes at least one tab associated with the video stream. The computer program is executed by a processor, which performs the following steps: In response to a drag operation on a target tab in the source window, a drag context corresponding to the target tab is created, and the operation status of the drag operation is polled at a preset frequency to obtain a polling result; wherein, the drag context includes at least one of the following information: the target tab, the window controller corresponding to the target tab, and the operation status information of the drag operation; Based on the polling results, the operation status information of the drag operation recorded in the drag context is updated to determine the current operation status information of the drag operation. Based on the current operation status information, a target window processing instruction matching the current operation status information is determined from multiple window processing instructions; wherein, the multiple window processing instructions include at least: tab separation instruction and tab merging instruction; Based on the execution result of the target window processing instruction, the window controller recorded in the drag context is updated to determine the updated drag context; In response to the end of the drag operation, the polling is stopped and the drag context is cleared.
[0117] In an optional implementation, when determining, based on the current operation state information, from a plurality of window processing instructions to execute a target window processing instruction that matches the current operation state information, the processor is configured to: Based on the current operation status information, determine whether the target tab has been dragged into the merge trigger area of the target window at the current moment; If it is determined that the target tab at the current moment is dragged into the merge trigger area, then it is determined to execute a tab merge instruction to merge the target tab with the target window.
[0118] In one alternative implementation, the window identifier of the target window is matched with the window identifier of the source window.
[0119] In an optional implementation, when the source window is a single-tab window, after determining whether the target tab has been dragged into the merge trigger area of the target window at the current moment, the processor is further configured to: If it is determined that the target tab at the current moment has not been dragged into the merge trigger area, then a window movement instruction for controlling the source window to move following the drag operation is executed.
[0120] In an optional implementation, when the source window is a multi-tab window, after determining whether the target tab has been dragged into the merge trigger area of the target window at the current moment, the processor is further configured to: Based on the current operation status information, the target vertical distance and the drag distance are determined respectively; wherein, the target vertical distance represents the vertical distance between the target tab and the tab bar boundary of the source window at the current moment, and the drag distance represents the distance moved by the target tab due to the drag operation; Determine whether the vertical distance to the target and the drag distance meet the triggering conditions of the tab separation instruction; If the target vertical distance and the drag distance meet the triggering conditions of the tab separation instruction, then it is determined that a tab separation instruction for separating the target tab from the source window will be executed. If the target vertical distance and the drag distance do not meet the triggering conditions of the tab separation instruction, then it is determined to execute an order adjustment instruction for reordering the target tabs in the tab bar of the source window.
[0121] In an optional implementation, when executing the tab separation instruction for separating the target tab from the source window, the processor is configured to: Based on a preset window offset and the window position of the source window, the horizontal position of the newly created window is determined from the graphical user interface; wherein, the preset window offset is determined based on the title bar height of the source window; Based on the preset window offset and the position of the target tab at the current moment, the vertical position of the newly created window is determined from the graphical user interface. Based on the horizontal and vertical positions, determine the position of the new window on the graphical user interface. The new window is displayed at the specified location, and the tab data of the target tab is migrated and displayed within the new window.
[0122] In an optional implementation, after determining the location of the new window corresponding to the new window on the graphical user interface, the processor is further configured to: Based on the window size of the source window, determine the size of the new window corresponding to the new window; Under the assumption that a new window with the same size as the new window is displayed at the new window location, determine whether the new window exceeds the display boundary of the graphical user interface; If it is determined that the newly created window exceeds the display boundary of the graphical user interface, the position of the newly created window is adjusted according to the display boundary of the graphical user interface to obtain the actual window position corresponding to the newly created window.
[0123] The computer-readable storage medium provided in this application creates a drag context for the dragged tab, which can completely record the entire process status information of the drag operation. A polling mechanism is established to continuously track the operation status of the drag operation, thereby ensuring that the dragged tab can seamlessly update the drag context when it is migrated across windows (i.e., tab separation and tab merging). This allows users to continuously perform tab drag functions such as tab separation and tab merging through a single drag operation.
[0124] In this embodiment, the computer-readable storage medium can also execute other machine-readable instructions when the processor runs, to perform window processing methods as described in other embodiments. For details on the specific window processing method steps and principles, please refer to the description of the method-side embodiment, which will not be repeated here.
[0125] In the embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. The system embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and there may be other division methods in actual implementation. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interface; the indirect coupling or communication connection between systems or units may be electrical, mechanical, or other forms.
[0126] 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 according to actual needs.
[0127] In addition, the functional units in the embodiments provided in 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.
[0128] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they 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 related technologies, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0129] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0130] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application. All should be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.
Claims
1. A window processing method, characterized in that, Applied to a remote control client, the remote control client provides a source window for displaying a video stream of the controlled device, the source window containing at least one tab associated with the video stream; The window processing method includes: In response to a drag operation on a target tab in the source window, a drag context corresponding to the target tab is created, and the operation status of the drag operation is polled at a preset frequency to obtain a polling result; wherein, the drag context includes at least one of the following information: the target tab, the window controller corresponding to the target tab, and the operation status information of the drag operation; Based on the polling results, the operation status information of the drag operation recorded in the drag context is updated to determine the current operation status information of the drag operation. Based on the current operation status information, a target window processing instruction matching the current operation status information is determined from multiple window processing instructions; wherein, the multiple window processing instructions include at least: tab separation instruction and tab merging instruction; Based on the execution result of the target window processing instruction, the window controller recorded in the drag context is updated to determine the updated drag context; In response to the end of the drag operation, the polling is stopped and the drag context is cleared.
2. The window processing method according to claim 1, characterized in that, The step of determining, based on the current operation state information, from multiple window processing instructions to execute a target window processing instruction that matches the current operation state information includes: Based on the current operation status information, determine whether the target tab has been dragged into the merge trigger area of the target window at the current moment; If it is determined that the target tab at the current moment is dragged into the merge trigger area, then it is determined to execute a tab merge instruction to merge the target tab with the target window.
3. The window processing method according to claim 2, characterized in that, The window identifier of the target window matches the window identifier of the source window.
4. The window processing method according to claim 2, characterized in that, When the source window is a single-tab window, after determining whether the target tab has been dragged into the merge trigger area of the target window at the current moment, the window processing method further includes: If it is determined that the target tab at the current moment has not been dragged into the merge trigger area, then a window movement instruction for controlling the source window to move following the drag operation is executed.
5. The window processing method according to claim 2, characterized in that, When the source window is a multi-tab window, after determining whether the target tab has been dragged into the merge trigger area of the target window at the current moment, the window processing method further includes: Based on the current operation status information, the target vertical distance and the drag distance are determined respectively; wherein, the target vertical distance represents the vertical distance between the target tab and the tab bar boundary of the source window at the current moment, and the drag distance represents the distance moved by the target tab due to the drag operation; Determine whether the vertical distance to the target and the drag distance meet the triggering conditions of the tab separation instruction; If the target vertical distance and the drag distance meet the triggering conditions of the tab separation instruction, then it is determined to execute the tab separation instruction to separate the target tab from the source window; If the target vertical distance and the drag distance do not meet the triggering conditions of the tab separation instruction, then it is determined to execute an order adjustment instruction for reordering the target tabs in the tab bar of the source window.
6. The window processing method according to claim 5, characterized in that, The execution of the tab separation instruction for separating the target tab from the source window includes: Based on a preset window offset and the window position of the source window, the horizontal position of the newly created window is determined from the graphical user interface; wherein, the preset window offset is determined based on the title bar height of the source window; Based on the preset window offset and the position of the target tab at the current moment, the vertical position of the newly created window is determined from the graphical user interface. Based on the horizontal and vertical positions, determine the position of the new window on the graphical user interface. The new window is displayed at the specified location, and the tab data of the target tab is migrated and displayed within the new window.
7. The window processing method according to claim 6, characterized in that, After determining the location of the new window on the graphical user interface, the window processing method further includes: Based on the window size of the source window, determine the size of the new window corresponding to the new window; Under the assumption that a new window with the same size as the new window is displayed at the new window location, determine whether the new window exceeds the display boundary of the graphical user interface; If it is determined that the newly created window exceeds the display boundary of the graphical user interface, the position of the newly created window is adjusted according to the display boundary of the graphical user interface to obtain the actual window position corresponding to the newly created window.
8. A window processing device, characterized in that, Applied to a remote control client, the remote control client provides a source window for displaying a video stream of the controlled device, the source window containing at least one tab associated with the video stream; The window processing device includes: The first response module is used to respond to a drag operation on a target tab in the source window, create a drag context corresponding to the target tab, and poll the operation status of the drag operation at a preset frequency to obtain a polling result; wherein, the drag context includes at least one of the following information: the target tab, the window controller corresponding to the target tab, and the operation status information of the drag operation; The first update module is used to update the operation status information of the drag operation recorded in the drag context according to the polling result, and determine the current operation status information of the drag operation. The instruction determination module is used to determine, based on the current operation state information, a target window processing instruction that matches the current operation state information from multiple window processing instructions; wherein, the multiple window processing instructions include at least: tab separation instructions and tab merging instructions; The second update module is used to update the window controller recorded in the drag context according to the execution result of the target window processing instruction, and determine the updated drag context. The second response module is used to stop the polling and eliminate the drag context in response to the end of the drag operation.
9. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, they perform the steps of the window processing method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the window processing method as described in any one of claims 1 to 7.