Display adjustment method and device based on modal window, terminal and medium

By creating a display adjustment node in the Wayland synthesizer, the problem that modal windows cannot be covered in Linux systems is solved, and the user's recognition efficiency and user experience of modal windows are improved.

CN120234087AActive Publication Date: 2025-07-01KYLIN CORP
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510724207.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-03
Publication Date
2025-07-01
Estimated Expiration
2045-06-03

AI Technical Summary

Technical Problem

In Linux systems, using Wayland to draw modal windows cannot achieve coverage effect, which affects the user's usage efficiency.

Method used

By creating a display adjustment node in the Wayland synthesizer, obtain the parent window information of the modal window, set the color and rounded corner state of the rectangle box, and adjust the node level to the highest level to achieve the coverage effect.

Benefits of technology

It improves the user's recognition efficiency of modal windows, reduces misoperation of the parent window, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120234087A_ABST
    Figure CN120234087A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a display adjustment method and device based on a modal window, a terminal and a medium, and the method comprises the steps: obtaining a parent window of the modal window when the modal window is determined, and detecting whether the modal window meets the requirement of a modal window creating effect standard or not; when the requirement is met, taking the surface hierarchy tree of the parent window as a parent in the synthesizer, and creating a display adjustment node in the surface hierarchy tree; obtaining the size and the position of the parent window; in the display adjustment node, setting a rectangular frame according to the size and the position of the parent window; acquiring fillet state information of the parent window; in the display adjustment node, according to the fillet state information, setting the fillet state of the rectangular frame; setting the color of the rectangular frame as an inactive color in the display adjustment node, and setting the state of the rectangular frame as an inactive display state; and adjusting the level of the display adjustment node to be the highest level.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of window display, and particularly to a display adjustment method, device, terminal and medium based on a modal window. Background Art

[0002] A modal window is a special type of session window. After the modal window is launched, the user must complete the current operation, such as confirmation, input, or selection, etc., before continuing to operate the main interface. The main interface and other windows are disabled from interacting during this period. Modal windows usually adopt a visual hierarchy enhancement design, that is, a covering layer design (such as a shadow, semi-transparent background) is used to place the modal window on the top layer of the page, forming a visual isolation effect to enhance the focus of the user's attention.

[0003] The Linux system usually uses the Wayland display server protocol to implement the drawing of windows. Therefore, it is impossible to directly use background code to implement a display effect similar to a mask layer, nor to use Unity to implement a drawing covering effect, and there is no corresponding drawing function to implement a similar function. And the Wayland compositor doesn't do much processing on the modal window. It just treats it as an ordinary child window and moves with the hierarchy of its parent window like other child windows. In the compositor, the parent window can still be moved by the mouse, but the content in the parent window cannot be operated. However, this drawing method will cause confusion to the user. The user cannot clearly know that this is a modal window and often directly operates its parent window, thereby affecting the user's usage efficiency and experience. Summary of the Invention

[0004] Embodiments of the present invention provide a display adjustment method, device, terminal and medium based on a modal window to solve the technical problem in the prior art that the Linux system using Wayland to draw a modal window cannot achieve a covering effect and affects the user's usage efficiency.

[0005] In a first aspect, embodiments of the present invention provide a display adjustment method based on a modal window, including: When it is determined to be a modal window, obtain the parent window of the modal window and detect whether the modal window meets the requirements of the creation modal window effect standard; When the requirements are met, use the surface level tree of the parent window as the parent in the Wayland compositor and create a display adjustment node in the surface level tree; Obtain the size and location of the parent window; In the display adjustment node, set a rectangular frame according to the size and location of the parent window; Obtain the rounded corner status information of the parent window; In the display adjustment node, set the rounded corner state of the rectangular frame according to the rounded corner state information; In the display adjustment node, set the color of the rectangular frame to the inactive color and set the state of the rectangular frame to the inactive display state; Adjust the layer level of the display adjustment node to the highest level.

[0006] In a second aspect, an embodiment of the present invention further provides a display adjustment device based on a modal window, including: A detection module, configured to obtain the parent window of the modal window and detect whether the modal window meets the requirements of the creation modal window effect standard when it is determined to be a modal window; A creation module, configured to create a display adjustment node in the surface layer hierarchy tree of the parent window in the Wayland compositor with the surface layer hierarchy tree of the parent window as the parent when the requirements are met; A first acquisition module, configured to acquire the size and location of the parent window; A first setting module, configured to set a rectangular frame in the display adjustment node according to the size and location of the parent window; A second acquisition module, configured to acquire the rounded corner state information of the parent window; A second setting module, configured to set the rounded corner state of the rectangular frame in the display adjustment node according to the rounded corner state information; A setting module, configured to set the color of the rectangular frame to the inactive color and set the state of the rectangular frame to the inactive display state in the display adjustment node; An adjustment module, configured to adjust the layer level of the display adjustment node to the highest level.

[0007] In a third aspect, an embodiment of the present invention further provides a terminal, including: One or more processors; A storage device, configured to store one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the display adjustment method based on a modal window provided in the above embodiments.

[0008] In a fourth aspect, an embodiment of the present invention further provides a storage medium including computer-executable instructions, where the computer-executable instructions are used to execute the display adjustment method based on a modal window provided in the above embodiments when executed by a computer processor.

[0009] The display adjustment method, device, terminal, and medium based on a modal window provided by an embodiment of the present invention, when determining it is a modal window, obtain the parent window of the modal window, and detect whether the modal window meets the requirements of the criteria for creating the modal window effect; avoiding display adjustment errors. When the requirements are met, in the Wayland compositor, use the surface hierarchy tree of the parent window as the parent, and create a display adjustment node in the surface hierarchy tree; obtain the size and location of the parent window; in the display adjustment node, set a rectangular frame according to the size and location of the parent window; obtain the rounded corner status information of the parent window; in the display adjustment node, set the rounded corner status of the rectangular frame according to the rounded corner status information; set the color of the rectangular frame in the display adjustment node to an inactive color, and set the status of the rectangular frame to an inactive display status; adjust the level of the display adjustment node to the highest level. It is possible to determine whether the modal window meets the requirements for optimizing the display effect according to the correspondence between the modal window and the parent window. When the requirements are met, in the Wayland compositor, create a corresponding display adjustment node using the surface hierarchy tree of the parent window, and set the attributes of the display adjustment node according to the characteristics of the parent window, so that the surface corresponding to the adjustment node can achieve an overlay effect, and by adjusting the level of the display adjustment node to the highest level, making it unaffected by other layers, ensuring that in the presence of a modal window, the parent window can be in an overlay state, facilitating the user to intuitively observe that the parent window is in an overlay state, reducing various operations on it, improving the user's operation efficiency, and enhancing the user's experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Other features, objects, and advantages of the present invention will become more apparent by reading the detailed description of the non-limiting embodiments with reference to the following drawings: Figure 1 is a flowchart of the display adjustment method based on a modal window provided by Embodiment 1 of the present invention; Figure 2 is a flowchart of the display adjustment method based on a modal window provided by Embodiment 2 of the present invention; Figure 3 is a structural diagram of the display adjustment device based on a modal window provided by Embodiment 3 of the present invention; Figure 4 is a structural diagram of the terminal provided by Embodiment 4 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0011] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present invention, rather than limiting the present invention. In addition, it should be noted that for the convenience of description, only the parts related to the present invention rather than all the structures are shown in the drawings.

[0012] Embodiment 1 Figure 1 FIG. 6 is a flowchart of a display adjustment method based on a modal window provided in Embodiment 1 of the present invention. In this embodiment, the display of the modal window is adjusted and optimized based on Wayland in the Linux system. This method can be executed by a display adjustment device based on the modal window, and specifically includes the following steps: Step 110, when it is determined that it is a modal window, obtain the parent window of the modal window, and detect whether the modal window meets the requirements of the creation modal window effect standard.

[0013] Wayland is a protocol that defines how a Wayland client communicates with a Wayland compositor. Given the advantages of Wayland over X11, especially the better support it provides in terms of high resolution and high refresh rate, the open source community has fully switched to Wayland for development, and major Linux system distributions have also started using Wayland as the default graphics display protocol.

[0014] After a modal window is launched, it will have a flag of the modal attribute. In the Wayland compositor, this flag can be used to determine whether the window is a modal window. Therefore, this flag can be used to determine whether it is a modal window.

[0015] Exemplarily, the parent window of the modal window can be found in the set_parent method of the xdg_toplevel interface, or the global window tree structure maintained inside the compositor can also be queried, and the parent window of the modal window can be determined in the parent field of the wlr_xdg_surface structure.

[0016] Under normal circumstances, after the parent window is determined, the corresponding display adjustment and optimization method can be executed. However, in this embodiment, the inventor found that due to incorrect settings of the parent window or the modal window, subsequent display adjustment errors may occur. Therefore, in this embodiment, it is necessary to first detect whether the modal window meets the requirements of the creation modal window effect standard to avoid subsequent display adjustment errors.

[0017] Exemplarily, the detection of whether the modal window meets the requirements for creating the modal window effect criteria may include: checking whether the modal window exists in the Wayland compositor; checking whether the parent window of the modal window exists; and checking whether the physical surface of the parent window exists in the Wayland compositor. Optionally, the above three conditions may exist concurrently, respectively corresponding to different set error situations. The first situation can avoid the situation of later modification due to incorrect attribute setting of the original modal window. Since Wayland is set by the client and there is a situation of being changed at any time, therefore, it is necessary to check again whether the modal window exists.

[0018] Furthermore, the parent-child inheritance relationship of the window can also be set and changed by the Wayland client, so it is also necessary to determine again whether the parent window exists.

[0019] When determining that the parent window exists, it is also necessary to further check whether the entity of the parent window exists. In some cases, due to incorrect settings, the attributes of the parent window always exist, but in reality, there is no entity corresponding to the parent window. Therefore, it is necessary to check whether the physical surface of the parent window exists in the Wayland compositor. Only when the physical surface exists can it be determined that the parent window truly exists. By checking at least the above three conditions, it can be determined that the modal window and the corresponding parent window truly exist.

[0020] Step 120, when the requirements are met, in the Wayland compositor, using the surface hierarchy tree of the parent window as the parent, create a display adjustment node in the surface hierarchy tree.

[0021] When the requirements are met, in the Wayland compositor, using the surface hierarchy tree of the parent window as the parent, create a next-level node belonging to the surface hierarchy tree for the surface hierarchy tree of the parent window as the display adjustment node. Utilizing the characteristic of the child node inheriting attributes, it can change with the change of the surface hierarchy tree. For example: the change of the movement position forms a rendering system of different levels.

[0022] Step 130, obtain the size and location of the parent window, and set a rectangular frame in the display adjustment node according to the size and location of the parent window.

[0023] Exemplarily, by looking up the geometric properties of the parent window's surface hierarchy tree, determine the size and location of the parent window in the surface hierarchy tree. Correspondingly, in the display adjustment node, set a rectangular frame adapted to the parent window. Exemplarily, corresponding settings can be made in the properties of the node. Further, it is also possible to listen for the parent window size change event in the Wayland compositor; when the parent window size change event is triggered, obtain the changed size of the parent window; synchronously reset the rectangular frame according to the changed size of the parent window. The Wayland compositor can monitor the size change of the parent window at any time and dynamically adjust the rectangular frame based on this to avoid the reduction of the display adjustment effect caused by the change of the parent window size.

[0024] Step 140, obtain the rounded corner status information of the parent window, and in the display adjustment node, set the rounded corner status of the rectangular frame according to the rounded corner status information. Since the parent window is usually rounded, in the Wayland compositor, using the geometric data of wlr_surface, insert rounded corner polygons at the window edge by modifying the vertex buffer. Therefore, it is necessary to ensure that the rectangular frame has the same rounded corner effect, so as to maintain visual consistency when the windows overlap or scale, and avoid edge flickering or breaking.

[0025] Optionally, in the adjustment node, parameters can be configured, such as the rounded corner radius and the number of segments, to achieve the adjustment rendering effect that the rectangular frame has the same rounded corners as the parent window.

[0026] Step 150, set the color of the rectangular frame in the display adjustment node to the inactive color, and set the status of the rectangular frame to the inactive display status.

[0027] Exemplarily, the adjustment can be made in the composite performance attributes in the adjustment node and set to the inactive color. The inactive color is the color corresponding when the user can recognize that the window is in the inactive state, such as gray, etc. And set the status of the rectangular frame to the inactive display status. The inactive display status can be a semi-transparent state, so that the user can accurately recognize that the current window is in the inactive state and cannot be operated.

[0028] Step 160, adjust the level of the display adjustment node to the highest level.

[0029] Since the level of the adjustment node may be relatively low, the above effects may not be visually obvious. Therefore, it is necessary to set the level of the display adjustment node to the highest level, that is, it can be the first layer visually, so that the set display effect of the rectangular frame corresponding to the display adjustment node can be prominently displayed, providing an intuitive visual guide for the user to use.

[0030] In this embodiment, when it is determined that it is a modal window, the parent window of the modal window is obtained, and it is detected whether the modal window meets the requirements of the creation modal window effect standard; this avoids display adjustment errors. When the requirements are met, in the Wayland compositor, with the surface hierarchy tree of the parent window as the parent, a display adjustment node is created in the surface hierarchy tree; the size and location of the parent window are obtained; in the display adjustment node, a rectangular frame is set according to the size and location of the parent window; the rounded corner status information of the parent window is obtained; in the display adjustment node, according to the rounded corner status information, the rounded corner status of the rectangular frame is set; in the display adjustment node, the color of the rectangular frame is set to the inactive color, and the status of the rectangular frame is set to the inactive display status; the layer of the display adjustment node is adjusted to the highest level. According to the corresponding relationship between the modal window and the parent window, it can be determined whether the modal window meets the requirements of display effect optimization. When the requirements are met, in the Wayland compositor, a corresponding display adjustment node can be created with the surface hierarchy tree of the parent window, and the attributes of the display adjustment node are set correspondingly according to the characteristics of the parent window, so that the surface corresponding to the adjustment node can achieve a covering effect, and by adjusting the layer of the display adjustment node to the highest level, it is not affected by other layers, ensuring that in the presence of a modal window, the parent window can be in a covering state, facilitating the user to intuitively observe that the parent window is in a covering state, reducing various operations on it, improving the user's operation efficiency, and enhancing the user's experience.

[0031] In a preferred implementation manner of this embodiment, the method may further add the following steps: when the window starts, use the attributes set during the window map process to determine whether it is a modal window; or after the window is displayed, use the attributes input through the protocol method to determine whether it is a modal window. In common methods, it is possible to determine whether it is a modal window by querying the attributes of the window, but when to perform the query needs to be set. Usually, a timed polling method can be used to query the attributes in turn. However, this method has a certain lag and cannot adjust the display effect in a timely manner. Therefore, in this embodiment, when the window starts, the attributes set during the window map process can be used to determine whether it is a modal window. It is possible to determine whether the window is a modal window at the first time when the window starts, or after the window is displayed, that is, at the first time after the Wayland compositor finishes drawing. When setting the window attributes in the input protocol, the attributes of the modal window can be directly obtained. The above two methods can obtain the attributes within the first time after the window is drawn, and timely determine whether it is a modal window, providing a timely judgment basis for subsequent display adjustment.

[0032] In another preferred implementation manner of this embodiment, it is possible to use the surface level tree of the parent window as the parent in the Wayland compositor, create a display adjustment node in the surface level tree; obtain the size and location of the parent window; in the display adjustment node, set a rectangular frame according to the size and location of the parent window; obtain the rounded corner status information of the parent window; in the display adjustment node, set the rounded corner status of the rectangular frame according to the rounded corner status information; set the color of the rectangular frame to an inactive color and set the status of the rectangular frame to an inactive display status in the display adjustment node; adjust the level of the display adjustment node to the highest level. Specifically, it is optimized as follows: call the modal window effect creation interface to use the surface level tree of the parent window as the parent in the Wayland compositor, create a display adjustment node in the surface level tree; obtain the size and location of the parent window; in the display adjustment node, set a rectangular frame according to the size and location of the parent window; obtain the rounded corner status information of the parent window; in the display adjustment node, set the rounded corner status of the rectangular frame according to the rounded corner status information; set the color of the rectangular frame to an inactive color and set the status of the rectangular frame to an inactive display status in the display adjustment node; adjust the level of the display adjustment node to the highest level. In this embodiment, the specific display adjustment process can be encapsulated as a whole and only expose the interface externally. Users do not need to understand more implementation logics. They can use this interface to dynamically adjust whether to enable this function as needed, or select an inactive color and an inactive display status suitable for themselves according to this interface, which is convenient for adapting to the personalized needs of users and can improve the user's usage efficiency and experience.

[0033] Further, the method can also add the following content: listen for the exit signal of the modal window, listen for the signal to cancel the modal attribute set through the protocol; and listen for the exit signal of the parent window; when the exit signal of the modal window, the signal to cancel the modal attribute, or the exit signal of the parent window occurs, close the modal window effect creation interface to close all display adjustment results based on the modal window. When one of the three signals occurs, the modal window effect creation interface can be directly used to close all display adjustment results based on the modal window.

[0034] Embodiment 2 Figure 2 FIG. is a flowchart of a display adjustment method based on a modal window provided by Embodiment 2 of the present invention. This embodiment is optimized based on the above embodiment and can add the following steps: register a mouse input event in the display adjustment node; when the mouse input event is detected, read the duration information from the timer; use the Wayland compositor to redraw and refresh the modal window regularly according to the corresponding relationship between the set displacement information and the duration information.

[0035] See Figure 2 , the display adjustment method based on the modal window includes: Step 210, when it is determined to be a modal window, obtain the parent window of the modal window, and detect whether the modal window meets the requirements of the creation modal window effect standard.

[0036] Step 220, when the requirements are met, use the surface hierarchy tree of the parent window as the parent in the Wayland compositor, and create a display adjustment node in the surface hierarchy tree.

[0037] Step 230, obtain the size and location of the parent window, and set a rectangular frame in the display adjustment node according to the size and location of the parent window.

[0038] The function index value and the relative address value can be bound and stored in the dynamic link library mapping allocator as a key-value pair structure, so that the relative address value, that is, the first value, can be found using the index value later.

[0039] Step 240, obtain the rounded corner status information of the parent window, and set the rounded corner status of the rectangular frame in the display adjustment node according to the rounded corner status information.

[0040] Step 250, set the color of the rectangular frame to the inactive color in the display adjustment node, and set the status of the rectangular frame to the inactive display status.

[0041] Step 260, adjust the level of the display adjustment node to the highest level.

[0042] Step 270, register a mouse input event in the display adjustment node, and when the mouse input event is monitored, read the duration information from the timer.

[0043] Although the display result of the parent window is adjusted and an overlay effect is adopted to visually prompt the user that the current parent window cannot be operated. However, the overlay effect can be set by the user according to their own usage habits. When other users use it, it may not be intuitive to determine that the parent window cannot be operated, and then the user may operate the parent window using external devices.

[0044] Therefore, in this embodiment, when the user operates on the parent window, the display of the modal window can be further adjusted to provide different visual prompts for the user.

[0045] First, it is necessary to register a mouse input event at the display adjustment node. Since the rectangular box drawn in the adjustment node is the same size as the parent window, a mouse input event can be registered at the display adjustment node without the need to optimize and adjust the complex parent window, thus avoiding affecting other functions of the parent window. Exemplarily, the mouse input event may include: the mouse moving into the rectangular box, clicking, and the mouse moving out of the rectangular box event.

[0046] The registered event can be used to listen for the mouse input event and perform different processing for different mouse input events respectively.

[0047] Optionally, in this embodiment, a timer set within the system can be used to read the duration information from the timer when the event occurs.

[0048] Step 280, use the Wayland compositor to redraw and refresh the modal window at regular intervals according to the corresponding relationship between the set displacement information and the duration information.

[0049] Exemplarily, after the event of the mouse moving into the rectangular box is monitored and the event of clicking within the range of the rectangular box occurs, the duration information can be read from the timer. Usually in the prior art, only the mouse click event is considered, but the inventor found that if the original mouse was already placed in the rectangular box before, the user may click accidentally and their intention is not to operate on the parent window. In this case, if the display adjustment of the modal window is performed, it will not only not serve as a reminder but will instead affect the normal operation of the user. Therefore, in this embodiment, first, it is monitored whether there is an event of the mouse moving into the rectangular box, and it is continuously monitored whether there is an event of the mouse clicking on the rectangular box. Only in this case can it be determined that the user's current intention is to operate on the parent window. In this case, the timer can be started, the duration information can be read from the timer, and according to the corresponding relationship between the set displacement information and the duration information, the modal window can be redrawn and refreshed at regular intervals at a new position. Exemplarily, the duration can be designed as a small value to achieve the display effect of the modal window jittering within a certain range, thereby prompting that there is a modal window in the parent window being currently operated on.

[0050] In addition, since there are multiple levels of modal windows in the parent window, it is necessary to traverse according to the attributes of the parent window to obtain the top-level modal window and only produce the display effect of jittering within a certain range for the top-level modal window.

[0051] Correspondingly, when it is monitored that the mouse moves out of the range of the rectangular box, the timer is terminated. Since the timer stops working and the duration changes to 0, the shaking effect of the modal window can be terminated.

[0052] Using the above method, when the user operates on the parent window, the corresponding modal window shaking effect can be used to prompt the user that they need to first operate and close the modal window corresponding to the current parent window before they can operate on the main window. This further improves the efficiency of the user using the modal window.

[0053] In this embodiment, by adding the following steps: registering a mouse input event at the display adjustment node; when the mouse input event is detected, reading duration information from a timer; using the Wayland compositor to redraw and refresh the modal window at regular intervals according to the corresponding relationship between the set displacement information and the duration information. When the user operates on the parent window, the corresponding modal window shaking effect can be used to prompt the user that they need to first operate and close the modal window corresponding to the current parent window before they can operate on the main window. This further improves the efficiency of the user using the modal window.

[0054] Embodiment III Figure 3 is a schematic structural diagram of a display adjustment device based on a modal window provided by Embodiment III of the present invention. Refer to Figure 3 , the display adjustment device based on a modal window includes: A detection module 310, configured to obtain the parent window of the modal window when it is determined to be a modal window, and detect whether the modal window meets the requirements for creating a modal window effect standard; A creation module 320, configured to, when the requirements are met, use the surface hierarchy tree of the parent window as the parent in the Wayland compositor, and create a display adjustment node in the surface hierarchy tree; A first acquisition module 330, configured to acquire the size and location of the parent window; A first setting module 340, configured to set a rectangular frame in the display adjustment node according to the size and location of the parent window; A second acquisition module 350, configured to acquire the rounded corner status information of the parent window; A second setting module 360, configured to set the rounded corner status of the rectangular frame in the display adjustment node according to the rounded corner status information; A setting module 370, configured to set the color of the rectangular frame to an inactive color and set the status of the rectangular frame to an inactive display status in the display adjustment node; An adjustment module 380, configured to adjust the level of the display adjustment node to the highest level.

[0055] The display adjustment device based on the modal window provided in this embodiment obtains the parent window of the modal window when it is determined to be a modal window, and detects whether the modal window meets the requirements of the criteria for creating the modal window effect; this avoids display adjustment errors. When the requirements are met, in the Wayland compositor, using the surface hierarchy tree of the parent window as the parent, a display adjustment node is created in the surface hierarchy tree; the size and location of the parent window are obtained; in the display adjustment node, a rectangular frame is set according to the size and location of the parent window; the rounded corner status information of the parent window is obtained; in the display adjustment node, according to the rounded corner status information, the rounded corner status of the rectangular frame is set; in the display adjustment node, the color of the rectangular frame is set to the inactive color, and the status of the rectangular frame is set to the inactive display status; the layer of the display adjustment node is adjusted to the highest level. It is possible to determine whether the modal window meets the requirements for optimizing the display effect according to the correspondence between the modal window and the parent window. When the requirements are met, in the Wayland compositor, a corresponding display adjustment node can be created using the surface hierarchy tree of the parent window, and the attributes of the display adjustment node are set according to the characteristics of the parent window, so that the surface corresponding to the adjustment node can achieve an overlay effect, and by adjusting the layer of the display adjustment node to the highest level, it is not affected by other layers, ensuring that in the presence of a modal window, the parent window can be in an overlay state, facilitating the user to intuitively observe that the parent window is in an overlay state, reducing various operations on it, improving the user's operation efficiency, and enhancing the user's experience.

[0056] Based on the above embodiments, the device further includes: A registration module for registering a mouse input event in the display adjustment node; A reading module for reading duration information from a timer when the mouse input event is monitored; A drawing module for using the Wayland compositor to redraw and refresh the modal window at regular intervals according to the corresponding relationship between the set displacement information and the duration information.

[0057] Based on the above embodiments, the mouse input event includes: Mouse moving into the rectangular frame, clicking, and mouse moving out of the rectangular frame events; Correspondingly, the reading module includes: A reading unit for reading duration information from a timer after the mouse moving into the rectangular frame event is monitored and the clicking event within the range of the rectangular frame occurs; Correspondingly, the reading module further includes: A termination unit for terminating the timer when the mouse moving out of the rectangular frame event is monitored.

[0058] Based on the above embodiments, the device further includes: A first judgment module, configured to judge whether it is a modal window by using the attributes set during the window map process when the window is started; Or A second judgment module, configured to judge whether it is a modal window by using the attributes input in a protocol manner after the window is displayed.

[0059] Based on the above embodiments, the detection module includes: a detection unit, configured to: Check whether the modal window exists in the Wayland compositor; Check whether the parent window of the modal window exists; and Check whether the physical surface of the parent window exists in the Wayland compositor.

[0060] Based on the above embodiments, the device further includes: A listening module, configured to listen for the parent window size change event in the Wayland compositor; A size acquisition module, configured to acquire the changed size of the parent window when the parent window size change event is triggered; A resetting module, configured to synchronously reset the rectangular frame according to the changed size of the parent window.

[0061] Based on the above embodiments, the device further includes: An interface calling module, which calls the modal window effect creation interface to create a display adjustment node in the Wayland compositor with the surface hierarchy tree of the parent window as the parent, obtain the size and location of the parent window, set a rectangular frame in the display adjustment node according to the size and location of the parent window, obtain the rounded corner status information of the parent window, set the rounded corner status of the rectangular frame in the display adjustment node according to the rounded corner status information, set the color of the rectangular frame to an inactive color and set the status of the rectangular frame to an inactive display status in the display adjustment node, and adjust the hierarchy of the display adjustment node to the highest level; Correspondingly, it further includes: An exit signal listening module, configured to listen for the exit signal of the modal window, the signal for canceling the modal attribute set through the protocol; and the exit signal of the parent window; A closing module, configured to close all display adjustment results based on the modal window by using the modal window effect creation interface when the exit signal of the modal window, the signal for canceling the modal attribute, or the exit signal of the parent window occurs.

[0062] The display adjustment device based on a modal window provided by an embodiment of the present invention can execute the display adjustment method based on a modal window provided by any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution of the method.

[0063] Embodiment 4 Figure 4 FIG. 4 is a schematic structural diagram of a terminal provided by Embodiment 4 of the present invention. Figure 4 FIG. 5 shows a block diagram of an exemplary terminal 12 suitable for implementing the embodiments of the present invention. Figure 4 The shown terminal 12 is only an example and should not impose any limitation on the functions and usage scope of the embodiments of the present invention.

[0064] As Figure 4 shown, the terminal 12 is presented in the form of a general-purpose computing device. The components of the terminal 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 connecting different system components (including the system memory 28 and the processing unit 16).

[0065] The bus 18 represents one or more of several types of bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the multiple bus architectures. By way of example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.

[0066] The terminal 12 typically includes a variety of computer system-readable media. These media can be any available media accessible by the terminal 12, including volatile and non-volatile media, removable and non-removable media.

[0067] The system memory 28 may include computer system-readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The terminal 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, a storage system 34 may be used for reading and writing non-removable, non-volatile magnetic media ( Figure 4 not shown, typically referred to as a "hard disk drive"). Although Figure 4Not shown in the figure, a disk drive for reading and writing a removable non-volatile disk (such as a "floppy disk") and an optical disk drive for reading and writing a removable non-volatile optical disk (such as a CD-ROM, DVD-ROM or other optical medium) can be provided. In these cases, each drive can be connected to the bus 18 through one or more data medium interfaces. The memory 28 may include at least one program product having a set (such as at least one) of program modules configured to perform the functions of the embodiments of the present invention.

[0068] A program / utility 40 having a set (at least one) of program modules 42 can be stored, for example, in the memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. The implementation of a network environment may be included in each or some combination of these examples. The program modules 42 generally perform the functions and / or methods in the embodiments described in the present invention.

[0069] The terminal 12 can also communicate with one or more external devices 14 (such as a keyboard, a pointing device, a display 24, etc.), and can also communicate with one or more terminals that enable a user to interact with the terminal 12, and / or communicate with any device (such as a network card, a modem, etc.) that enables the terminal 12 to communicate with one or more other computing terminals. Such communication can be carried out through the input / output (I / O) interface 22. Moreover, the terminal 12 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through the network adapter 20. As Figure 4 shown, the network adapter 20 communicates with other modules of the terminal 12 through the bus 18. It should be understood that although not shown in the figure, other hardware and / or software modules can be used in combination with the terminal 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0070] The processing unit 16 executes various functional applications and data processing by running the programs stored in the system memory 28, such as implementing the modal window-based display adjustment method provided by the embodiments of the present invention.

[0071] Embodiment 5 Embodiment 5 of the present invention also provides a storage medium containing computer-executable instructions, and the computer-executable instructions are used to execute any one of the modal window-based display adjustment methods provided by the above embodiments when executed by a computer processor.

[0072] The computer storage medium of an embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the computer-readable storage medium include: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device.

[0073] The computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries the computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and this computer-readable medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device.

[0074] The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0075] The computer program code for performing the operations of the present invention can be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or device. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).

[0076] Note that the above is only a preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein. Various obvious changes, re-adjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, more other equivalent embodiments can be included, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A display adjustment method based on a modal window, characterized in that including: When it is determined to be a modal window, obtain the parent window of the modal window, and detect whether the modal window meets the requirements of the creation modal window effect standard; When the requirements are met, in the Wayland compositor, use the surface hierarchy tree of the parent window as the parent, and create a display adjustment node in the surface hierarchy tree; Obtain the size and location of the parent window; In the display adjustment node, set a rectangular frame according to the size and location of the parent window; Obtain the rounded corner status information of the parent window; In the display adjustment node, set the rounded corner status of the rectangular frame according to the rounded corner status information; In the display adjustment node, set the color of the rectangular frame to an inactive color, and set the status of the rectangular frame to an inactive display status; Adjust the level of the display adjustment node to the highest level.

2. The method according to claim 1, wherein The method further includes: Register a mouse input event in the display adjustment node; When the mouse input event is monitored, read the duration information from the timer; Use the Wayland compositor to redraw and refresh the modal window regularly according to the corresponding relationship between the set displacement information and the duration information.

3. The method according to claim 2, wherein The mouse input event includes: Mouse moving into the rectangular frame, clicking, and mouse moving out of the rectangular frame events; Correspondingly, the step of reading the duration information from the timer when the mouse input event is monitored includes: After monitoring that the mouse moving into the rectangular frame event occurs and when the clicking event within the range of the rectangular frame occurs, read the duration information from the timer; Correspondingly, the method further includes: When monitoring that the mouse moving out of the rectangular frame event occurs, terminate the timer.

4. The method according to claim 1, wherein The method further includes: When the window starts, use the attributes set during the window map process to determine whether it is a modal window; Or After the window is displayed, use the attributes input through the protocol method to determine whether it is a modal window.

5. The method according to claim 4, wherein The step of detecting whether the modal window meets the requirements of the creation modal window effect standard includes: Check whether the modal window exists in the Wayland compositor; Check whether the parent window of the modal window exists; and Check whether the entity surface of the parent window exists in the Wayland compositor.

6. The method according to claim 1, characterized in that The method further includes: Monitor the parent window size change event in the Wayland compositor; When the parent window size change event is triggered, obtain the changed parent window size; Synchronously reset the rectangular frame according to the changed parent window size.

7. The method according to claim 1, wherein The steps of using the surface hierarchy tree of the parent window as the parent in the Wayland compositor, creating a display adjustment node in the surface hierarchy tree; obtaining the size and location of the parent window; setting a rectangular frame in the display adjustment node according to the size and location of the parent window; obtaining the rounded corner status information of the parent window; setting the rounded corner status of the rectangular frame in the display adjustment node according to the rounded corner status information; setting the color of the rectangular frame to an inactive color and setting the status of the rectangular frame to an inactive display status in the display adjustment node; Adjusting the level of the display adjustment node to the highest level includes: Call the modal window effect creation interface to implement creating a display adjustment node in the surface hierarchy tree of the parent window in the Wayland compositor with the surface hierarchy tree of the parent window as the parent; obtain the size and location of the parent window; in the display adjustment node, set a rectangular frame according to the size and location of the parent window; obtain the rounded corner status information of the parent window; in the display adjustment node, set the rounded corner status of the rectangular frame according to the rounded corner status information; set the color of the rectangular frame to an inactive color and set the status of the rectangular frame to an inactive display status in the display adjustment node; adjust the level of the display adjustment node to the highest level. Correspondingly, the method further includes: Listening for the exit signal of the modal window, listening for the signal for canceling the modal attribute set through the protocol; and listening for the exit signal of the parent window. When the exit signal of the modal window, the signal for canceling the modal attribute, or the exit signal of the parent window occurs, use the modal window effect creation interface to close all display adjustment results based on the modal window.

8. A display adjustment device based on a modal window, characterized in that It includes: A detection module for, when determining it is a modal window, obtaining the parent window of the modal window and detecting whether the modal window meets the requirements of the creation modal window effect standard. A creation module for, when the requirements are met, creating a display adjustment node in the surface hierarchy tree in the Wayland compositor with the surface hierarchy tree of the parent window as the parent. A first acquisition module for obtaining the size and location of the parent window. A first setting module for setting a rectangular frame in the display adjustment node according to the size and location of the parent window. A second acquisition module for obtaining the rounded corner status information of the parent window. A second setting module for setting the rounded corner status of the rectangular frame in the display adjustment node according to the rounded corner status information. A setting module for setting the color of the rectangular frame to an inactive color and setting the status of the rectangular frame to an inactive display status in the display adjustment node. An adjustment module for adjusting the level of the display adjustment node to the highest level.

9. A terminal, characterized in that, It includes: One or more processors; A storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, enabling the one or more processors to implement the display adjustment method based on the modal window as described in any one of claims 1-7.

10. A storage medium containing computer-executable instructions, characterized in that, The computer-executable instructions are used to execute the display adjustment method based on the modal window as described in any one of claims 1-7 when executed by a computer processor.

Citation Information

Patent Citations

  • Display control method and device for modal dialog boxes

    CN102436339A

  • Application window interface changing method and apparatus

    CN105404512A

  • Control method and device for windows in application program

    CN105892817A

  • Dialog box display method and device, computer equipment and storage medium

    CN111078335A

  • Data processing method and device

    CN114330717A