-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Convert qubes.WindowIconUpdater to a socket service #37
Conversation
def67a4
to
c48f450
Compare
Ouch, this is not right, I think the cache needs to depend on domain ID... |
c48f450
to
5b15353
Compare
Not only cache, but also window ID map. Or at least the map should now have two fields (vm, remote window id). IMO it would be cleaner to have separate object instances for each incoming connection and keep domain-specific data there. |
What do you think about the current code? I converted the "remote ID" to I think creating separate object instances would make it less clean, because the X server connection is global and not related to either a specific domain or connection. You would need to filter X messages (which we receive globally) down to the right instance, and handle creating/destroying these instances. With the current code, we store very little state per connection (just the local variables: domain and color), and we keep open the possibility of multiple connections from icon-sender, for instance per-request instead of per-session (that's not to say we should do that, but I think it shows things are more decoupled). |
Ok, makes sense. |
5b15353
to
7b66d55
Compare
By the way, master is still broken for me:
|
Does it happen after logoff+logon? |
No, right after reboot. |
It might be because of the qrexec-policy-daemon. Since it's now this service calling qrexec-client, not qrexec-daemon, the actual service is called a) as root, b) with limited environment variables. |
Since QubesOS/qubes-core-qrexec#41 is merged, I assume this should make use of it, right? |
This also needs adjusted dependencies, for all the new things it requires:
Both Fedora and Debian. |
This makes icon-sender handle GUI restart, same as qubes-gui and audio. However, in this case we are not running raw vchan, but Qubes RPC, so the procedure is more complicated: we start a qrexec-client-vm subprocess, and restart it if it breaks. Needs icon-receiver to be a service with wait-for-session (QubesOS/qubes-gui-daemon#37), and fix for socket services in dom0 (QubesOS/qubes-core-qrexec#42).
This makes icon-sender handle GUI restart, same as qubes-gui and audio. However, in this case we are not running raw vchan, but Qubes RPC, so the procedure is more complicated: we start a qrexec-client-vm subprocess, and restart it if it breaks. Needs icon-receiver to be a service with wait-for-session (QubesOS/qubes-gui-daemon#37), and fix for socket services in dom0 (QubesOS/qubes-core-qrexec#42).
This makes icon-sender handle GUI restart, same as qubes-gui and audio. However, in this case we are not running raw vchan, but Qubes RPC, so the procedure is more complicated: we start a qrexec-client-vm subprocess, and restart it if it breaks. Needs icon-receiver to be a service with wait-for-session (QubesOS/qubes-gui-daemon#37), and fix for socket services in dom0 (QubesOS/qubes-core-qrexec#42).
window-icon-updater/icon-receiver
Outdated
while True: | ||
await event.wait() | ||
event.clear() | ||
self.handle_pending_events() |
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.
Why not simply connect handle_pending_events() as a reader function directly?
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.
Right. Updated.
As a result, we have a single service running for all the VMs. Start it using /etc/xdg/autostart to ensure it's running in the proper graphical session. Use (domain, ID) as remote IDs to prevent conflicts between windows. Depends on Image.get_from_stream_async, implemented in QubesOS/qubes-linux-utils#52.
Added to dom0 in QubesOS/qubes-core-qrexec#41.
- qubes-core-qrexec >= 4.1.5 (for socket services) - qubes-utils >= 4.1.4 (for Image.get_from_stream_async)
7b66d55
to
4f67989
Compare
Ouch, there is one more edge case: creating a new machine while the process is running :) |
Newly created domains, and color changes.
As a result, we have a single service running for all the VMs.
Start it using /etc/xdg/autostart to ensure it's running in the
proper graphical session.
Depends on Image.get_from_stream_async, implemented in
QubesOS/qubes-linux-utils#52.