bspwm
bspwm copied to clipboard
GNU Emacs (GTK GUI) starts off as floating
Why is it that the launching the GTK version of GNU Emacs (25.1.1) gives me a floating window? xprop
says _NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
, which should make it tiling by default, no?
I know I can bypass this by adding a rule, but I found it weird.
What's the full xprop
output?
_MOTIF_DRAG_RECEIVER_INFO(_MOTIF_DRAG_RECEIVER_INFO) = 0x6c, 0x0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
_NET_WM_DESKTOP(CARDINAL) = 2
WM_STATE(WM_STATE):
window state: Normal
icon window: 0x0
WM_HINTS(WM_HINTS):
Client accepts input or input focus: True
Initial state is Normal State.
bitmap id # to use for icon: 0x1200139
bitmap id # of mask for icon: 0x120013f
window id # of group leader: 0x1200001
_GTK_THEME_VARIANT(UTF8_STRING) =
_NET_WM_ICON(CARDINAL) = Icon (48 x 48):
░░░▒▒▒░░░
░▒▒▒▒▒▒▒▒▒▒▒▒▒▒░
░▒▒▒▒░░░░░░░░░▒▒▒▒▒░
░▒▒▒░░░░░░░░░░░░░░░▒▒▒▒░
▒▒▒░░░░░░░░░░░░░░░░░░░▒▒▒▒
░▒▒░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒░
░▒▒░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒░
░▒▒░░░░░░░░░░░░░░░ ░▒▒▒▒▒▒▓░
░▒▒░░░░░░░░░░░░░ ░▒▒▒▒▒▒▒
▒▒░░░░░░░░░░░░░░░░░░░░░ ░▒▒▒▒▒▒▒▒
▒▒░░░░░░░░░░░░░░░░░░░░░ ▒▒▒▒▒▒▒▒▒
░▒░░░░░░░░░░░░░░░ ░▒▒▒▒▒▒▒▒▓░
▒▒░░░░░░░░░ ░▒▒▒▒▒▒▒▒▒▒
░▒░░░░░░░░░ ░▒▒▒▒▒▒▒▒▒▒▒▓░
▒▒░░░░░░░░ ░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
░▒░░░░░░░░░░ ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓
▒▒░░░░░░░░░░░ ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓░
▒▒░░░░░░░░░░░░ ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒░░░░░░░░░░░░░ ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
░▒░░░░░░░░░░░▒▒▒▒░ ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓
░▒░░░░░░░░░░▒▒▒▒▒▒▒░ ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓░
░▒░░░░░░░░░▒▒▒▒▒▒▒░░░░ ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓░
▒▒░░░░░░░▒▒▒▒▒░░ ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓░
▒▒░░░░░░▒▒▒▒░ ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓░
░▒░░░░░▒▒▒░ ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓░
░▒░░░▒▒▒▒░ ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓░
░▒░░▒▒▒▒░ ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓
▓▒▒▒▒▒▒░ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓
▒▒▒▒▒▒▒░ ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒░ ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓░
░▒▒▒▒▒▒▒ ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓
▒▒▒▒▒▒▒▒░ ░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
░▒▒▒▒▒▒▒▒░ ░░▒▒▒▒▒▒▒▓░
▒▒▒▒▒▒▒▒▒▒░░ ░▒▒▒▒▒▒▒
░▒▒▒▒▒▒▒▒▒▒▒▒▒░░ ▒▒▒▒▒▒▓░
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░ ░▒▒▒▒▒▒▓▒
░▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░ ░░▒▒▒▒▒▒▒▒▓
░▓▒▒▒▒▒▒▒▒▒▒▒░░ ░░▒▒▒▒▒▒▒▒▒▒▒▓░
░▓▒▒▒▒▒▒▒▒░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓░
▒▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓░
░▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓░
░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▒
▒▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓░
░▒▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▒
░▒▓▓▒▒▒▒▒▒▒▓▓▓▒░
░░▒▒▒▒▒▒░░
XdndAware(ATOM) = BITMAP
_NET_WM_OPAQUE_REGION(CARDINAL) = 7, 0, 578, 7, 0, 7, 592, 491
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 18874657, 18874658
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x1200120
WM_CLIENT_LEADER(WINDOW): window id # 0x1200001
_NET_WM_PID(CARDINAL) = 13108
WM_LOCALE_NAME(STRING) = "en_US.utf8"
WM_CLIENT_MACHINE(STRING) = "d125q-PC"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
program specified minimum size: 39 by 78
program specified resize increment: 7 by 12
program specified base size: 39 by 78
window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_CLASS(STRING) = "emacs", "Emacs"
WM_ICON_NAME(STRING) = "emacs@d125q-PC"
_NET_WM_ICON_NAME(UTF8_STRING) = "emacs@d125q-PC"
WM_NAME(STRING) = "emacs@d125q-PC"
_NET_WM_NAME(UTF8_STRING) = "emacs@d125q-PC"
I am seeing this intermittently. If I open a terminal, and launch then quit emacs several times, sometimes it will launch floating, sometimes it will launch tiling. I diffed xprop's in both instances, and the only difference was the _NET_WM_OPAQUE_REGION
and _NET_WM_PID
.
@d125q This is expected (cf. https://specifications.freedesktop.org/wm-spec/wm-spec-latest.html#NORESIZE).
A problem I see is that both the Emacs windows which are tiled and those which are floated have minheight = maxheight and minwidth = maxwidth. I don't see how that can be intended, as it's completely inconsistent.
I added the line bspc rule -a emacs state=tiled
to my bspwmrc and noticed when closing emacs with an sxhkd hotkey subsequent sessions will load floating. Whereas using M-x M-c to close emacs causes the next session to be loaded tiled. I'm not sure if this is particularly helpful in resolving this issue, but I did find it interesting and it may point to the solution.
My emacs is always starting in floating mode, even after I added bspc rule -a emacs state=tiled
. I have to set it to tiled with a hotkey after it has opened.
Actually it had to be bspc rule -a Emacs state=tiled
, now it always starts as tiled. @mrlinuxfish I wonder if it's the same for you.
I did change that line in my bspwmrc to Emacs state=tiled
and it fixed the problem for me too. It's strange that emacs wants to start in a floating state. Also, as an anecdote which may be relevant, I had to set a similar rule for zathura (a PDF viewer).
This only started happening to me after upgrading from 0.9 to 0.9.2
With GTK, this seems to only happen when I don't call gtk_widget_set_size_request
, or if I call it with the values -1, -1
, which is the same as leaving it unset. I haven't actually read any of the code, but maybe this section is the relevant one.
In the latest release, the fix no longer works. It just freezes bspwm. You need to add (setq frame-resize-pixelwise t)
somewhere in your config to prevent this.
I am having the same problem, and bspwm freezes. It is so bad that I am thinking of reverting to i3. Where would you add
(setq frame-resize-pixelwise t)
somewhere in a new line in bspwmrc?
No, no. In your .emacs
. This is an Emacs issue, not a bspwm issue. Emacs does not obey size hints because it wants to preserve a whole number of characters height and width wise. The reason other wms work is that they eventually give up. Bspwm is just being insistent on giving you what you asked for.
I can confirm that adding
(setq frame-resize-pixelwise t)
to my emacs config fixed the issue for me.