ch11ng / exwm

Emacs X Window Manager
2.85k stars 136 forks source link

X application overlaps tab-line #788

Open jj1uzh opened 3 years ago

jj1uzh commented 3 years ago

exwm-issue-resized

As the screenshot above, tab-line (emacs >27.1) is overlapped by X applications. Looks like the height is correct, as seen the background single line at the bottom.

I'm not sure whether this is caused by exwm or emacs(tab-line-mode, window.el?)...

Thanks.

jj1uzh commented 3 years ago
(defun exwm-layout--show (id &optional window)
  "Show window ID exactly fit in the Emacs window WINDOW."
  (exwm--log "Show #x%x in %s" id window)
  (let* ((edges (window-inside-absolute-pixel-edges window))
         (x (pop edges))
         (y (pop edges))
         (width (- (pop edges) x))
         (height (- (pop edges) y))
         frame-x frame-y frame-width frame-height)
    (with-current-buffer (exwm--id->buffer id)
      (when exwm--floating-frame
        ...)
      (when (exwm-layout--fullscreen-p)
        ...)
;; edited here
      (when (bound-and-true-p tab-line-mode)
    (setq y (+ y (frame-char-height))))
;; edited here
      (exwm--set-geometry id x y width height)
      (xcb:+request exwm--connection (make-instance 'xcb:MapWindow :window id))
      (exwm-layout--set-state id xcb:icccm:WM_STATE:NormalState)
      (setq exwm--ewmh-state
            (delq xcb:Atom:_NET_WM_STATE_HIDDEN exwm--ewmh-state))
      (exwm-layout--set-ewmh-state id)
      (exwm-layout--auto-iconify)))
  (xcb:flush exwm--connection))

This is my simple workaround.

djeis97 commented 2 years ago

I can confirm this as well, it looks like a bug in window-inside-absolute-pixel-edges (and so, really, a bug in window-edges). window-edges doesn't reference #'window-tab-line-height anywhere, but it does explicitly reference #'window-header-line-height (and correspondingly, the header-line does work properly with exwm). A cursory glance at the source of emacs master suggests that this has not been fixed yet, but I have not actually tested it.