Xfwm4 4.14.3 Is Released With X-Resource Extension Support

From LinuxReviews
Jump to navigationJump to search
Xfce4-whiskermenu.svg

The latest version of the Xfwm4 window manager for the popular light-weight Xfce desktop environment fixes a use-after-free after reading setting strings, adds support for more error messages sent from the X server and it is now capable of taking advantage of the X server's X-Resource extension.

written by 林慧 (Wai Lin) 2020-07-26 - last edited 2020-08-01. © CC BY

Xfwm4-4.14.2.jpg
The Xfwm4 v4.14.2 configuration dialog, Thunar and Audacious on a box running Xfce 4.14. Wallpaper: Yuna from ITZY.

The Xfwm4 window manager has gained a few nice improvements in the git branch scheduled for Xfce 4.16. Xfwm 4.14.3 is a stable branch maintenance release with few major changes.

One small change is the nice addition of support for the X-Resource extension. This extension has been around for long time and it is present in the X servers shipped with the modern GNU/Linux distributions. Xfwm4 now checks if the X-Resource extension is present in src/display.c and it utilizes it for display hints in src/hints.c using the following code:

#ifdef HAVE_XRES
    XResClientIdSpec client_specs;
    XResClientIdValue *client_ids = NULL;
    int i;
    int result;
    long num_ids;

    if (display_info->have_xres)
    {
        client_specs.client = w;
        client_specs.mask = XRES_CLIENT_ID_PID_MASK;

        myDisplayErrorTrapPush (display_info);

        XResQueryClientIds (display_info->dpy, 1, &client_specs, &num_ids, &client_ids);

        result = myDisplayErrorTrapPop (display_info);

        if (result == Success)
        {
            for (i = 0; i < num_ids; i++)
            {
             	if (client_ids[i].spec.mask == XRES_CLIENT_ID_PID_MASK)
                {
                    CARD32 *value = client_ids[i].value;
                    pid = (GPid) *value;
                    break;
                }
            }

            XFree(client_ids);

            if (pid > 0)
            {
             	return pid;
            }
	}
    }
#endif /* HAVE_XRES */

There is also support for more X error notifications using XError traps in Xfwm4.

One major performance hinder that is not addressed in this release is Xfwm4s default use of very slow code utilizing glx to do vertical sync. Xfwm4 supports doing vertical sync using either xpresent or glx. Using xpresent is much more efficient while glx is horribly slow for some very odd reason. The difference when playing a 4k video in mpv using moderate settings on a mid-range AMD GPU is a 30% CPU load when xpresent vs a 50% CPU load when glx is used. The GNOME team held a presentation about the carbon footprint software generates at this years GUADEC conference. Making xfwm4 use xpresent is an easy way to reduce carbon footprint in the backwards areas of the world where power is produced using gas and coal and increase performance in games and other GPU intensive applications.

Asking xfwm4 to use xpresent to do vertical sync is easy. It can be done by creating a new vblank_mode configuration option either using a termianl:

xfconf-query -c xfwm4 -p /general/vblank_mode -t string -s "xpresent" --create

It can also be done with the xfce4-settings-editor program. Open that and select xfwm4 and an entry named /general/vblank_mode as the type string and give that new string the value xpresent and you're done.

You will need to restart xfwm4 with xfwm4 --replace & to make the new setting take effect.

xpresent will be the default xfwm4 vertical sync setting for Intel and some AMD graphics chips in Xfce 4.16 when it is released in October/November this year. Which AMD graphics cards will and won't use xpresent by default is, right now, almost random due to how Mesa identifies some but not other AMD cards as being AMD cards. Xfwm4 could check if a GPU is either AMD or RADEON as proposed in xfwm issue 409. There is no progress in getting the "RADEON", added to src/compositor.c so this will probably still be the case when Xfce 4.16 is released.

xfwm4 4.14.3 can be acquired from archive.xfce.org. Distributions shipping Xfce will have the new version in their repositories shortly.

0.00
(0 votes)


Add your comment
LinuxReviews welcomes all comments. If you do not want to be anonymous, register or log in. It is free.