Method for realizing magnifying glass special effect under wayland environment

By managing the dual-mode magnifier effect within the Wayland environment, and by implementing independent viewport calculations and rendering logic, the issues of deep coupling in rendering and coarse cursor handling were resolved, thereby improving user experience and performance.

CN121635730BActive Publication Date: 2026-05-01KYLIN CORP
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
KYLIN CORP
Filing Date
2026-02-05
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

The existing magnifying glass effect in the Wayland environment suffers from issues such as deep coupling with rendering, resulting in code redundancy, poor reusability, lack of interactivity, rough cursor handling, and unoptimized performance.

Method used

Under a unified architecture, it manages two zoom modes, implements independent viewport calculation, content fetching and rendering logic, listens for cursor movement events through the compositor, dynamically adjusts the viewport area to avoid additional buffer rendering, supports dynamic adjustment through shortcut keys and DBus service, and optimizes GPU rendering by utilizing the Scene Viewport mechanism.

Benefits of technology

It achieves a modular, loosely coupled rendering architecture, improving maintainability and scalability, ensuring cursor boundary constraints and user experience continuity, and reducing GPU load and power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121635730B_ABST
    Figure CN121635730B_ABST
Patent Text Reader

Abstract

The present application relates to magnifying glass technical field, specifically to a kind of magnifying glass special effect implementation method under Wayland environment, comprising the following steps: step S1: synthesizer creates structure for magnifying glass, and based on structure initialization default state of magnifying glass;Default state includes magnifying mode;Step S2: the core processing function of magnifying glass is registered to synthesizer;Step S3: when user activates magnifying glass, it is judged that the magnifying mode selected by user, and initialization is carried out based on the magnifying mode selected by user;Step S4: synthesizer carries out rendering preprocessing based on the magnifying mode selected by user;Step S5: after rendering preprocessing is completed, synthesizer executes rendering process, to complete magnifying glass special effect.The scheme of the present application makes that magnifying glass is always with the focus of user as center, improves the reliability of user barrier-free use.
Need to check novelty before this filing date? Find Prior Art

Description

A method for implementing a magnifying glass effect in the Wayland environment Technical Field

[0001] This invention relates to the field of magnifying glass technology, and more specifically, to a method for implementing magnifying glass effects in the Wayland environment. Background Technology

[0002] The magnifying glass effect is an important accessibility feature in operating systems. It magnifies the content on the screen, allowing users to see every detail more clearly. For users with poor eyesight, small fonts and tiny icons are often difficult to discern; the magnifying glass effect can significantly improve the user experience. It helps users more accurately locate and manipulate screen details when designing, drawing, or editing documents.

[0003] Wayland is an open-source project designed to create a new display server architecture for Linux. Wayland aims to provide a simple, efficient, and lightweight display server architecture that meets the requirements of modern desktops. A key feature of modern desktops is window composition. Currently, very few implementations of a magnifier effect are based on Wayland. A few that do implement magnifier functionality suffer from the following drawbacks: 1. Deep coupling with rendering, making maintenance difficult: Placing the magnification logic within the rendering loop, rather than abstracting it into an independent module, leads to code redundancy, poor reusability, and difficulty in coordinating with other visual effects. 2. Lack of interactivity: Magnification and mode (full-screen, lens) are usually fixed at startup and do not support dynamic adjustment via shortcuts or external applications at runtime. 3. Crude cursor handling: When the cursor moves outside the effective magnification area, no boundary constraints are applied, making it easy for users to "get lost" outside the magnification area, severely impacting the user experience. 4. Unoptimized performance: Achieved through full-screen scaling or additional buffer rendering, resulting in high GPU load and power consumption, especially pronounced on high-resolution screens. Summary of the Invention

[0004] The main objective of this invention is to provide a method for implementing a magnifying glass effect in the Wayland environment. Under a unified architecture, two magnification modes are managed, and independent viewport calculation, content capture, and rendering logic are implemented for each magnification mode, thereby meeting the magnification needs of users in the Wayland environment.

[0005] This invention provides a method for implementing a magnifying glass effect in the Wayland environment, comprising the following steps:

[0006] Step S1: The synthesizer creates a structure for the magnifying glass and initializes the magnifying glass's default state based on the structure; the default state includes the magnification mode;

[0007] Step S2: Register the core processing function of the magnifying glass into the synthesizer;

[0008] Step S3: When the user activates the magnifier, determine the magnification mode selected by the user and initialize it based on the selected magnification mode;

[0009] Step S4: The compositor performs rendering preprocessing based on the user-selected amplification mode;

[0010] Step S5: After rendering preprocessing is completed, the compositor executes the rendering process to complete the magnifying glass effect.

[0011] Furthermore, the zoom modes include window mode and full-screen mode.

[0012] Furthermore, in step S3, when the selected zoom mode is full-screen mode, the full-screen mode is initialized as follows: the compositor listens to cursor movement events and initializes the viewport area based on the cursor position in the cursor movement event.

[0013] In step S3, when the selected zoom mode is window mode, the initialization of window mode is as follows: the compositor listens for cursor movement events and initializes the geometric information of the window area based on the position of the cursor in the cursor movement event.

[0014] Furthermore, in step S3, the synthesizer listens for cursor movement events based on the cursor tracker.

[0015] Furthermore, in step S4, if the user selects full-screen mode as the zoom mode, the rendering preprocessing steps are as follows:

[0016] Step S411: The synthesizer checks whether the zoom ratio of the magnifying glass has changed; if the zoom ratio of the magnifying glass has changed, the synthesizer determines the offset of the viewport area with the cursor position as the center, and performs a translation of the viewport area based on the offset, and then proceeds to step S414; if the zoom ratio of the magnifying glass has not changed, proceeds to step S412.

[0017] Step S412: The synthesizer checks whether the cursor position has moved. If the cursor position has not moved, the process ends directly; if the cursor position has moved, the process proceeds to step S413.

[0018] Step S413: The compositor determines whether the position of the moved cursor is within the viewport area. If the position of the moved cursor is within the viewport area, proceed to step S414; if the position of the moved cursor is not within the viewport area, determine the coordinates of the nearest boundary point of the viewport area and the cursor position, and translate the viewport area based on the coordinates of the nearest boundary point of the viewport area and then proceed to step S414.

[0019] Step S414: The synthesizer constrains the boundary of the viewport region;

[0020] Step S415: The compositor sets the output viewport region within the constrained viewport region, thereby completing the rendering preprocessing.

[0021] Furthermore, in step S4, if the user selects window mode as the zoom mode, the rendering preprocessing steps are as follows:

[0022] Step S421: The compositor calculates the position and size of the window area in real time based on the cursor position;

[0023] Step S422: The compositor determines whether the position of the window region has changed; if the position of the window region has changed, the compositor redraws the damage region based on the size of the window region before the change and the size of the window region after the change, thereby completing the rendering preprocessing; if the position of the window region has not changed, the window region is directly marked as the damage region, thereby completing the rendering preprocessing.

[0024] Furthermore, it also includes post-rendering processing in step S6;

[0025] Step S6 includes the following steps:

[0026] Step S61: After the rendering process is completed, the compositor determines whether the zoom mode selected by the user is full-screen mode; if the zoom mode selected by the user is full-screen mode, the process ends directly; if the zoom mode selected by the user is not full-screen mode, the process proceeds to step S62.

[0027] Step S62: The compositor renders the damage area as a texture;

[0028] Step S63: The compositor defines a target rectangle; the compositor extracts the texture based on the source rectangle of the damage area; the extracted texture is rendered onto the target rectangle, and a border is added to the target rectangle to complete the magnifying glass effect.

[0029] Furthermore, step S7 is included: after the amplifier effect is completed, based on the user's disable command, the synthesizer performs a cleanup operation and removes the core processing function of the magnifier, restoring the synthesizer to its original state.

[0030] Furthermore, the structure is the zoom_effect structure.

[0031] Furthermore, the synthesizer is the Wayland synthesizer.

[0032] The beneficial effects of this invention are as follows:

[0033] (1) The special effects are highly modularized and the rendering is loosely coupled, which improves maintainability and scalability.

[0034] The core logic of the special effects (such as cursor tracking, viewport calculation, and boundary constraints) is not embedded in the main rendering loop. Instead, it is called during the preprocessing stage (pre) of rendering through registered interface functions. This avoids the problem of "deep coupling between amplification logic and rendering" in traditional solutions, significantly reduces code redundancy, improves module reusability, and supports collaborative work with other visual effects within the same framework.

[0035] (2) Cursor boundary constraints and viewport snapping ensure the continuity of user experience.

[0036] A viewport based on pixman_region32 is introduced, and when the cursor moves out of the effective magnification area, the nearest point to the viewport boundary is automatically calculated, and the offset is dynamically adjusted to ensure that the cursor is always visible. This effectively solves the problem of "users getting disoriented after the cursor moves out" in existing solutions, ensuring that the magnifier is always centered on the user's focus, and improving the reliability of barrier-free use.

[0037] (3) Deeply integrate the Scene Viewport mechanism to achieve high-performance, low-power rendering.

[0038] By fully utilizing viewport capabilities such as `ky_scene_output_set_viewport_source_box` in the compositor, the rendering source region and scaling factor can be adjusted directly at the logic layer, without the need to create an additional off-screen buffer or perform full-screen texture scaling. Compared to existing solutions that rely on the high overhead of "full-screen redraw" or "additional buffer rendering," this solution significantly reduces GPU load and memory consumption, with its advantages being particularly prominent on 4K / 8K high-resolution screens. Attached Figure Description

[0039] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0040] Figure 1 is a schematic diagram of the method of the present invention. Detailed Implementation

[0041] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Many specific details are set forth in the following description to provide a thorough understanding of the present invention; however, the present invention may also be implemented in other ways different from those described herein. Those skilled in the art can make similar extensions without departing from the spirit of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0042] This invention proposes a method for implementing a magnifying glass effect in a Wayland environment, focusing on the following two points: First, unified management of dual modes. Under a unified architecture, it supports full-screen mode and lens window. An internal state machine manages the current magnification mode and implements independent viewport calculation, content fetching, and rendering logic for each magnification mode. Second, high-performance rendering based on the viewport region. For full-screen mode: it abandons full-screen scaling and achieves direct magnification sampling of a specified area of ​​the source screen content by dynamically calculating and setting the viewport region of the compositor's output. The scaling is completed using the GPU's texture sampler, avoiding CPU involvement in pixel handling, resulting in extremely high efficiency.

[0043] For windowed mode: In the later stages of the rendering pipeline (frame_render_end), the calculated magnified area is used as a texture and precisely overlaid onto the final image through the render pass, and the border is drawn. This method reuses the main rendering pipeline and requires no additional compositing steps.

[0044] The magnifying glass effect of this invention is based on the new generation Wayland graphics display system. It achieves the magnifying glass effect through image scaling, drawing position processing, and display processing.

[0045] The magnifying glass effect is implemented in two main parts: the first part is the magnifying glass itself, responsible for implementing the core logic, state management, and user interaction of the effect; the second part is the Wayland compositor, which handles rendering integration, mounting and executing the magnifying glass's rendering commands at appropriate rendering stages. It mainly includes the following functions:

[0046] ① Effect Creation and Initialization: When the system starts, a global zoom_effect structure is created for the magnifier. This structure integrates the general effect interface of the Wayland compositor's effect framework, manages the magnifier's default state (such as magnification mode, zoom ratio, viewport area), and registers a shortcut key to enable the magnifier effect.

[0047] ② Dual-mode design: The magnifying glass internally implements two independent magnification modes, and separate processing logic is built for each:

[0048] Fullscreen mode (ZOOM_OUTPUT): Treats the entire screen as a magnified area. It calculates and manages a dynamic "viewport area" based on the cursor position to determine which portion of the screen content is magnified for display.

[0049] ZOOM_WINDOW mode: Creates a floating window (window area) that follows the cursor. The position and content of this window are updated in real time based on the cursor coordinates.

[0050] ③ Rendering control: Register the core processing functions of the magnifying glass to the two key stages of compositor rendering:

[0051] Pre-rendering stage (frame_render_pre): This stage performs preprocessing for the zoom logic. For full-screen mode, the new viewport area and logical coordinates are calculated based on the cursor position; for windowed mode, the position of the zoomed-in window is updated and the damage area is marked.

[0052] Post-rendering stage (frame_render_end): Primarily used in windowed mode. In this stage, the previously calculated enlarged area content is rendered as a separate texture, overlaid onto the final framebuffer, and the window border is drawn for it.

[0053] ④ Content updates and viewport area management (full-screen mode):

[0054] The source content and viewport area are dynamically calculated based on the cursor position and zoom level.

[0055] When the cursor moves to the current viewport boundary, the viewport is automatically and smoothly panned so that the magnified content follows the cursor. Viewport region calculation (pixman_region32_t) ensures that the viewport does not move out of the valid screen layout area.

[0056] ⑤ Multi-seat and cursor movement event handling: Create a seat_cursor structure for each input device and listen for cursor movement events so that the magnifier can work correctly in a multi-user, multi-mouse environment, and all cursor movements can correctly drive the update of the magnified area.

[0057] ⑥ Dynamic scaling and state synchronization: Provides a DBus service interface and shortcut key support for dynamically enabling / disabling effects, switching modes, and changing scaling ratios. State changes drive the compositor to re-render, thereby achieving real-time updates of scaling animations and interface updates.

[0058] ⑦ Resource Management: Manage resource listeners related to the magnifier, such as output and seats. Properly initialize and clean up these resources when effects are enabled / disabled or modes are switched, ensuring efficient resource utilization and preventing memory leaks.

[0059] Specific Implementation Example 1:

[0060] This embodiment provides a method for implementing a magnifying glass effect in the Wayland environment, as shown in Figure 1, including the following steps:

[0061] Step S1, Effect Creation: The compositor (Wayland compositor) calls the `zoom_effect_create` function to create a global `zoom_effect` structure for the magnifying glass. This structure integrates the compositor's general effect interface for its effects framework and initializes the magnifying glass's default state, including magnification mode (type), zoom level (scale), effect enabled state (enabled), and whether OpenGL is supported (is_opengl). Simultaneously, it registers the DBus service interface (for third-party applications to call) and global shortcut keys (such as Win + "+" to zoom in, Win + "-" to zoom out). The general effect interface includes the `effect_interface` interface. Magnification modes include full-screen mode (`ZOOM_OUTPUT`) and windowed mode (`ZOOM_WINDOW`).

[0062] Step S2: Register the core processing functions for the magnifying glass to the compositor's effects framework using the `effect_interface` interface. The core processing functions include:

[0063] frame_render_pre: Called before the compositor renders each frame, it is used to perform preprocessing for amplification logic.

[0064] frame_render_end: Called after the compositor has finished rendering, used to perform post-overlay rendering.

[0065] Step S3: Activation and Mode Selection.

[0066] Users can activate the magnifier (corresponding to the startup effect in Figure 1) by using the shortcut key (Win + "+") or the DBus service interface (such as the StartZoom interface) to determine whether the startup was successful.

[0067] If startup is successful, the compositor initializes according to the preset or user-specified magnification mode (full-screen mode or window mode), including:

[0068] Create a seat_cursor structure (cursor tracker) for all connected input devices (seats) and listen for cursor movement events on these input devices.

[0069] The full-screen mode initialization refers to the compositor initializing the viewport region based on the cursor position in the cursor movement event.

[0070] Window mode initialization refers to the compositor initializing the geometric information of the window area based on the cursor position in the cursor movement event.

[0071] If the startup fails, the process will terminate immediately.

[0072] Step S4: The compositor performs rendering preprocessing (frame_render_pre) based on the user-selected magnification mode.

[0073] Specifically, the first step is to determine whether the zoom mode selected by the user is full-screen mode.

[0074] If the selected zoom mode is fullscreen mode, the rendering preprocessing steps are as follows:

[0075] Step S411: The synthesizer checks whether the zoom ratio of the magnifying glass has changed; if the zoom ratio of the magnifying glass has changed, the synthesizer determines the offset (offset_x, offset_y) of the viewport area with the cursor position as the center, and translates the viewport area based on the offset, and then proceeds to step S414; if the zoom ratio of the magnifying glass has not changed, proceeds to step S412.

[0076] Step S412: The synthesizer checks whether the position of the cursor (corresponding to the "cursor" in Figure 1) has moved. If the position of the cursor has not moved, the process ends directly; if the position of the cursor has moved, the process proceeds to step S413.

[0077] Step S413: The compositor determines whether the position of the moved cursor is within the viewport area. If the position of the moved cursor is within the viewport area, proceed to step S414; if the position of the moved cursor is not within the viewport area, the compositor calls zoom_output_calc_closest_point to determine the coordinates of the nearest boundary point of the viewport area and the cursor position, and translates the viewport area based on the coordinates of the nearest boundary point of the viewport area, and then proceeds to step S414. zoom_output_calc_closest_point is a function that is mainly used to calculate the coordinates of the nearest point of the viewport area. When the user moves the mouse out of the current zoomed area, the viewport area needs to move with the mouse, and the moving distance is the distance from the nearest point to the viewport area.

[0078] Step S414: The compositor calls `zoom_constrain_viewport_offset` to constrain the viewport area's boundaries, preventing it from moving out of the valid screen layout. `zoom_constrain_viewport_offset` is a function that ensures the magnifying glass's viewport area does not exceed the screen layout. Specifically, it adjusts the offset (offset_x, offset_y) based on the current viewport area's position and size to ensure the viewport area always remains within the valid display area. For example, in a multi-screen scenario, if the mouse is at the screen edge and the boundaries are not constrained, a black area will be displayed.

[0079] Step S415: The compositor sets the output viewport area within the constrained viewport area using ky_scene_output_set_viewport_source_box. The compositor then enlarges this area to complete the rendering preprocessing.

[0080] If the user selects window mode as the zoom mode, the rendering preprocessing steps are as follows:

[0081] Step S421: The compositor calls zoom_window_update_geo in real time based on the cursor position to calculate the position and size of the window area; zoom_window_update_geo is a function that updates the position of the magnifying glass window area. When the cursor moves, the window area moves with the cursor.

[0082] Step S422: The compositor determines whether the position of the window region has changed. If the position of the window region has changed, the compositor redraws the window region as a damage region based on the size of the window region before the change and the size of the window region after the change using `zoom_window_add_damage`, thus completing the rendering preprocessing. If the position of the window region has not changed, the window region is directly marked as a damage region, thus completing the rendering preprocessing. `zoom_window_add_damage` is a function that generates a new window region after the position of the window region changes, and adds the new window region and the old window region (the window region before the position change) as damage regions to the compositor's total damage.

[0083] Step S5, Rendering: The compositor executes the normal rendering process.

[0084] If the zoom mode in the preceding steps is full-screen mode, all output content will be automatically zoomed in and rendered based on the size of the output viewport area. If the zoom mode in the preceding steps is window mode, the content will be rendered as is based on the damage area determined in step S4.

[0085] Step S6: Post-rendering processing (frame_render_end, window mode only)

[0086] The specific steps are as follows:

[0087] Step S61: After the rendering process is completed, the compositor determines whether the zoom mode selected by the user is full-screen mode; if the zoom mode selected by the user is full-screen mode, the process ends directly; if the zoom mode selected by the user is not full-screen mode, the process proceeds to step S62.

[0088] Step S62: Extract the damage area that needs to be enlarged as determined in the previous steps from the main rendering buffer (target->buffer) and create it as a texture (wlr_texture).

[0089] Step S63: The compositor defines a target rectangle (dst_box), which represents the position and size of the magnified window on the screen. Based on the source rectangle (src_box) of the damage region, the compositor defines which portion of the texture to extract (the proportionally scaled-down portion of the damage region's center). The compositor renders the extracted texture into the target rectangle using ky_render_pass_add_texture. Finally, a white border is drawn around the target rectangle to improve visual clarity.

[0090] Cursor movement events are continuously driven: Throughout the entire lifecycle of the magnifying glass effect, cursor movement events from all input devices are continuously monitored. Any cursor movement event updates the corresponding coordinates and sets the movement flag (moved=true), thereby driving the update of the viewport area or window area position in the next frame, forming a closed loop.

[0091] Dynamic state switching and resource management: Users can dynamically switch the default state (zoom mode, adjust the zoom factor, turn off the magnifier effect) through DBus service interfaces (such as SetMagnifierMode, ZoomIn, ZoomOut, and StopZoom interfaces) or keyboard shortcuts. Changes to the default state trigger a region update (ky_scene_damage_whole) to ensure the interface updates instantly. When switching zoom mode or turning off the effect, the system calls zoom_reset_state to clean up related resources (such as destroying the cursor tracker and releasing the viewport area) to ensure no memory leaks.

[0092] Specific Implementation Example 2:

[0093] This embodiment provides a method for implementing a magnifying glass effect in the Wayland environment. The method is largely the same as that in the previous embodiment, except that the method in this embodiment further includes step S7: disabling the effect.

[0094] Effects disabled: After the user issues a disable command via the StopZoom interface, a cleanup operation is performed, removing the core processing functions registered in the compositor's rendering framework and restoring the compositor to its original state. The magnifying glass effect is then disabled.

[0095] Definitions of abbreviations and key terms:

[0096] Special effects: In the operating system, a series of visual effects displayed graphically enhance the user experience, increase the intuitiveness of operation, provide visual feedback, and guide user actions. Examples include fade-in / fade-out effects when windows open / close, and animations when switching workspaces.

[0097] The magnifying glass effect supports two working modes: full-screen mode and lens mode (window mode). In full-screen mode, the entire screen content is magnified, but you may not be able to see the entire screen at once, depending on the screen size and zoom level. This mode is suitable for scenarios requiring high magnification. In lens mode (window mode), the magnifying glass acts as a "lens" and moves with the mouse pointer. The area around the mouse pointer is magnified, and the magnified area moves with the mouse.

[0098] Wayland is a display server protocol for UNIX-like systems. Based on domain sockets, Wayland implements a library for communication between the display server and client, and defines an extensible communication protocol in XML format. The core idea of ​​Wayland is to simplify the graphics stack, solve the increasingly prominent problems in the X11 architecture, and gradually replace X11.

[0099] Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

Claims

1. A method for implementing a magnifying glass effect in the Wayland environment, characterized in that, Includes the following steps: Step S1: The compositor creates a structure for the magnifying glass and initializes its default state based on the structure; the default state includes magnification modes; magnification modes include windowed mode and full-screen mode; the compositor is the Wayland compositor; Step S2: Register the core processing functions of the magnifying glass to the compositor; Step S3: When the user activates the magnifying glass, determine the magnification mode selected by the user and initialize it based on the selected magnification mode; when the selected magnification mode is full-screen mode, the initialization of full-screen mode is as follows: the compositor listens for cursor movement events and initializes the viewport area based on the cursor position in the cursor movement event; Step S4: The compositor performs rendering preprocessing based on the magnification mode selected by the user; Step S5: After rendering preprocessing is completed, the compositor executes the rendering process to complete the magnifying glass effect; In step S4, if the user selects full-screen mode as the magnification mode, the rendering preprocessing steps are as follows: Step S411: The compositor checks whether the scaling ratio of the magnifying glass has changed. If the magnifying glass's zoom level changes, the compositor determines the offset of the viewport area based on the cursor's position, and translates the viewport area based on the offset, then proceeds to step S414; if the magnifying glass's zoom level does not change, proceeds to step S412; Step S412: The compositor checks whether the cursor's position has moved. If the cursor's position has not moved, the process ends directly; if the cursor's position has moved, proceeds to step S413; Step S413: The compositor determines whether the moved cursor's position is within the viewport area. If the moved cursor's position is within the viewport area, proceeds to step S414; if the moved cursor's position is not within the viewport area, the compositor determines the coordinates of the nearest boundary point of the viewport area relative to the cursor's position, and translates the viewport area based on the coordinates of the nearest boundary point of the viewport area relative to the cursor's position, then proceeds to step S414. Step S414: The compositor constrains the boundary of the viewport region; Step S415: The compositor sets the output viewport region within the constrained viewport region, thereby completing the rendering preprocessing.

2. The method for implementing a magnifying glass effect in a Wayland environment according to claim 1, characterized in that, In step S3, when the selected zoom mode is window mode, the initialization of window mode is as follows: the compositor listens for cursor movement events and initializes the geometric information of the window area based on the position of the cursor in the cursor movement event.

3. The method for implementing a magnifying glass effect in a Wayland environment according to claim 2, characterized in that, In step S3, the synthesizer listens for cursor movement events based on the cursor tracker.

4. The method for implementing a magnifying glass effect in a Wayland environment according to claim 1, characterized in that, In step S4, if the zoom mode selected by the user is window mode, the rendering preprocessing steps are as follows: Step S421: The compositor calculates the position and size of the window area in real time based on the cursor position; Step S422: The compositor determines whether the position of the window area has changed; if the position of the window area has changed, the compositor redraws the damage area based on the size of the window area before the change and the size of the window area after the change, thereby completing the rendering preprocessing; if the position of the window area has not changed, the window area is directly marked as the damage area, thereby completing the rendering preprocessing.

5. The method for implementing a magnifying glass effect in a Wayland environment according to claim 4, characterized in that, It also includes post-rendering processing in step S6; step S6 includes the following steps: Step S61: After the rendering process is completed, the compositor determines whether the magnification mode selected by the user is full-screen mode; if the magnification mode selected by the user is full-screen mode, it ends directly; if the magnification mode selected by the user is not full-screen mode, it proceeds to step S62; Step S62: The compositor renders the damage area as a texture; Step S63: The compositor defines a target rectangle; the compositor extracts the texture based on the source rectangle of the damage area; the extracted texture is rendered onto the target rectangle, and a border is added to the target rectangle to complete the magnifying glass effect.

6. The method for implementing a magnifying glass effect in a Wayland environment according to claim 5, characterized in that, It also includes step S7: After the amplifier effect is completed, based on the user's disable command, the synthesizer performs a cleanup operation and removes the core processing function of the magnifier, restoring the synthesizer to its original state.

7. The method for implementing a magnifying glass effect in a Wayland environment according to claim 1, characterized in that, The structure is a zoom_effect structure.

Citation Information

Patent Citations

  • Wayland synthesizer

    CN115809047A