Xfwm4

From LinuxReviews
Jump to navigationJump to search
xfwm4
The Xfwm4 v4.14.2 configuration dialog, Thunar and Audacious on a box running Xfce 4.14. Wallpaper: Yuna from ITZY.
The Xfwm4 v4.14.2 configuration dialog, Thunar and Audacious on a box running Xfce 4.14. Wallpaper: Yuna from ITZY.
Developer(s)Olivier Fourdan
Repositorygitlab.xfce.org/xfce/xfwm4/-/tree/master
Written inC
Operating systemLinux, BSD
Platformxfce
Included withxfce
TypeWindow manager
LicenseGPLv2
Websitedocs.xfce.org/xfce/xfwm4/
Xfce4-whiskermenu.svg

Xfwm4 is a optionally compositing window manager for the Xfce desktop environment. It supports themes, configurable keyboard shortcuts, placing windows always-above other windows, sticking windows to multiple desktops and it has configurable compositing support that can be turned on or off.

Xfwm4 can be used as a stand-alone window manager but it is absolutely not meant to be used as such, it is written for the explicit purpose of working with the Xfce desktop environment.

Configuration[edit]

Xfwm4 has two different configuration utilities for historical reasons.

xfwm4-settings lets you configure theme, window manager related keyboard shortcuts, focus model and other focus settings and window snapping.

xfwm4-tweaks-settings lets you configure cycling, additional focus options, workspaces, default window placement and the display compositor.

It is, additionally, possible to set some configuration keys that are not available using any graphical configuration tool using the xfce4-settings-editor.

HOWTO Make Xfwm4 More Efficient[edit]

Xfwm4 supports doing vertical sync using either xpresent or glx.

How well xpresent and glx work on a given system depends on the GPU and the video driver used. xpresent is the much better option for Intel and AMD graphics cards.

glx is the default for AMD and Intel cards in Xfce 4.14. xpresent will be default for Intel graphics chips and some AMD graphics chips in Xfce 4.16.

UNIGINE Superposition
GPU xfwm4 --vblank=xpresent xfwm4 --vblank=glx
AMD RX 470, 1080p Medium 5625 5579
AMD RX 470, 720p Low 12951 12779
AMD HD7850, 720p Low 4518 4449
Intel i7-5500U, 720p Low 1548 1518

The difference when playing a 4k video in mpv using moderate settings on a mid-range AMD GPU is a 30% CPU load when --vblank=xpresent vs a 50% CPU load with --vblank=glx.

There is no graphical configuration option where you can choose the method xfwm4 uses to do vertical sync. There is also no way to see what is actually used beyond compiling xfwm4 with --enable-debug=yes.

You can choose what vertical sync method xfwm4 uses in two non-obvious ways. You can create a new xfwm4 configuration string called vblank_mode to xpresent in a terminal:

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

The vblank_mode string can be set to glx the same way:

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

vblank_mode can also be configured using 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.

You can switch between glx and xpresent without making permanent configuration changes by running xfwm4 --vblank=glx --replace & or xfwm4 --vblank=xpresent --replace & respectively.

AMD Users Should Manually Configure Vblank Mode on xfwm 4.15.x / Xfce 4.16 too[edit]

xpresent will be the default xfwm4 vertical sync mode 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, in the current xfwm4 git, almost random due to how Mesa identifies some but not all AMD cards as being AMD cards. Some cards are just identified as being Radeon. That is a problem because xfwm4 4.15.x uses this code to check if glx or xpresent should be used in src/compositor.c:

#if HAVE_PRESENT_EXTENSION
    const char *prefer_xpresent[] = {
        "Intel",
        "AMD",
        NULL
    };
#endif /* HAVE_PRESENT_EXTENSION */

AMD Radeon RX 470 graphics cards from some vendors are identified by Mesa as AMD Radeon (TM) RX 470 Graphics. They will match that check. Other AMD Radeon RX 470 cards from other vendors are identified as just Radeon RX 470 Series so they do not match that check.

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.

You could manually make sure Xfwm is using xpresent if you are using Xfce 4.14.x and you should also manually ensure xpresent is used if glxinfo|grep Device returns a string that does not contain Intel or AMD.

Kemonomimi rabbit.svg
Note: We have NOT tested if/how either setting works with the free nouveau driver for Nvidia graphics cards.

Patches Extending Xfwm4[edit]

Ignacio Losiggio maintains a GitHub repository with several interesting patches for xfwm4. His Xfwm4-cycle-per-monitor.patch that allows you to cycle through all the windows on a specific monitor is the most interesting of those patches.

Links[edit]

The xfwm4 source is at gitlab.xfce.org/xfce/xfwm4/-/tree/master and the website is at docs.xfce.org/xfce/xfwm4/.


avatar

Anonymous (22d08f1476)

10 days ago
Score 0

I don't see a date on this article. i was looking online for more info about xfwm4 standalone. I love XFCE, but it is still too bloated. When I try to remove some of the package, i can break my desktop and then need to Timeshift to fix it. I prefer the idea of ala carte.

I am not sure which package I must have and in which order to put them in. I've got the top 5 package names, though.
Add your comment
LinuxReviews welcomes all comments. If you do not want to be anonymous, register or log in. It is free.