GLib 2.19.1 released

2008-12-01 Thread Matthias Clasen
GLib 2.19.1 is now available for download at:

   ftp://ftp.gtk.org/pub/glib/2.19/
   http://download.gnome.org/sources/glib/2.19/

glib-2.19.1.tar.bz2 md5sum: 9309139a515408d9c99558d051c18302
glib-2.19.1.tar.gz  md5sum: eab90f5965f3d004b8787989be5cca85

This is the second development release leading up to GLib 2.20.

Notes:

 * This is unstable development release. While it has had
   a bit of testing, there are certainly plenty of bugs
   remaining to be found. This release should not be used
   in production.

 * Installing this version will overwrite your existing
   copy of GLib 2.18. If you have problems, you'll need
   to reinstall GLib 2.18.

 * GLib 2.20 will be source and binary compatible with
   the GLib 2.18 series; however, the new API additions
   in GLib 2.19.0 are not yet finalized, so there may
   be incompatibilities between this release and the final
   2.20 release. 

 * Bugs should be reported to http://bugzilla.gnome.org.
   

About GLib
==

GLib is the low-level core library that forms the basis for projects
such as GTK+ and GNOME. It provides data structure handling for C,
portability wrappers, and interfaces for such runtime functionality as
an event loop, threads, dynamic loading, and an object system.

More information about GLib is available at:

 http://www.gtk.org/

An installation guide for the GTK+ libraries, including GLib, can
be found at:

 http://developer.gnome.org/doc/API/2.0/gtk/gtk-building.html


Overview of Changes from GLib 2.19.0 to GLib 2.19.1
===

* GIO: 
  - g_icon_to_string, g_icon_new_for_string: GIcon serialization support
  - G_FILE_ATTRIBUTE_PREVIEW_ICON: new file attribute for preview images
  - g_app_info_get_commandline: new function to get the full commandline
  - g_mount_shadow, g_mount_unshadow, g_mount_is_shadowed: New
functions 
to 'shadow' mounts (i.e. hide them from the UI when they already
have a different representation, like a bookmark) 

* Bugs fixed:
 556186 gpoll.h breaks gmain.h inclusion
 557087 mem leak in g_content_types_get_registered
 556921 gpoll.h breaks hal compilation
 557210 g_compute_checksum_for_* asserts with less than 2 bytes
 558381 Add support for compile time assertions
 558185 'parent' variable in g_local_file_get_child_for_display_name()
hits g_object_unref(NULL) assertion
 558513 g_warn_if_fail FIXME in gtestutils
 558672 NULL key lookup using g_hash_table_lookup_extended() 
 555740 gicon serialization
 557182 preview functionality
 528320 Incorrect icons displayed for files with custom mimetype icons
 556910 Memory leak: sub
 557592 Missing include in gwinhttpfile.c
 556415 Crash on Windows 2000 in g_winhttp_vfs_init()
 555935 Clarify the mechanism of overwriting properties
 552776 ac_cv_func_posix_getgrgid_r not mentioned
 559448 GObject Reference Manual (typo)
 561212 GFileReadMoreCallback API doc refers to non-existant function
 560569 gkeyfile doesn't use the set list_separator in some cases
 560568 gkeyfile docs buglet
 559413 g_option_group_set_error_hook docs buglet
 562378 callback return value not respected for callback option
with no arg
 559110 Do not include libintl.h after glibintl.h
 557603 carbon check output misplaced
 562544 g_key_file_get_string and g_key_file_get_value
documentation does not explain the difference
 547264 Missing no flags flag
 562638 GDebugKey key member should be const
 562639 g_parse_debug_flags() parsing help
 562549 g_byte_array_free should tell how free data
 559452 GObject Reference Manual (typo)
 559462 GObject Reference Manual (typo)
 559517 GObject Reference Manual (typo)
 562538 GObject interface tutorial shouldn't finalise with
Please forget everything
 561352 Leak of icon description
 561375 Leaks mountpoint description
 561807 inotify_sub.c: dup_dirname() fails to remove trailing '/'
 562393 g_buffered_input_stream_read_byte broken if data available
 541715 win32 : patch for warnings and signature problems in recent code
 547481 g_data_input_stream_read_line behaves not as stated in the docs
 548163 Nautilus displays wrong error message for too long file names
 559633 gtk_image_new_from_gicon does not always work for .desktop files
 555486 No way to recover command line from GAppInfo

* Translation updates:
 Spanish (es)
 Ukrainian (uk)

Thanks to all contributors:
Michael Natterer
Christian Persch
Anis Elleuch
Tommi Komulainen
Joseph Pingenot
Tim Janik
Christian Dywan
Matt Johnston
Grahame Bowland
Tor Lillqvist
Alexander Larsson
David Zeuthen
Daniel Marjamäki
Federico Mena Quintero
Cosimo Cecchi
Maciej Piechotka
Behdad Esfahbod
Christophe Fergeau
Peter Kjellerstedt
Mart Raudsepp
Bastien Nocera
Guillaume Desmottes
Andrew Feren
Dan Williams
Philip Withnall
Jody Goldberg
Paul Pogonyshev
Leonardo Ferreira Fontenelle
Axel von Bertoldi
Enrico Tröger
Hans Petter Jansson


December 1, 2008


___
gtk-app-devel-list mailing list

programmatic screenshots?

2008-12-01 Thread Garth's KidStuff
Hey All,

I'm runnign a Gtk++ app under ubuntu 8.04 and I'd liek to take a screenshot
from inside the app.  Any hints?

Thanks in advance.

-Garth

-- 
Garth Upshaw
Garth's KidStuff
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Focus problem

2008-12-01 Thread Perriman
Hi Larry,

Thank a lo for you patch but it don't work for me :( I think
the problem is Metacity... Andrea get works without metacity and it
works on my xfce but not in my gnome with metacty (ubuntu 8.10)...

The code below works fine in metacity using your changes and
set_modal (thank Jesse and gedit) but I cannot show the decoration
because the popup is a GTK_WINDOW_POPUP  :) 

I'll try some changes to do it work on all environments

Regards,
Perriman

#include gtk/gtk.h
#include gdk/gdkkeysyms.h

static GtkWidget *window;
static GtkWidget *view;
static GtkWidget *popup;
static GtkWidget *popup_view;
static gboolean set_focus = FALSE;

static void
destroy_cb (GtkObject * object, gpointer user_data)
{
  gtk_main_quit ();
}

static gboolean
focus_window (gpointer win)
{
  g_debug (focus win);
  gtk_window_present_with_time (GTK_WINDOW (win), GDK_CURRENT_TIME);
  gtk_window_activate_focus (GTK_WINDOW (win));
  gtk_widget_grab_focus (GTK_WIDGET (win));
  return FALSE;
}


static void
show_cb (GtkWidget * widget, gpointer user_data)
{
  g_debug (show popup);
  focus_window (window);
}

static void
realize_cb (GtkWidget * widget, gpointer user_data)
{
  g_debug (realize popup);
  focus_window (window);
}

static void
focus_in_cb (GtkWidget * widget, gpointer user_data)
{
  g_debug (focus-in);
}

static void
focus_out_win_cb (GtkWidget * widget, gpointer user_data)
{
  g_debug (focus-out-win);
}

static void
map_cb (GtkWidget * widget, gpointer user_data)
{
  g_debug (map popup);
  focus_window (window);
}

static gboolean
key_press (GtkWidget * widget, GdkEventKey * event, gpointer user_data)
{
  if (event-keyval == GDK_F5)
{
  if (GTK_WIDGET_VISIBLE (GTK_WIDGET (popup)))
{
  gtk_widget_hide (popup);
}
  else
{
  gtk_widget_show_all (popup);
  focus_window (window);
  g_debug (unfocus al popup);
  set_focus = FALSE;
  gtk_widget_grab_focus (view);
  gtk_window_set_decorated (GTK_WINDOW (popup), FALSE);
}
}
  else if (event-keyval == GDK_F6)
{
  if (GTK_WIDGET_VISIBLE (GTK_WIDGET (popup)))
{
  if (set_focus == FALSE)
{
  g_debug (focus al popup);
  set_focus = TRUE;
  gtk_window_set_modal(GTK_WINDOW (popup), TRUE);
  focus_window (popup);
  gtk_widget_grab_focus (popup_view);
  gtk_window_set_decorated (GTK_WINDOW (popup), TRUE);
  
}
  else
{
  g_debug (unfocus al popup);
  set_focus = FALSE;
  gtk_window_set_modal(GTK_WINDOW (popup), FALSE);
  focus_window (window);
  gtk_widget_grab_focus (view);
  gtk_window_set_decorated (GTK_WINDOW (popup), FALSE);
}
}
}

  return FALSE;
}

GtkWidget *
create_popup (void)
{
  popup = gtk_window_new (GTK_WINDOW_POPUP);
  gtk_window_set_transient_for (GTK_WINDOW (popup), GTK_WINDOW
(window)); gtk_window_set_focus_on_map (GTK_WINDOW (popup), FALSE);
  gtk_window_set_type_hint (GTK_WINDOW (popup),
GDK_WINDOW_TYPE_HINT_NORMAL); gtk_window_set_decorated (GTK_WINDOW
(popup), FALSE); gtk_container_set_border_width (GTK_CONTAINER (popup),
2); gtk_window_resize (GTK_WINDOW (popup), 200, 200);
  popup_view = gtk_text_view_new ();
  GtkWidget *scroll = gtk_scrolled_window_new (NULL, NULL);
  gtk_container_add (GTK_CONTAINER (scroll), popup_view);
  gtk_container_add (GTK_CONTAINER (popup), scroll);

  g_signal_connect (popup, key-release-event, G_CALLBACK (key_press),
NULL); return popup;
}

GtkWidget *
create_window (void)
{
  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_resize (GTK_WINDOW (window), 800, 600);
  view = gtk_text_view_new ();
  gtk_window_set_default (GTK_WINDOW (window), view);
  GtkWidget *scroll = gtk_scrolled_window_new (NULL, NULL);
  gtk_container_add (GTK_CONTAINER (scroll), view);
  gtk_container_add (GTK_CONTAINER (window), scroll);
  g_signal_connect (view, key-release-event, G_CALLBACK (key_press),
NULL);

  g_signal_connect (window, destroy, G_CALLBACK (destroy_cb), NULL);
  g_signal_connect (window, focus-out-event, G_CALLBACK
(focus_out_win_cb), NULL);

  return window;
}

int
main (int argc, char *argv[])
{
  GtkWidget *window;

  gtk_set_locale ();
  gtk_init (argc, argv);

  window = create_window ();
  popup = create_popup ();
  gtk_widget_show_all (window);

  gtk_main ();
  return 0;
}
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Focus problem

2008-12-01 Thread Larry Reaves
Hmmm... I'm running ubuntu 8.10 also, but with compiz.  I just switched
to metacity and I see what you're talking about.  The code below works
for me in both metacity and compiz if I make pop a toplevel window:

-  popup = gtk_window_new (GTK_WINDOW_POPUP);
+  popup = gtk_window_new (GTK_WINDOW_TOPLEVEL);


Hope this helps,
Larry

On Sun, 2008-11-30 at 21:02 -0500, Larry Reaves wrote:
 Hi,
   I think this patch should do what you want:
 
 --- test.orig.c   2008-11-30 20:40:21.0 -0500
 +++ test.c2008-11-30 20:49:57.0 -0500
 @@ -78,7 +78,11 @@
   {
 gtk_widget_show_all(popup);
 focus_window(window);
 -  
 +   g_debug(unfocus al popup);
 +   set_focus = FALSE;
 +   focus_window(window);
 +   gtk_widget_grab_focus(view);
 +   gtk_window_set_decorated(GTK_WINDOW(popup),FALSE);
 //g_timeout_add(2000,focus_window,window);
   }
  }
 @@ -86,10 +90,22 @@
  {
if (GTK_WIDGET_VISIBLE(GTK_WIDGET(popup)))
   {
 -   g_debug(focus al popup);
 -   set_focus = TRUE;
 -   focus_window(popup);
 -   gtk_widget_grab_focus(popup_view);
 +   if (set_focus == FALSE)
 + {
 +   g_debug(focus al popup);
 +   set_focus = TRUE;
 +   focus_window(popup);
 +   gtk_widget_grab_focus(popup_view);
 +   gtk_window_set_decorated(GTK_WINDOW(popup),TRUE);
 + }
 +   else
 + {
 +   g_debug(unfocus al popup);
 +   set_focus = FALSE;
 +   focus_window(window);
 +   gtk_widget_grab_focus(view);
 +   gtk_window_set_decorated(GTK_WINDOW(popup),FALSE);
 + }
   }
  }

 @@ -103,7 +119,7 @@
gtk_window_set_transient_for(GTK_WINDOW(popup),GTK_WINDOW(window));
gtk_window_set_focus_on_map(GTK_WINDOW(popup), FALSE);
gtk_window_set_type_hint(GTK_WINDOW(popup),
 -GDK_WINDOW_TYPE_HINT_TOOLTIP);
 +GDK_WINDOW_TYPE_HINT_NORMAL);
gtk_window_set_decorated(GTK_WINDOW(popup),FALSE);
gtk_container_set_border_width(GTK_CONTAINER(popup),2);
gtk_window_resize(GTK_WINDOW(popup),200,200);
 @@ -112,6 +128,8 @@
gtk_container_add(GTK_CONTAINER(scroll),popup_view);
gtk_container_add(GTK_CONTAINER(popup),scroll);

 +  g_signal_connect(popup, key-release-event,
 +G_CALLBACK(key_press), NULL); 
/*g_signal_connect(popup, show, G_CALLBACK(show_cb), NULL);
  g_signal_connect(popup, realize, G_CALLBACK(realize_cb),
  NULL); g_signal_connect(popup, map, G_CALLBACK(map_cb), NULL);
 
 
 Summary of changes:
 1.  set type hint to be 'normal' instead of 'tooltip'
 2.  connect up key-release-event to popup also, so when it has focus we
 can get out of it
 3.  on f6, only grab focus if we don't have it and add decorations
 4.  if we do have it, return focus to main window and remove decorations
 5.  if we hide popup while it has focus, remove decorations and focus
 
 So, you open the app and the main window has focus.  Pressing F5 will
 show the popup, but focus will remain with the main window.  Pressing F5
 again will hide it.  If F6 is pressed while the popup is open, it will
 grab focus and become decorated.  While it has focus, it can remove
 decorations and pass focus back via F6.  F5 also returns focus and
 removes decorations, but also hides the window.  If this is not the
 desired behavior, let me know and I'll see if I can help.
 
 P.S.
 I'm not sure what you're trying to do with gtk_window_set_default, but
 it isn't doing anything... I get:
 
 (test:19164): Gtk-CRITICAL **: gtk_window_set_default: assertion
 `GTK_WIDGET_CAN_DEFAULT (default_widget)' failed
 
 at runtime.  devhelp says:
 Before making a widget the default widget, you must set the
 GTK_CAN_DEFAULT flag on the widget you'd like to make the default using
 GTK_WIDGET_SET_FLAGS().
 However, I'm not sure you need the call in the first place to achieve
 your desired behavior.
 
 -Larry Reaves
 [EMAIL PROTECTED]
 
 
 
 On Mon, 2008-12-01 at 00:47 +0100, Perriman wrote:
  Hi all,
  
  I want to create a GTK_WINDOW_POPUP and change the type
  to GTK_WINDOW_TOPLEVEL. 
  
  If you have used eclipse, when you are writting you can see a
  calltip (but the focus is in the editor) and if you press F2, then the
  calltip window gets the focus and show the decoration.
  
  I'm trying for two weeks and I cannot do the same in the
  example program. If I set GTK_WINDOW_POPUP then I cannot set the focus
  to the window and, If I use GTK_WINDOW_TOPLEVEL then the window lost
  the focus. If I show the popup window and set the focus to the main
  window, it does not work... I'm desperated
  
  Can you help me?
  
  Thank you again!!
  
  El Sun, 30 Nov 2008 23:37:29 +0100
  Perriman [EMAIL PROTECTED] escribió:
  
   Hi Michael
   
   I paste the code:
   
   #include gtk/gtk.h
   #include gdk/gdkkeysyms.h
   
   static GtkWidget *window;
   static GtkWidget *view;
 

Problem with g_spawn_async_with_pipes

2008-12-01 Thread Kevin DeKorte
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

I'm using GTK/GLIB to spawn an application with
g_spawn_async_with_pipes. The command I am using is this

ok = g_spawn_async_with_pipes(NULL, argv, NULL,
  G_SPAWN_SEARCH_PATH,
  NULL, NULL, NULL, std_in, std_out,
std_err, NULL);


The only problem I am appearing to have is that the new process that is
created has a PPID of 1 rather than the PID of the application that
spawned it. So if my app receives a SIGKILL (like in the case of someone
killing X), then my app cannot shutdown the spawned app, due to the KILL
and the spawned app also does not get the kill signal since it is not in
the signal tree of the application.

Is there a setting I can use to correct this? I have tried using
sigaction to hook kill, but that fails for SIGKILL.

Thanks,

Kevin
- --
Get my public GnuPG key from
http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x7D0BD5D1
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkk0RKYACgkQ6w2kMH0L1dGEHwCdE6brlXkZgJzyIaU1qGEnFYpU
+GoAn3Agnh7QtPK+f6avHbsVPXMt+Uzb
=Qo5D
-END PGP SIGNATURE-
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


GLib 2.19.2

2008-12-01 Thread Matthias Clasen
This is a quick followup release GLib 2.19.2 is now available for
download at:

   ftp://ftp.gtk.org/pub/glib/2.19/
   http://download.gnome.org/sources/glib/2.19/

glib-2.19.2.tar.bz2 md5sum: ed8a3dea6e33fae39cf7ffe056cf
glib-2.19.2.tar.gz  md5sum: 4f4ba56c56401e5a00495e3c375b9489

This is a quick followup release to revert a change in 2.19.1 that 
would have unnecessarily changed the established behavior of
g_data_input_stream_read_line().


December 1, 2008
Matthias Clasen

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: programmatic screenshots?

2008-12-01 Thread Stefan Kost
Garth's KidStuff schrieb:
 Hey All,

 I'm runnign a Gtk++ app under ubuntu 8.04 and I'd liek to take a screenshot
 from inside the app.  Any hints?

 Thanks in advance.

 -Garth

   
http://buzztard.svn.sourceforge.net/viewvc/buzztard/trunk/buzztard/tests/bt-check.c?view=markup
look at check_make_widget_screenshot() at the bottom. Please note that
it cannot capture window-decorations :/.

Stefan
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list