Software window display control method and system based on X11 environment
By setting custom hierarchy attributes and building a tree structure for windows in the X11 environment, combined with the transient window mechanism, the problem of managing the display hierarchy of multiple windows is solved, flexible window display control is achieved, and the user experience is improved.
Patent Information
- Application Number
- CN202511037705.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-28
- Publication Date
- 2025-11-28
AI Technical Summary
In the X11 graphics environment, the existing window manager is unable to meet the requirement of displaying multiple software windows in a specific hierarchical order, resulting in dynamic changes in window display hierarchy, occlusion problems, and affecting user experience.
By setting custom hierarchical attributes for windows to be controlled, a tree structure is constructed, and the window display order is dynamically maintained using the transient window mechanism, including window grouping attributes, priority numerical attributes, and sorting control attributes. Combined with event listening and processing, flexible window hierarchy management is achieved.
It enables hierarchical control of various software windows, solves the problem of dynamic window occlusion, provides a flexible window display control method and system, and improves the user experience.
Smart Images

Figure CN121029296A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software window display control technology, and in particular to a software window display control method and system based on the X11 environment. Background Technology
[0002] The Graphical User Interface (GUI) is a crucial component of the Linux operating system, allowing users to interact with the computer without using the command line. The Linux windowing system provides the underlying technology for the GUI, managing application window display, input events, and graphics rendering. Currently, Linux has two main windowing systems: the X Window System (X11) and Wayland. X11 was the earliest windowing system used in Linux, while Wayland is a newer and more modern graphical environment.
[0003] In the X11 graphics environment, the window manager provides basic window stacking management functions by default, such as raising or lowering window levels, and bringing windows to the top or bottom of the display hierarchy. However, when multiple software windows need to be displayed in a specific hierarchical order, the existing window manager struggles to meet these application scenarios and requirements. As users switch between windows, the display hierarchy dynamically changes, leading to windows obscuring each other and negatively impacting the user experience. Summary of the Invention
[0004] This application aims to solve at least one technical problem existing in the prior art mentioned above, and proposes a software window display control method and system based on the X11 environment, which aims to solve the problem of difficult management of display layers of various types of software windows based on the Linux operating system.
[0005] In a first aspect, embodiments of this application provide a software window display control method based on the X11 environment, comprising:
[0006] Set custom hierarchy attributes for the window to be controlled. Custom hierarchy attributes include one or more of the following: window grouping attributes, priority numerical attributes, and sorting control attributes.
[0007] Construct a tree structure with the root window of the screen as the root node and group windows as child nodes, and sort the nodes according to priority numerical attributes and sorting control attributes;
[0008] Listen for window creation / closure events; if the window has custom hierarchy attributes, insert it into the corresponding position in the tree structure.
[0009] Set the newly added window as the transient window of its parent node, and update the transient parent window pointer of its child windows;
[0010] When a window is closed, the corresponding node is deleted, and the transient parent window of its child window is set to the original grandparent window.
[0011] Furthermore, the sorting rules for sorting nodes based on priority numerical attributes and sorting control attributes satisfy the following:
[0012] In ascending order mode, child nodes have higher priority than parent nodes.
[0013] In descending order mode, child nodes have lower priority than parent nodes.
[0014] Furthermore, set custom hierarchy attributes, including:
[0015] Create three atomic variables, which are respectively associated with the window grouping property, the priority numeric property, and the sorting control property;
[0016] Call the X client library function to set the window grouping property, priority numeric property, and sorting control property to the window's custom properties using atomic variables.
[0017] Furthermore, listen for window creation / closure events, including:
[0018] Set the event mask for the root window of the screen;
[0019] Capture the creation / closure events of all child or descendant windows of the root window of the screen through the event loop.
[0020] Furthermore, it also includes:
[0021] Insert the window at the corresponding position in the tree structure. If the priority of the new window is the same as that of an existing window, automatically assign a new priority to the new window or return an error message to the client.
[0022] Furthermore, it also includes:
[0023] Receive or send window creation / closing messages via the HTTP / Web service interface.
[0024] Furthermore, when the window is closed, the corresponding node is deleted, and the transient parent window of its child windows is set to the original grandparent window, including:
[0025] Set the transient parent window of the closed window to its grandparent window;
[0026] If the closed window is the root node of a group, then its child nodes are promoted to direct children of the screen root node.
[0027] Secondly, embodiments of this application provide a software window display control system based on the X11 environment, including:
[0028] The X client program unit sets custom hierarchy attributes for the window to be controlled. Custom hierarchy attributes include one or more of the following: window grouping attributes, priority numerical attributes, and sorting control attributes.
[0029] The X server program unit performs graphics drawing and input event processing;
[0030] The X Window Manager unit manages basic window operations;
[0031] A custom window display control unit is used to construct a tree structure and dynamically maintain the window display order through a transient window mechanism.
[0032] Furthermore, the custom window display control unit includes:
[0033] The event listener module captures window creation / closing events via event masks or web service interfaces;
[0034] The tree structure management module uses the root window of the screen as the root node and groups windows according to priority.
[0035] The transient window control module sets the parent-child transient relationship between windows.
[0036] Furthermore, the tree structure management module includes:
[0037] The grouping search submodule matches nodes with the same grouping attribute among the child nodes of the root node;
[0038] The conflict handling submodule automatically adjusts or reports an error when priorities are duplicated.
[0039] This application provides a software window display control method based on the X11 environment. By adding custom layer attribute settings to windows, it enables software windows to be displayed and controlled according to user-defined layers, solving the problem of difficult control over the display layers of various types of windows under the Linux system. This application solves the problem of dynamic occlusion of multiple windows in the X11 environment through a triple mechanism of custom attributes, tree structure, and transient windows. Attached Figure Description
[0040] Figure 1 The core flowchart of a software window display control method based on the X11 environment provided in this application embodiment;
[0041] Figure 2 A tree structure diagram illustrating a software window display control method based on the X11 environment provided in this application embodiment;
[0042] Figure 3A schematic diagram of the functional module structure of a software window display control system based on the X11 environment provided in this application embodiment;
[0043] Figure 4 This is a structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0044] To enable those skilled in the art to better understand the technical solutions of this application, exemplary embodiments of this application are described below with reference to the accompanying drawings, including various details of the embodiments of this application to aid understanding. These should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this application. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description. Unless otherwise specified, the various embodiments of this application and the features within those embodiments can be combined with each other.
[0045] As used herein, the term “and / or” includes any and all combinations of one or more of the associated enumerated entries. The terminology used herein is for describing particular embodiments only and is not intended to limit the application. As used herein, the singular forms “a” and “the” are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that when the terms “comprising” and / or “made of” are used in this specification, the presence of the stated features, integrals, steps, operations, elements, and / or components is specified, but the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof is not excluded. Terms such as “connected” or “linked” are not limited to physical or mechanical connections but can include electrical connections, whether direct or indirect.
[0046] Unless otherwise specified, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art. It should also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having the meaning consistent with their meaning in the context of the relevant art and this application, and will not be interpreted as having an idealized or overly formal meaning, unless expressly so defined herein.
[0047] As described in the background section of this specification, when multiple software windows need to be displayed in a specific hierarchical order, existing window managers are insufficient to meet this application scenario and requirement. As users switch between windows, the display hierarchy dynamically changes, leading to windows obscuring each other and affecting the user experience. Therefore, this application proposes a software window display control method and system based on the X11 environment, aiming to solve the problem of managing the display hierarchy of various types of software windows based on the Linux operating system.
[0048] refer to Figure 1 and Figure 3 One embodiment of this application provides a software window display control method based on the X11 environment, which may specifically include the following steps.
[0049] Step 1: Start the custom window display control unit with system administrator privileges and listen for system window creation and closing events. In some embodiments, Step 1 may further include the following sub-steps.
[0050] Step 11: Create an event mask for the custom window display control unit. The event mask contains the window creation event and the window closing event.
[0051] Step 12: The custom window display control unit calls the X client library function to obtain the root window of the X system screen.
[0052] Step 13: The custom window display control unit calls the X client library function to set the event mask for the root window of the screen, specifying that it will receive window creation and window closing events;
[0053] Step 14: The custom window display control unit can capture the creation and closing events of all child windows or descendant windows of the root window in the event loop and handle the event responses. This setting ensures that window state changes are handled in real time and maintains hierarchical consistency.
[0054] The custom window display control unit provides a window management service interface, offering services for handling window creation and closing events via HTTP / HTTPS or Web services. Receiving window creation / closing messages through the HTTP / Web service interface can replace the event capture mechanism, thus supporting cross-process communication and expanding application scenarios.
[0055] When the custom window display control unit starts, it runs the window management service. When the X client program unit starts a window, it calls the window management service interface to send a window creation message to the custom window display control unit. When the X client program unit exits the program or closes the window, it calls the window management service interface to send a window close message to the custom window display control unit. The custom window display control unit listens for and processes window creation and window close messages.
[0056] Step 2: The X client program unit adds custom window hierarchy attributes to the windows that need to be displayed. The custom window hierarchy attributes include one or more of the following: window grouping attributes, priority numerical attributes, and sorting control attributes.
[0057] The window grouping attribute defines the group information to which the window belongs, the priority value attribute defines the hierarchy priority of the window in the group, and the sorting control attribute defines the stacking order of the windows.
[0058] A window group is a collection of windows with the same grouping attribute. Windows in a group are ordered hierarchically according to their priority numerical attribute, and windows in the same group cannot have the same priority numerical attribute.
[0059] The sorting control properties include two order control methods: ascending and descending. In ascending mode, windows with higher priority values will appear before windows with lower priority values; in descending mode, windows with lower priority values will appear before windows with higher priority values. This setting supports flexible sorting strategies to adapt to different scenario needs.
[0060] Users can set one or more window groups according to actual application needs, with each group having different priority value ranges and sorting control methods. For example, defining the level attribute value as 0~255 and the sorting control method as incremental means there are 256 window display levels. With the sorting control method as incremental, the windows within the window group are sorted in ascending order of priority value. The larger the level attribute value, the higher the window's display level and the more prominent it is; the smaller the level attribute value, the lower the window's display level and the more easily it is obscured by other windows with higher level attribute values.
[0061] In some embodiments, step 2 may further include the following sub-steps.
[0062] Step 21: The X client program unit calls the X client library function to create a display connection with the X server program unit.
[0063] Step 22: The X client program unit calls the X client library function to create three custom hierarchical attribute-related Atom variables. The first atomic variable defines the window's grouping attribute, the second atomic variable defines the window's priority numerical attribute, and the third atomic variable defines the sorting control attribute.
[0064] In the X Window system, an atomic variable is a 32-bit integer value that uniquely identifies a property name, event type, or other specific information. When creating an atomic variable, a property name string must be specified. This string is user-defined and must be globally unique, not duplicated with property names predefined in the X client library.
[0065] Step 23: The X client program unit calls the X client library function and uses atomic variables to set the window's grouping attribute, priority value attribute, and sorting control attribute as the window's custom attributes.
[0066] Step 24: The X client program unit closes the display connection with the X server program unit.
[0067] Step 3: The custom window display control unit handles the window creation event and obtains the handle of the newly created window using the event capture mechanism or window management service interface.
[0068] Specifically, the custom window display control unit handles window creation events. When the custom window display control unit detects a window creation event in the event loop, it uses the event capture mechanism to obtain the handle of the newly created window; or it receives the window creation message sent by the X client program unit through the window management service interface to obtain the handle of the newly created window.
[0069] Step 4: The custom window display control unit obtains the custom layer attributes of the newly created window and determines whether the window has custom window layer attributes.
[0070] Specifically, the custom window display control unit obtains the custom hierarchy attributes of the newly created window, including window grouping attributes, priority numerical attributes, and sorting control attributes. Then, it determines whether the newly created window has custom hierarchy attributes. If the new window has custom hierarchy attributes, it performs hierarchy sorting processing on the window; if the window does not have custom hierarchy attributes, no hierarchy sorting processing is performed, and the X system's window manager unit performs the system's default window display control.
[0071] Step 5: The custom window display control unit inserts the newly added window node into the appropriate position in the tree structure.
[0072] The custom window display control unit uses a tree structure to maintain the window hierarchy, see reference. Figure 2 This tree structure has the following properties:
[0073] Each node represents an independent window.
[0074] The root window of the X system is used as the root node of the tree structure. The hierarchy of the root node cannot be adjusted, but the hierarchy of the descendant nodes of the root node can be adjusted. The root window is the top-level window of the entire window hierarchy, and all other windows are child windows or descendant windows of the root window.
[0075] A root node can contain multiple child nodes, and each child node corresponds to a root node of a group.
[0076] In a tree structure, each node except the root node has one and only one parent node, and each node can contain either 0 or 1 child nodes.
[0077] Each node's window is displayed in front of its parent node's window, and the windows of its child nodes are displayed in front of that node's window.
[0078] In the ordering control mode where the priority value is increasing, the priority value of each node is less than the priority value of its descendant nodes, but greater than the priority value of its parent node.
[0079] In descending order control mode, the priority value of each node is greater than the priority value of its descendant nodes and less than the priority value of its parent node.
[0080] Based on the window grouping attribute of the newly added window node, search for a node with the same grouping attribute among the child nodes of the root node of the tree structure. If no node with the same grouping attribute is found, the window node is added to the list of child nodes of the root node of the tree structure as the root node of the group. If a root node with the same grouping attribute is found, the node is inserted into the appropriate position in the node list of that group according to the priority numerical attribute and the sorting control attribute, ensuring that after the insertion of the new window node, the tree structure still satisfies the property that the group nodes are arranged in ascending or descending order of priority numerical attribute.
[0081] Specifically, if the priority value of a newly added window node is the same as the priority value of an existing node in the group, i.e., a duplicate priority value occurs, the custom window display control unit needs to support handling the conflict according to the user-defined conflict resolution strategy. It can choose to send an error report of duplicate priority value to the user so that the user can readjust the window priority value, or let the custom window display control unit automatically assign a new priority value to the newly added window node according to the predetermined conflict resolution strategy, so as to avoid the occurrence of conflict, ensure the effectiveness of the tree structure, and avoid sorting failure.
[0082] Step 6: The custom window display control unit obtains the parent node window and child node window of the newly added window in the tree structure, sets the newly added window as the transient window of its parent node window, and sets the child node window of the newly added window as the transient window of the newly added window.
[0083] In some embodiments, the transient window is set using the XSetTransientForHint function of the Xlib library or the xcb_change_property function of the XCB library. When calling the xcb_change_property function of the XCB library, the XCB_ATOM_WM_TRANSIENT_FOR property needs to be used.
[0084] The custom window display control unit uses transient windows to achieve hierarchical control of windows. Transient windows have the following properties:
[0085] Each transient window has a defined parent window, and the transient window is closed when the parent window is closed.
[0086] In terms of stacking order, transient windows will always be displayed on top of their parent windows and will not be obscured by them.
[0087] Step 7: When the custom window display control unit detects a window closing event, it responds to the event by using the event capture mechanism or window management service interface to obtain the handle of the closed window.
[0088] Specifically, when the custom window display control unit detects a window closing event, it responds to the event; in the event loop, the custom window display control unit detects a window closing event and uses the event capture mechanism to obtain the handle of the closed window; or the custom window display control unit receives a window closing message sent by the X client program unit through the window management service interface and obtains the handle of the closed window.
[0089] Step 8: The custom window display control unit obtains the custom hierarchy attribute of the closed window based on the handle of the closed window and determines whether the window has a custom hierarchy attribute. If the window has a custom hierarchy attribute, it performs hierarchy sorting; if the window does not have a custom hierarchy attribute, it does not need to perform hierarchy sorting.
[0090] Step 9: In the custom window display control unit, delete the node corresponding to the closed window in the tree structure and adjust the window display hierarchy.
[0091] The custom window display control unit adjusts the hierarchical order of closed windows. Specifically, based on the handle of the closed window and its custom hierarchical attributes, it locates the corresponding window node in the tree structure, obtains the parent and child window node information of the closed window, and calls X client library functions to set the child node windows of the closed window as the transient windows of their parent windows. In other words, the transient parent window of the child window points to its original grandparent window. This setting maintains hierarchical continuity and prevents breakage of window relationships. If the closed window is the root node of a group, its child nodes are promoted to direct children of the screen root node, thus completing the adjustment of the window display hierarchy.
[0092] This application provides a functional extension to the default window manager in the X11 environment. By adding custom layer attribute settings to windows, it enables software windows to be displayed and controlled according to user-defined layers, solving the problem of difficult control over the display layers of various window types under Linux systems. The method provided in this application has the advantages of good scalability and ease of use. When users need to adjust the window display layer, they only need to set new layer attribute values for the window to dynamically adjust and switch between them, achieving a flexible switching effect. This application solves the problem of dynamic occlusion of multiple windows in the X11 environment through a triple mechanism of custom attributes, tree structure, and transient windows.
[0093] For detailed technical descriptions of the functional modules mentioned in the aforementioned embodiment of a software window display control method based on the X11 environment, such as the X client program unit, X server program unit, X window manager unit, and custom window display control unit, please refer to the subsequent embodiment of a software window display control system based on the X11 environment. The aforementioned method and the subsequent system are technically related and will not be repeated here.
[0094] refer to Figure 3 An embodiment of this application also provides a software window display control system based on the X11 environment, which may specifically include the following functional modules.
[0095] The X client program unit provides the graphical interface and user interaction for the application software. It communicates with the X server program unit through the X protocol unit, sending interface drawing commands to the X server program unit. It sets custom hierarchy attributes for the windows to be controlled, including one or more of window grouping attributes, priority numerical attributes, and sorting control attributes.
[0096] The X server program unit is responsible for managing display hardware and input devices (such as screen, mouse, and keyboard), performing basic graphics drawing operations, and handling all graphics display-related tasks. The X server program unit runs on the local machine and is the executor of graphics display tasks.
[0097] The X Window Manager unit is a key component for the X11 environment, responsible for managing basic operations such as window decoration, positioning, layout, moving, scaling, stacking, toggling, minimizing, and closing.
[0098] The X Protocol Unit (XPU) is a request / response-based communication protocol used for graphical user interface (GUI) display and interaction in a network environment. It defines the communication rules between X client program units and X server program units, including requests, responses, and events. X client program units send request messages to X server program units through the XPU, and X server program units return device input events and response results to X client program units through the XPU. Xlib and XCB are two commonly used client libraries for implementing the X11 protocol. Xlib encapsulates the low-level details of the X11 protocol, providing various interfaces from low-level to high-level. The low-level interfaces provide the underlying implementation of X protocol requests and responses, while the high-level interfaces encapsulate more complex operations such as window management and event handling. XCB, on the other hand, is a more modern and efficient X11 client library, offering advantages such as higher performance, a simpler and more modern API, better multi-threading support, and better extensibility.
[0099] Custom Window Display Control Unit: Provides extended functionality for window display control, enabling customized window hierarchy display control. It constructs a tree structure and dynamically maintains the window display order through a transient window mechanism.
[0100] In some embodiments, the custom window display control unit may further include:
[0101] The event listener module captures window creation / closing events via event masks or web service interfaces.
[0102] The tree structure management module uses the root window of the screen as the root node and sorts and groups windows according to priority.
[0103] The transient window control module sets the parent-child transient relationship between windows.
[0104] In some embodiments, the tree structure management module may further include:
[0105] The grouping search submodule matches nodes with the same grouping attribute among the child nodes of the root node.
[0106] The conflict handling submodule automatically adjusts or reports an error when priorities are duplicated.
[0107] For the specific technical details of each functional module of the software window display control system based on the X11 environment in this embodiment, please refer to the aforementioned embodiment of the software window display control method based on the X11 environment, which will not be repeated here.
[0108] Based on the same inventive concept, embodiments of this application also provide an electronic device. Figure 4 This is a structural block diagram of an electronic device provided in an embodiment of this application. Figure 4 As shown in the embodiments of this application, an electronic device includes: one or more processors 101, a memory 102, and one or more I / O interfaces 103. The memory 102 stores one or more programs, which, when executed by the one or more processors, enable the one or more processors to implement any of the software window display control methods based on the X11 environment as described in the above embodiments; the one or more I / O interfaces 103 are connected between the processor and the memory, configured to enable information interaction between the processor and the memory.
[0109] The processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 102 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface (read / write interface) 103 is connected between the processor 101 and the memory 102, and can realize information interaction between the processor 101 and the memory 102, including but not limited to a data bus (Bus).
[0110] In some embodiments, the processor 101, memory 102, and I / O interface 103 are interconnected via bus 104, and thus connected to other components of the computing device.
[0111] In some embodiments, the one or more processors 101 include a field-programmable gate array.
[0112] This application also provides a computer-readable medium. The computer-readable medium stores a computer program, which, when executed by a processor, implements the steps of any of the software window display control methods based on the X11 environment described in the above embodiments. The computer-readable storage medium can be volatile or non-volatile.
[0113] This application also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code. When the computer-readable code is run in the processor of an electronic device, the processor in the electronic device executes the above-described software window display control method based on the X11 environment.
[0114] Those skilled in the art will understand that all or some of the steps, systems, and apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software can be distributed on a computer-readable storage medium, which may include computer storage media (or non-transitory media) and communication media (or transient media).
[0115] As is known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable program instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technologies, portable compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, it is known to those skilled in the art that communication media typically contain computer-readable program instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0116] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0117] The computer program instructions used to perform the operations of this application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuits, such as programmable logic circuits, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), are personalized by utilizing the status information of the computer-readable program instructions. These electronic circuits can execute the computer-readable program instructions to implement various aspects of this application.
[0118] The computer program product described herein can be implemented specifically through hardware, software, or a combination thereof. In one alternative embodiment, the computer program product is specifically embodied in a computer storage medium; in another alternative embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.
[0119] Various aspects of this application are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0120] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0121] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0122] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0123] Example embodiments have been disclosed herein, and while specific terminology has been used, it is for general illustrative purposes only and should not be construed as limiting. In some embodiments, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in connection with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in connection with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of this application as set forth by the appended claims.
Claims
1. A method for controlling display of a software window based on an Xl 1 environment, characterized by, The method comprises the following steps: Setting a custom hierarchy attribute for a to-be-controlled window, the custom hierarchy attribute comprising one or more of a window grouping attribute, a priority value attribute, and a sorting control attribute; Building a tree structure with the root window of a screen as a root node and the grouped windows as child nodes, and sorting the nodes according to the priority value attribute and the sorting control attribute; Listening to window creation / closure events, and if the window contains a custom hierarchy attribute, inserting it into the corresponding position of the tree structure; Setting the newly-added window as a transient window of its parent node, and updating the transient parent window pointer of the child window of the newly-added window; Deleting the corresponding node when the window is closed, and updating the transient parent window pointer of the child window of the closed window to the original grandparent window.
2. The control method according to claim 1, characterized by, The sorting rule for sorting the nodes according to the priority value attribute and the sorting control attribute satisfies the following conditions: In the increasing mode of the sorting control attribute, the priority of the child node is greater than that of the parent node; In the decreasing mode of the sorting control attribute, the priority of the child node is less than that of the parent node.
3. The control method according to claim 1, characterized by, Setting the custom hierarchy attribute comprises the following steps: Creating three atomic variables respectively associated with the window grouping attribute, the priority value attribute, and the sorting control attribute; Calling an X client library function to set the window grouping attribute, the priority value attribute, and the sorting control attribute as custom attributes of the window by using the atomic variables.
4. The control method according to claim 1, characterized by, Listening to window creation / closure events comprises the following steps: Setting an event mask for the root window of the screen; Capturing the creation / closure events of all child windows or descendant windows of the root window of the screen through an event loop.
5. The control method according to claim 1, characterized by, Further comprising the following steps: Inserting the newly-added window into the corresponding position of the tree structure, and if the priority of the newly-added window is repeated with an existing window, automatically assigning a new priority to the newly-added window or returning an error message to the client.
6. The control method according to claim 1, characterized by, Further comprising the following steps: Receiving or sending window creation / closure messages through an HTTP / Web service interface.
7. The control method according to claim 1, characterized by, Deleting the corresponding node when the window is closed, and updating the transient parent window pointer of the child window of the closed window to the original grandparent window comprises the following steps: Updating the transient parent window pointer of the child window of the closed window to the grandparent window of the closed window; If the closed window is a grouping root node, upgrading the child nodes of the closed window to direct child nodes of the root node of the screen.
8. An Xl 1 environment-based software window display control system, characterized by, The method comprises the following steps: An X client program unit sets a custom hierarchy attribute for a to-be-controlled window, the custom hierarchy attribute comprising one or more of a window grouping attribute, a priority value attribute, and a sorting control attribute; An X server program unit performs graphic drawing and input event processing; An X window manager unit manages basic window operations; A custom window display control unit builds a tree structure and dynamically maintains the display order of windows through a transient window mechanism.
9. The control system of claim 8, wherein, The custom window display control unit comprises the following units: An event listening module captures window creation / closure events through an event mask or a Web service interface; A tree structure management module sorts grouped windows according to priority in a tree structure with the root window of a screen as a root node; A transient window control module sets the parent-child transient relationship of windows.
10. The control system of claim 9, wherein, The tree structure management module comprises the following sub-modules: A grouping retrieval sub-module matches the same grouping attribute among the child nodes of the root node; A conflict processing sub-module automatically adjusts or reports an error when the priority is repeated.
Citation Information
Patent Citations
System and method for controlling display of windows
CN101021859A
Multi-window management method and multi-window browser
CN101699395A
Display method and electronic equipment
CN119311240A
Airborne display window management method and device
CN119960715A
Display device, display method, display program, and recording medium
US20030122879A1