Re: [gtk-vnc-devel] PATCH: Clear areas outside of framebuffer region



On Wed, Aug 29, 2007 at 09:09:08AM -0300, Jonh Wendell wrote:
> Em Qua, 2007-08-22 às 19:52 +0100, Daniel P. Berrange escreveu:
> > On Wed, Aug 22, 2007 at 03:47:03PM -0300, Jonh Wendell wrote:
> > > Em Qua, 2007-08-22 às 19:24 +0100, Daniel P. Berrange escreveu:
> > > > > 
> > > > > BTW, What do you think about putting the widget in the middle of area,
> > > > > instead of top left?
> > > > 
> > > > It would complicate the drawing code :-)  Can you put the vnc widget
> > > > inside the GTK alignment widget and let the alignment do the centering ?
> > > > 
> > > > Dan.
> > > 
> > > Ah, but the widget itself is big, isn't it? I mean, the black part
> > > belongs to widget, right?
> > 
> > Yes, the black part is part of the VNC widget. But if you embedded the
> > VNC widget inside an alignment I think the VNC widget would always
> > remain at the perfect size to match the remote framebuffer, and the GTK
> > alignment widget would take care of positioning & filling the extra space.
> 
> No luck, see the attachment, taken on full screen:

How about the attached patch for Vinagree - it seems to work reasonably in
my testing.

Regards,
Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 
Index: src/vinagre-tab.c
===================================================================
--- src/vinagre-tab.c	(revision 8)
+++ src/vinagre-tab.c	(working copy)
@@ -253,6 +253,7 @@
 vinagre_tab_init (VinagreTab *tab)
 {
   GtkWidget *scroll;
+  GtkWidget *align;
 
   tab->priv = VINAGRE_TAB_GET_PRIVATE (tab);
 
@@ -267,8 +268,10 @@
 
   /* Create the vnc widget */
   tab->priv->vnc = vnc_display_new ();
+  align = gtk_alignment_new(0.5, 0.5, 0, 0);
+  gtk_container_add(GTK_CONTAINER(align), tab->priv->vnc);
   gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scroll),
-					 tab->priv->vnc);
+					 align);
   gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroll),
 				       GTK_SHADOW_IN);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]