Commit 21eb0ce6 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

try to minimize the flashing scrollbars when a canvas becomes visible. (Still...

try to minimize the flashing scrollbars when a canvas becomes visible. (Still getting some flashes for the loadmeter.pd patch)
parent a08f09ac
......@@ -387,7 +387,6 @@ var canvas_events = (function() {
document.querySelector("#canvas_find_text").addEventListener("focusin",
canvas_find_focus, false
);
document.querySelector("#canvas_find_text").addEventListener("blur",
canvas_find_blur, false
);
......@@ -411,7 +410,6 @@ var canvas_events = (function() {
// set minimum window size
gui.Window.get().setMinimumSize(150, 100);
return {
none: function() {
var name;
......@@ -518,11 +516,17 @@ var canvas_events = (function() {
// we can create the menu and register event callbacks
function register_canvas_id(cid) {
name = cid; // hack
// We create the window menus and popup menu before doing anything else
// to ensure that we don't try to set the svg size before these are done.
// Otherwise we might set the svg size to the window viewport, only to have
// the menu push down the svg viewport and create scrollbars. Those same
// scrollbars will get erased once canvas_map triggers, causing a quick
// (and annoying) scrollbar flash
nw_create_patch_window_menus(cid);
create_popup_menu(cid);
canvas_events.register(cid);
canvas_events.normal();
nw_create_patch_window_menus(cid);
pdgui.canvas_map(cid);
pdgui.canvas_map(cid); // side-effect: triggers gui_canvas_getscroll from Pd
}
function create_popup_menu(name) {
......
......@@ -2513,7 +2513,15 @@ void canvas_vis(t_canvas *x, t_floatarg f)
//if (g && (pd_class(&g->g_pd) == garray_class)
// sys_vgui("pdtk_canvas_set_scrollless .x%lx\n", x);
//else
scrollbar_update(x);
/* We can't update the scrollbars here, because we have to wait
for the canvas window to load before anything else can happen.
So we just call canvas_getscroll in the GUI after the window
finishes loading. I'm not sure if there's an ulterior motive
to this scrollbar_update here-- possibly related to graphs--
so let's keep it here for reference in case we run into a
but later. */
//scrollbar_update(x);
/*
//newly opened arrays created prior to pd-l2ork require fittograph
......
Markdown is supported
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