Comment 1 for bug 1720096

Revision history for this message
Tavmjong Bah (tavmjong-free) wrote :

Wicked!

On creating a new file, a call to Application::add_desktop() (a.k.a INKSCAPE.add_desktop()) is made setting the active desktop to the new desktop. However, a SPDesktopWidget::onFocusInEvent() happens before the panels are created. This sets the active desktop back to the old desktop. The panels are then created using the wrong desktop.

sp_file_open()/sp_file_new() calls
 sp_desktop_widget_new() calls
  SPDesktopWidget::createInstance() calls
   Appllication::add_desktop() a.k.a INKSCAPE.add_desktop()

sp_file_new()/sp_file_open() calls
 sp_create_window() which emits signal (win->show()) that calls

  SPDesktop::onFocusInEvent() Sets desktop back to old desktop before above signal handled.

  sp_desktop_widget_size_allocate() calls This is strange, why is it here?
   SPDesktop->show_dialogs() calls
     _dlg_mgr->showDialog for each dialog in Inkscape
       Dialog::getDialog()
         PanelDialog<B>::create()
           Panel::_init() Wrong desktop used!

Misc. Notes:

sp_namedview_window_from_document() calls SPDesktop->show_dialogs. On Linux this is blocked "due to gdl dock bug"

Application::active_desktop() a.k.a. SP_ACTIVE_DESKTOP: returns desktop at front of _desktops.
Application::add_desktop(SPDesktop * desktop) : inserts desktop into _desktops at front.

SPDesktopWidget::createInstance: calls Application::add_desktop a.k.a INKSCAPE.add_desktop
  it also calls dtw->panels->setDesktop

SPDesktop::init(): sets calls DialogManager::getInstance()