Re: [Spice-devel] [PATCH] spicy: add --title= command line option</span></a></span> </h1> <p class="darkgray font13"> <span class="sender pipe"><a href="/search?l=spice-devel@lists.freedesktop.org&q=from:%22Dunrong+Huang%22" rel="nofollow"><span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Dunrong Huang</span></span></a></span> <span class="date"><a href="/search?l=spice-devel@lists.freedesktop.org&q=date:20120905" rel="nofollow">Wed, 05 Sep 2012 02:43:01 -0700</a></span> </p> </div> <div itemprop="articleBody" class="msgBody"> <!--X-Body-of-Message--> <pre>2012/9/5 Uri Lublin <u...@redhat.com>: > --- > > This simplifies using Alon's copy/paste test script, which requires > the window title string > > --- > gtk/spicy.c | 18 +++++++++++++++++- > 1 files changed, 17 insertions(+), 1 deletions(-) > > diff --git a/gtk/spicy.c b/gtk/spicy.c > index 8b3b087..1fc544b 100644 > --- a/gtk/spicy.c > +++ b/gtk/spicy.c > @@ -123,6 +123,7 @@ static void del_window(spice_connection *conn, > SpiceWindow *win); > /* options */ > static gboolean fullscreen = false; > static gboolean version = false; > +static char *spicy_title = NULL; > /* globals */ > static GMainLoop *mainloop = NULL; > static int connections = 0; > @@ -1173,7 +1174,12 @@ static SpiceWindow > *create_spice_window(spice_connection *conn, SpiceChannel *ch > > /* toplevel */ > win->toplevel = gtk_window_new(GTK_WINDOW_TOPLEVEL); > - snprintf(title, sizeof(title), _("spice display %d:%d"), id, monitor_id); > + if (spicy_title == NULL) { > + snprintf(title, sizeof(title), _("spice display %d:%d"), id, > monitor_id); > + } else { > + snprintf(title, sizeof(title), "%s", spicy_title); > + } > + > gtk_window_set_title(GTK_WINDOW(win->toplevel), title); > g_signal_connect(G_OBJECT(win->toplevel), "window-state-event", > G_CALLBACK(window_state_cb), win); > @@ -1741,6 +1747,12 @@ static GOptionEntry cmd_entries[] = { > .arg_data = &version, > .description = N_("Display version and quit"), > },{ > + .long_name = "title", > + .arg = G_OPTION_ARG_STRING, > + .arg_data = &spicy_title, > + .description = N_("Set the window title"), > + .arg_description = N_("<title>"), > + },{ > /* end of list */ > } > }; > @@ -1907,5 +1919,9 @@ int main(int argc, char *argv[]) > g_free(conf); > g_key_file_free(keyfile); > > + if (spicy_title) { > + g_free(spicy_title); > + } g_free() dont need to check for NULL pointer > + > return 0; > } > -- > 1.7.1 > > _______________________________________________ > Spice-devel mailing list > Spice-devel@lists.freedesktop.org > <a rel="nofollow" href="http://lists.freedesktop.org/mailman/listinfo/spice-devel">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a></pre><pre> -- Best Regards, Dunrong Huang _______________________________________________ Spice-devel mailing list Spice-devel@lists.freedesktop.org <a rel="nofollow" href="http://lists.freedesktop.org/mailman/listinfo/spice-devel">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a> </pre> </div> <div class="msgButtons margintopdouble"> <ul class="overflow"> <li class="msgButtonItems"><a class="button buttonleft " accesskey="p" href="msg10504.html">Previous message</a></li> <li class="msgButtonItems textaligncenter"><a class="button" accesskey="c" href="thrd2.html#10505">View by thread</a></li> <li class="msgButtonItems textaligncenter"><a class="button" accesskey="i" href="mail3.html#10505">View by date</a></li> <li class="msgButtonItems textalignright"><a class="button buttonright " accesskey="n" href="msg10506.html">Next message</a></li> </ul> </div> <a name="tslice"></a> <div class="tSliceList margintopdouble"> <ul class="icons monospace"> <li class="icons-email"><span class="subject"><a href="msg10503.html">[Spice-devel] [PATCH] spicy: add --title=<title> ...</a></span> <span class="sender italic">Uri Lublin</span></li> <li><ul> <li class="icons-email"><span class="subject"><a href="msg10504.html">Re: [Spice-devel] [PATCH] spicy: add --title=<t...</a></span> <span class="sender italic">Marc-André Lureau</span></li> <li class="icons-email tSliceCur"><span class="subject">Re: [Spice-devel] [PATCH] spicy: add --title=<t...</span> <span class="sender italic">Dunrong Huang</span></li> <li><ul> <li class="icons-email"><span class="subject"><a href="msg10506.html">Re: [Spice-devel] [PATCH] spicy: add --title=&...</a></span> <span class="sender italic">Uri Lublin</span></li> </ul> </ul> </ul> </div> <div class="overflow msgActions margintopdouble"> <div class="msgReply" > <h2> Reply via email to </h2> <form method="POST" action="/mailto.php"> <input type="hidden" name="subject" value="Re: [Spice-devel] [PATCH] spicy: add --title=<title> command line option"> <input type="hidden" name="msgid" value="CAOZVR5aW-_tb2m_HrA7m9x_99GZn1J4mK903wS6o8VRnmnDdqA@mail.gmail.com"> <input type="hidden" name="relpath" value="spice-devel@lists.freedesktop.org/msg10505.html"> <input type="submit" value=" Dunrong Huang "> </form> </div> </div> </div> <div class="aside" role="complementary"> <div class="logo"> <a href="/"><img src="/logo.png" width=247 height=88 alt="The Mail Archive"></a> </div> <form class="overflow" action="/search" method="get"> <input type="hidden" name="l" value="spice-devel@lists.freedesktop.org"> <label class="hidden" for="q">Search the site</label> <input class="submittext" type="text" id="q" name="q" placeholder="Search spice-devel"> <input class="submitbutton" name="submit" type="image" src="/submit.png" alt="Submit"> </form> <div class="nav margintop" id="nav" role="navigation"> <ul class="icons font16"> <li class="icons-home"><a href="/">The Mail Archive home</a></li> <li class="icons-list"><a href="/spice-devel@lists.freedesktop.org/">spice-devel - all messages</a></li> <li class="icons-about"><a href="/spice-devel@lists.freedesktop.org/info.html">spice-devel - about the list</a></li> <li class="icons-expand"><a href="/search?l=spice-devel@lists.freedesktop.org&q=subject:%22Re%5C%3A+%5C%5BSpice%5C-devel%5C%5D+%5C%5BPATCH%5C%5D+spicy%5C%3A+add+%5C-%5C-title%3D%3Ctitle%3E+command+line%09option%22&o=newest&f=1" title="e" id="e">Expand</a></li> <li class="icons-prev"><a href="msg10504.html" title="p">Previous message</a></li> <li class="icons-next"><a href="msg10506.html" title="n">Next message</a></li> </ul> </div> <div class="listlogo margintopdouble"> </div> <div class="margintopdouble"> </div> </div> </div> <div class="footer" role="contentinfo"> <ul> <li><a href="/">The Mail Archive home</a></li> <li><a href="/faq.html#newlist">Add your mailing list</a></li> <li><a href="/faq.html">FAQ</a></li> <li><a href="/faq.html#support">Support</a></li> <li><a href="/faq.html#privacy">Privacy</a></li> <li class="darkgray">CAOZVR5aW-_tb2m_HrA7m9x_99GZn1J4mK903wS6o8VRnmnDdqA@mail.gmail.com</li> </ul> </div> </body> </html>