MuPDF: mupdf-gl has no wm_class

71 views Asked by At

The mupdf-x11 has WM_CLASS(STRING) = "mupdf", "MuPDF", but mupdf-gl has no. I need wm_class to use mupdf-gl correctly in FVWM. How can I solve this problem? Maybe by some small changing the source code before compilation? The solution suggested here is not working.

1

There are 1 answers

0
nail On

My friend programmer helped me and we found a solution by changing the source code of mupdf before compilation. In the file thirdparty/freeglut/src/x11/fg_menu_x11.c two changes made

  1. After definition the function fgPlatformOpenWindow add XClassHint *classhint;. This block now read
void fgPlatformOpenWindow( SFG_Window* window, const char* title,
                           GLboolean positionUse, int x, int y,
                           GLboolean sizeUse, int w, int h,
                           GLboolean gameMode, GLboolean isSubWindow )
{
    XClassHint *classhint;

  1. After XSetWMProtocols add:
classhint = XAllocClassHint(); 
    if (classhint)
    {
        classhint->res_name = "mupdf-gl";
        classhint->res_class = "MuPDF-gl";
        XSetClassHint(fgDisplay.pDisplay.Display, window->Window.Handle, classhint);
        XFree(classhint);
    }

After compilation, the window of mupdf-gl is identified as WM_CLASS(STRING) = "mupdf-gl", "MuPDF-gl".