[Spice-devel] Patch to fix the bug in spice-client

Divya divyas15 at gmail.com
Wed Feb 29 07:15:02 PST 2012


Hello list
I find that spice-client (spicec) does not honour the screen value of
DISPLAY variable in multi head setup. spicec started from any of the
DISPLAY, opens up the client window on DISPLAY :0.0. I have fixed this
issue and attaching the patch herewith. Locally it is working fine for me.
I would request others to test and review the patch and provide your inputs
on the same. While working on this issue, I figured out following which
stopped the client to start at the DISPLAY it was started from:

1] In the Application::init_remainder method, get_screen() was called with
value 0 which was further taken up id for the screen.

2] I fixed up this by returning the XDefaultScreen value from
Platform::init() and using it further for initialization.

3] I added a method Platform::get_startup_monitor &
Application::get_startup_monitor_id to get the monitor id for the screen.

4] Passed the appropriate monitor reference to the RedScreen, which was set
to NULL earlier and caused the client window to start at screen 0.

Code inside screen.cpp, which checks for monitor and started the window

<snip>
void RedScreen::show()
{
    RecurciveLock lock(_update_lock);
    _window.show(_monitor ? _monitor->get_screen_id() : 0);
}
</snip>

For this part of the code step 3 was required.

5] I have added a new variable _default_screen_id in the Application class
to store the value of screen from which spice client starts. Motivation for
this name was that in x_display variable this appears as
default_screen. Application::set_default_screen_id
& get_default_screen_id() are added as getter and setter for the same. Any
suggestion on the naming conventions would be appreciated if they do not
look appropriate in the code.

I also find the same bug being reported in the thread
http://www.mail-archive.com/spice-devel@lists.freedesktop.org/msg05463.html
--
Thanks & regards,
Divya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20120229/9b7cfb24/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: honor-screen_in-multi-head-setup.patch
Type: text/x-patch
Size: 8206 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20120229/9b7cfb24/attachment.bin>


More information about the Spice-devel mailing list