Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upcolorful window icons not always passed to dom0, padlock showed instead #1495
Comments
marmarek
added
bug
C: gui-virtualization
P: minor
labels
Dec 7, 2015
marmarek
added this to the Release 3.1 milestone
Dec 7, 2015
marmarek
modified the milestones:
Release 3.1 updates,
Release 3.1
Feb 8, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Feb 12, 2016
Member
- When the icon is received but no matching window exists, it is
discarded. That part of code is here:
https://github.com/QubesOS/qubes-gui-daemon/blob/master/window-icon-updater/icon-receiver#L319-L324 - Instead of discarding it should be cached for a short time, and then
when new window appears icon from cache should be applied (if there is
one). This part require watching for "CreateNotifyEvent", which isn't
currently done. Instead X11 events are handled only when searching for
some window:
https://github.com/QubesOS/qubes-gui-daemon/blob/master/window-icon-updater/icon-receiver#L235
Watching for such events is implemented on the sender part here:
https://github.com/QubesOS/qubes-gui-agent-linux/blob/master/window-icon-updater/icon-sender#L134-L143 - The icon cache should be done with security in mind, for example to
not allow any VM use all dom0 memory. I think limiting its size to for
example last 10 icons should be enough.
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
v6ak
Feb 18, 2016
Why not implement the logic in DomUs? For example, icon would be sent on window creation.
Pros:
- No need for such DoS prevention mechanisms.
- It should work in any load (compared to the “cached for a short time” best-effort mechanism)
- A simpler code, I guess. At least in dom0.
Cons:
- Maybe need to implement the logic in multiple agents. (But I am not sure if the issue also happens with QWT, maybe it is not needed there.)
v6ak
commented
Feb 18, 2016
|
Why not implement the logic in DomUs? For example, icon would be sent on window creation. Pros:
Cons:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Feb 18, 2016
Member
On Thu, Feb 18, 2016 at 06:40:54AM -0800, Vít Šesták wrote:
Why not implement the logic in DomUs? For example, icon would be sent on window creation.
It is exactly what is currently done. In practice it looks like this:
- Application create a window
- Application set an icon
3a. gui-agent notice new window and send it to dom0
3b. icon-sender notice new window and send its icon to dom0
4a. gui-daemon receive new window info and create it on dom0 X server
4b. icon-receiver get new icon for a window and set the icon (if window
exists)
The problem is that, we don't control order of 4a and 4b. To make things
even worse, it could be also another situation:
5. Application destroys the window
6. gui-agent send that event to dom0
7. gui-daemon destroys the window
and now 4b is happening.
VM have no direct confirmation when window is actually created in dom0.
So no simple point of synchronization...
Another idea (instead of caching) - add some feedback dom0->VM like "no
such window" info, so VM could retry some time later?
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
|
On Thu, Feb 18, 2016 at 06:40:54AM -0800, Vít Šesták wrote:
It is exactly what is currently done. In practice it looks like this:
The problem is that, we don't control order of 4a and 4b. To make things VM have no direct confirmation when window is actually created in dom0. Another idea (instead of caching) - add some feedback dom0->VM like "no Best Regards, |
marmarek
referenced this issue
Mar 13, 2016
Closed
R3.1: Colorful icons only show up on a few VMs out of many #1830
marmarek
referenced this issue
Mar 21, 2016
Closed
UI and UX: colorized app icons in taskbar instead of colorized locks #967
jpouellet
referenced this issue
Feb 24, 2017
Closed
Firefox icon (also chromium) gets "lost" on Debian AppVMs (unpredictably, hard to reproduce) #2586
andrewdavidwong
modified the milestones:
Release 3.1 updates,
Release 3.2 updates
May 31, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
najamelan
Dec 28, 2017
I know this is somewhat old, but I feel this feature is not stabilized. I still see lock icons and so do others in Q4.
In terms of implementation described by @marmarek, something seems off. I would say that here the vm is the model and the gui agent in dom0 is the view. For that it should not be up to the model to send data to the view. It should be the view that requests it.
Example:
Model sends an event to dom0 (new window created, handle:xxx)
dom0 requests extra data for handle xxx: vm, please give me window title, position, icon...
This way the control over data that flows to dom0 is in the hands of dom0 and not the vm. The vm cannot send more icons than requested. This is better from a security perspective. All you have to do is sanitize and then validate the data you get back. Is the icon a valid image, not exceeding a certain size? Is the window title a valid utf-8 string, with min and max lengths, without forbidden characters, etc.
This also solves synchronization issues. dom0 will always be ready when it receives any data, because it has requested it.
It also means you don't need several different services. One gui manager in dom0 and one in each vm, no need for something separate for icons, or anything else that we should send, like mouse cursor? This should simplify the architecture.
I have not had a look at the implementation in Qubes, but obviously there is one area in which we have the vm initiate comms: Events. It is just important to sanitize and validate all data send by events, and formalize the format. It can then be used by stuff other than gui related as well. It should be a fixed transport protocol. It can help users to make safe extensions as well, when using something strictly typed.
najamelan
commented
Dec 28, 2017
•
|
I know this is somewhat old, but I feel this feature is not stabilized. I still see lock icons and so do others in Q4. In terms of implementation described by @marmarek, something seems off. I would say that here the vm is the model and the gui agent in dom0 is the view. For that it should not be up to the model to send data to the view. It should be the view that requests it. Example: This way the control over data that flows to dom0 is in the hands of dom0 and not the vm. The vm cannot send more icons than requested. This is better from a security perspective. All you have to do is sanitize and then validate the data you get back. Is the icon a valid image, not exceeding a certain size? Is the window title a valid utf-8 string, with min and max lengths, without forbidden characters, etc. This also solves synchronization issues. dom0 will always be ready when it receives any data, because it has requested it. It also means you don't need several different services. One gui manager in dom0 and one in each vm, no need for something separate for icons, or anything else that we should send, like mouse cursor? This should simplify the architecture. I have not had a look at the implementation in Qubes, but obviously there is one area in which we have the vm initiate comms: Events. It is just important to sanitize and validate all data send by events, and formalize the format. It can then be used by stuff other than gui related as well. It should be a fixed transport protocol. It can help users to make safe extensions as well, when using something strictly typed. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
najamelan
Dec 30, 2017
Not sure whether this helps, but in fedora-26 template, I get this in ~/.xsession-errors:
Traceback (most recent call last):
File "/usr/lib/qubes/icon-sender", line 155, in <module>
retriever.watch_and_send_icons()
File "/usr/lib/qubes/icon-sender", line 136, in watch_and_send_icons
[xproto.EventMask.SubstructureNotify])
File "/usr/lib64/python2.7/site-packages/xcb/xproto.py", line 1400, in ChangeWindowAttributesChecked
for elt in xcb.Iterator(value_list, 15, 'value_list', False):
xcb.Exception: Too few items in 'value_list' list (expect 15).
najamelan
commented
Dec 30, 2017
|
Not sure whether this helps, but in fedora-26 template, I get this in ~/.xsession-errors:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
This helps a lot, thanks! |
added a commit
to marmarek/old-qubes-gui-agent-linux
that referenced
this issue
Dec 31, 2017
marmarek
referenced this issue
in QubesOS/qubes-gui-agent-linux
Dec 31, 2017
Merged
icon-sender: prefer xcffib module over xpyb #31
marmarek
referenced this issue
in QubesOS/qubes-gui-daemon
Jan 1, 2018
Merged
icon-receiver: cache icons received for not (yet) existing windows #20
qubesos-bot
referenced this issue
in QubesOS/updates-status
Jan 12, 2018
Closed
gui-agent-linux v4.0.8 (r4.0) #351
andrewdavidwong
referenced this issue
Feb 4, 2018
Closed
Inconsistency in displaying of app icons in the toolbar R4.0 rc4 #3537
added a commit
to QubesOS/qubes-gui-agent-linux
that referenced
this issue
Feb 12, 2018
qubesos-bot
referenced this issue
in QubesOS/updates-status
Feb 12, 2018
Closed
gui-agent-linux v3.2.20 (r3.2) #409
marmarek
closed this
in
marmarek/qubes-gui-daemon@7b4c255
Feb 25, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
qubesos-bot
Mar 4, 2018
Automated announcement from builder-github
The package qubes-gui-dom0-4.0.7-1.fc25 has been pushed to the r4.0 testing repository for dom0.
To test this update, please install it with the following command:
sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing
qubesos-bot
commented
Mar 4, 2018
|
Automated announcement from builder-github The package
|
qubesos-bot
added
the
r4.0-dom0-cur-test
label
Mar 4, 2018
qubesos-bot
referenced this issue
in QubesOS/updates-status
Mar 4, 2018
Closed
gui-daemon v4.0.7 (r4.0) #448
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
qubesos-bot
Mar 12, 2018
Automated announcement from builder-github
The package qubes-gui-dom0-4.0.7-1.fc25 has been pushed to the r4.0 stable repository for dom0.
To install this update, please use the standard update command:
sudo qubes-dom0-update
Or update dom0 via Qubes Manager.
qubesos-bot
commented
Mar 12, 2018
|
Automated announcement from builder-github The package
Or update dom0 via Qubes Manager. |
marmarek commentedDec 7, 2015
It looks like sometimes colorful icon isn't set for a window. Most likely it is transferred before window in dom0 gets created, and simply discarded.
Dom0 part might monitor for new window events and have some (small) queue for such icons.