If you've ever noticed that some windows in XFCE pop up at-center on your screen while others — like Thunar opening from a "Home" or "File System" desktop icon — stubbornly land off in a corner, you're not imagining things, and you're not alone. It turns out there's a genuinely confusing gotcha buried in xfwm4, XFCE's window manager, that's been tripping people up since at least 2014.
The symptom
XFCE's Window Manager Tweaks dialog has a setting called "Placement" with options like Center, Automatic, and Under mouse. Set it to Center and you'd reasonably expect every window to open centered on screen. Instead, some windows obey it and others simply don't — Thunar file manager windows being a particularly common offender.
The real root cause
The setting you actually changed lives in the xfconf channel xfwm4 at /general/placement_mode. But that property only controls the style of placement — it says nothing about whether centering happens at all.
The gatekeeper is a separate, easy-to-miss property: /general/placement_ratio, an integer that defaults to 20. Digging into xfwm4's own source (src/placement.c, the window-placement logic), a window is only eligible for center/mouse placement if it's smaller than roughly placement_ratio percent of the screen's area. Anything larger silently falls through to a completely different algorithm — XFCE's "smart placement" heuristic — regardless of what placement_mode is set to.
In the Tweaks dialog itself, this threshold is exposed as a tiny, easy-to-skip slider labeled: "Minimum size of windows to trigger smart placement." Most people (understandably) read "Placement: Center" and never touch that second control, assuming it's unrelated. A typical Thunar window, at a reasonable default size, comfortably exceeds that 20% threshold on most modern displays — so it gets routed straight past centering, every time.
The fix
The fix is simple once you know where to look: raise placement_ratio high enough that it stops excluding normal-sized application windows. Setting it to 100 effectively removes the size cutoff, so placement_mode=center actually applies uniformly:
xfconf-query -c xfwm4 -p /general/placement_mode -n -t string -s center
xfconf-query -c xfwm4 -p /general/placement_ratio -n -t int -s 100
Or, if you're provisioning a fresh installation and want this baked in as a system default, ship it as an xfconf property XML:
<?xml version="1.0" encoding="UTF-8"?>
<channel name="xfwm4" version="1.0">
<property name="general" type="empty">
<property name="placement_mode" type="string" value="center"/>
<property name="placement_ratio" type="int" value="100"/>
</property>
</channel>
Drop that at /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml for a system-wide default, and copy it into each user's own ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml too — xfconf has a first-run migration step that can otherwise race the system default on a brand-new user profile.
Not a new bug, just an old, undocumented one
This isn't some obscure edge case we stumbled into by accident — the exact same symptom, with the exact same resolution, shows up in an Arch Linux forums thread dating back over a decade. It's a real, long-standing rough edge in xfwm4's interaction design: two settings that look like they should be one, and a UI label ("smart placement") that doesn't make it obvious it silently overrides "Center" for anything but small windows.
If you're building or customizing an XFCE-based system and windows won't center no matter what you do, check placement_ratio before you assume something is broken. It almost certainly isn't — it's just quietly deferring to a threshold you never knew existed.
0 Comments
No comments yet. Be the first!
Leave a Comment