Method, device, equipment and medium for displaying authorized windows in multi-screen mode
By monitoring the insertion or removal of monitors, updating the full-screen window position and size in real time, and disabling the switching shortcut keys, the problem of the authorization window not being displayed with high priority in multi-screen mode is solved, ensuring that authorization information is obtained in a timely manner and important functions operate normally.
Patent Information
- Application Number
- CN202510883808.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-06-30
AI Technical Summary
In multi-screen mode, existing technologies cannot effectively ensure high-priority display of the authorization window. Users may operate through other unmasked screens, affecting the timeliness of authorization and the operation of important functions.
By monitoring the insertion or removal of the monitor, the position and size of the full-screen window are updated in real time so that the full-screen window covers the entire screen, and the switching shortcut keys are disabled to ensure that the full-screen window always maintains the maximum window size. An authorization window is created to display interactive information.
The authorization window is displayed with high priority in multi-screen mode to prevent users from accidentally switching to other windows, ensuring timely acquisition of authorization information and normal operation of important functions.
Smart Images

Figure CN120371246B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of window display priority of Linux operating systems, and in particular to a method, device, equipment and medium for authorizing window dominance display in a multi-screen mode. Background Art
[0002] The Linux operating system is used across various industries, and with the increasing diversification and intelligence of desktop environments, the demand for an interactive interface experience is becoming increasingly demanding. Important pop-up windows in the desktop environment require strong reminders and priority actions. For example, when an authorization pop-up window appears, other application interfaces cannot be operated. This includes, but is not limited to, disabling the taskbar, desktop, control panel, and file manager. This ensures timely authorization and ensures the operation of important functions.
[0003] Existing technologies often mask the full-screen window by displaying a top-level, transparent window, and then displaying a sub-window on top of the full-screen window, restricting the user to operations within the full-screen window. This ensures the priority of the window. However, when authorization pop-up windows are required, especially in multi-screen scenarios, users can perform activities other than authorized operations on other screens that are not masked, affecting the priority of the authorization window, resulting in the inability to obtain authorization in a timely manner and the inability to ensure the operation of important functions. Summary of the Invention
[0004] Embodiments of the present invention provide a method, apparatus, device, and medium for displaying an authorized window on a multi-screen mode, so as to solve the technical problem of displaying the authorized window with high priority in the multi-screen mode.
[0005] In a first aspect, an embodiment of the present invention provides a method for displaying an authorized window in a multi-screen mode, comprising:
[0006] S101, monitors the user authorization pop-up request of the Linux system Polkit service;
[0007] S102, responding to the user's authorization pop-up request, creating a full-screen window and setting the window to a top-most state;
[0008] S103, updating the position of the full-screen window in real time according to the insertion and removal of the display, and adjusting the size of the full-screen window to the maximum window size visible in the current display mode of the system;
[0009] S104, setting the full-screen window as a parent window, creating an authorization window on the parent window, and displaying the authorization interaction information in the authorization window;
[0010] S105, actively disabling the shortcut keys for switching workspaces and switching application windows;
[0011] S106: When receiving the user's authorization operation, close the full-screen window and restore the disabled shortcut keys.
[0012] Furthermore, the S103 includes:
[0013] Get the maximum window size currently visible in the system, and set the size of the full-screen window to be consistent with the maximum window size;
[0014] Monitor and respond to the insertion or removal of the display, and obtain the latest display area coordinates according to the insertion or removal of the display;
[0015] The position and size of the full-screen window are updated in real time according to the latest display area coordinates.
[0016] Furthermore, the S105 includes:
[0017] Call the D-Bus interface to generate a list of switching shortcut keys to be blocked, and add a disabled status flag to each shortcut key in the list;
[0018] Register the D-Bus service, shield the switching shortcut key according to the switching shortcut key shielding list and the disabled state flag of each shortcut key in the list, and update the disabled state flag of the shortcut key.
[0019] Furthermore, the S102 includes:
[0020] Receive Polkit's user authorization pop-up request;
[0021] Create a QWidget window, and the window size is the maximum visible window size based on the system's current display mode;
[0022] Set the QWidget window properties to borderless, top, and transparent.
[0023] Furthermore, the method further comprises:
[0024] According to the transparency effect support option of the window compositor, the transparency attribute of the full-screen window is determined, and the corresponding background image is drawn according to the transparency attribute and the number of screens. The image size of the background image is consistent with the corresponding screen size.
[0025] Furthermore, the S104 includes:
[0026] Set the full-screen window as the parent window, and create an authorization window based on QDialog on the parent window;
[0027] The authorization interaction information is displayed in the authorization window, and the authorization interaction information includes: authorization description information, authorization program icon, and authorized user list.
[0028] Furthermore, the method further comprises:
[0029] Setting the authorization window as a modal dialog box;
[0030] Monitor the mouse click area and trigger the shaking reminder effect of the modal dialog box according to the mouse click area.
[0031] In a second aspect, an embodiment of the present invention provides a device for displaying an authorized window in a multi-screen mode, comprising:
[0032] Request monitoring module, used to monitor user authorization pop-up requests from the Linux system Polkit service;
[0033] The request response module is used to respond to the user's authorization pop-up request and create a full-screen window to set the window to the top state;
[0034] A window update module is used to update the position of the full-screen window and adjust the size of the full-screen window in real time according to the insertion and removal of the display;
[0035] The authorization information module is used to set the full-screen window as the parent window and create an authorization window on the parent window to display the authorization interaction information;
[0036] The shortcut key shielding module is used to proactively disable the shortcut keys for switching workspaces and application windows;
[0037] The window restoration module is used to close the full-screen window and restore the disabled shortcut keys when receiving the user's authorization operation.
[0038] In a third aspect, an embodiment of the present invention provides an electronic device, including:
[0039] one or more processors;
[0040] a storage device for storing one or more programs,
[0041] When the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned method for displaying the authorized window in a multi-screen mode.
[0042] In a fourth aspect, an embodiment of the present invention provides a storage medium comprising computer-executable instructions, which, when executed by a computer processor, are used to execute the above-mentioned method for authorized window dominance display in multi-screen mode.
[0043] The embodiment of the present invention provides a method, device, equipment and medium for displaying an authorized window in a multi-screen mode. The method creates a full-screen window based on the user's authorization pop-up request, monitors the insertion or removal of the display, and updates the position and size of the full-screen window in real time according to the change in the display area coordinates caused by the insertion or removal of the display, so that the size of the full-screen window always remains consistent with the maximum window size visible in the current display mode, thereby achieving the effect of covering all screens, allowing users to operate only within the full-screen window, and covering all other content on the screen, thereby ensuring the high priority of the authorized window. The switching shortcut keys are shielded through the D-Bus interface to prevent users from switching to other windows by mistake and ignoring the authorization information. At the same time, the shortcut keys can be unblocked by monitoring the exit of the D-Bus service, avoiding the problem of shortcut keys being unavailable due to abnormal exit of the shortcut key disabling. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings, which constitute part of the present invention, are provided to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are provided to explain the present invention and do not constitute an undue limitation of the present invention. In the accompanying drawings:
[0045] Figure 1 This is a flowchart of a method for authorizing a window to dominate the screen display in a multi-screen mode according to the first embodiment of the present invention;
[0046] Figure 2 This is a flowchart of a method for authorizing a window to dominate the screen display in a multi-screen mode according to the second embodiment of the present invention;
[0047] Figure 3 This is a flowchart of a method for authorizing a window to dominate the screen display in a multi-screen mode according to the third embodiment of the present invention;
[0048] Figure 4 This is a flowchart of a method for authorizing a window to dominate the screen display in a multi-screen mode according to a fourth embodiment of the present invention;
[0049] Figure 5 This is a structural diagram of a device for authorizing a window to dominate the screen display in a multi-screen mode according to a fifth embodiment of the present invention;
[0050] Figure 6 This is a structural diagram of the device described in Example 6 of the present invention. DETAILED DESCRIPTION
[0051] The present invention will be further described in detail below with reference to the accompanying drawings and examples. It will be understood that the specific embodiments described herein are intended only to illustrate the present invention and are not intended to limit the present invention. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions relevant to the present invention, not all structures.
[0052] In the Linux operating system, users can continue to click, input, and switch interfaces in other general program windows through areas not covered by the authorization window. This can easily cause the authorization window to be ignored, affecting the timeliness of authorization and delaying the use of important functions. Covering the screen with a full-screen window can prevent users from clicking outside the authorization window. However, in a multi-screen environment, the full-screen window often has difficulty covering all screens as the number of screens changes. Users can still operate on other screens, making it impossible to ensure the high priority of the authorization window, which affects authorization efficiency.
[0053] Example 1
[0054] Figure 1 This is a flowchart of a method for displaying an authorized window in a multi-screen mode according to a first embodiment of the present invention. This embodiment monitors the connection and disconnection of a display and adjusts the size of the full-screen window in real time to achieve preferential display of the authorized window. The method specifically includes the following steps:
[0055] S101, monitoring the user authorization pop-up request of the Linux system Polkit service.
[0056] First, you need to configure the operating system environment to support the dependency of the authorization pop-up window. You need to confirm the installation of the policykit-1 framework for managing management policies and privileges, and confirm the installation of ukui-polkit for the authorization pop-up agent, ukui-kwin window manager, and ukui-settings-daemon configuration management backend. For example, when starting the user desktop environment, you can use the above configuration to automatically start the application desktop file: / etc / xdg / autostart / polkit-ukui-authentication-agent-1.desktop
[0057] And the authorization pop-up window backend program that automatically starts at login: / usr / lib / x86_64-linux-gnu / ukui-polkit / polkit-ukui-authentication-agent-1.
[0058] The authorization pop-up window backend program monitors the user's authorization pop-up window request by registering a listener for the Polkit service.
[0059] S102, responding to the user's authorization pop-up request, creating a full-screen window and setting the window to a top state.
[0060] When the authorization pop-up window backend program receives the user's authorization pop-up window request by monitoring the Polkit service, it responds to the user's authorization pop-up window request by creating a full-screen window and setting the full-screen window's properties to be pinned to the top, covering the entire screen so that the user can only operate within the full-screen window, preventing the user from operating parts outside the full-screen window.
[0061] S103: updating the position of the full-screen window in real time according to the insertion and removal of the display, and adjusting the size of the full-screen window to the maximum window size visible in the current display mode of the system.
[0062] According to the maximum visible window size in the current display mode of the system, the size of the full-screen window is set to be consistent with the maximum window size, so that the full-screen window can cover all screens. By monitoring the insertion or removal of the display, the coordinate changes of the display area are obtained. Connecting a display will increase the coordinate range of the display area, and unplugging the display will reduce the coordinate range of the display area. The position and size of the full-screen window are updated in real time according to the coordinate range of the display area to ensure that the size of the full-screen window is always consistent with the maximum visible window size in the current display mode, so that the full-screen window always covers all screens. For example, a new rule can be added to the full-screen window in the window manager, and the rule can be set to not limit the window size. The window size can be freely set within the application. The newly added rule can be bound to the full-screen window in the configuration file, so that the window manager no longer limits the size of the full-screen window, thereby making the above-mentioned full-screen window resizing method effective and achieving the effect of covering all screens.
[0063] S104: Set the full-screen window as a parent window, create an authorization window on the parent window, and display authorization interaction information in the authorization window.
[0064] The full-screen window covers the entire screen. The authorization window, as a child window of the full-screen window, is displayed on top of the parent window to display authorization information. This information is presented prominently to the user, allowing them to focus on the authorization operation. The authorization window inherits from the QDialog class and passes the parentWidget parameter to the full-screen window instance pointer when instantiating the authorization window. The authorization window class instance is then passed information such as the authorization purpose and the application icon requiring authorization through the information passing interface. The authorization window then displays the information content in the appropriate window location.
[0065] S105: Actively disable shortcut keys for switching workspaces and switching application windows.
[0066] The window manager responds to shortcut keys for switching workspaces and application windows. The authorized window program passes information about a list of disabled switching shortcut keys to the window manager's D-Bus interface, preventing the window manager from processing these shortcut keys. This disables the ability to switch workspaces and application windows via shortcut keys. The configuration manager also responds to shortcut keys to enter the window switcher. The authorized window program registers a service with a D-Bus service name agreed upon with the configuration manager and provides an interface for obtaining a list of disabled switching shortcut keys. Upon detecting a D-Bus service registration event that meets the service name criteria, the configuration manager calls the service's disabled shortcut key function interface and does not respond to the corresponding shortcut keys. This disables the ability to switch windows via shortcut keys by entering the window switcher. Disabling these shortcut keys ensures that the full-screen window and the authorized window display process cannot be switched to other workspaces or application windows by pressing shortcut keys, which would result in the authorization request being ignored. This method directly handles the disabling of the function corresponding to the specific shortcut key, without having to worry about the correspondence between the function and the shortcut key; in addition, the method of monitoring the D-Bus service registration and service exit signals can solve the problem of the shortcut key function being disabled due to the abnormal exit of the calling program.
[0067] S106: When receiving the user's authorization operation, close the full-screen window and restore the disabled shortcut keys.
[0068] When the user authorization operation is completed, the full-screen window is closed, and the configuration management backend exits by monitoring the registered D-Bus service. At the same time, the shortcut keys disabled by the service are automatically released, the shortcut key functions are restored, and the authorization operation is completed.
[0069] This embodiment creates a full-screen window based on the user's authorization pop-up request, and at the same time monitors the insertion or removal of the display. According to the change in the display area coordinates caused by the insertion or removal of the display, the position and size of the full-screen window are updated in real time, so that the size of the full-screen window always remains consistent with the maximum window size visible in the current display mode, thereby achieving the effect of covering the entire screen, so that the user can only operate within the full-screen window, and all other content on the screen is covered, ensuring the high priority of the authorized window. The switching shortcut key is shielded through the D-Bus interface to prevent the user from accidentally switching to other windows and ignoring the authorization information. At the same time, the shortcut key can be unblocked by monitoring the exit of the D-Bus service, avoiding the problem of the shortcut key being unavailable due to abnormal exit of the shortcut key disabling.
[0070] Example 2
[0071] Figure 2This is a flow chart of a method for authorizing a window to dominate the screen display in a multi-screen mode according to a second embodiment of the present invention. This embodiment is optimized based on the above embodiment. In this embodiment, S103 is specifically optimized as follows:
[0072] Get the maximum window size currently visible in the system, and set the size of the full-screen window to be consistent with the maximum window size;
[0073] Monitor and respond to the insertion or removal of the display, and obtain the latest display area coordinates according to the insertion or removal of the display;
[0074] The position and size of the full-screen window are updated in real time according to the latest display area coordinates.
[0075] Accordingly, the method for displaying an authorized window in a multi-screen mode provided by this embodiment specifically includes:
[0076] S201, monitoring the user authorization pop-up request of the Linux system Polkit service.
[0077] S202, responding to the user's authorization pop-up request, creating a full-screen window and setting the window to a top-most state.
[0078] S203, obtaining the maximum window size currently visible in the system, and setting the size of the full-screen window to be consistent with the maximum window size.
[0079] Based on the current number of screens in the system and the coordinates of the display area, the maximum visible window size is determined, and the size of the full-screen window is set to be consistent with the maximum window size, ensuring that the full-screen window can always maintain full-screen status and cover all screens under multiple screens. The maximum display operation area after all screens are configured according to the currently set display parameters is obtained through the geometry() interface of the QDesktopWidget class instance returned by the QApplication::desktop() interface, and then the full-screen window calls setGeometry() to set it to the aforementioned area size.
[0080] S204 , monitoring and responding to the insertion or removal action of the display, and obtaining the latest display area coordinates according to the insertion or removal action of the display.
[0081] Monitor the insertion or removal of the monitor, adjust the coordinates of the display area accordingly, and generate the latest display area coordinates. Monitor the resized, workAreaResized, primaryScreenChanged, and screenCountChanged signals of the QDesktopWidget class instance obtained by QApplication::desktop(), and re-obtain the geometry() coordinates and size of the QDesktopWidget upon receiving the signals.
[0082] S205: updating the position and size of the full-screen window in real time according to the latest display area coordinates.
[0083] According to the coordinates and size obtained by the geometry() interface of the QDesktopWidget above, the full-screen window is set to the same coordinates and size of the QRect through setGeometry to cover the entire display area, keeping the size of the full-screen window able to cover all screens.
[0084] S206: Set the full-screen window as a parent window, create an authorization window on the parent window, and display the authorization interaction information in the authorization window.
[0085] S207: Actively disable shortcut keys for switching workspaces and switching application windows.
[0086] S208: Upon receiving the user's authorization operation, close the full-screen window and restore the disabled shortcut keys.
[0087] This embodiment obtains the latest display area coordinates by monitoring the insertion or removal of the display, and updates the position and size of the full-screen window in real time based on the latest display area coordinates. In a multi-screen scenario, even if the number of screens increases or decreases, the full-screen window can still maintain the effect of covering all screens, avoiding users from operating other parts and ensuring the priority of the authorized window.
[0088] Optionally, the method further includes:
[0089] According to the transparency effect support option of the window compositor, the transparency attribute of the full-screen window is determined, and the corresponding background image is drawn according to the transparency attribute and the number of screens. The image size of the background image is consistent with the corresponding screen size.
[0090] Whether the current environment supports window compositing is determined by checking whether the value of the property compositingType of the window compositor's D-Bus service interface (service: org.ukui.KWin, path: / Compositor, interface: org.freedesktop.DBus.Properties) is "none". If it is not "none", window compositing is supported to set the full-screen window. For example, if the window compositor supports the transparent attribute, the full-screen window is set to transparent. If the transparent attribute is not supported, it is necessary to draw the background image of the corresponding screen on the full-screen window according to the number of multiple screens and the size of each screen, and keep the size of the background image consistent with the size of the corresponding screen. The background image of the corresponding screen is displayed on the corresponding screen through the full-screen window to achieve an effect close to full transparency, so that the full-screen window's coverage of all screens is less sensitive or even imperceptible, thereby improving the user experience.
[0091] Example 3
[0092] Figure 3 This is a flowchart of a method for authorizing a window to dominate the screen display in a multi-screen mode according to a third embodiment of the present invention. This embodiment is optimized based on the above embodiment. In this embodiment, S105 is specifically optimized as follows:
[0093] Call the D-Bus interface to generate a list of switching shortcut keys to be blocked, and add a disabled status flag to each shortcut key in the list;
[0094] Register the D-Bus service, shield the switching shortcut key according to the switching shortcut key shielding list and the disabled state flag of each shortcut key in the list, and update the disabled state flag of the shortcut key.
[0095] Accordingly, the method for displaying an authorized window in a multi-screen mode provided by this embodiment specifically includes:
[0096] S301, monitoring the user authorization pop-up request of the Linux system Polkit service.
[0097] S302, responding to the user's authorization pop-up request, creating a full-screen window and setting the window to a top-most state.
[0098] S303: updating the position of the full-screen window in real time according to the insertion and removal of the display, and adjusting the size of the full-screen window to the maximum window size visible in the current display mode of the system.
[0099] S304: Set the full-screen window as a parent window, create an authorization window on the parent window, and display authorization interaction information in the authorization window.
[0100] S305: calling the D-Bus interface to generate a switching shortcut key shielding list, and adding a disabled state flag to each shortcut key in the list.
[0101] The D-Bus interface is a general interface that the window manager can use to disable shortcut keys. When obtaining the shortcut keys to be disabled and generating a list of disabled shortcut keys through this interface, a disabled status flag can be added to each shortcut key to record and indicate the disabled status of the shortcut key. The window manager's D-Bus interface (service: org.ukui.KWin, path: / Kwin, interface: org.ukui.KWin) is called to set a list of disabled shortcut keys such as "Switch One Desktop to the Left" through the blockShortcut interface. The configuration manager is also registered with the D-Bus service named "org.ukui.settingsDaemon.shortcut.ukui-polkit," which is listened to by the configuration manager. This interface, called blockShortcuts, is used to obtain the disabled shortcut key list, allowing the configuration manager to obtain information about the shortcut keys to be blocked. In this way, before responding to shortcut keys that are not registered with kglobalaccel, the disable status flag can be used to determine whether to continue responding during subsequent disablement. This can not only manage the disabling process of shortcut keys registered with kglobalaccel, but also manage shortcut keys that are not registered with kglobalaccel. The window manager's method of disabling shortcut keys through the D-Bus interface is compatible with different display service scenarios such as xorg and x-wayland scenarios.
[0102] S306: Register the D-Bus service, shield the switching shortcut key according to the switching shortcut key shielding list and the disabled state flag of each shortcut key in the list, and update the disabled state flag of the shortcut key.
[0103] The configuration management backend registers the D-Bus service, which obtains the switching shortcut key blocking list and blocks all shortcut keys in the table based on the list. At the same time, it updates the disabled status flag indicating the disabled state, making it easier to determine the disabled state of the shortcut keys when disabling them later. This makes it compatible with more display service scenarios.
[0104] S307: Upon receiving the user's authorization operation, close the full-screen window and restore the disabled shortcut keys.
[0105] When the user completes the authorization operation, the corresponding shortcut keys are automatically unblocked by monitoring the exit of the D-Bus service, avoiding the problem of shortcut keys becoming unavailable due to abnormal exit of the caller that disables the shortcut keys. In addition, by disabling shortcut keys through the general D-Bus interface of the configuration management backend, it is compatible with different display service scenarios such as xorg and x-wayland scenarios.
[0106] This embodiment disables shortcut keys by calling the general interface of the window manager, and identifies the disabled state of the shortcut keys by adding a disabled state flag, which facilitates the management of different shortcut key disabling methods. The shortcut keys are restored by monitoring the service corresponding to the interface, avoiding the unavailability of shortcut keys caused by abnormal exit, and is also compatible with more display service scenarios.
[0107] In an optional implementation of this embodiment, S302 includes:
[0108] Receive Polkit's user authorization pop-up request.
[0109] The authorization pop-up window backend program receives the user's authorization pop-up window request by monitoring the Polkit service.
[0110] Create a QWidget window with a size that is the maximum visible window size based on the system's current display mode.
[0111] Create a QWidget full-screen window. The size of the full-screen window is consistent with the maximum visible window size in the system's current display mode. The full-screen window is set through the window manager. The window manager contains layers from low to high, such as DesktopLayer, BelowLayer, NormalLayer, DockLayer, AboveLayer, and UnmanagedLayer. The window manager draws windows in order from low to high according to the hierarchy. The level of the full-screen window is AboveLayer, which ensures that the full-screen window is displayed above the desktop, taskbar, and general windows. At the same time, it does not affect the display level of windows with higher priority functions such as system notification windows and lock screen windows, ensuring that higher priority windows can still be displayed on the upper layer of the full-screen window.
[0112] Set the QWidget window properties to borderless, top, and transparent.
[0113] By setting the full-screen window to be borderless and transparent, so that the window directly covers the taskbar instead of hiding it, the authorization pop-up window can be kept on top while displaying some dynamic information of the taskbar, such as application message reminders in the tray, period date display, etc., to prevent users from missing other reminders they want to pay attention to.
[0114] For example, by:
[0115] setWindowFlags(Qt::Tool | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint);
[0116] Among them, Qt::Tool sets the window as a tool window (Tool Window), and tool windows usually have no taskbar entries; Qt::WindowStaysOnTopHint forces the window to always appear on top of other windows, and the window will be placed above all other non-top windows (unless other windows also set this flag); Qt::FramelessWindowHint: removes the window border and title bar, and the window has no title bar, border, close / minimize buttons and other system decorations; through setWindowOpacity(0.25); adjust the window transparency to 0.25, 0 is fully transparent, and 1 is opaque.
[0117] Example 4
[0118] Figure 4 This is a flowchart of a method for authorizing a window to dominate the screen display in a multi-screen mode according to a fourth embodiment of the present invention. This embodiment is optimized based on the above embodiment. In this embodiment, S104 is specifically optimized as follows:
[0119] Set the full-screen window as the parent window, and create an authorization window based on QDialog on the parent window;
[0120] The authorization interaction information is displayed in the authorization window, and the authorization interaction information includes: authorization description information, authorization program icon, and authorized user list.
[0121] Accordingly, the method for displaying an authorized window in a multi-screen mode provided by this embodiment specifically includes:
[0122] S401, monitoring the user authorization pop-up request of the Linux system Polkit service.
[0123] S402, responding to the user's authorization pop-up request, creating a full-screen window and setting the window to a top-most state.
[0124] S403: updating the position of the full-screen window in real time according to the insertion and removal of the display, and adjusting the size of the full-screen window to the maximum window size visible in the current display mode of the system.
[0125] S404: Set the full-screen window as a parent window, and create an authorization window based on QDialog on the parent window.
[0126] After the full-screen window covers all screens, a QDialog window is created on the upper layer of the full-screen window in the form of a child window for displaying authorization information, so as to inherit the properties of the full-screen window and display the authorization information with high priority.
[0127] S405: Display authorization interaction information in the authorization window, where the authorization interaction information includes authorization description information, authorization program icon, and authorized user list.
[0128] In order to facilitate users to obtain the information that needs to be authorized and determine whether to authorize based on the authorization information, the authorization interaction information displayed in the authorization window needs to describe the authorization content, as well as the program icon that needs to obtain authorization, and the list of users who are granted permission. Users can intuitively understand the authorization content through the above authorization interaction information and quickly perform authorization operations.
[0129] S406: Actively disable shortcut keys for switching workspaces and switching application windows.
[0130] S407: Upon receiving the user's authorization operation, close the full-screen window and restore the disabled shortcut keys.
[0131] This embodiment uses the full-screen window as the parent window and creates an authorization window on the upper layer of the full-screen window in the form of a child window, which facilitates attribute inheritance, improves the display priority of authorization information, makes it easier for users to obtain authorization information, and improves user authorization efficiency.
[0132] Specifically, the method further includes:
[0133] Set the authorization window as a modal dialog box.
[0134] Since the authorization window is a child window of the full-screen window, the full-screen window covers the entire screen, and the authorization window only occupies part of the full-screen window. When the user clicks on a full-screen window other than the authorization window, although the full-screen window can block other applications by covering them, the user still needs to be prompted to quickly perform the authorization operation.
[0135] Monitor the mouse click area and trigger the shaking reminder effect of the modal dialog box according to the mouse click area.
[0136] By monitoring the mouse click area, when the mouse clicks on an area outside the authorization window, the modal dialog box will be triggered to shake. The shaking effect can prompt the user to pay attention to the content in the authorization window, thereby improving authorization efficiency.
[0137] Example 5
[0138] Figure 5This is a schematic diagram of the structure of a device for displaying an authorized window occupying a screen in a multi-screen mode according to a fifth embodiment of the present invention. In this embodiment, the device for displaying an authorized window occupying a screen in a multi-screen mode includes:
[0139] Request monitoring module 810, used to monitor user authorization pop-up requests of the Linux system Polkit service;
[0140] The request response module 820 is used to respond to the user's authorization pop-up window request and create a full-screen window to set the window to the top state;
[0141] Window update module 830, used to update the position of the full-screen window and adjust the size of the full-screen window in real time according to the insertion and removal of the display;
[0142] Authorization information module 840, used to set the full-screen window as the parent window and create an authorization window on the parent window to display the authorization interaction information;
[0143] The shortcut key shielding module 850 is used to proactively disable the shortcut keys for switching workspaces and switching application windows;
[0144] The window restoration module 860 is configured to close the full-screen window and restore disabled shortcut keys upon receiving an authorization operation from the user.
[0145] This embodiment monitors the user's authorization pop-up window request through the request monitoring module, responds to the monitored user authorization pop-up window request through the request response module, adjusts the size of the full-screen window through the window update module, creates an authorization window through the authorization information module and displays the authorization interaction information in the authorization window, disables the switching shortcut key through the shortcut key shielding module, and restores the disabled shortcut key after the full-screen window is closed through the window recovery module. By creating a full-screen window according to the user's authorization pop-up window request, and monitoring the insertion or removal of the display, the position and size of the full-screen window are updated in real time according to the change in the display area coordinates caused by the insertion or removal of the display, so that the size of the full-screen window always remains consistent with the maximum window size visible in the current display mode, thereby achieving the effect of covering all screens, so that the user can only operate in the full-screen window, and other content on the screen is covered, ensuring the high priority of the authorization window. The switching shortcut key is shielded through the D-Bus interface to prevent the user from switching to other windows by mistake and ignoring the authorization information. At the same time, the shortcut key can be disabled by monitoring the exit of the D-Bus service, avoiding the problem of shortcut key unavailability caused by abnormal exit of the shortcut key disablement.
[0146] The authorized window screen-dominating display device in the multi-screen mode provided by an embodiment of the present invention can execute the authorized window screen-dominating display method in the multi-screen mode provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0147] Example 6
[0148] Figure 6 This is a structural diagram of an electronic device according to a sixth embodiment of the present invention. Figure 6 A block diagram of an exemplary device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 6 The device 12 shown is only an example and should not bring any limitation to the functionality and scope of use of the embodiments of the present invention.
[0149] like Figure 6 As shown, device 12 is implemented as a general-purpose computing device. Components of device 12 may include, but are not limited to, one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including system memory 28 and processing unit 16).
[0150] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0151] Device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by device 12, including volatile and non-volatile media, removable and non-removable media.
[0152] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be configured to read and write non-removable, non-volatile magnetic media ( Figure 6 Not shown, usually called a "hard drive"). Although Figure 6Although not shown, a magnetic disk drive for reading and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), as well as an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of various embodiments of the present invention.
[0153] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may include an implementation of a network environment. Program modules 42 generally implement the functions and / or methodologies of the embodiments described herein.
[0154] Device 12 may also communicate with one or more external devices 14 (e.g., a keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with device 12 / server / computer, and / or any device that enables device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). This communication may occur via input / output (I / O) interface 22. Furthermore, device 12 may communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with other modules of device 12 via bus 18. It should be understood that, although not shown, other hardware and / or software modules may be used in conjunction with device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0155] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the method for displaying an authorized window in a multi-screen mode provided by an embodiment of the present invention.
[0156] Example 7
[0157] Embodiment 7 of the present invention further provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to execute the method for authorized window dominance display in a multi-screen mode as provided in the above embodiment.
[0158] The computer storage medium of the embodiments of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0159] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0160] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0161] Computer program code for performing the operations of the present invention 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 stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0162] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the concept of the present invention. The scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for displaying an authorized window in a multi-screen mode, characterized in that: include: S101, monitors the user authorization pop-up request of the Linux system Polkit service; S102, responding to the user's authorization pop-up request, creating a full-screen window and setting the window to a top-most state; S103, updating the position of the full-screen window in real time according to the insertion and removal of the display, and adjusting the size of the full-screen window to the maximum window size visible in the current display mode of the system; S104, setting the full-screen window as a parent window, creating an authorization window on the parent window, and displaying the authorization interaction information in the authorization window; S105, actively disabling the shortcut keys for switching workspaces and switching application windows; S106: When receiving the user's authorization operation, close the full-screen window and restore the disabled shortcut keys.
2. The method according to claim 1, characterized in that The S103 includes: Get the maximum window size currently visible in the system, and set the size of the full-screen window to be consistent with the maximum window size; Monitor and respond to the insertion or removal of the display, and obtain the latest display area coordinates according to the insertion or removal of the display; The position and size of the full-screen window are updated in real time according to the latest display area coordinates.
3. The method according to claim 1, characterized in that The S105 includes: Call the D-Bus interface to generate a list of switching shortcut keys to be blocked, and add a disabled status flag to each shortcut key in the list; Register the D-Bus service, shield the switching shortcut key according to the switching shortcut key shielding list and the disabled state flag of each shortcut key in the list, and update the disabled state flag of the shortcut key.
4. The method according to claim 1, wherein The S102 includes: Receive Polkit's user authorization pop-up request; Create a QWidget window, and the window size is the maximum visible window size based on the system's current display mode; Set the QWidget window properties to borderless, top, and transparent.
5. The method according to claim 2, characterized in that The method further comprises: According to the transparency effect support option of the window compositor, the transparency attribute of the full-screen window is determined, and the corresponding background image is drawn according to the transparency attribute and the number of screens. The image size of the background image is consistent with the corresponding screen size.
6. The method according to claim 1, characterized in that The S104 includes: Set the full-screen window as the parent window, and create an authorization window based on QDialog on the parent window; The authorization interaction information is displayed in the authorization window, and the authorization interaction information includes: authorization description information, authorization program icon, and authorized user list.
7. The method according to claim 6, characterized in that The method further comprises: Setting the authorization window as a modal dialog box; Monitor the mouse click area and trigger the shaking reminder effect of the modal dialog box according to the mouse click area.
8. A device for displaying a screen dominated by an authorized window in a multi-screen mode, characterized in that: include: Request monitoring module, used to monitor user authorization pop-up requests from the Linux system Polkit service; The request response module is used to respond to the user's authorization pop-up request and create a full-screen window to set the window to the top state; A window update module is used to update the position of the full-screen window and adjust the size of the full-screen window in real time according to the insertion and removal of the display; The authorization information module is used to set the full-screen window as the parent window and create an authorization window on the parent window to display the authorization interaction information; The shortcut key shielding module is used to proactively disable the shortcut keys for switching workspaces and application windows; The window restoration module is used to close the full-screen window and restore the disabled shortcut keys when receiving the user's authorization operation.
9. An electronic device, characterized in that: The device comprises: one or more processors; a storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method for displaying an authorized window occupying the screen in a multi-screen mode as described in any one of claims 1 to 7.
10. A storage medium comprising computer-executable instructions, wherein the computer-executable instructions, when executed by a computer processor, are used to execute the method for authorized window dominance display in a multi-screen mode as described in any one of claims 1-7.
Citation Information
Patent Citations
Modal box dragging method and system compatible with multiple react component libraries
CN118069120A
Method and system for limiting user to only operate current program window in desktop system
CN118467090A