Desktop::setGlobalScaleFactor() on Linux broken


It appears windows don't repaint properly if you use Desktop::setGlobalScaleFactor() on Linux. A part on the left and bottom of any top level windows will not be painted. But interaction with those parts seems to work ok.

I can reproduce the issue by setting the scale factor in the initialisation code of eg. the IntroJucer.


Ok, try again now..

This fix works, thanks.

I did some testing and there are other small issues:

If you click the menu bar the pull down menu doesn't stay open unless you click on the top left corner of the menu item;

A splash screen isn't centred properly (it seems to set it's scaled bounds using the physical screen size);

And similarly the menus use the physical screen size to decide if they should go up or down, which often results in the bottom part being clipped by the screen bounds.


Thanks - looks like a typo, try again now!

OK this is the situation now:

What works:

  • the splash screen is centred properly and menus don't clip anymore.
  • Windows with an owner are also centred above their parent windows.
  • painting works properly

What doesn't work:

  • The window menus don't stay open when you click the menu bar, they close as soon as you release the mouse button (I mean without dragging).
  • setFullScreen(true) will set the physical window bounds to the scaled screen bounds. (Ideally the window should be maximised as on windows)

This is some code to maximise windows that seems to work (source

        XEvent xev;

        Atom wm_state  =  XInternAtom(display, "_NET_WM_STATE", False);
        Atom max_horz  =  XInternAtom(display, "_NET_WM_STATE_MAXIMIZED_HORZ", False);
        Atom max_vert  =  XInternAtom(display, "_NET_WM_STATE_MAXIMIZED_VERT", False);

        memset(&xev, 0, sizeof(xev));
        xev.type = ClientMessage;
        xev.xclient.window = window;
        xev.xclient.message_type = wm_state;
        xev.xclient.format = 32;[0] = _NET_WM_STATE_ADD;[1] = max_horz;[2] = max_vert;

        XSendEvent(display, DefaultRootWindow(display), False, SubstructureNotifyMask, &xev);



Thanks - try again now!

Ok, it's working perfectly now, thanks!