Lars Gullik Bjønnes wrote: > [EMAIL PROTECTED] (Lars Gullik Bjønnes) writes: > > | Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes: > | > | | >>>>> "Peter" == Peter Kümmel <[EMAIL PROTECTED]> writes: > | | > | | Peter> I've reproduced the error and fixed it. The problem was, not > | | Peter> only page up/down keys were dropped. This code does not work > | | Peter> (because of the implicit casts?) > | | > | | Peter> static const int delayed_keys = Qt::Key_PageDown | > | | Peter> Qt::Key_PageUp; if (e->key() & delayed_keys) { > | | > | | I know this stuff is very difficult to get right, but I do not like at > | | all the idea of testing explicitely qt::pageup/down. We should not > | | depend on these hardcoded keys. For example, your patch will fail for > | | people who use the emacs bindings and use Ctrl+v for page down. I am > | | not asking for adding another case for Ctrl+v (!) but I'd prefer a > | | solution which does not take this into account (especially since I do > | | not understand why only PageDown would be a problem (why is paragraph > | | down not a problem?) > | > | What is the problem that you are trying to solve here? > > Is it my old pet? "Countinued scorrling after key-release"? > > What was wrong with my patch from months back?
It only fixes scrolling with keys. > > Index: src/frontends/qt4/GuiWorkArea.cpp > =================================================================== > --- src/frontends/qt4/GuiWorkArea.cpp (revision 18535) > +++ src/frontends/qt4/GuiWorkArea.cpp (working copy) > @@ -45,6 +45,9 @@ > #include <QTimer> > #include <QInputContext> > > +#ifdef Q_WS_X11 > +# include <QX11Info> > +#endif > #include <boost/bind.hpp> > #include <boost/current_function.hpp> > > @@ -412,6 +415,13 @@ > } > > > +#ifdef Q_WS_X11 > + extern "C" { > + int XEventsQueued(Display * display, int mode); > + int XSync(Display *, bool); > + } > +#endif > + > void GuiWorkArea::keyPressEvent(QKeyEvent * e) > { > > @@ -422,6 +432,16 @@ > << " key=" << e->key() > << endl; > > +#ifdef Q_WS_X11 > + if (e->isAutoRepeat()) { > + if (XEventsQueued(QX11Info::display(), 0 /* QueuedAlready */) > > 0) { > + XSync(QX11Info::display(), true); > + e->ignore(); > + return; > + } > + } > +#endif > + > boost::shared_ptr<QKeySymbol> sym(new QKeySymbol); > sym->set(e); > processKeySym(sym, q_key_state(e->modifiers())); > -- Peter Kümmel