Now I get a segfault, when closing a buffer via the keyboard shortcut:

#0  0x024c7197 in QObject::startTimer ()
#1  0x024d0381 in QTimer::start ()
#2 0x0048be48 in lyx::frontend::GuiWorkArea::startGeneralTimer (this=0x1a25a030) at qt4/GuiWorkArea.h:125 #3 0x00486e41 in lyx::frontend::GuiWorkArea::processKeySym (this=0x1a25a030, [EMAIL PROTECTED], mod=lyx::ControlModifier) at /Users/ sts/Quellen/mac/lyx-scope-dynmacro/src/frontends/qt4/GuiWorkArea.cpp:345 #4 0x00489376 in lyx::frontend::GuiWorkArea::keyPressEvent (this=0x1a25a030, ev=0xbfffe970) at /Users/sts/Quellen/mac/lyx-scope- dynmacro/src/frontends/qt4/GuiWorkArea.cpp:737
#5  0x01ac1a48 in QWidget::event ()
#6  0x01d70eb1 in QFrame::event ()
#7  0x01df42f6 in QAbstractScrollArea::event ()
#8 0x00489568 in lyx::frontend::GuiWorkArea::event (this=0x1a25a030, e=0xbfffe970) at /Users/sts/Quellen/mac/lyx-scope-dynmacro/src/ frontends/qt4/GuiWorkArea.cpp:544

Stefan

Am 05.02.2008 um 01:37 schrieb [EMAIL PROTECTED]:

Author: rgheck
Date: Tue Feb  5 01:37:30 2008
New Revision: 22779

URL: http://www.lyx.org/trac/changeset/22779
Log:
Additional fixes related to disentangling the blinking cursor signal from other signals. Thanks to Abdel for pointing out the need for this.

Modified:
   lyx-devel/trunk/src/frontends/qt4/GuiWorkArea.cpp
   lyx-devel/trunk/src/frontends/qt4/GuiWorkArea.h

Modified: lyx-devel/trunk/src/frontends/qt4/GuiWorkArea.cpp
URL: 
http://www.lyx.org/trac/file/lyx-devel/trunk/src/frontends/qt4/GuiWorkArea.cpp?rev=22779
= = = = = = = = ======================================================================
--- lyx-devel/trunk/src/frontends/qt4/GuiWorkArea.cpp (original)
+++ lyx-devel/trunk/src/frontends/qt4/GuiWorkArea.cpp Tue Feb 5 01:37:30 2008
@@ -211,7 +211,7 @@
        general_timer_.setInterval(500);
        connect(&general_timer_, SIGNAL(timeout()),
                this, SLOT(handleRegularEvents()));
-       general_timer_.start();
+       startGeneralTimer();

        screen_ = QPixmap(viewport()->width(), viewport()->height());
        cursor_ = new frontend::CursorWidget();
@@ -333,11 +333,16 @@
void GuiWorkArea::processKeySym(KeySymbol const & key, KeyModifier mod)
{
        // In order to avoid bad surprise in the middle of an operation,
-       // we better stop the blinking cursor.
+       // we better stop the blinking cursor...
        stopBlinkingCursor();
+       // ...and the general timer.
+       stopGeneralTimer();

        theLyXFunc().setLyXView(lyx_view_);
        theLyXFunc().processKeySym(key, mod);
+       
+       // the cursor gets restarted in GuiView::restartCursor()
+       startGeneralTimer();
}


@@ -364,11 +369,15 @@
        else
                cmd = cmd0;

+       bool const notJustMovingTheMouse =
+ cmd.action != LFUN_MOUSE_MOTION || cmd.button() != mouse_button::none;
+       
// In order to avoid bad surprise in the middle of an operation, we better stop
-       // the blinking cursor.
-       if (!(cmd.action == LFUN_MOUSE_MOTION
-               && cmd.button() == mouse_button::none))
+       // the blinking cursor and the general timer
+       if (notJustMovingTheMouse) {
                stopBlinkingCursor();
+               stopGeneralTimer();
+       }

        buffer_view_->mouseEventDispatch(cmd);

@@ -379,15 +388,15 @@
        }

        // GUI tweaks except with mouse motion with no button pressed.
-       if (!(cmd.action == LFUN_MOUSE_MOTION
-               && cmd.button() == mouse_button::none)) {
+       if (notJustMovingTheMouse) {
                // Slight hack: this is only called currently when we
                // clicked somewhere, so we force through the display
                // of the new status here.
                lyx_view_->clearMessage();

-               // Show the cursor immediately after any operation.
+               // Show the cursor immediately after any operation
                startBlinkingCursor();
+               startGeneralTimer();
        }
}


Modified: lyx-devel/trunk/src/frontends/qt4/GuiWorkArea.h
URL: 
http://www.lyx.org/trac/file/lyx-devel/trunk/src/frontends/qt4/GuiWorkArea.h?rev=22779
= = = = = = = = ======================================================================
--- lyx-devel/trunk/src/frontends/qt4/GuiWorkArea.h (original)
+++ lyx-devel/trunk/src/frontends/qt4/GuiWorkArea.h Tue Feb 5 01:37:30 2008
@@ -121,6 +121,10 @@
        void stopBlinkingCursor();
        ///
        void startBlinkingCursor();
+       ///
+       void startGeneralTimer() { general_timer_.start(); }
+       ///
+       void stopGeneralTimer() { general_timer_.stop(); }
        /// Process Key pressed event.
/// This needs to be public because it is accessed externally by GuiView.
        void processKeySym(KeySymbol const & key, KeyModifier mod);



Reply via email to