DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L1986
Version: 1.1.9


If a new FLTK window is opened while a menu is opened, FLTK causes the X
server to hang until the application is killed. The code below reproduces
the problem. Run it and open the menu. After a few seconds fl_message is
called from the idle callback and the application and X-server freeze. 

Tested on Fedora Core 6 x32, gcc 4.1.2. Not tested under windows.

#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Menu_Bar.H>
#include <FL/Fl_Menu_Button.H>
#include <FL/fl_ask.H>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

void quit_cb(Fl_Widget*, void*) {exit(0);}

Fl_Menu_Item menutable[] = {
  {"&File",0,0,0,FL_SUBMENU},
    {"&Open",   FL_ALT+'o', 0, 0, FL_MENU_INACTIVE},
    {"&Close",  0,      0},
    {"&Quit",   FL_ALT+'q', quit_cb, 0, FL_MENU_DIVIDER},
    {0},
  {0}
};

void IdleCallback(void* pData)
{
    usleep(5000);

    static int cnt = 0;
    if (++cnt > 1000)
    {
        fl_message("Hello bug!");
        cnt = 0;
    }
}

int main(int argc, char **argv) 
{
  Fl_Window window(600,400);
  Fl_Menu_Bar menubar(0,0,600,30); 
  menubar.menu(menutable);
  window.end();
  window.show(argc, argv);
  Fl::add_idle(IdleCallback, &window);
  return Fl::run();
}


Link: http://www.fltk.org/str.php?L1986
Version: 1.1.9

_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to