-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow monitor choice #24
Conversation
Possibly requires #23 to avoid merge conflicts on the DBUS variable. |
I don't think it should be client selecting the monitor. Besides the policy aspect (who control what is shared), the display names may not match (or be known at all) to the source qube - see Later it could be extended to include also a screenshot, or even selecting individual window (the latter might be more problematic, and may deserve separate separate service if a protocol with dynamic frame size would be needed). |
The monitor names are not known by the source. I just allow the client to specify the target because then it can be shown in the Qrexec dialog, but in any case, the target can always override the monitor name. You following suggestions seems promising, especially the combination of dialog box with screenshot of the monitors.
I believe the monitor names can only have these characeters: See the output of: xrandr | awk '/ (dis)?connected /{print $1}' I didn't read the xrandr source code to verify and did not find information in the manual page. Qrexec arguments can have the following characters:
I thought about this, but then thought there should be less dialogs for UX reasons, but if you prefer a dialog, I can do that instead.
A screenshot of the screens would be nice, I thought of this to be more explicit but then went in the simple route.
|
Installing:
yad x86_64 9.3-4.fc37 qubes-dom0-cached 235 k
Installing dependencies:
gspell x86_64 1.12.1-1.fc37 qubes-dom0-cached 106 k
gtksourceview3 x86_64 3.24.11-8.fc37 qubes-dom0-cached 581 k
javascriptcoregtk4.0 x86_64 2.42.2-1.fc37 qubes-dom0-cached 8.4 M
webkit2gtk4.0 x86_64 2.42.2-1.fc37 qubes-dom0-cached 24 M Possibly GTK is better because there is a high chance everything is already installed. |
It's also okay to start with zenity (which AFAIR is already pulled in by something else) for the list-only option, and later replace with something else for list+screenshots. @marmarta can help with GTK dialog. |
d139d38
to
88d08f8
Compare
Zenity dialog ready for review. Sorry about many pushes, had some troubles in the rebase and merge. |
585a6c1
to
b4bf184
Compare
If more than one monitor is found on the target, an interactive dialog will be prompted to the user to choose from, displaying monitor name (port) and resolution and geometry for better identification. The monitor can be enforced by the target by environment variable. Fixes: QubesOS/qubes-issues#9275
* qubesos/main: Update policy format Export dbus address for the notification server
b4bf184
to
f7485c9
Compare
Updated commit message. |
I have no prior experience with Gtk other than this PR, but I can grasp some examples that I've read about screenshots with pixbuf and combobox. One design idea is taking screenshot of monitors using Gdk.pixbuf_get_from_window and setting the geometry to the monitor one. Then a combobox to select the monitor and when an option is selected, show screenshot of wanted monitor. Do not show screenshot of all monitors at the same time as many monitor can coexist and would have to reduce image resolution. window = Gdk.get_default_root_window()
x, y, width, height = window.get_geometry()
monitor_pixbuf = Gdk.pixbuf_get_from_window(window, x, y, width, height)
if monitor_pixbuf:
monitor_pixbuf.savev("monitor_NAME.png", "png", (), ())
else:
## ERROR OUT Another option is a design similar to the KDE screen arrangement would be one option and the user click on the display or on a combobox that selects the display per name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets merge zenity version first, and extend in a separate PR
The client can choose the monitor, which will be prompted in the Qrexec dialog. The monitor can be enforced overridden by the target by environment variable. Useful on a multi-monitor setup, especially when Dom0 is the target.
Fixes: QubesOS/qubes-issues#9275