Solving issue 1769: "Single Editor mode: unnecessary thumbnail refresh when switching from tab to tab"
This commit is contained in:
parent
b038720e37
commit
744583f32b
@ -288,18 +288,20 @@ bool RTWindow::on_window_state_event(GdkEventWindowState* event) {
|
||||
}
|
||||
|
||||
void RTWindow::on_mainNB_switch_page(GtkNotebookPage* page, guint page_num) {
|
||||
if (page_num > 1) {
|
||||
if (page_num > 1) {
|
||||
if (isSingleTabMode()) MoveFileBrowserToEditor();
|
||||
|
||||
EditorPanel *ep = static_cast<EditorPanel*>(mainNB->get_nth_page(page_num));
|
||||
ep->setAspect();
|
||||
} else {
|
||||
EditorPanel *ep = static_cast<EditorPanel*>(mainNB->get_nth_page(page_num));
|
||||
ep->setAspect();
|
||||
} else {
|
||||
// in single tab mode with command line filename epanel does not exist yet
|
||||
if (isSingleTabMode() && epanel) {
|
||||
// Save profile on leaving the editor panel
|
||||
epanel->saveProfile();
|
||||
|
||||
MoveFileBrowserToMain();
|
||||
// Moving the FileBrowser only if the user has switched to the FileBrowser tab
|
||||
if (page_num==0)
|
||||
MoveFileBrowserToMain();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,12 @@ void ThumbBrowserEntryBase::updateBackBuffer () {
|
||||
|
||||
Gtk::Widget* w = parent->getDrawingArea ();
|
||||
|
||||
backBuffer = Gdk::Pixmap::create (w->get_window(), exp_width, exp_height);
|
||||
Glib::RefPtr<Gdk::Window> win = w->get_window();
|
||||
if (!win)
|
||||
// Nothing to draw on, so we return
|
||||
return;
|
||||
|
||||
backBuffer = Gdk::Pixmap::create (win, exp_width, exp_height);
|
||||
|
||||
// If thumbnail is hidden by a filter drawing to it will crash
|
||||
int backbuffer_w=0, backbuffer_h=0;
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include <omp.h>
|
||||
#endif
|
||||
|
||||
#define DEBUG(format,args...)
|
||||
#define DEBUG(format,args...)
|
||||
//#define DEBUG(format,args...) printf("ThumbImageUpdate::%s: " format "\n", __FUNCTION__, ## args)
|
||||
|
||||
class
|
||||
@ -138,7 +138,7 @@ public:
|
||||
|
||||
// remove so not run again
|
||||
jobs_.erase(i);
|
||||
DEBUG("%d job(s) remaining",jobs_.size());
|
||||
DEBUG("%d job(s) remaining", int(jobs_.size()) );
|
||||
|
||||
++active_;
|
||||
}
|
||||
@ -215,7 +215,7 @@ ThumbImageUpdater::add(ThumbBrowserEntryBase* tbe, bool* priority, bool upgrade,
|
||||
i->listener_ == l &&
|
||||
i->upgrade_ == upgrade )
|
||||
{
|
||||
DEBUG("updating job %s",tbe->getFileName().c_str());
|
||||
DEBUG("updating job %s",tbe->shortname.c_str());
|
||||
// we have one, update queue entry, will be picked up by thread when processed
|
||||
/*i->pparams_ = params;
|
||||
i->height_ = height; */
|
||||
@ -225,10 +225,10 @@ ThumbImageUpdater::add(ThumbBrowserEntryBase* tbe, bool* priority, bool upgrade,
|
||||
}
|
||||
|
||||
// create a new job and append to queue
|
||||
DEBUG("queing job %s",t->getFileName().c_str());
|
||||
DEBUG("queing job %s",tbe->shortname.c_str());
|
||||
impl_->jobs_.push_back(Impl::Job(tbe,priority,upgrade,l));
|
||||
|
||||
DEBUG("adding run request %s",t->getFileName().c_str());
|
||||
DEBUG("adding run request %s",tbe->shortname.c_str());
|
||||
impl_->threadPool_->push(sigc::mem_fun(*impl_, &ThumbImageUpdater::Impl::processNextJob));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user