Floating emacs frames aren't centered

asked 2015-07-17 15:12:36 +0000

mkaito gravatar image

updated 2015-07-18 03:08:53 +0000

i3 centers new floating windows by default. Except for Emacs frames. Those are stuck to the top left. I've triple checked the emacs docs and my dotemacs, and as far as I can tell, this should not be happening.

To be more specific, the default-frame-alist variable contains default parameters for new frames. It does not contain the keys top or left in my config. According to the emacs docs, this should cause the window manager to do whatever it does by default.

To test this yourself, put this in your .i3/config:

for_window [class="^Emacs$" instance="^floating$"] floating enable

And try:

emacs --geometry 50x50+200+200 --name floating

Or maybe:

emacs --daemon
emacsclient -c -F '((name . "floating") (width . 50) (height . 50))' some.file

Edit: Here's a log file of me reproducing the observed behaviour. It's probably much longer than necessary, but a search for "personal-org" will get you to where the interesting bits happen.

http://logs.i3wm.org/logs/57426367574...

edit retag flag offensive close merge delete

Comments

It'd be better if you could provide a log file. Make sure to close all other apps and restart i3 before reproducing and taking the log file.

Airblader gravatar imageAirblader ( 2015-07-17 15:41:37 +0000 )edit

Added a log file.

mkaito gravatar imagemkaito ( 2015-07-18 03:09:03 +0000 )edit

I don't have much time right now, but from what I can tell, emacs specifies a "leader" window for i3 and i3 centers the instance on top of that leader window. That may play a role here.

Airblader gravatar imageAirblader ( 2015-07-18 06:21:48 +0000 )edit

That's the first time I've heard of such a thing. I'm not sure what to make of it. Is there anything special about this leader window that would prevent it from being handled adequately by i3?

mkaito gravatar imagemkaito ( 2015-07-19 04:26:42 +0000 )edit

I suggest you file a bug on Github so that more people might look at it. If all you want is a quick fix for this, simply execute "position move center" after floating the window.

Airblader gravatar imageAirblader ( 2015-07-19 09:19:30 +0000 )edit