gtk_window_set_skip_taskbar_hint does not seem to work correctly



Hi,

After I used gtk_window_set_skip_taskbar_hint [1] with the setting argument TRUE the window correctly dissapears from the taskbar. However if I then call it again with the setting argument set to TRUE is does not appear again.

The attached example program shows the problem. You need to compile the program with: gcc -o helloworld helloworld.c `pkg-config --cflags gtk+-2.0` -ansi -Wall `pkg-config --libs gtk+-2.0`

If you then click on the "Hello World" button, the program will call
gtk_window_set_skip_taskbar_hint with skip_taskbar set to TRUE or FALSE.

The first time you click (skip_taskbar set to TRUE), the window as expected is not shown anymore in the taskbar.

The second time you click (skip_taskbar set to FALSE) the window does not show up in the taskbar. While you would expect it to appear again.

You can make it appear though by manually changing the size of the window.

My questions:
Am I doing something wrong?
Is this a bug in GTK?
Or maybe metacity?

I'm running CVS HEAD versions of both GTK and metacity

Thanks,

Jaap

[1] http://developer.gnome.org/doc/API/2.0/gtk/GtkWindow.html#gtk-window-set-skip-taskbar-hint

#include <gtk/gtk.h>

static void button_click_cb (GtkWidget *widget,
			      GtkWindow* window)
{
	static gboolean skip_taskbar = TRUE;
	g_print ("skip_taskbar %d\n", skip_taskbar);
	gtk_window_set_skip_taskbar_hint (window, skip_taskbar);
	skip_taskbar = !skip_taskbar;
}

static gboolean delete_event( GtkWidget *widget,
                              GdkEvent  *event,
                              gpointer   data ) 
{
	return FALSE;
}

static void destroy( GtkWidget *widget,
                     gpointer   data )
{
	gtk_main_quit ();
}

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

	gtk_init (&argc, &argv);

	window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

	g_signal_connect (G_OBJECT (window), "delete_event",
		      G_CALLBACK (delete_event), NULL);

	g_signal_connect (G_OBJECT (window), "destroy",
		      G_CALLBACK (destroy), NULL);

	gtk_container_set_border_width (GTK_CONTAINER (window), 10);

	button = gtk_button_new_with_label ("Hello World");

	g_signal_connect (G_OBJECT (button), "clicked",
			  G_CALLBACK (button_click_cb), window);

	gtk_container_add (GTK_CONTAINER (window), button);

	gtk_widget_show (button);
	gtk_widget_show (window);

	gtk_main ();
    
	return 0;
}


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