Since glfwSetWindowTitle in X11 context seems to set class, title, and instance to the same string, and given that the title will be the filename followed by the page number, it's impossible to match any of the three X11 window properties for applying a rule. Also, GLFW doesn't seem to provide platform specific APIs that would allow one to set the X11 window class to a different string than the dynamic title. One possible solution would be to always prefix it with the default/initial title "MuPDF/GL". This could work with matchers able to check for a substring or prefix, but will fail with those that do a whole string match. If we were to implement this, what should the length > 50 case in update_title() do? Another solution would be to implement a flag to not update the title at all, which if it's deemed fine to include, is easier to implement.
Actually, there's a bug in gl-main.c where filename is used as the title when creating the window and not "MuPDF/GL". I'll upload a patch to fix that.
Created attachment 13446 [details] [PATCH] gl: use fix title for X11 class and instance
Created attachment 13456 [details] [PATCH] gl: use fix title for X11 class and instance
Patch merged: http://git.ghostscript.com/?p=mupdf.git;a=commit;h=be98e926dfde735a306ed5913d3d0a8850addad4