Application window adjustment method and device, electronic equipment, storage medium and product
By receiving and parsing the size adjustment messages of the desktop operating system, automatically adjusting the resolution and size of the component window, it solves the problem of poor display effect of Android applications on large-sized screens, and achieves the best display effect and user experience of the component window .
Patent Information
- Application Number
- CN202411641722.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2024-12-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The Android applications of the current desktop operating system cannot meet the application window size requirements on large-sized screens, resulting in poor display effects and the window size cannot be adjusted freely, affecting the visual effect.
Provide an application window adjustment method, by receiving and parsing component window size adjustment messages sent by the desktop operating system, judging the size change type and resolution requirements of component windows, and automatically adjusting the resolution and size to ensure that component windows are on different display devices and The best display effect is presented at resolution.
It realizes clear and coherent display of component windows, improves operational efficiency and user experience, and avoids display problems caused by resolution mismatch or inflexible size adjustments, such as picture distortion or stretching.
Smart Images

Figure CN119149159A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of interface display technology, and in particular to an application window adjustment method, device, electronic device, storage medium and computer program product. Background Art
[0002] In the current Android application compatible display based on the desktop operating system, it is mainly realized through the Android virtual screen. There are only two options: fixed window size and maximization. The window size cannot be changed freely, and maximization only scales the Android window to the maximum, which seriously affects the visual effect. When large-size screens such as extended screens and 4k screens are connected, the Android system cannot meet the corresponding window size requirements. Therefore, there is a problem in the Android application display of the current desktop operating system that the application window is difficult to adapt efficiently. Summary of the invention
[0003] The main purpose of the present application is to provide an application window adjustment method, device, electronic device, storage medium and computer program product, aiming to solve the technical problem that application windows are difficult to adapt efficiently.
[0004] To achieve the above object, the present application proposes an application window adjustment method, which is applied to a preset operating system, the preset operating system is compatible with running on a desktop operating system, a target application is running on the preset operating system, and the target application corresponds to at least one component window. The application window adjustment method includes: For any component window of the target application, receiving a size adjustment message of the component window sent by the desktop operating system, and determining a target size of the component window by parsing the size adjustment message, wherein the target size represents the number of pixels occupied by the component window; Determining a size change type of the component window by comparing the target size with an original size of the component window, and judging whether an original resolution of the component window meets a resolution requirement of the target size according to the size change type; When the original resolution of the component window does not meet the resolution requirement of the target size, the original resolution is adjusted to a target resolution level corresponding to the target size, and the original size of the component window is set to the target size; After traversing each component window of the target application, the component windows are synthesized into an application image and output to the desktop operating system.
[0005] In one embodiment, a daemon service process is provided in the preset operating system, and the step of receiving a size adjustment message of the component window sent by the desktop operating system and determining a target size of the component window by parsing the size adjustment message comprises: Monitoring whether a size adjustment message is input to the waiting service process, wherein the size adjustment message is input by the desktop operating system through inter-process communication, and the size adjustment message encapsulates the target size of the component window after being adjusted; The size adjustment message received in the waiting service process is parsed according to a preset protocol, and the target size is extracted and stored.
[0006] In one embodiment, the size adjustment message further encapsulates a window identifier corresponding to the target size, and the steps of determining the size change type of the component window by comparing the target size with the original size of the component window, and judging whether the original resolution of the component window meets the resolution requirement of the target size according to the size change type include: Determine the component window by using the window identifier, compare the target size with the original size of the component window, and determine whether the size change type of the component window is an enlargement type or a reduction type; If the target size is larger than the original size, it indicates that the size change type is an enlargement type, and when the preset resolution level corresponding to the target size is larger than the preset resolution level corresponding to the original resolution, it is determined that the original resolution of the component window does not meet the resolution requirement of the target size; If the target size is smaller than the original size, it indicates that the size change type is a reduction type. When the preset resolution level corresponding to the target size is smaller than the preset resolution level corresponding to the original resolution, it is determined that the original resolution of the component window does not meet the resolution requirement of the target size.
[0007] In one embodiment, the step of adjusting the original resolution to a target resolution level corresponding to the target size includes: In the case where the preset resolution level corresponding to the target size is greater than the preset resolution level corresponding to the original resolution, matching the target resolution level corresponding to the target size in a preset resolution level higher than the original resolution, and adjusting the original resolution to the target resolution level; When the preset resolution level corresponding to the target size is smaller than the preset resolution level corresponding to the original resolution, the target resolution level corresponding to the target size is matched in a preset resolution level lower than the original resolution, and the original resolution is adjusted to the target resolution level.
[0008] In one embodiment, the step of synthesizing the component windows into an application image and outputting the application image to the desktop operating system includes: Capture all component windows, synthesize them through a preset image synthesizer, and generate an application image; When it is determined that the desktop operating system is credible, a connection channel for the desktop operating system is established, and the application image is transferred to the desktop operating system to display the application image.
[0009] In one embodiment, the application window adjustment method further includes: Each time a size adjustment message of the component window sent by the desktop operating system is received, a target size in the size adjustment message is recorded to generate a size adjustment set; Analyze the size adjustment set to determine the size adjustment range of the component window; When the target application is started in the preset operating system, a component window of an optimal window size is created according to the size adjustment range.
[0010] In addition, to achieve the above-mentioned purpose, the present application also proposes an application window adjustment device, which is applied to a preset operating system, the preset operating system is compatible with running on a desktop operating system, a target application is running on the preset operating system, and the target application corresponds to at least one component window. The application window adjustment device includes: A receiving module, configured to receive, for any component window of the target application, a size adjustment message of the component window sent by the desktop operating system, and determine a target size of the component window by parsing the size adjustment message, wherein the target size represents the number of pixels occupied by the component window; A judgment module, used for determining a size change type of the component window by comparing the target size with an original size of the component window, and judging whether an original resolution of the component window meets a resolution requirement of the target size according to the size change type; An adjustment module, configured to adjust the original resolution to a target resolution level corresponding to the target size and set the original size of the component window to the target size if the original resolution of the component window does not meet the resolution requirement of the target size; The output module is used to synthesize the component windows of the target application into an application image after traversing the component windows of the target application and output the application image to the desktop operating system.
[0011] In addition, to achieve the above objectives, the present application also proposes an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the application window adjustment method described above.
[0012] In addition, to achieve the above objectives, the present application also proposes a storage medium, which is a computer-readable storage medium, and stores a computer program on the storage medium. When the computer program is executed by a processor, the steps of the application window adjustment method described above are implemented.
[0013] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the application window adjustment method described above are implemented.
[0014] The present application provides an application window adjustment method, which is applied to a preset operating system. The preset operating system is compatible with running on a desktop operating system. A target application is running on the preset operating system, and the target application corresponds to at least one component window. The application window adjustment method includes: for any component window of the target application, receiving a size adjustment message of the component window sent by the desktop operating system, determining a target size of the component window by parsing the size adjustment message, and the target size represents the number of pixels occupied by the component window; determining a size change type of the component window by comparing the target size with an original size of the component window, and judging whether an original resolution of the component window meets a resolution requirement of the target size according to the size change type; if the original resolution of the component window does not meet the resolution requirement of the target size, adjusting the original resolution to a target resolution level corresponding to the target size, and setting the original size of the component window to the target size; after traversing each component window of the target application, synthesizing each component window into an application image and outputting it to the desktop operating system.
[0015] The present application directly receives and parses the size adjustment message of the desktop operating system, parses the target size of the component window, ensures that the preset operating system can capture the change of the user or program to the size of the component window, and provides a basis for the subsequent component window adjustment. By judging the size change type and resolution requirements, it accurately identifies whether the current component window needs to adjust the resolution, comprehensively considers the adaptation of the component window size and resolution, and ensures the display effect of the component window after adjustment. When the original resolution of the component window does not meet the resolution requirements of the target size, the resolution and size are automatically adjusted to ensure that the display effect of the component window after adjustment is optimal. By synthesizing and outputting the application image, the complete display of the component window is achieved, ensuring that the user can see a clear and coherent application interface. Compared with the related solutions, the component window often has a poor display effect due to resolution mismatch or inflexible size adjustment, and may even cause problems such as picture distortion, stretching or compression. The present application can receive and process the size adjustment message of the component window, realize automatic adjustment of the component window size and resolution, and obtain a clear and coherent application interface without manual intervention by the user, ensuring that the component window can present the best display effect under different display devices and resolutions, greatly improving the operation efficiency and user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 A flowchart of the first embodiment of the method for adjusting the application window of the present application is provided; Figure 2 A flowchart of the second embodiment of the application window adjustment method of the present application is provided; Figure 3 The overall flow chart of the window adjustment method for this application; Figure 4 This is a schematic diagram of the module structure of the window adjustment device used in the embodiment of the present application; Figure 5 A schematic diagram of the device structure of the hardware operating environment involved in the application window adjustment method in the embodiment of the present application.
[0019] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0020] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0021] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0022] The embodiment of the present application is applied to a preset operating system, which is compatible with running on a desktop operating system. A target application is running on the preset operating system, and the target application corresponds to at least one component window. The main solution is: for any component window of the target application, a size adjustment message of the component window sent by the desktop operating system is received, and the target size of the component window is determined by parsing the size adjustment message, where the target size represents the number of pixels occupied by the component window; the size change type of the component window is determined by comparing the target size with the original size of the component window, and whether the original resolution of the component window meets the resolution requirement of the target size is judged according to the size change type; when the original resolution of the component window does not meet the resolution requirement of the target size, the original resolution is adjusted to the target resolution level corresponding to the target size, and the original size of the component window is set to the target size; after traversing each component window of the target application, each component window is synthesized into an application image and output to the desktop operating system.
[0023] In this embodiment, for ease of description, the following description is made with the preset operating system as the execution subject.
[0024] Due to the existing technology, when the current desktop operating system is compatible with displaying Android applications, the window size adjustment function is limited and only supports fixed size or maximization. It cannot be adjusted freely, which affects the user experience. It is not compatible with large screens (such as 4K screens). The Android system cannot provide a suitable window size, resulting in poor display effects.
[0025] The present application provides a solution, which ensures that the component window can present the best display effect on different display devices and resolutions by presetting resolution levels and adjusting the size in real time, and realizes automatic adjustment of the component window size and resolution without manual intervention by the user, thereby greatly improving operational efficiency and user experience.
[0026] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a preset operating system, etc. The following takes the preset operating system as an example to illustrate this embodiment and the following embodiments.
[0027] Based on this, the embodiment of the present application provides an application window adjustment method, which is applied to a preset operating system, the preset operating system is compatible with running on a desktop operating system, a target application is running on the preset operating system, and the target application corresponds to at least one component window. Figure 1 , Figure 1 This is a flow chart of the first embodiment of the application window adjustment method of the present application.
[0028] In this embodiment, the application window adjustment method includes steps S01 to S04: Step S01, for any component window of the target application, receiving a size adjustment message of the component window sent by the desktop operating system, and determining a target size of the component window by parsing the size adjustment message, where the target size represents the number of pixels occupied by the component window; It should be noted that the preset operating system refers to the operating system environment on which this application is based, which may be the Android system; the desktop operating system refers to the host environment in which the preset operating system runs, such as the Linux desktop operating system; the target application refers to the application running on the preset operating system; the component window refers to the window interface displayed by the target application in the preset operating system; and the target size refers to the size of the component window changed by the user by dragging the mouse or clicking the maximize button.
[0029] In addition, it should be noted that before the preset operating system runs the target application, the desktop operating system will create a preset operating system operating environment with a default resolution size (e.g., 1920x1080) when it is started, and create a component window with a default size (e.g., 820x600) when the preset operating system starts the target application. The dynamic changes of multiple component windows are monitored in the desktop operating system. When the user changes the size of any component window by dragging the mouse, clicking the maximize button, or other means, the desktop operating system detects this change in real time and transmits the new size information of the target window (i.e., the target size) to the preset operating system. The target size is expressed in pixels and is used to represent the number of pixels occupied by the component window, such as 2200x1200. The preset operating system can perform subsequent window adjustment operations only after receiving the target size.
[0030] It is understandable that, since existing solutions can often only provide fixed window size or maximization functions and cannot capture the user's size adjustment operations in real time, step S01 is performed, and the system can receive component window size adjustment information detected by the desktop operating system in real time, providing basic data for resolution adjustment and size adaptation in subsequent steps.
[0031] Step S02, determining the size change type of the component window by comparing the target size with the original size of the component window, and judging whether the original resolution of the component window meets the resolution requirement of the target size according to the size change type; It should be noted that the target size is compared with the original size of the component window to determine the size change type (increase or decrease). At the same time, the resolution of the component window when it is not adjusted under the corresponding size change type (i.e., the original resolution) is compared with the resolution level corresponding to the target size. If the resolution level corresponding to the target size is not met, it means that the original resolution of the component window does not meet the resolution requirement of the target size, otherwise it meets the resolution requirement.
[0032] It is understandable that, since the existing solutions cannot automatically determine and adapt to window size changes through manual adjustment or fixed resolution settings, step S02 is performed to determine the type of size change (such as enlargement or reduction) by comparing the target size with the original size of the component window, and then determine whether the original resolution of the component window meets the resolution requirement of the target size. This realizes automatic determination of resolution requirements based on size changes, and provides a basis for judgment for subsequent resolution adjustments.
[0033] It is understandable that, since existing solutions can often only provide fixed resolution levels or cannot be dynamically adjusted according to the window size, step S02 is performed to compare the target size of the component window with the preset resolution level, and dynamically adjust the resolution and window size of the preset operating system, ensuring that the component window can obtain the best display effect at different sizes while reducing unnecessary resource usage.
[0034] Step S03, when the original resolution of the component window does not meet the resolution requirement of the target size, the original resolution is adjusted to a target resolution level corresponding to the target size, and the original size of the component window is set as the target size; It should be noted that the target resolution gear refers to a series of resolution levels preset by the system to meet the needs of different sizes. If the resolution requirement of the target size is not greater than the original resolution, the original size of the component window is directly set to the target size. If the resolution requirement of the target size is greater than the original resolution, the original resolution is adjusted to the target resolution gear corresponding to the target size and the original size of the component window is set to the target size.
[0035] It is understandable that, since existing solutions can often only provide fixed resolution levels or cannot be dynamically adjusted according to the window size, step S03 is performed to compare the target size of the component window with the preset resolution level, and dynamically adjust the resolution and window size of the preset operating system, ensuring that the component window can obtain the best display effect at different sizes while reducing unnecessary resource usage.
[0036] Step S04, after traversing each component window of the target application, synthesize each component window into an application image and output it to the desktop operating system.
[0037] It should be noted that the application image refers to the image of the component window prepared to be output to the desktop operating system for display after all component windows are synthesized. In the preset operating system, the component windows of the target application are traversed, the images of the component windows are synthesized, the final application image is generated, and the synthesized application image is output to the desktop operating system for display, so that the user can see the dynamically adjusted component windows in the desktop operating system, and the display effect is optimized.
[0038] It is understandable that since existing solutions often use virtual screens to display multiple windows, the more windows there are, the more virtual screens need to be created, which seriously affects performance. Therefore, step S04 is performed to synthesize the component windows, generate an application image and output it to the desktop operating system for display, without creating a virtual screen. At the same time, it ensures that multiple component windows can be displayed simultaneously and smoothly in the desktop operating system, thereby improving the display effect and user experience.
[0039] In a feasible implementation, a daemon service process is provided in the preset operating system. In step S01, a size adjustment message of a component window sent by the desktop operating system is received, and the step of determining a target size of the component window by parsing the size adjustment message includes steps A01-A02: Step A01, monitoring whether a size adjustment message is input to the daemon service process, wherein the size adjustment message is input by the desktop operating system through inter-process communication, and the size adjustment message encapsulates the target size of the component window after being adjusted; It should be noted that the daemon process is a program running in the background of the preset operating system, which is responsible for monitoring and processing size adjustment messages from the desktop operating system. Size adjustment messages refer to communication data packets that encapsulate window size change information and include target sizes, which are used to inform corresponding component window sizes that have changed. Inter-process communication refers to the process of exchanging information or data between different processes, such as IPC communication methods such as sockets, which are used to pass size adjustment messages in the desktop operating system to the daemon process. Window adjustment operations refer to the behavior of users or the system changing the size of component windows, such as dragging window borders, adjusting window layouts, etc.
[0040] In addition, it should be noted that the preset operating system includes a waiting service process, which is responsible for monitoring and processing size adjustment messages from the desktop operating system, and detecting in real time whether the waiting service process has received the size adjustment message. The size adjustment message is transmitted from the desktop operating system through the inter-process communication mechanism, which encapsulates the target size of the component window after receiving the window adjustment operation.
[0041] Step A02: parsing the size adjustment message received in the waiting service process according to a preset protocol, extracting and storing the target size.
[0042] It should be noted that when the waiting service process detects the incoming size adjustment message, it confirms the integrity and validity of the size adjustment message, including checking the message format, checksum, etc., to ensure that the message has not been tampered with or damaged during transmission. Once the size adjustment message is confirmed to be valid, the waiting service process parses the message content and extracts the target size from the message. The parsed target size is stored in the internal data structure of the waiting service process for subsequent processing and query.
[0043] In this implementation, a waiting service process is set up and size adjustment messages are detected to ensure that size change information can be captured in a timely manner, providing a basis for subsequent processing. By parsing messages and storing key information, accurate data support is provided for subsequent component window adjustments, ensuring that the window can correctly adapt to the new size.
[0044] In a feasible implementation, the size adjustment message also encapsulates a window identifier corresponding to the target size. In step S02, the size change type of the component window is determined by comparing the target size with the original size of the component window. The step of judging whether the original resolution of the component window meets the resolution requirement of the target size according to the size change type includes steps A11 to A13: Step A11, determining the component window through the window identifier, comparing the target size with the original size of the component window, and determining whether the size change type of the component window is an enlargement type or a reduction type; It should be noted that the window identifier is a string or numeric code that uniquely identifies a component window. It is used to associate a size adjustment message with a specific component window to ensure that the message can be correctly processed and applied to the corresponding component window. The waiting service process uses the window identifier to find and determine the corresponding component window in the component window list maintained internally. At the same time, after obtaining the target size of the target window, it compares it with the original size of the current record. Through the comparison result, it determines whether the size change type of the component window is an enlargement type or a reduction type.
[0045] Step A12: if the target size is larger than the original size, it indicates that the size change type is an enlargement type. When the preset resolution level corresponding to the target size is larger than the preset resolution level corresponding to the original resolution, it is determined that the original resolution of the component window does not meet the resolution requirement of the target size. It should be noted that the preset resolution level is a standard resolution selection provided for the target application to optimize the display effect, such as 1920x1080 (1080p), 2560x1440 (1440p), 3840x2160 (4K), etc. The original resolution refers to the resolution of the component window before adjustment. Check whether the target size is larger than the currently recorded original size. When the target size is larger than the original size, determine that the size change type of the component window is an enlargement type, and further determine whether the preset resolution level corresponding to the target size is higher than the preset resolution level corresponding to the original resolution. If it is higher than the preset resolution level corresponding to the original resolution, it is determined that the original resolution of the component window does not meet the resolution requirement of the target size. If it does not exceed the preset resolution level corresponding to the original resolution, there is no need to adjust the resolution of the component window, only the original size of the component window needs to be adjusted.
[0046] Step A13, if the target size is smaller than the original size, it indicates that the size change type is a reduction type. When the preset resolution level corresponding to the target size is smaller than the preset resolution level corresponding to the original resolution, it is determined that the original resolution of the component window does not meet the resolution requirement of the target size.
[0047] It should be noted that, similar to step A12, it is checked whether the target size is smaller than the original size of the current record. When the target size is smaller than the original size, it is determined that the size change type of the component window is a reduction type, and it is further determined whether the preset resolution level corresponding to the target size is lower than the preset resolution level corresponding to the original resolution. If it is lower than the preset resolution level corresponding to the original resolution, it is determined that the original resolution of the component window does not meet the resolution requirement of the target size. If it is not lower than the preset resolution level corresponding to the original resolution, there is no need to adjust the resolution of the component window, and only the original size of the component window needs to be adjusted.
[0048] For example, assume that the system has the following resolution levels: Level 1, 1920x1080: 1080p; Level 2, 2560x1440: 1440p; Level 3, 3840x2160: 4K. When a user enlarges a component window from 820x600 to 2200x1200, the system determines that the size change type of the component window is an enlargement type, and the adjusted size exceeds the level corresponding to the current preset operating system resolution of 1920x1080, so it is necessary to adjust the resolution of the corresponding component window in the preset operating system. Similarly, if a user reduces a window from 2560x1440 to 1800x1000, it is detected that the sizes of all windows are not within the 1920x1080 level (but one window is close to the level), so only the size of the corresponding window is adjusted without changing the resolution of the corresponding component window in the preset operating system.
[0049] In this implementation, the component window of the target size desired by the user is accurately identified and located through the window identifier, providing a precise target for subsequent operations, and accurately judging the user's operation intention (zooming in or out) by comparing the sizes before and after adjustment, providing a decision basis for subsequent resolution adjustment, and by judging whether the target size exceeds or is lower than the preset resolution level, the system can intelligently decide whether it is necessary to adjust the original resolution of the corresponding component window to adapt to enlarging or reducing the original size of the component window, thereby improving user experience, system performance and flexibility.
[0050] In a feasible implementation manner, in step S02, the step of adjusting the original resolution to a target resolution level corresponding to the target size includes steps A21-A22: Step A21, when the preset resolution level corresponding to the target size is greater than the preset resolution level corresponding to the original resolution, matching the target resolution level corresponding to the target size in the preset resolution level higher than the original resolution, and adjusting the original resolution to the target resolution level; It should be noted that the system detects whether the preset resolution level corresponding to the target size exceeds the preset resolution level corresponding to the current original resolution. If so, the system searches for the level that best matches the target size (i.e., the target resolution level) among the preset resolution levels that are higher than the current original resolution. After a successful match, the system calls the corresponding system service (such as WindowManagerService) to adjust the original resolution to the matching target resolution level.
[0051] Step A22, when the preset resolution level corresponding to the target size is smaller than the preset resolution level corresponding to the original resolution, the target resolution level corresponding to the target size is matched in the preset resolution level lower than the original resolution, and the original resolution is adjusted to the target resolution level.
[0052] It should be noted that, similar to step A22, the system detects whether the preset resolution level corresponding to the target size is lower than the preset resolution level corresponding to the current original resolution. If so, the system searches for the level that best matches the target size (i.e., the target resolution level) among the preset resolution levels that are lower than the current original resolution. After a successful match, the system calls the corresponding system service to adjust the original resolution to the matching target resolution level.
[0053] For example, assume that the system has the following resolution levels: Level 1, 1920x1080: 1080p; Level 2, 2560x1440: 1440p; Level 3, 3840x2160: 4K. Initially, the system resolution is 1920x1080 (Level 1). The user drags the window edge to adjust the window size to 2200x1200. The system detects the change in window size and determines it as an enlargement type. It matches the preset resolution level to the corresponding larger resolution of 2200x1200. For high-level resolution (2560x1440, level 2), call the setForcedDisplaySize method of WindowManagerService to set the Android system resolution to 2560x1440. On the contrary, if the user adjusts the window size to be smaller than the current system resolution (such as 1080x720), the system will automatically match it to a lower resolution level (such as 1920x1080, level 1) and adjust the system resolution to that level.
[0054] In this implementation, by presetting the resolution level, the resolution level is automatically matched and adjusted to a level suitable for the current window size, thereby avoiding problems such as blurred display or content overflow due to insufficient resolution, ensuring the display effect and user experience of the application, and at the same time, reducing unnecessary resource consumption and improving system performance.
[0055] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 2 In step S03, the step of synthesizing the component windows into an application image and outputting it to the desktop operating system includes steps S11 to S12: Step S11, capturing all component windows, and synthesizing the component windows through a preset image synthesizer to generate an application image; It should be noted that the preset image synthesizer (such as SurfaceFlinger) refers to a pre-configured component or module in the system for synthesizing multiple component windows. It has powerful image processing capabilities and flexible synthesis rules to meet the needs of different scenarios. The system traverses all currently running target applications, captures their component windows, and uses the preset image synthesizer to synthesize the captured component windows according to specific rules (such as hierarchy, transparency, etc.) to generate a complete application image containing the contents of all component windows.
[0056] Step S12: when it is determined that the desktop operating system is credible, a connection channel for the desktop operating system is established, and the application image is transmitted to the desktop operating system so that the application image is displayed.
[0057] It should be noted that the connection channel refers to the channel required to transfer the application image generated by the target application from the preset operating system to the desktop operating system, which can be an IPC channel based on memory sharing, or a network socket based on network communication, etc. The preset operating system authenticates the desktop operating system (such as digital signature verification, digital certificate verification, etc.) to ensure its credibility. After confirming that the desktop operating system is credible, a connection channel is established for transmitting data, and the application image generated in step S11 is passed to the desktop operating system through the connection channel. After receiving the application image, the desktop operating system will display it on the screen.
[0058] In this implementation, through the use of a preset image synthesizer, the synthesis problem of multiple component windows is automatically and efficiently handled to ensure that the component windows can be displayed on the screen as expected, which not only improves the display efficiency but also enhances the user experience, allowing the desktop operating system to run the target application more smoothly. By establishing a secure and efficient connection channel, the application image is transmitted to the desktop operating system in real time and ensures its correct display, which not only improves the security and stability of the system but also ensures that users can have a smooth application experience.
[0059] In a feasible implementation manner, the application window adjustment method further includes steps B01 to B03: Step B01, each time a size adjustment message of a component window sent by a desktop operating system is received, a target size in the size adjustment message is recorded to generate a size adjustment set; It should be noted that the desktop operating system monitors the size changes of component windows in real time. Each time a size change is detected, the system records the new size information (i.e., the target size) and stores it in a size adjustment set. The size adjustment set is a data structure containing multiple size records. Each record represents the size information of the component window at a certain point in time, reflecting the change history of the component window size and the user's preference.
[0060] Step B02, analyzing the size adjustment set to determine the size adjustment range of the component window; It should be noted that the size adjustment set is cleaned to remove duplicate, invalid or abnormal data records, and the statistics of each size parameter in the size adjustment set, such as the mean, median, maximum, minimum, etc., are calculated. Statistical methods (such as normal distribution analysis, box plot analysis, etc.) are used to analyze the trend and pattern of size changes, such as whether the user tends to adjust the window to a certain size. Based on the results of statistical analysis, the size adjustment range is determined, and the size adjustment range covers the window size that the user is most likely to accept.
[0061] Step B03: when starting the target application in the preset operating system, create a component window of the optimal window size according to the size adjustment range.
[0062] It should be noted that before starting the target application, the predetermined size adjustment range is read, and the optimal window size is calculated based on the size adjustment range. The optimal window size can be a specific value within the size adjustment range (such as the average, median, etc.), or a comprehensive value obtained through weighted calculation. Use the API or tools provided by the operating system to create a component window based on the calculated optimal window size.
[0063] In this implementation, by continuously recording the target size of the component window, a large amount of size data about user preferences and application requirements is accumulated, which provides a basis for subsequent analysis and helps the system to more accurately understand the user's real needs for window size. By analyzing the size adjustment set, a size adjustment range based on the user's actual usage is obtained, which provides a basis for the subsequent creation of a component window with an optimal window size, and helps to improve the adaptation effect and user experience of the component window. By creating a component window with an optimal window size according to the size adjustment range, the adaptation effect and user experience of the component window are significantly improved. The user does not need to manually adjust the window size to obtain a window interface that meets their needs and preferences.
[0064] For example, to help understand the technical concept or technical principle of this application, please refer to Figure 3 , Figure 3An overall flow chart of an application window adjustment method is provided. When a desktop operating system is started, a preset operating system environment with a default resolution (e.g., 1920x1080) is created. When a target application is started in the preset operating system, a window of a default size (e.g., 820x600) is created. When it is detected that a user adjusts a component window, the adjusted window size, i.e., the target size, is obtained. According to the target size, it is determined whether the component window is enlarged. If the component window is enlarged, it is determined whether the target size is larger than the resolution of the component window before adjustment, i.e., the original resolution. When the target size is larger than the original resolution, the adjustment gear corresponding to the target size is matched in a preset resolution gear higher than the original resolution, the original resolution is adjusted to the adjustment gear, and then the size of the component window is adjusted, and the size of the component window before adjustment (i.e., the original size) is set as the target size. If the target size is smaller than the original resolution, there is no need to adjust the original resolution, and the original size of the component window is directly adjusted to the target size; accordingly, if the component window is reduced, it is determined whether the target size is smaller than the original resolution. If the target size is smaller than the original resolution, the adjustment gear corresponding to the target size is matched in a preset resolution gear lower than the original resolution, the original resolution is adjusted to the adjustment gear, and then the size of the component window is adjusted, and the original size of the component window is set to the target size. If the target size is smaller than the original resolution, there is no need to adjust the original resolution, and the original size of the component window is directly adjusted to the target size. After completing the size and resolution adjustment of the component window, each component window is synthesized into an application image and output to the desktop operating system, and the application image is displayed on the desktop operating system.
[0065] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the application window adjustment method of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.
[0066] The present application also provides an application window adjustment device, which is applied to a preset operating system, the preset operating system is compatible with running on a desktop operating system, a target application is running on the preset operating system, and the target application corresponds to at least one component window, please refer to Figure 4 , the application window adjustment device comprises: The receiving module 10 is used for receiving a size adjustment message of the component window sent by the desktop operating system for any component window of the target application, and determining a target size of the component window by parsing the size adjustment message, where the target size represents the number of pixels occupied by the component window; A judgment module 20, configured to determine a size change type of the component window by comparing the target size with the original size of the component window, and to judge whether the original resolution of the component window meets the resolution requirement of the target size according to the size change type; An adjustment module 30, configured to adjust the original resolution to a target resolution level corresponding to the target size when the original resolution of the component window does not meet the resolution requirement of the target size, and set the original size of the component window to the target size; The output module 40 is used to traverse the component windows of the target application, synthesize the component windows into an application image, and output it to the desktop operating system.
[0067] Optionally, a waiting service process is provided in the preset operating system, and the receiving module 10 is further used for: Monitor whether there is a size adjustment message incoming to the waiting service process, wherein the size adjustment message is transmitted by the desktop operating system through inter-process communication, and the size adjustment message encapsulates the target size of the component window after being adjusted; The size adjustment message received in the waiting service process is parsed according to the preset protocol, and the target size is extracted and stored.
[0068] Optionally, the size adjustment message further encapsulates a window identifier corresponding to the target size, and the adjustment module 20 is further configured to: Determine the component window through the window identifier, compare the target size with the original size of the component window, and determine whether the size change type of the component window is an enlargement type or a reduction type; If the target size is larger than the original size, it indicates that the size change type is an enlargement type. When the preset resolution level corresponding to the target size is larger than the preset resolution level corresponding to the original resolution, it is determined that the original resolution of the component window does not meet the resolution requirement of the target size. If the target size is smaller than the original size, it indicates that the size change type is a reduction type. When the preset resolution level corresponding to the target size is smaller than the preset resolution level corresponding to the original resolution, it is determined that the original resolution of the component window does not meet the resolution requirement of the target size.
[0069] Optionally, the adjustment module 30 is further used for: When the preset resolution level corresponding to the target size is greater than the preset resolution level corresponding to the original resolution, the target resolution level corresponding to the target size is matched in the preset resolution level higher than the original resolution, and the original resolution is adjusted to the target resolution level; When the preset resolution level corresponding to the target size is smaller than the preset resolution level corresponding to the original resolution, the target resolution level corresponding to the target size is matched in the preset resolution level lower than the original resolution, and the original resolution is adjusted to the target resolution level.
[0070] Optionally, the output module 40 is further used for: Capture all component windows, synthesize them through a preset image synthesizer, and generate an application image; When it is determined that the desktop operating system is credible, a connection channel for the desktop operating system is established, and the application image is transferred to the desktop operating system to display the application image.
[0071] Optionally, the window adjustment device further includes a creation module 50, and the creation module 50 is further used for: Each time a size adjustment message of a component window sent by the desktop operating system is received, the target size in the size adjustment message is recorded to generate a size adjustment set; Analyze the resize collection to determine the resize range of the component window; When the target application is launched in the preset operating system, a component window of an optimal window size is created according to the size adjustment range.
[0072] The application window adjustment device provided by the present application adopts the application window adjustment method in the above embodiment, which can solve the technical problem that the application window is difficult to adapt efficiently. Compared with the prior art, the beneficial effects of the application window adjustment device provided by the present application are the same as the beneficial effects of the application window adjustment method provided by the above embodiment, and other technical features in the application window adjustment device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0073] The present application provides an electronic device, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the application window adjustment method in the above-mentioned embodiment 1.
[0074] Reference below Figure 5 , which shows a schematic diagram of the structure of an electronic device suitable for implementing an embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, notebook computers, PADs (Portable Application Description: tablet computers), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0075] like Figure 5As shown, the electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the electronic device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a microphone, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0076] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0077] The electronic device provided by the present application adopts the application window adjustment method in the above embodiment to solve the technical problem that the application window is difficult to adapt efficiently. Compared with the prior art, the beneficial effects of the electronic device provided by the present application are the same as the beneficial effects of the application window adjustment method provided by the above embodiment, and other technical features in the electronic device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0078] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0079] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0080] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the application window adjustment method in the above-mentioned embodiment.
[0081] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0082] The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0083] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the application window adjustment device: for any component window of the target application, receives a size adjustment message of the component window sent by the desktop operating system, determines a target size of the component window by parsing the size adjustment message, and the target size represents the number of pixels occupied by the component window; determines a size change type of the component window by comparing the target size with an original size of the component window, and determines whether an original resolution of the component window meets the resolution requirement of the target size according to the size change type; if the original resolution of the component window does not meet the resolution requirement of the target size, adjusts the original resolution to a target resolution level corresponding to the target size, and sets the original size of the component window to the target size; after traversing each component window of the target application, synthesizes each component window into an application image and outputs it to the desktop operating system.
[0084] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may 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 may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0085] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0086] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0087] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned application window adjustment method, and can solve the technical problem that the application window is difficult to adapt efficiently. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the application window adjustment method provided by the above-mentioned embodiment, and will not be described in detail here.
[0088] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned application window adjustment method when executed by a processor.
[0089] The computer program product provided by the present application can solve the technical problem that the application window is difficult to adapt efficiently. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the application window adjustment method provided by the above embodiment, which will not be repeated here.
[0090] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for adjusting an application window, characterized in that: Applied to a preset operating system, the preset operating system is compatible with running on a desktop operating system, a target application is running on the preset operating system, and the target application corresponds to at least one component window, and the application window adjustment method includes: For any component window of the target application, receiving a size adjustment message of the component window sent by the desktop operating system, and determining a target size of the component window by parsing the size adjustment message, wherein the target size represents the number of pixels occupied by the component window; Determining a size change type of the component window by comparing the target size with an original size of the component window, and judging whether an original resolution of the component window meets a resolution requirement of the target size according to the size change type; When the original resolution of the component window does not meet the resolution requirement of the target size, the original resolution is adjusted to a target resolution level corresponding to the target size, and the original size of the component window is set to the target size; After traversing each component window of the target application, the component windows are synthesized into an application image and output to the desktop operating system.
2. The application window adjustment method according to claim 1, characterized in that: The preset operating system is provided with a daemon service process, and the step of receiving a size adjustment message of the component window sent by the desktop operating system and determining a target size of the component window by parsing the size adjustment message comprises: Monitoring whether a size adjustment message is input to the waiting service process, wherein the size adjustment message is input by the desktop operating system through inter-process communication, and the size adjustment message encapsulates the target size of the component window after being adjusted; The size adjustment message received in the waiting service process is parsed according to a preset protocol, and the target size is extracted and stored.
3. The application window adjustment method according to claim 2, characterized in that: The size adjustment message also encapsulates a window identifier corresponding to the target size. The steps of determining the size change type of the component window by comparing the target size with the original size of the component window, and judging whether the original resolution of the component window meets the resolution requirement of the target size according to the size change type include: Determine the component window by using the window identifier, compare the target size with the original size of the component window, and determine whether the size change type of the component window is an enlargement type or a reduction type; If the target size is larger than the original size, it indicates that the size change type is an enlargement type, and when the preset resolution level corresponding to the target size is larger than the preset resolution level corresponding to the original resolution, it is determined that the original resolution of the component window does not meet the resolution requirement of the target size; If the target size is smaller than the original size, it indicates that the size change type is a reduction type. When the preset resolution level corresponding to the target size is smaller than the preset resolution level corresponding to the original resolution, it is determined that the original resolution of the component window does not meet the resolution requirement of the target size.
4. The application window adjustment method according to claim 3, characterized in that: The step of adjusting the original resolution to a target resolution level corresponding to the target size comprises: In the case where the preset resolution level corresponding to the target size is greater than the preset resolution level corresponding to the original resolution, matching the target resolution level corresponding to the target size in a preset resolution level higher than the original resolution, and adjusting the original resolution to the target resolution level; When the preset resolution level corresponding to the target size is smaller than the preset resolution level corresponding to the original resolution, the target resolution level corresponding to the target size is matched in a preset resolution level lower than the original resolution, and the original resolution is adjusted to the target resolution level.
5. The application window adjustment method according to claim 1, characterized in that: The step of synthesizing the component windows into an application image and outputting the application image to the desktop operating system comprises: Capture all component windows, synthesize them through a preset image synthesizer, and generate an application image; When it is determined that the desktop operating system is credible, a connection channel for the desktop operating system is established, and the application image is transferred to the desktop operating system to display the application image.
6. The application window adjustment method according to claim 1, characterized in that: The application window adjustment method further includes: Each time a size adjustment message of the component window sent by the desktop operating system is received, a target size in the size adjustment message is recorded to generate a size adjustment set; Analyze the size adjustment set to determine the size adjustment range of the component window; When the target application is started in the preset operating system, a component window of an optimal window size is created according to the size adjustment range.
7. An application window adjustment device, characterized in that: Applied to a preset operating system, the preset operating system is compatible with running on a desktop operating system, a target application is running on the preset operating system, and the target application corresponds to at least one component window, and the application window adjustment device includes: A receiving module, configured to receive, for any component window of the target application, a size adjustment message of the component window sent by the desktop operating system, and determine a target size of the component window by parsing the size adjustment message, wherein the target size represents the number of pixels occupied by the component window; A judgment module, used for determining a size change type of the component window by comparing the target size with an original size of the component window, and judging whether an original resolution of the component window meets a resolution requirement of the target size according to the size change type; An adjustment module, configured to adjust the original resolution to a target resolution level corresponding to the target size and set the original size of the component window to the target size if the original resolution of the component window does not meet the resolution requirement of the target size; The output module is used to synthesize the component windows of the target application into an application image after traversing the component windows of the target application and output the application image to the desktop operating system.
8. An electronic device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the application window adjustment method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the application window adjustment method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the application window adjustment method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Video window picture display method and device
CN111432261A
Method and device for zooming Android application window on Linux
CN116627579A
Method and system for adjusting software window based on artificial intelligence
CN116841440A
Image sensors with variable resolution image format
US20220261963A1
