Pavel Sanda wrote:
> Pavel Sanda wrote:
> > Will take some time to get the exact steps, but crash is clearly there when 
> > I play for a while...
> 
> Ok, I think I was capable to nail the crash down, and it is not specifically 
> linked to beamer.
> The recipy:
> 1. open any structured document (eg introduction manual)
> 2. open second lyx window and the same document via View->Hidden->...
> 3. open and undock outliner out of lyx window
> 4. pick random subsection in outliner and start moving it via up/down buttons
>    WHILE sometimes moving window focus between window 1/window 2.
> 5. I tried it couple times and within a minute I get crash.
> 
> I believe the reason is that althouth outliner was launched from window 2, 
> when
> windows 1 get focus (which happens accidentaly & easily if you have 'focus 
> follows pointer'
> policy in your desktop environment) outliner moving actions get somehow 
> linked (?sending some
> paint updates?) to window which was last time under focus and it just matter 
> of time when
> some synchro problem happens...
> 
> As if we had some construct in outliner which calls
> sendUpdate(getCurrentlyActiveWindow)
> instead of 
> sendUpdate(getOutlinerOwnerWindow)

Looking at the backtrace from the dispatch of LFUN_OUTLINE_UP:

Thread 1 "lyx" hit Breakpoint 1, lyx::Text::dispatch (
    this=this@entry=0x555557218248, cur=..., cmd=...) at Text3.cpp:2553
2553                    outline(OutlineUp, cur);
(gdb) bt
#0  lyx::Text::dispatch (this=this@entry=0x555557218248, cur=..., cmd=...) at 
Text3.cpp:2553
#1  0x0000555555c8861f in lyx::InsetText::doDispatch (this=0x555557218230, 
cur=..., cmd=...) at insets/InsetText.cpp:337
#2  0x0000555555b52730 in lyx::Inset::dispatch (this=0x555557218230, cur=..., 
cmd=...) at insets/Inset.cpp:325
#3  0x00005555557e1579 in lyx::Cursor::dispatch (this=0x555557485848, cmd0=...) 
at Cursor.cpp:781
#4  0x0000555555cece8a in lyx::frontend::GuiView::dispatchToBufferView 
(this=this@entry=0x555556d3f620, cmd=..., dr=...) at GuiView.cpp:3605
#5  0x0000555555d044a6 in lyx::frontend::GuiView::dispatch 
(this=0x555556d3f620, cmd=..., dr=...) at GuiView.cpp:4252
#6  0x0000555555ccbe8f in lyx::frontend::GuiApplication::dispatch 
(this=0x5555569d3300, cmd=..., dr=...) at GuiApplication.cpp:2061
#7  0x0000555555cbe522 in lyx::frontend::GuiApplication::dispatch 
(this=0x5555569d3300, cmd=...) at GuiApplication.cpp:1402
#8  0x000055555589e7f7 in lyx::dispatch (action=...) at LyX.cpp:1462
#9  0x0000555555f13755 in lyx::frontend::TocWidget::outline 
(this=0x555557137540, func_code=func_code@entry=lyx::LFUN_OUTLINE_UP)
    at TocWidget.cpp:333
#10 0x0000555555f137dc in lyx::frontend::TocWidget::on_moveUpTB_clicked 
(this=<optimized out>) at TocWidget.cpp:341
#11 0x0000555555f1541f in lyx::frontend::TocWidget::qt_static_metacall 
(_o=_o@entry=0x555557137540, 
    _c=_c@entry=QMetaObject::InvokeMetaMethod, _id=_id@entry=11, 
_a=_a@entry=0x7fffffffd580) at moc_TocWidget.cpp:146
#12 0x0000555555f160c2 in lyx::frontend::TocWidget::qt_metacall 
(this=0x555557137540, _c=QMetaObject::InvokeMetaMethod, _id=11, 
    _a=0x7fffffffd580) at moc_TocWidget.cpp:186
...

after pushing the outliner button we call in TocWidget::outline generic
GuiApplication::dispatch which likely grabs currently active window; if that's
the wrong window, it grabs wrong cursor position, moves wrong section and
suddenly content of outliner and buffer structure are out of sync and crash is
just matter of time....

Now this is not some glitch but rather conceptual problem how we handle lfuns 
from the widget(s).
Opinions how to move forward?

Pavel

Reply via email to