Help: after clist doubleclick all X windows are locked



Hi,

situation is like this: I have a clist and the items in this clist
may be chosen by double click or by click on an extra button.

In either way a modal messagebox is shown and the user needs to
choose one of four actions.

Problem: if the clist item was double clicked the messagebox 
appears normally but then all X windows freeze. No move, no resize,
no close. XTerms, my gtk app, everything. And the buttons in the
messagebox are not sensitive. The process must be killed from
another terminal.

Must be related to the double click because if the item is chosen
by click on that extra button (which uses the same code) everything
runs normal and as expected.

The signals for double click and button click are connected like
this:

  gtk_signal_connect (GTK_OBJECT (buttonLoad), "clicked",
                      GTK_SIGNAL_FUNC (buttonLoad_Clicked), NULL);

  gtk_signal_connect (GTK_OBJECT (clistFiles), "button_press_event",
                      GTK_SIGNAL_FUNC (clistFiles_2ButtonPress), NULL);

And these functions are here:

void buttonLoad_Clicked (GtkWidget *widget, gpointer data)
{
  gchar  *file_name;
  struct stat buffer;

  file_name = gtk_editable_get_chars (GTK_EDITABLE (entryName), 0, -1);

  if (strlen (file_name) != 0) {
    stat (file_name, &buffer);
    if ((buffer.st_mode & S_IFMT) != S_IFDIR)
      load_func (file_name);
  }
  g_free (file_name);
}

void clistFiles_2ButtonPress (GtkWidget *widget, GdkEventButton *event,
                              gpointer data)
{
  if (event->type != GDK_2BUTTON_PRESS)
    return;

  if (files_row_selected >= 0)      <-------------------------
    buttonLoad_Clicked (widget, data);
}


If I debug with ddd and set a breakpoint where the arrow is ddd displays
a dialog box with this message: 'The mouse pointer appears to be frozen.
Continuing execution automatically.' and a counter counts from 10 down to
1 and the execution continues. Then the message box is shown and NOW the
buttons on it are working. ddd must have applied some magic here.

I suspect that the double click somehow grabs the mouse but not releases
it in time (that is before the messagebox is to be shown). What can I do?


Regards,
WL





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