vectorgraphics / asymptote

2D & 3D TeX-Aware Vector Graphics Language
https://asymptote.sourceforge.io/
GNU General Public License v3.0
549 stars 90 forks source link

Suggestion: Give the temporary rendering window a distinctive name #423

Closed user202729 closed 7 months ago

user202729 commented 8 months ago

I suggest implementing the following:

--- a/glrender.cc
+++ b/glrender.cc
@@ -2146,7 +2146,7 @@ void glrender(const string& prefix, const picture *pic, const string& format,
     glutInitWindowSize(maxTileWidth,maxTileHeight);
     glutInitDisplayMode(displaymode);
     fpu_trap(false); // Work around FE_INVALID
-    window=glutCreateWindow("");
+    window=glutCreateWindow("Asymptote rendering window");
     fpu_trap(settings::trap());
     glutHideWindow();
   }

Reason: I use a tiling window manager (xmonad) where window hiding does not really work, so there is a flash on the screen. So I use something like this (irrelevant to the discussion, but basically it ignores the windows with title Asymptote rendering window)

myManageHook = composeAll 
   [ title =? "Asymptote rendering window" --> doIgnore
   ]
main = do
   a <- xmobar (def {
        manageHook  = myManageHook <+> manageHook def
      })
   xmonad a

For people such that the "hide window" is executed correctly, this should not have any adverse effect, I believe.

johncbowman commented 7 months ago

Well, it does have an adverse effect if iconify is true as it makes the icon much larger and more obtrusive. So let's settle on this:

window=glutCreateWindow(Iconify ? "" : "Asymptote rendering window" );

This issue will disappear anyway in the upcoming Vulkan port.

user202729 commented 7 months ago

That's an interesting perspective (that I didn't think about). Fair point.

That having said, in Windows 10 I think only the icon is displayed when the window is minimized anyway (in the default setting?)