Desktop::setGlobalScaleFactor() on Linux broken


#1

Hi,

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.

--
Roeland


#2

Ok, try again now..


#3

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.

--
Roeland


#4

Thanks - looks like a typo, try again now!


#5

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 http://stackoverflow.com/questions/4530786/xlib-create-window-in-mimized-or-maximized-state)

        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;
        xev.xclient.data.l[0] = _NET_WM_STATE_ADD;
        xev.xclient.data.l[1] = max_horz;
        xev.xclient.data.l[2] = max_vert;

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

 

--
Roeland


#6

Thanks - try again now!


#7

Ok, it's working perfectly now, thanks!

--
Roeland