Commit 61ed6873 authored by Tavmjong Bah's avatar Tavmjong Bah
Browse files

Block in window updating code. WIP

parent e9597d15
Pipeline #47454035 passed with stages
in 6 minutes and 25 seconds
......@@ -52,6 +52,19 @@ InkscapeApplication::InkscapeApplication()
, _active_view(nullptr)
{}
void
InkscapeApplication::update_windows(SPDocument* document)
{
// Find windows:
auto it = _documents.find( document );
if (it != _documents.end()) {
std::vector<InkscapeWindow*> windows = it->second;
std::cout << "InkscapeApplication::update_windows: windows: " << windows.size() << std::endl;
} else {
std::cout << "InkscapeApplication::update_windows: no windows found" << std::endl;
}
}
template<class T>
ConcreteInkscapeApplication<T>::ConcreteInkscapeApplication()
: T("org.inkscape.application.with_gui",
......
......@@ -59,6 +59,9 @@ public:
Inkscape::UI::View::View* get_active_view() { return _active_view; }
void set_active_view(Inkscape::UI::View::View* view) { _active_view = view; }
// Update all windows connected to a document.
void update_windows(SPDocument* document);
// These are needed to cast Glib::RefPtr<Gtk::Application> to Glib::RefPtr<InkscapeApplication>,
// Presumably, Gtk/Gio::Application takes care of ref counting in ConcreteInkscapeApplication
// so we just provide dummies (and there is only one application in the application!).
......
......@@ -131,6 +131,7 @@ InkscapeWindow::on_focus_in_event(GdkEventFocus* event)
_app->set_active_document(_document);
_app->set_active_view(_desktop);
_app->set_active_selection(_desktop->selection);
// _app->update_windows(_document);
} else {
std::cerr << "Inkscapewindow::on_focus_in_event: app is nullptr!" << std::endl;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment