[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:%22Uri+Lublin%22" rel="nofollow"><span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Uri Lublin</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:35:49 -0700</a></span> </p> </div> <div itemprop="articleBody" class="msgBody"> <!--X-Body-of-Message--> <pre>--- This simplifies using Alon's copy/paste test script, which requires the window title string</pre><pre> --- 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); + } + 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> </div> <div class="msgButtons margintopdouble"> <ul class="overflow"> <li class="msgButtonItems"><a class="button buttonleft " accesskey="p" href="msg10499.html">Previous message</a></li> <li class="msgButtonItems textaligncenter"><a class="button" accesskey="c" href="thrd2.html#10503">View by thread</a></li> <li class="msgButtonItems textaligncenter"><a class="button" accesskey="i" href="mail3.html#10503">View by date</a></li> <li class="msgButtonItems textalignright"><a class="button buttonright " accesskey="n" href="msg10504.html">Next message</a></li> </ul> </div> <a name="tslice"></a> <div class="tSliceList margintopdouble"> <ul class="icons monospace"> <li class="icons-email tSliceCur"><span class="subject">[Spice-devel] [PATCH] spicy: add --title=<title> ...</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"><span class="subject"><a href="msg10505.html">Re: [Spice-devel] [PATCH] spicy: add --title=<t...</a></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="[Spice-devel] [PATCH] spicy: add --title=<title> command line option"> <input type="hidden" name="msgid" value="0e5e090436fe66bf19fc7b78985db0d9616682bb.1346837502.git.uril@redhat.com"> <input type="hidden" name="relpath" value="spice-devel@lists.freedesktop.org/msg10503.html"> <input type="submit" value=" Uri Lublin "> </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:%22%5C%5BSpice%5C-devel%5C%5D+%5C%5BPATCH%5C%5D+spicy%5C%3A+add+%5C-%5C-title%3D%3Ctitle%3E+command+line+option%22&o=newest&f=1" title="e" id="e">Expand</a></li> <li class="icons-prev"><a href="msg10499.html" title="p">Previous message</a></li> <li class="icons-next"><a href="msg10504.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">0e5e090436fe66bf19fc7b78985db0d9616682bb.1346837502.git.uril@redhat.com</li> </ul> </div> </body> </html> <script>(function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'9edf166bdb5bcf53',t:'MTc3NjQ2NzI2Mw=='};var a=document.createElement('script');a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();</script>