Recently, in the Linux distro I use, I switched from the Fluxbox desktop environment to XFCE, because XFCE provides some unique and nice features for me like the ability to re-order taskbar buttons. In Fluxbox, I had set up all windows to open at the center of the screen with a hack. XFCE also comes with the ability to center new windows out of the box, however, it fails for me from time to time. Here is how to get rid of the issue so windows are centered properly.
How to center new windows in XFCE
The XFCE desktop environment comes with its own window manager called xfwm4. It has the appropriate options to place new windows at the center of the screen. To get it working, you need to go to Settings -> Windows Manager tweaks and adjust the Placement slider to the right position as shown below:
Why window centering does not work and how to fix it
After reboot, I noticed that new windows stopped opening at the center of the screen. Instead, they appeared at the top left corner of the screen:
To fix it, go to the folder of the theme you are using and find the file there called "themerc". It must be in the xfwm4 subfolder. Per-user themes are located in the /home/your_user_name/.themes directory, and system-wide themes are usually located at /usr/shared/themes/.
In my case, I should edit the following file:
Comment out the "placement_ratio" line as shown below:
Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options: