Re: Status of 2.0 API freeze bugs



>>>>> "Owen" == Owen Taylor <otaylor redhat com> writes:

Owen> Alexander Larsson <alla lysator liu se> writes:

>> On 3 Apr 2001, Owen Taylor wrote:
>> 
>> > 1579 general gtk+ Setting Gtk widget insensitive can lock GUI
>> >
>> > Was mostly fixed in GTK+-1.2; probably can be fixed by combination
>> > of documentation and porting that.
>> 
>> I tried the example in the bug, but it didn't lock the GUI.

Owen> The problem is definitely real.

Owen>  - Widget with a pointer grab becomes shadowed by gtk_grab_add()
Owen> or becomes insensitive and never gets button release.

Owen>  - Widget with gtk_grab_add() becomes insensitive. (This is what
Owen> the GTK+-1.2 change fixed.)

Owen> Things like this. If you look at my mail to the list about
Owen> notification of shadowing by gtk_grab_add() I made suggestions
Owen> there about the elemements of a fix.

I thought that bug report looked familiar...

http://bugs.gnome.org is not working for me right now so I went
through my old email.  It looks like the bug report I submitted many
moons ago.  I just tried my little test program again and the bug
seems to have gone away.

My Gtk+ libraries:

ii  libgtk1.2      1.2.9-2        The GIMP Toolkit set of widgets for X
ii  libgtk1.2-dev  1.2.9-2        Development files for the GIMP Toolkit

The test program follows (since bugs.gnome.org does not seem to be
working):

- Dave

compile-command: cc -o grab grab.c `gtk-config --cflags --libs`

- - 8< grab.c - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#include <gtk/gtk.h>

static gint timer_id;

static void lock_gui_cb(GtkWidget *btn)
{
	gtk_widget_set_sensitive(btn, FALSE);
	gtk_label_set_text(GTK_LABEL(GTK_BIN(btn)->child),
			   "GUI is locked");
	gtk_timeout_remove(timer_id);
	timer_id = 0;
}

static void clicked_cb(GtkWidget *btn, gpointer user_data)
{
	if (timer_id == 0) {
		gtk_label_set_text(GTK_LABEL(GTK_BIN(btn)->child),
				   "Press and hold me down");
		timer_id = gtk_timeout_add(2000, (GtkFunction)lock_gui_cb,
					   btn);
	}
}

int main(int argc, char *argv[])
{
	GtkWidget *top;
	GtkWidget *box;
	GtkWidget *btn;

	gtk_init(&argc, &argv);

	top = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	gtk_widget_show(top);
	gtk_window_set_title(GTK_WINDOW(top), "Grab bug");
	gtk_window_set_policy(GTK_WINDOW(top), TRUE, TRUE, FALSE);
	gtk_signal_connect(GTK_OBJECT(top), "delete_event",
			   GTK_SIGNAL_FUNC(gtk_main_quit), NULL);

	box = gtk_vbox_new(FALSE, 10);
	gtk_container_border_width(GTK_CONTAINER(box), 10);
	gtk_container_add(GTK_CONTAINER(top), box);

	btn = gtk_button_new_with_label("Click Me");
	gtk_signal_connect(GTK_OBJECT(btn), "clicked",
			   GTK_SIGNAL_FUNC(clicked_cb), NULL);
	gtk_box_pack_start(GTK_BOX(box), btn, TRUE, FALSE, 0);

	gtk_box_pack_start(GTK_BOX(box),
			   gtk_button_new_with_label("Test Me"),
			   TRUE, FALSE, 0);

	gtk_widget_show_all(top);

	gtk_main();

	return 0;
}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -





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