Hi i tried to compile your app using latest gtkdfb libs from cvs and i
was able to reproduce the problem exactly you described it.
I also noticed than, using a generic gtkdfb app, the gtk application
crashes badly when window is resized using the combination <win
key><ctrl><mouse movement>.
I tried to gdb the problem but i could only get him to tell me that the
crash occourred during dfb_gfx_copy (i'm using DFB 0.9.24).
Shall i file this bug in gnome's BTS?
Attilio
Christian Schaubschlaeger wrote:
> Hello!
>
> I have an addition to my email from last tuesday, concerning problems
> with directfb & gtk_dialog_run (see below). The problem is obviously
> somehow related to g_threads. I have attached a very simple gtk app
> to this email, where the described phenomenon occurs. Actually
> I don't use g_threads in this example, I just initialize the g_thread
> system... which is enough for the problem to occur.
>
> What is definitely not clear to me, can be found in line 38 and below
> in my code. To make gtk_dialog_run work correctly, I need to do the
> following:
>
> #ifdef _DIRECTFB
> gdk_threads_enter();
> gtk_dialog_run(GTK_DIALOG(dialog2));
> gdk_threads_leave();
> #else
> gtk_dialog_run(GTK_DIALOG(dialog2));
> #endif
>
> i.e. when linked to the x11-gtk-libraries i must not use gdk_threads_enter()
> and gdk_threads_leave() before and after the call to gtk_dialog_run (which
> is correct I guess?), in case of directfb-gtk I _have_ to! It's really
> mutually exclusive...
>
> I'm wondering if this behavior is intended or not...?
>
> Best regards
> Christian
>
>
> Am Dienstag, 27. Juni 2006 13:54 schrieb Christian Schaubschlaeger:
>
>>Hi all!
>>
>>I observe a severe problem in my gtk+ app, which might be related to
>>directfb. I'm not sure, maybe the problem lies in my domain, but the
>>reason, why I think it might be dfb related is, that on gtk+X11 everything
>>works perfectly fine...
>>
>>My environment is: gentoo linux, 2.6.16.16, gcc-3.4.6.
>>DirectFB version is 0.9.25.1
>>Gtk version is 2.9.2
>>Glib version is 2.11.4
>>(Gtk libraries for X11 are V2.8.12)
>>
>>And here's the problem:
>>
>>I've implemented a simple messagebox dialog as shown below. I
>>have a "wrapper" function "dialog_messagebox", which creates
>>the dialog and waits for it's completion (i.e. it blocks until the
>>user clicks the ok button). This is realized using gtk_dialog_run
>>and gtk_dialog_response, as you can see below:
>>
>>
>>/*
>>---------------------------------------------------------------------------
>>-- */ #include <gtk/gtk.h>
>>
>>#include "dialog_messagebox.h"
>>#include "interface.h"
>>#include "support.h"
>>
>>#include "sbs_login_gui_support.h"
>>
>>void dialog_messagebox(char *title, char *text, char *text_button_ok)
>>{
>> extern GList *sbs_dialogs;
>> GtkWidget *dialog_messagebox;
>> GtkWidget *label;
>> GtkWidget *label_button_ok;
>>
>> dialog_messagebox = create_dialog_messagebox();
>>
>> sbs_dialog_list_insert(dialog_messagebox,"dialog_messagebox",&sbs_dialogs)
>>;
>>
>> gtk_window_set_title(GTK_WINDOW(dialog_messagebox), _(title));
>>
>> label = lookup_widget(dialog_messagebox, "dialog_messagebox_label");
>> gtk_label_set_text(GTK_LABEL(label),_(text));
>>
>> label_button_ok = lookup_widget(dialog_messagebox,
>>"dialog_messagebox_label_button_ok");
>>gtk_label_set_markup_with_mnemonic(GTK_LABEL(label_button_ok),
>>_(text_button_ok));
>>
>> gtk_dialog_run(GTK_DIALOG(dialog_messagebox));
>>
>> gtk_widget_destroy(dialog_messagebox);
>> sbs_dialog_list_delete("dialog_messagebox", &sbs_dialogs);
>>}
>>
>>void on_dialog_messagebox_button_ok_clicked (GtkButton *button,
>> gpointer user_data)
>>{
>> extern GList *sbs_dialogs;
>> GtkWidget *dialog_messagebox;
>>
>> dialog_messagebox = sbs_dialog_list_get("dialog_messagebox",
>> sbs_dialogs);
>> gtk_dialog_response(GTK_DIALOG(dialog_messagebox),GTK_RESPONSE_OK);
>>}
>>
>>/*
>>---------------------------------------------------------------------------
>>-- */
>>
>>Now I use such a messagebox quite frequently, eg. in many
>>callback functions of other dialogs, in the following way:
>>
>>void on_some_dialog_some_callback(...)
>>{
>> ...
>> dialog_messagebox("A Dialog", "This is the message...", "OK");
>> ...
>>}
>>
>>The call to "dialog_messagebox" blocks until the user clicks on the ok
>>Button.
>>
>>This works fine under gtk+-X11, but it behaves very strangely under
>>gtk+-directfb. In the latter case the messagebox pops up, and after the
>>klick on the OK button it is properly destroyed and disapperars from the
>>screen. But from now any dialogs which were/are on the screen are not
>>responsible any more, ie. I cannot click buttons, activate entrys, etc.
>>What I can do is to move the dialogs (using the built-in "window-manager"),
>>the dialogs are repainted correctly. But I can not interact with them.
>>
>>So maybe someone has an idea on what could be wrong here...?
>>
>>Thanks and best regards
>>Christian
>>
>>
>>_______________________________________________
>>directfb-users mailing list
>>[email protected]
>>http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users
>>
>>
>>------------------------------------------------------------------------
>>
>>#include <gtk/gtk.h>
>>
>>/* Function prototypes */
>>GtkWidget *create_dialog1(void);
>>GtkWidget *create_dialog2(void);
>>void on_okbutton1_clicked(GtkButton * button, gpointer user_data);
>>void on_okbutton2_clicked(GtkButton * button, gpointer user_data);
>>
>>/* Globals */
>>GtkWidget *dialog1;
>>GtkWidget *dialog2;
>>
>>int main(int argc, char *argv[])
>>{
>> gtk_init(&argc, &argv);
>>
>> if (!g_thread_supported())
>> g_thread_init(NULL);
>> gdk_threads_init();
>>
>> dialog1 = create_dialog1();
>> gtk_widget_show(dialog1);
>>
>> gdk_threads_enter();
>> gtk_main();
>> gdk_threads_leave();
>>
>> return 0;
>>}
>>
>>/* Callback functions */
>>void on_okbutton1_clicked(GtkButton * button, gpointer user_data)
>>{
>> extern GtkWidget *dialog2;
>>
>> dialog2 = create_dialog2();
>>
>>#ifdef _DIRECTFB
>> gdk_threads_enter();
>> gtk_dialog_run(GTK_DIALOG(dialog2));
>> gdk_threads_leave();
>>#else
>> gtk_dialog_run(GTK_DIALOG(dialog2));
>>#endif
>>
>> gtk_widget_destroy(dialog2);
>>}
>>
>>void on_okbutton2_clicked(GtkButton * button, gpointer user_data)
>>{
>> extern GtkWidget *dialog2;
>>
>> gtk_dialog_response(GTK_DIALOG(dialog2), GTK_RESPONSE_OK);
>>}
>>
>>/* Create dialogs... */
>>GtkWidget *create_dialog1(void)
>>{
>> GtkWidget *dialog1;
>> GtkWidget *dialog_vbox1;
>> GtkWidget *label1;
>> GtkWidget *dialog_action_area1;
>> GtkWidget *okbutton1;
>>
>> dialog1 = gtk_dialog_new();
>> gtk_window_set_title(GTK_WINDOW(dialog1), "dialog1");
>> gtk_window_set_position(GTK_WINDOW(dialog1), GTK_WIN_POS_CENTER_ALWAYS);
>> gtk_window_set_type_hint(GTK_WINDOW(dialog1), GDK_WINDOW_TYPE_HINT_DIALOG);
>>
>> dialog_vbox1 = GTK_DIALOG(dialog1)->vbox;
>> gtk_widget_show(dialog_vbox1);
>>
>> label1 = gtk_label_new("Dialog1");
>> gtk_widget_show(label1);
>> gtk_box_pack_start(GTK_BOX(dialog_vbox1), label1, FALSE, FALSE, 0);
>> gtk_misc_set_padding(GTK_MISC(label1), 40, 20);
>>
>> dialog_action_area1 = GTK_DIALOG(dialog1)->action_area;
>> gtk_widget_show(dialog_action_area1);
>> gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog_action_area1),
>> GTK_BUTTONBOX_END);
>>
>> okbutton1 = gtk_button_new_from_stock("gtk-ok");
>> gtk_widget_show(okbutton1);
>> gtk_dialog_add_action_widget(GTK_DIALOG(dialog1), okbutton1,
>> GTK_RESPONSE_OK);
>> GTK_WIDGET_SET_FLAGS(okbutton1, GTK_CAN_DEFAULT);
>>
>> g_signal_connect((gpointer) okbutton1, "clicked",
>> G_CALLBACK(on_okbutton1_clicked), NULL);
>> return dialog1;
>>}
>>
>>GtkWidget *create_dialog2(void)
>>{
>> GtkWidget *dialog2;
>> GtkWidget *dialog_vbox2;
>> GtkWidget *label2;
>> GtkWidget *dialog_action_area2;
>> GtkWidget *okbutton2;
>>
>> dialog2 = gtk_dialog_new();
>> gtk_window_set_title(GTK_WINDOW(dialog2), "dialog2");
>> gtk_window_set_position(GTK_WINDOW(dialog2), GTK_WIN_POS_CENTER_ALWAYS);
>> gtk_window_set_type_hint(GTK_WINDOW(dialog2), GDK_WINDOW_TYPE_HINT_DIALOG);
>>
>> dialog_vbox2 = GTK_DIALOG(dialog2)->vbox;
>> gtk_widget_show(dialog_vbox2);
>>
>> label2 = gtk_label_new("Dialog2");
>> gtk_widget_show(label2);
>> gtk_box_pack_start(GTK_BOX(dialog_vbox2), label2, FALSE, FALSE, 0);
>> gtk_misc_set_padding(GTK_MISC(label2), 10, 10);
>>
>> dialog_action_area2 = GTK_DIALOG(dialog2)->action_area;
>> gtk_widget_show(dialog_action_area2);
>> gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog_action_area2),
>> GTK_BUTTONBOX_END);
>>
>> okbutton2 = gtk_button_new_from_stock("gtk-ok");
>> gtk_widget_show(okbutton2);
>> gtk_dialog_add_action_widget(GTK_DIALOG(dialog2), okbutton2,
>> GTK_RESPONSE_OK);
>> GTK_WIDGET_SET_FLAGS(okbutton2, GTK_CAN_DEFAULT);
>>
>> g_signal_connect((gpointer) okbutton2, "clicked",
>> G_CALLBACK(on_okbutton2_clicked), NULL);
>> return dialog2;
>>}
>>
>>
>>------------------------------------------------------------------------
>>
>>_______________________________________________
>>directfb-users mailing list
>>[email protected]
>>http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users
_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev