Hello,

Sorry to bother you but I think I found a very strange bug which does not
show up under twm, mwm, sawfish, or window maker. The bug can be seen as
follows: compile the following code under Red Hat 7.3 in a directory 
called main by typing qmake -project; qmake; make; ./main
Then grab one of the edges of the window and resize it
so it becomes really small and then quickly large many
times. Upon releasing the mouse the window will resize
itself to an unappropriate or state and/or may exhibit
some strange resizing behavior which does not show up 
under the four window managers described above.
Here is the code:

Thanks for your replies,

Neil

--- main.cpp ---

#include <qapplication.h>
#include <qpopupmenu.h>
#include <qmenubar.h>
#include <qpainter.h>
#include <qvbox.h>

#define H 40
#define W 60

class Foo: public QVBox {
  public:
    Foo(QWidget *parent = 0): QVBox(parent) {
      bar = new QMenuBar(this);
      one = new QPopupMenu(bar);
      two = new QPopupMenu(bar);
      thr = new QPopupMenu(bar);
      bar->insertItem("The              ", one);
      bar->insertItem("Menu             ", two);
      bar->insertItem("Bar              ", thr);
      setSizeIncrement(W, H);
      resize(10 * W, 10 * H + bar->height());
      resize(10 * W, 10 * H + bar->height());
    }
  protected:
    void paintEvent(QPaintEvent *);
  private:
    QMenuBar *bar;
    QPopupMenu *one;
    QPopupMenu *two;
    QPopupMenu *thr;
};

void Foo::paintEvent(QPaintEvent *) {
  int contentHeight = height() - bar->height();
  if (contentHeight % H != 0) {
    setBaseSize(W, bar->height() + H);
    resize(width(), height() - contentHeight % H);
  }
  QPainter p(this); int i, j;
  for (i = 0; i < height() / H; i++)
    for (j = 0; j < width() / W; j++)
      p.drawRect(j * W, i * H + bar->height(), W, H);
}

int main(int argc, char **argv) {
  QApplication app(argc, argv);
  Foo foo;
  app.setMainWidget(&foo);
  foo.show();
  return app.exec();
}

// end of main.cpp


--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]

Reply via email to